Starting path clean up. (All paths should go through EnvironmentProvider)

This commit is contained in:
kay.one 2011-10-28 21:54:33 -07:00
commit cd32a70179
14 changed files with 72 additions and 82 deletions

View file

@ -67,6 +67,26 @@ namespace NzbDrone.Common
}
}
public virtual string WebRoot
{
get
{
return Path.Combine(ApplicationPath, "NzbDrone.Web");
}
}
public virtual string AppDataPath
{
get
{
var path = Path.Combine(WebRoot, "App_data");
if (!Directory.Exists(path))
Directory.CreateDirectory(path);
return path;
}
}
public virtual string StartUpPath
{
get
@ -75,6 +95,30 @@ namespace NzbDrone.Common
}
}
public virtual Version Version
{
get { return Assembly.GetExecutingAssembly().GetName().Version; }
}
public virtual DateTime BuildDateTime
{
get
{
var fileLocation = Assembly.GetCallingAssembly().Location;
return new FileInfo(fileLocation).CreationTime;
}
}
public virtual String TempPath
{
get
{
return Path.GetTempPath();
}
}
private static bool ContainsIIS(DirectoryInfo dir)
{
return dir.GetDirectories("iisexpress").Length != 0;