aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Common
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2015-02-09 16:58:30 -0500
committerLuke <luke.pulverenti@gmail.com>2015-02-09 16:58:30 -0500
commit4cc3b2f0ccd7c092a4acf72db4903415e175037a (patch)
treef9f90f8665b726253b8b357674f2f141aa43abc9 /MediaBrowser.Common
parente7037a9b80843c127712f11430239f8fa3cb4aed (diff)
parent3d7089a7dbabb652730c892206ca050f52f832b1 (diff)
Merge pull request #1005 from MediaBrowser/dev
3.0.5518.0
Diffstat (limited to 'MediaBrowser.Common')
-rw-r--r--MediaBrowser.Common/Extensions/BaseExtensions.cs30
-rw-r--r--MediaBrowser.Common/IO/IFileSystem.cs28
-rw-r--r--MediaBrowser.Common/Net/INetworkManager.cs7
3 files changed, 35 insertions, 30 deletions
diff --git a/MediaBrowser.Common/Extensions/BaseExtensions.cs b/MediaBrowser.Common/Extensions/BaseExtensions.cs
index 4c94f3aa20..22dfa378fc 100644
--- a/MediaBrowser.Common/Extensions/BaseExtensions.cs
+++ b/MediaBrowser.Common/Extensions/BaseExtensions.cs
@@ -26,36 +26,6 @@ namespace MediaBrowser.Common.Extensions
return Regex.Replace(htmlString, pattern, string.Empty).Trim();
}
- /// <summary>
- /// Replaces the specified STR.
- /// </summary>
- /// <param name="str">The STR.</param>
- /// <param name="oldValue">The old value.</param>
- /// <param name="newValue">The new value.</param>
- /// <param name="comparison">The comparison.</param>
- /// <returns>System.String.</returns>
- public static string Replace(this string str, string oldValue, string newValue, StringComparison comparison)
- {
- var sb = new StringBuilder();
-
- var previousIndex = 0;
- var index = str.IndexOf(oldValue, comparison);
-
- while (index != -1)
- {
- sb.Append(str.Substring(previousIndex, index - previousIndex));
- sb.Append(newValue);
- index += oldValue.Length;
-
- previousIndex = index;
- index = str.IndexOf(oldValue, index, comparison);
- }
-
- sb.Append(str.Substring(previousIndex));
-
- return sb.ToString();
- }
-
public static string RemoveDiacritics(this string text)
{
return String.Concat(
diff --git a/MediaBrowser.Common/IO/IFileSystem.cs b/MediaBrowser.Common/IO/IFileSystem.cs
index 3bcec98ce6..5ce84f4360 100644
--- a/MediaBrowser.Common/IO/IFileSystem.cs
+++ b/MediaBrowser.Common/IO/IFileSystem.cs
@@ -133,5 +133,33 @@ namespace MediaBrowser.Common.IO
/// <param name="path">The path.</param>
/// <returns><c>true</c> if [is path file] [the specified path]; otherwise, <c>false</c>.</returns>
bool IsPathFile(string path);
+
+ /// <summary>
+ /// Deletes the file.
+ /// </summary>
+ /// <param name="path">The path.</param>
+ /// <param name="sendToRecycleBin">if set to <c>true</c> [send to recycle bin].</param>
+ void DeleteFile(string path, bool sendToRecycleBin);
+
+ /// <summary>
+ /// Deletes the directory.
+ /// </summary>
+ /// <param name="path">The path.</param>
+ /// <param name="recursive">if set to <c>true</c> [recursive].</param>
+ /// <param name="sendToRecycleBin">if set to <c>true</c> [send to recycle bin].</param>
+ void DeleteDirectory(string path, bool recursive, bool sendToRecycleBin);
+
+ /// <summary>
+ /// Deletes the file.
+ /// </summary>
+ /// <param name="path">The path.</param>
+ void DeleteFile(string path);
+
+ /// <summary>
+ /// Deletes the directory.
+ /// </summary>
+ /// <param name="path">The path.</param>
+ /// <param name="recursive">if set to <c>true</c> [recursive].</param>
+ void DeleteDirectory(string path, bool recursive);
}
}
diff --git a/MediaBrowser.Common/Net/INetworkManager.cs b/MediaBrowser.Common/Net/INetworkManager.cs
index 979dae49c9..8fc947e8fe 100644
--- a/MediaBrowser.Common/Net/INetworkManager.cs
+++ b/MediaBrowser.Common/Net/INetworkManager.cs
@@ -51,5 +51,12 @@ namespace MediaBrowser.Common.Net
/// <param name="endpoint">The endpoint.</param>
/// <returns><c>true</c> if [is in local network] [the specified endpoint]; otherwise, <c>false</c>.</returns>
bool IsInLocalNetwork(string endpoint);
+
+ /// <summary>
+ /// Generates a self signed certificate at the locatation specified by <paramref name="certificatePath"/>.
+ /// </summary>
+ /// <param name="certificatePath">The path to generate the certificate.</param>
+ /// <param name="hostname">The common name for the certificate.</param>
+ void GenerateSelfSignedSslCertificate(string certificatePath, string hostname);
}
} \ No newline at end of file