MCPcopy Index your code
hub / github.com/processing/processing / deleteFile

Method deleteFile

app/src/processing/app/Platform.java:375–388  ·  view source on GitHub ↗

Attempts to move to the Trash on OS X, or the Recycle Bin on Windows. Also tries to find a suitable Trash location on Linux. If not possible, just deletes the file or folder instead. @param file the folder or file to be removed/deleted @return true if the folder was successfully removed @throws IOEx

(File file)

Source from the content-addressed store, hash-verified

373 * @throws IOException
374 */
375 static public boolean deleteFile(File file) throws IOException {
376 FileUtils fu = FileUtils.getInstance();
377 if (fu.hasTrash()) {
378 fu.moveToTrash(new File[] { file });
379 return true;
380
381 } else if (file.isDirectory()) {
382 Util.removeDir(file);
383 return true;
384
385 } else {
386 return file.delete();
387 }
388 }
389
390
391 // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Callers 2

prepareExportFolderMethod · 0.95
handleDeleteCodeMethod · 0.45

Calls 3

removeDirMethod · 0.95
deleteMethod · 0.80
getInstanceMethod · 0.45

Tested by

no test coverage detected