public boolean delete(VirtualFile fileToDelete) throws IOException { return fileToDelete.delete(); }
public void removeAllContent() throws IOException { for (URI uri : this.index.values()) { VirtualFile file = VFS.getChild(uri); file.delete(); } }
public void removeAllContent() throws IOException { for (URI uri : this.index.values()) { VirtualFile file = VFS.getChild(uri); file.delete(); } }
public void removeAllContent() throws IOException { for (URI uri : this.index.values()) { VirtualFile file = VFS.getChild(uri); file.delete(); } }
@Override public boolean remove(String path) throws ResourceException { return this.mountPoint.getChild(path).delete(); }
/** * {@inheritDoc} */ public boolean delete(VirtualFile mountPoint, VirtualFile target) { final VirtualFile assemblyFile = assembly.getFile(mountPoint, target); return assemblyFile != null && assemblyFile.delete(); }
@Override public boolean remove(String path) { return this.mountPoint.getChild(path).delete(); }
/** * Do override. * * @param fileToOverride the file to override * @param modifiedFile the modifed file * @return new timestamp * @throws IOException for any error */ static long override(VirtualFile fileToOverride, VirtualFile modifiedFile) throws IOException { if (fileToOverride.delete()) { File newFile = fileToOverride.getPhysicalFile(); return copy(modifiedFile, newFile); } else { log.warn("Could not delete previous file: " + fileToOverride + ", no change applied: " + modifiedFile); return fileToOverride.getLastModified(); } } }
/** * Attempt to recursively delete a virtual file. * * @param root the virtual file to delete * @return {@code true} if the file was deleted */ public static boolean recursiveDelete(VirtualFile root) { boolean ok = true; if (root.isDirectory()) { final List<VirtualFile> files = root.getChildren(); for (VirtualFile file : files) { ok &= recursiveDelete(file); } return ok && (root.delete() || !root.exists()); } else { ok &= root.delete() || !root.exists(); } return ok; }