private static Entity CreateZippedEntity(Directory directory, string path) { var zippedDir = directory as ZippedFolder; if (zippedDir.Zip.IsFile(path)) { if (File.IsArchive(path)) { return(ZipFactory.GetZippedFolder(path, DirectoryType.Zipped, zippedDir)); } return(new ZippedFile(zippedDir.Zip, zippedDir.GetEntry(path))); } return(new ZippedFolder(zippedDir.Zip, path, directory)); }
private static Entity CreateFileSystemEntity(Directory directory, string path) { if (System.IO.Directory.Exists(path)) { return(new Folder(path)); } if (System.IO.File.Exists(path)) { if (File.IsArchive(path)) { return(ZipFactory.GetZippedFolder(path, DirectoryType.System, directory)); } return(new File(path)); } throw new ArgumentException("This entity is superfluous."); }