make channel access opt-in rather than opt out

This commit is contained in:
Luke Pulverenti
2015-01-12 22:46:44 -05:00
parent f552174069
commit d8d5dd4873
72 changed files with 399 additions and 241 deletions

View File

@@ -475,7 +475,7 @@ namespace MediaBrowser.Common.Implementations
SecurityManager = new PluginSecurityManager(this, HttpClient, JsonSerializer, ApplicationPaths, LogManager);
RegisterSingleInstance(SecurityManager);
InstallationManager = new InstallationManager(Logger, this, ApplicationPaths, HttpClient, JsonSerializer, SecurityManager, ConfigurationManager);
InstallationManager = new InstallationManager(Logger, this, ApplicationPaths, HttpClient, JsonSerializer, SecurityManager, ConfigurationManager, FileSystemManager);
RegisterSingleInstance(InstallationManager);
ZipClient = new ZipClient();

View File

@@ -690,7 +690,7 @@ namespace MediaBrowser.Common.Implementations.HttpClientManager
{
try
{
File.Delete(file);
_fileSystem.DeleteFile(file);
}
catch (IOException)
{

View File

@@ -270,8 +270,8 @@ namespace MediaBrowser.Common.Implementations.IO
File.Copy(temp1, file2, true);
File.Copy(temp2, file1, true);
File.Delete(temp1);
File.Delete(temp2);
DeleteFile(temp1);
DeleteFile(temp2);
}
/// <summary>
@@ -409,5 +409,25 @@ namespace MediaBrowser.Common.Implementations.IO
//return Path.IsPathRooted(path);
}
public void DeleteFile(string path, bool sendToRecycleBin)
{
File.Delete(path);
}
public void DeleteDirectory(string path, bool recursive, bool sendToRecycleBin)
{
Directory.Delete(path, recursive);
}
public void DeleteFile(string path)
{
DeleteFile(path, false);
}
public void DeleteDirectory(string path, bool recursive)
{
DeleteDirectory(path, recursive, false);
}
}
}

View File

@@ -125,7 +125,7 @@ namespace MediaBrowser.Common.Implementations.ScheduledTasks.Tasks
{
try
{
File.Delete(path);
_fileSystem.DeleteFile(path);
}
catch (IOException ex)
{

View File

@@ -76,7 +76,7 @@ namespace MediaBrowser.Common.Implementations.ScheduledTasks.Tasks
cancellationToken.ThrowIfCancellationRequested();
File.Delete(file.FullName);
_fileSystem.DeleteFile(file.FullName);
index++;
}

View File

@@ -1,6 +1,7 @@
using MediaBrowser.Common.Configuration;
using MediaBrowser.Common.Events;
using MediaBrowser.Common.Implementations.Security;
using MediaBrowser.Common.IO;
using MediaBrowser.Common.Net;
using MediaBrowser.Common.Plugins;
using MediaBrowser.Common.Progress;
@@ -106,6 +107,7 @@ namespace MediaBrowser.Common.Implementations.Updates
private readonly IJsonSerializer _jsonSerializer;
private readonly ISecurityManager _securityManager;
private readonly IConfigurationManager _config;
private readonly IFileSystem _fileSystem;
/// <summary>
/// Gets the application host.
@@ -113,7 +115,7 @@ namespace MediaBrowser.Common.Implementations.Updates
/// <value>The application host.</value>
private readonly IApplicationHost _applicationHost;
public InstallationManager(ILogger logger, IApplicationHost appHost, IApplicationPaths appPaths, IHttpClient httpClient, IJsonSerializer jsonSerializer, ISecurityManager securityManager, IConfigurationManager config)
public InstallationManager(ILogger logger, IApplicationHost appHost, IApplicationPaths appPaths, IHttpClient httpClient, IJsonSerializer jsonSerializer, ISecurityManager securityManager, IConfigurationManager config, IFileSystem fileSystem)
{
if (logger == null)
{
@@ -129,6 +131,7 @@ namespace MediaBrowser.Common.Implementations.Updates
_jsonSerializer = jsonSerializer;
_securityManager = securityManager;
_config = config;
_fileSystem = fileSystem;
_logger = logger;
}
@@ -570,7 +573,7 @@ namespace MediaBrowser.Common.Implementations.Updates
try
{
File.Delete(tempFile);
_fileSystem.DeleteFile(tempFile);
}
catch (IOException e)
{
@@ -591,7 +594,7 @@ namespace MediaBrowser.Common.Implementations.Updates
// Remove it the quick way for now
_applicationHost.RemovePlugin(plugin);
File.Delete(plugin.AssemblyFilePath);
_fileSystem.DeleteFile(plugin.AssemblyFilePath);
OnPluginUninstalled(plugin);