예제 #1
0
        public void execute(MinecraftPaths p)
        {
            SevenZipCompressor comp = new SevenZipCompressor();

            comp.ArchiveFormat = OutArchiveFormat.Zip;
            comp.CompressDirectory(p.resolvePath(source, ExtraTags), p.resolvePath(target, ExtraTags));
        }
예제 #2
0
        public void reverse(MinecraftPaths p)
        {
            string s = p.resolvePath(source);
            string t = p.resolvePath(target);

            SMMMUtil.FileSystemUtils.UndoDirectoryCopy(s, t);
        }
예제 #3
0
        public void execute(MinecraftPaths p)
        {
            Regex zip = new Regex(@"ZIP$");

            if (zip.IsMatch(target))
            {
                SevenZip.SevenZipCompressor comp = new SevenZipCompressor();
                Match m = zip.Match(target);

                target = target.Remove(m.Index) + "NAME";
                comp.CompressDirectory(p.resolvePath(source, ExtraTags), p.resolvePath(target, ExtraTags));
            }
            else
            {
                SMMMUtil.FileSystemUtils.CopyDirectory(p.resolvePath(source, ExtraTags), p.resolvePath(target, ExtraTags));
            }
        }
예제 #4
0
        public void execute(MinecraftPaths p)
        {
            Regex zip = new Regex(@"ZIP$");
            if (zip.IsMatch(target))
            {
                SevenZip.SevenZipCompressor comp = new SevenZipCompressor();
                Match m = zip.Match(target);

                target = target.Remove(m.Index) + "NAME";
                comp.CompressDirectory(p.resolvePath(source, ExtraTags), p.resolvePath(target, ExtraTags));

            }
            else
            {
                SMMMUtil.FileSystemUtils.CopyDirectory(p.resolvePath(source, ExtraTags), p.resolvePath(target, ExtraTags));

            }
        }
예제 #5
0
 public static IFSAction GenerateAction(MinecraftPaths p, string source, string target, ICollection<KeyValuePair<string,string>> extraTags = null,  bool compress=true)
 {
     string s = p.resolvePath(source,extraTags);
     string t = p.resolvePath(target,extraTags);
     if (Path.GetExtension(t) == ".zip")
     {
         return new DirectoryCompressAction(p.CompressPath(s, extraTags), p.CompressPath(t, extraTags));
     }
     else if (Directory.Exists(s))
     {
         return new DirectoryCopyAction(p.CompressPath(s, extraTags), p.CompressPath(t, extraTags));
     }
     else if (File.Exists(s))
     {
         return new FileCopyAction(p.CompressPath(s, extraTags), Path.Combine(p.CompressPath(t, extraTags), Path.GetFileName(s)));
     }
     else
     {
         throw new InvalidOperationException();
     }
 }
예제 #6
0
        public static IFSAction GenerateAction(MinecraftPaths p, string source, string target, ICollection <KeyValuePair <string, string> > extraTags = null, bool compress = true)
        {
            string s = p.resolvePath(source, extraTags);
            string t = p.resolvePath(target, extraTags);

            if (Path.GetExtension(t) == ".zip")
            {
                return(new DirectoryCompressAction(p.CompressPath(s, extraTags), p.CompressPath(t, extraTags)));
            }
            else if (Directory.Exists(s))
            {
                return(new DirectoryCopyAction(p.CompressPath(s, extraTags), p.CompressPath(t, extraTags)));
            }
            else if (File.Exists(s))
            {
                return(new FileCopyAction(p.CompressPath(s, extraTags), Path.Combine(p.CompressPath(t, extraTags), Path.GetFileName(s))));
            }
            else
            {
                throw new InvalidOperationException();
            }
        }
예제 #7
0
 public void reverse(MinecraftPaths p)
 {
     string t = p.resolvePath(target, ExtraTags);
     File.Delete(t);
 }
예제 #8
0
 public void execute(MinecraftPaths p)
 {
     File.Copy(p.resolvePath(source, ExtraTags), p.resolvePath(target, ExtraTags), true);
 }
예제 #9
0
 public void reverse(MinecraftPaths p)
 {
     string s = p.resolvePath(source);
     string t = p.resolvePath(target);
     SMMMUtil.FileSystemUtils.UndoDirectoryCopy(s, t);
 }
예제 #10
0
        public void reverse(MinecraftPaths p)
        {
            string t = p.resolvePath(target, ExtraTags);

            File.Delete(t);
        }
예제 #11
0
 public void execute(MinecraftPaths p)
 {
     File.Copy(p.resolvePath(source, ExtraTags), p.resolvePath(target, ExtraTags), true);
 }
예제 #12
0
 public void reverse(MinecraftPaths p)
 {
     File.Delete(p.resolvePath(target));
 }
예제 #13
0
 public void reverse(MinecraftPaths p)
 {
     File.Delete(p.resolvePath(target));
 }
예제 #14
0
 public void execute(MinecraftPaths p)
 {
     SevenZipCompressor comp = new SevenZipCompressor();
     comp.ArchiveFormat = OutArchiveFormat.Zip;
     comp.CompressDirectory(p.resolvePath(source, ExtraTags), p.resolvePath(target, ExtraTags));
 }