public IEnumerable <string> GetSubDirectories(string relpath) { if (relpath.StartsWith(Path.DirectorySeparatorChar.ToString())) { relpath = relpath.Substring(1); } return(FSInterop.GetSubDirectories(Path.Combine(BackupPathSrc, relpath)).Select(filepath => Path.GetFileName(filepath))); }
private Stream GetRawFileData(string relpath) { if (BackupPathSrc == null) { throw new Exception("Must be configured with source path for this operation"); } return(FSInterop.GetFileData(Path.Combine(BackupPathSrc, relpath))); }
public FileMetadata GetFileMetadata(string relpath) { if (relpath.StartsWith(Path.DirectorySeparatorChar.ToString())) { relpath = relpath.Substring(1); } return(FSInterop.GetFileMetadata(Path.Combine(BackupPathSrc, relpath))); }
public IEnumerable <string> GetSubDirectories(string relpath) { if (relpath.StartsWith(Path.DirectorySeparatorChar.ToString())) { relpath = relpath.Substring(1); } if (BackupPathSrc == null) { throw new Exception("Must be configured with source path for this operation"); } return(FSInterop.GetSubDirectories(Path.Combine(BackupPathSrc, relpath)).Select(filepath => Path.GetFileName(filepath))); }
public FileMetadata GetFileMetadata(string relpath) { if (relpath.StartsWith(Path.DirectorySeparatorChar.ToString())) { relpath = relpath.Substring(1); } if (BackupPathSrc == null) { throw new Exception("Must be configured with source path for this operation"); } return(FSInterop.GetFileMetadata(Path.Combine(BackupPathSrc, relpath))); }
public void WriteOutMetadata(string path, FileMetadata metadata, bool absolutepath = false) { if (!absolutepath) { path = Path.Combine(BackupPathSrc, path); } try { FSInterop.WriteOutMetadata(path, metadata); } catch (Exception) { throw; } }
public void CreateDirectory(string path, bool absolutepath = false) { if (!absolutepath) { path = Path.Combine(BackupPathSrc, path); } try { FSInterop.CreateDirectoryIfNotExists(path); } catch (Exception) { throw; } }
public void OverwriteOrCreateFile(string path, byte[] data, FileMetadata fileMetadata = null, bool absolutepath = false) { if (!absolutepath) { path = Path.Combine(BackupPathSrc, path); } try { FSInterop.OverwriteOrCreateFile(path, data, fileMetadata); } catch (Exception) { throw; } }
public void WriteOutMetadata(string path, FileMetadata metadata, bool absolutepath = false) { if (!absolutepath) { if (BackupPathSrc == null) { throw new Exception("Must be configured with source path for this operation"); } path = Path.Combine(BackupPathSrc, path); } try { FSInterop.WriteOutMetadata(path, metadata); } catch (Exception) { throw; } }
public void CreateDirectory(string path, bool absolutepath = false) { if (!absolutepath) { if (BackupPathSrc == null) { throw new Exception("Must be configured with source path for this operation"); } path = Path.Combine(BackupPathSrc, path); } try { FSInterop.CreateDirectoryIfNotExists(path); } catch (Exception) { throw; } }
public void DeleteFile(string path, bool absolutepath = false) { if (!absolutepath) { if (BackupPathSrc == null) { throw new Exception("Must be configured with source path for this operation"); } path = Path.Combine(BackupPathSrc, path); } try { FSInterop.DeleteFile(path); } catch (Exception) { throw; } }
public void OverwriteOrCreateFile(string path, byte[] data, FileMetadata?fileMetadata = null, bool absolutepath = false) { if (!absolutepath) { if (BackupPathSrc == null) { throw new Exception("Must be configured with source path for this operation"); } path = Path.Combine(BackupPathSrc, path); } try { FSInterop.OverwriteOrCreateFile(path, data, fileMetadata); } catch (Exception) { throw; } }
private Stream GetRawFileData(string relpath) { return(FSInterop.GetFileData(Path.Combine(BackupPathSrc, relpath))); }