MCPcopy Create free account
hub / github.com/BaseXdb/basex / delete

Method delete

basex-core/src/main/java/org/basex/io/IOFile.java:307–321  ·  view source on GitHub ↗

Deletes the file, or the directory and its children. @return true if the file does not exist or has been deleted

()

Source from the content-addressed store, hash-verified

305 * @return {@code true} if the file does not exist or has been deleted
306 */
307 public boolean delete() {
308 boolean ok = true;
309 if(file.exists()) {
310 if(isDir()) {
311 for(final IOFile ch : children()) ok &= ch.delete();
312 }
313 try {
314 Files.delete(toPath());
315 } catch(final IOException ex) {
316 Util.debug(ex);
317 return false;
318 }
319 }
320 return ok;
321 }
322
323 /**
324 * Renames a file to the specified path. The path must not exist yet.

Callers 15

writeFromResourceMethod · 0.95
stopMethod · 0.95
exportMethod · 0.95
runMethod · 0.95
extractToZipSlipMethod · 0.95
readWriteMethod · 0.95
stopMethod · 0.95
writeStoreMethod · 0.95
dropMethod · 0.95
binariesMethod · 0.95
alterMethod · 0.95

Calls 5

isDirMethod · 0.95
childrenMethod · 0.95
toPathMethod · 0.95
debugMethod · 0.95
existsMethod · 0.45

Tested by 6

writeFromResourceMethod · 0.76
exportMethod · 0.76
runMethod · 0.76
extractToZipSlipMethod · 0.76
readWriteMethod · 0.76