yavsc/ZicMoove/ZicMoove.Droid/Helpers/YavscHelpers.cs

36 lines
988 B
C#
Raw Normal View History

using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Specialized;
using System.Net;
using System.Runtime.Serialization.Json;
using System.Text;
2017-01-26 13:00:31 +01:00
using ZicMoove.Model.Auth.Account;
2017-03-09 22:20:19 +01:00
using System.IO;
2017-01-26 13:00:31 +01:00
namespace ZicMoove.Droid
{
public static class YavscHelpers
{
2017-03-09 22:20:19 +01:00
public static string GetSpecialFolder(this string specialPath)
{
2017-03-09 22:20:19 +01:00
if (specialPath == null)
throw new InvalidOperationException();
2017-03-09 22:20:19 +01:00
var appData =
System.Environment.GetFolderPath(System.Environment.SpecialFolder.ApplicationData);
string imagesFolder = System.IO.Path.Combine(appData, specialPath);
DirectoryInfo di = new DirectoryInfo(imagesFolder);
// FIXME Create this folder at app startup
if (!di.Exists) di.Create();
return imagesFolder;
}
2017-03-09 22:20:19 +01:00
public static string GetTmpDir ()
{
return GetSpecialFolder("tmp");
}
}
}