mirror of
https://github.com/Radarr/Radarr.git
synced 2026-04-18 21:35:51 -04:00
b1f76082b2
Old folder is now only left behind if extra files are also present in new dir and cannot be overwritten. Generally Dynamic Paths should be more stable now. Fixes #2048
56 lines
2.5 KiB
C#
56 lines
2.5 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Security.AccessControl;
|
|
using System.Security.Principal;
|
|
|
|
namespace NzbDrone.Common.Disk
|
|
{
|
|
public interface IDiskProvider
|
|
{
|
|
long? GetAvailableSpace(string path);
|
|
void InheritFolderPermissions(string filename);
|
|
void SetPermissions(string path, string mask, string user, string group);
|
|
long? GetTotalSize(string path);
|
|
DateTime FolderGetCreationTime(string path);
|
|
DateTime FolderGetLastWrite(string path);
|
|
DateTime FileGetLastWrite(string path);
|
|
void EnsureFolder(string path);
|
|
bool FolderExists(string path);
|
|
bool FileExists(string path);
|
|
bool FileExists(string path, StringComparison stringComparison);
|
|
bool CanUseGDIPlus();
|
|
bool IsValidGDIPlusImage(string path);
|
|
bool FolderWritable(string path);
|
|
string[] GetDirectories(string path);
|
|
string[] GetFiles(string path, SearchOption searchOption);
|
|
long GetFolderSize(string path);
|
|
long GetFileSize(string path);
|
|
void CreateFolder(string path);
|
|
void DeleteFile(string path);
|
|
void CopyFile(string source, string destination, bool overwrite = false);
|
|
void MoveFile(string source, string destination, bool overwrite = false);
|
|
void MoveFolder(string source, string destination, bool overwrite = false);
|
|
bool TryCreateHardLink(string source, string destination);
|
|
void DeleteFolder(string path, bool recursive);
|
|
string ReadAllText(string filePath);
|
|
void WriteAllText(string filename, string contents);
|
|
void FolderSetLastWriteTime(string path, DateTime dateTime);
|
|
void FileSetLastWriteTime(string path, DateTime dateTime);
|
|
bool IsFileLocked(string path);
|
|
string GetPathRoot(string path);
|
|
string GetParentFolder(string path);
|
|
void SetPermissions(string filename, WellKnownSidType accountSid, FileSystemRights rights, AccessControlType controlType);
|
|
FileAttributes GetFileAttributes(string path);
|
|
void EmptyFolder(string path);
|
|
string GetVolumeLabel(string path);
|
|
FileStream OpenReadStream(string path);
|
|
FileStream OpenWriteStream(string path);
|
|
List<IMount> GetMounts();
|
|
IMount GetMount(string path);
|
|
List<DirectoryInfo> GetDirectoryInfos(string path);
|
|
List<FileInfo> GetFileInfos(string path);
|
|
void RemoveEmptySubfolders(string path);
|
|
}
|
|
}
|