continue file system rework

This commit is contained in:
Luke Pulverenti
2015-10-04 00:23:11 -04:00
parent 8ad702060e
commit 078277ebc2
286 changed files with 459 additions and 1309 deletions

View File

@@ -99,6 +99,7 @@ using System.Linq;
using System.Reflection;
using System.Threading;
using System.Threading.Tasks;
using CommonIO;
namespace MediaBrowser.Server.Startup.Common
{

View File

@@ -12,6 +12,7 @@ using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using CommonIO;
namespace MediaBrowser.Server.Startup.Common.FFMpeg
{

View File

@@ -8,6 +8,7 @@ using System.IO;
using System.Text;
using MediaBrowser.Common.IO;
using System.Collections.Generic;
using CommonIO;
namespace MediaBrowser.Server.Startup.Common.FFMpeg
{

View File

@@ -0,0 +1,53 @@
using System;
using System.IO;
using CommonIO;
namespace MediaBrowser.Server.Startup.Common
{
public class MbLinkShortcutHandler : IShortcutHandler
{
private readonly IFileSystem _fileSystem;
public MbLinkShortcutHandler(IFileSystem fileSystem)
{
_fileSystem = fileSystem;
}
public string Extension
{
get { return ".mblink"; }
}
public string Resolve(string shortcutPath)
{
if (string.IsNullOrEmpty(shortcutPath))
{
throw new ArgumentNullException("filenshortcutPathame");
}
if (string.Equals(Path.GetExtension(shortcutPath), ".mblink", StringComparison.OrdinalIgnoreCase))
{
var path = _fileSystem.ReadAllText(shortcutPath);
return _fileSystem.NormalizePath(path);
}
return null;
}
public void Create(string shortcutPath, string targetPath)
{
if (string.IsNullOrEmpty(shortcutPath))
{
throw new ArgumentNullException("shortcutPath");
}
if (string.IsNullOrEmpty(targetPath))
{
throw new ArgumentNullException("targetPath");
}
File.WriteAllText(shortcutPath, targetPath);
}
}
}

View File

@@ -32,10 +32,17 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="CommonIO">
<HintPath>..\packages\CommonIO.1.0.0.3\lib\net45\CommonIO.dll</HintPath>
</Reference>
<Reference Include="Mono.Posix, Version=4.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Mono.Posix.4.0.0.0\lib\net40\Mono.Posix.dll</HintPath>
</Reference>
<Reference Include="Patterns.Logging, Version=1.0.5494.41209, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Patterns.Logging.1.0.0.2\lib\portable-net45+sl4+wp71+win8+wpa81\Patterns.Logging.dll</HintPath>
</Reference>
<Reference Include="ServiceStack.Interfaces, Version=4.0.0.0, Culture=neutral, PublicKeyToken=e06fbc6124f57c43, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\ThirdParty\ServiceStack\ServiceStack.Interfaces.dll</HintPath>
@@ -63,6 +70,7 @@
<Compile Include="FFMpeg\FFMpegInfo.cs" />
<Compile Include="FFMpeg\FFmpegValidator.cs" />
<Compile Include="INativeApp.cs" />
<Compile Include="MbLinkShortcutHandler.cs" />
<Compile Include="Migrations\DeleteDlnaProfiles.cs" />
<Compile Include="Migrations\DeprecatePlugins.cs" />
<Compile Include="Migrations\IVersionMigration.cs" />

View File

@@ -1,6 +1,7 @@
using MediaBrowser.Common.IO;
using MediaBrowser.Controller;
using System.IO;
using CommonIO;
namespace MediaBrowser.Server.Startup.Common.Migrations
{

View File

@@ -1,6 +1,7 @@
using MediaBrowser.Common.IO;
using MediaBrowser.Controller;
using System.IO;
using CommonIO;
namespace MediaBrowser.Server.Startup.Common.Migrations
{

View File

@@ -3,6 +3,7 @@ using MediaBrowser.Controller;
using System;
using System.IO;
using System.Linq;
using CommonIO;
namespace MediaBrowser.Server.Startup.Common.Migrations
{

View File

@@ -1,4 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="CommonIO" version="1.0.0.3" targetFramework="net45" />
<package id="Mono.Posix" version="4.0.0.0" targetFramework="net45" />
<package id="Patterns.Logging" version="1.0.0.2" targetFramework="net45" />
</packages>