@Override public void unlink( BitField<FsAccessOption> options, FsNodeName name) throws IOException { controller.unlink(options, name); }
@Override public final void unlink(BitField<FsAccessOption> options, FsNodeName name) throws IOException { controller.unlink(map(options), name); } }
void delete(TPath path) throws IOException { getController().unlink(path.getAccessPreferences(), path.getNodeName()); }
/** * Deletes the given file or directory. * If the file is a directory, it must be empty. * * @param file the file or directory. * Note that although this just needs to be a plain {@code File} * object, archive files and entries are only supported for * instances of {@code TFile}. * @throws IOException if any I/O error occurs. * @see <a href="#bulkIOMethods">Bulk I/O Methods</a> */ @FsAssertion(atomic=YES, consistent=YES, isolated=YES) @SuppressWarnings("AccessingNonPublicFieldOfAnotherObject") public static void rm(File file) throws IOException { if (file instanceof TFile) { TFile tfile = (TFile) file; if (null != tfile.innerArchive) { tfile.innerArchive.getController().unlink( getAccessPreferences(), tfile.getNodeName()); return; } file = tfile.file; } if (!file.delete()) throw new FileSystemException(file.getPath(), null, "Cannot delete!"); }
@Override public final void unlink( final BitField<FsAccessOption> options, final FsNodeName name) throws IOException { try { controller.unlink(options, name); } catch (final ControlFlowException ex) { // If the exception is caused by a key exception, then throw this // cause instead in order to avoid treating the target archive file // like a false positive and routing this operation to the parent // file system. // This prevents the application from inadvertently deleting an // encrypted ZIP file just because the user cancelled key prompting. final IOException keyEx = findKeyException(ex); if (null == keyEx) throw ex; throw keyEx; } final FsModel model = getModel(); final URI mpu = driver.mountPointUri(model); final URI fsu = driver.fileSystemUri(model, name.toString()); if (!fsu.equals(mpu) || name.isRoot()) keyManager().unlink(fsu); }