public void execute(MinecraftPaths p) { SevenZipCompressor comp = new SevenZipCompressor(); comp.ArchiveFormat = OutArchiveFormat.Zip; comp.CompressDirectory(p.resolvePath(source, ExtraTags), p.resolvePath(target, ExtraTags)); }
public void reverse(MinecraftPaths p) { string s = p.resolvePath(source); string t = p.resolvePath(target); SMMMUtil.FileSystemUtils.UndoDirectoryCopy(s, t); }
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)); } }
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(); } }
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(); } }
public void reverse(MinecraftPaths p) { string t = p.resolvePath(target, ExtraTags); File.Delete(t); }
public void execute(MinecraftPaths p) { File.Copy(p.resolvePath(source, ExtraTags), p.resolvePath(target, ExtraTags), true); }
public void reverse(MinecraftPaths p) { File.Delete(p.resolvePath(target)); }