Ejemplo n.º 1
0
        protected static IEnumerable<Directory> GetSubDirectories(Directory directory, string[] exclusions = null)
        {
            foreach (Directory subDirectory in directory.Directories)
            {
                if (exclusions != null && exclusions.Any(e => MatchPattern(subDirectory.Path + "/", e)))
                    continue;

                yield return subDirectory;

                foreach (Directory subSubDirectory in GetSubDirectories(subDirectory, exclusions))
                    yield return subSubDirectory;
            }
        }
Ejemplo n.º 2
0
        public override void DeleteDirectory(Directory directory)
        {
            if (!directory.Parent.Equals(this))
                throw new ArgumentException("The specified directory could not be found");

            string path = this.directory.FullName + "/" + directory.Name;
            storage.SftpClient.DeleteDirectory(path);
        }
Ejemplo n.º 3
0
        public SftpCachedDirectory(SftpStorage storage, Directory parent, string path, string name)
        {
            this.storage = storage;
            this.parent = parent;

            this.path = path;
            this.name = name;
            this.directories = new List<SftpCachedDirectory>();
            this.files = new List<SftpCachedFile>();
        }
Ejemplo n.º 4
0
        public override void DeleteDirectory(Directory directory)
        {
            if (!directory.Parent.Equals(this))
                throw new ArgumentException("The specified directory could not be found");

            OneDriveDirectory oneDriveDirectory = directory as OneDriveDirectory;

            Task task = storage.Client.Drive.Items[oneDriveDirectory.directory.Id].Request().DeleteAsync();
            task.Wait();
        }
Ejemplo n.º 5
0
        public override void DeleteDirectory(Directory directory)
        {
            ZipDirectory zipDirectory = directory as ZipDirectory;
            zipDirectory.directory.Delete();

            storage.Modified = true;
        }
Ejemplo n.º 6
0
 public DeleteDirectoryAction(Directory directory)
 {
     Directory = directory;
 }
Ejemplo n.º 7
0
        public override void DeleteDirectory(Directory directory)
        {
            if (!directory.Parent.Equals(this))
                throw new ArgumentException("The specified directory could not be found");

            ZipDirectory zipDirectory = directory as ZipDirectory;
            zipDirectory.directory.Delete();

            storage.Modified = true;
        }
Ejemplo n.º 8
0
 public ZipDirectory(ZipStorage storage, Directory parent, ZipArchiveEntry directory)
 {
     this.storage = storage;
     this.parent = parent;
     this.directory = directory;
 }
Ejemplo n.º 9
0
 public DirectoryDiff(Storage leftStorage, Directory leftDirectory, Storage rightStorage, Directory rightDirectory)
 {
     this.leftStorage = leftStorage;
     this.rightStorage = rightStorage;
     this.leftDirectory = leftDirectory;
     this.rightDirectory = rightDirectory;
 }
Ejemplo n.º 10
0
 public abstract void DeleteDirectory(Directory directory);