public static string GetStorageTarget(string sha, DirectoryInfo objectsDir)
        {
            string pendingFileName;
            string keepFileName;

            ObjectStorage.GetStorageTargets(sha, objectsDir, out pendingFileName, out keepFileName);

            return(keepFileName);
        }
Exemple #2
0
        public static FileJob GetBackupJob(IFile file, DirectoryInfo objectsDir, string password, string salt)
        {
            string pendingFileName;
            string keepFileName;

            ObjectStorage.GetStorageTargets(file.Sha256, objectsDir, out pendingFileName, out keepFileName);

            return(new FileJob(file, file.GetFileInfo().FullName, pendingFileName, keepFileName, ModeEnum.CompressEncrypt, password, salt));
        }
Exemple #3
0
        public static FileJob GetRestoreJob(IFile file, DirectoryInfo objectsDir, DirectoryInfo restoreTargetDir, string password, string salt)
        {
            string toPath  = Path.Combine(restoreTargetDir.FullName, file.GetPathFromRoot());
            string pending = toPath + ".pending";

            string pendingFileName; // don't use for restore, this is just for backup
            string keepFileName;

            ObjectStorage.GetStorageTargets(file.Sha256, objectsDir, out pendingFileName, out keepFileName);

            return(new FileJob(file, keepFileName, pending, toPath, ModeEnum.DecryptDecompress, password, salt));
        }