public FsEntry getInstance(FsFolder parent, ZipEntry subEntry) { FsEntry elem = null; if (_zipfile != null) { elem = parent.getInstance(_zipfile, subEntry); } else if (_url != null) { elem = parent.getInstance(null, subEntry); // elem = parent.getInstance(_url, subEntry); } else { elem = null; } return elem; }
public static FsFolder createFolder(FsFolder parent, File folder) { FsFolder folderRef = (FsFolder) parent.getInstance(folder); if (folderRef == null) { if (!folder.exists()) { folder.mkdirs(); } folderRef = new FsFolder(parent, folder); String name = folder.getName(); // parent.addChild(name, folderRef); } return folderRef; }