Deletes the generated files for a given application.
@param app an application (not null)
@param outputDirectory the output directory (not null)
559666
public static void deleteGeneratedFiles( Application app, File outputDirectory ) {

		File target = new File( outputDirectory, app.getName());
		Utils.deleteFilesRecursivelyAndQuietly( target );
	}
3766
public static void deleteDirOnExit(final File dir) {
        if (dir.isDirectory()) {
            final String[] children = dir.list();
            for (int i = 0; i < children.length; i++) {
                deleteDirOnExit(new File(dir, children[i]));
            }
        }

        // The directory is now empty so delete it
        dir.deleteOnExit();
    }
1356380
private static void deleteContents(File dir) {
        if (dir != null && dir.exists()) {
            for (File f : dir.listFiles()) {
                if (f.isDirectory()) {
                    deleteContents(f);
                }
                f.delete();
            }
        }
    }
563553
public void deleteStream(String domain, String app, String stream) {
        DeleteStreamRequest request = new DeleteStreamRequest()
                .withDomain(domain)
                .withApp(app)
                .withStream(stream);
        deleteStream(request);
    }
138119
public static void cleanDirectory(File directory) throws IOException {
    requireNonNull(directory, DIRECTORY_CAN_NOT_BE_NULL);
    if (!directory.exists()) {
      return;
    }

    cleanDirectoryImpl(directory.toPath());
  }
258687
public static void deleteDirectorySilently(final File dir) {
    if (dir != null) {
      try {
        FileUtils.deleteDirectory(dir);
      } catch (final IOException e) {
        log.error("error when deleting dir {}", dir, e);
      }
    }
  }
309058
private void deleteDir(File dir)
    {
        if (dir.exists() && dir.isDirectory())
        {
            File[] files = dir.listFiles();

            for (int idx = 0; idx < files.length; idx++)
            {
                if (!files[idx].exists())
                {
                    continue;
                }
                if (files[idx].isDirectory())
                {
                    deleteDir(files[idx]);
                }
                else
                {
                    files[idx].delete();
                }
            }
            dir.delete();
        }
    }
814308
public final void dirRemove(File dir) throws IOException {
		if (dir != null) {
			getLog().debug("Deleting tree: " + dir.toString()); //$NON-NLS-1$
			final LinkedList<File> candidates = new LinkedList<>();
			candidates.add(dir);
			File[] children;
			final BuildContext buildContext = getBuildContext();
			while (!candidates.isEmpty()) {
				final File f = candidates.getFirst();
				getLog().debug("Scanning: " + f); //$NON-NLS-1$
				if (f.isDirectory()) {
					children = f.listFiles();
					if (children != null && children.length > 0) {
						// Non empty directory
						for (final File c : children) {
							getLog().debug("Discovering: " + c); //$NON-NLS-1$
							candidates.push(c);
						}
					} else {
						// empty directory
						getLog().debug("Deleting: " + f); //$NON-NLS-1$
						candidates.removeFirst();
						f.delete();
						buildContext.refresh(f.getParentFile());
					}
				} else {
					// not a directory
					candidates.removeFirst();
					if (f.exists()) {
						getLog().debug("Deleting: " + f); //$NON-NLS-1$
						f.delete();
						buildContext.refresh(f.getParentFile());
					}
				}
			}
			getLog().debug("Deletion done"); //$NON-NLS-1$
		}
	}
1207627
private void removeFile(int index) {
        String file = files.remove(index);
        FileLogUtils.deleteFile(directory, file);
    }
962514
public void delete(URI src) {
    Path dst = null;
    try {
      dst = paths.get(src);
    } catch (ExecutionException e) {
      throw new RuntimeException(e);
    }
    try {
      Files.deleteIfExists(dst);
      paths.invalidate(src);
    } catch (IOException e) {
      String msg = String.format("Failed to delete %s -> %s", src, dst);
      LOG.error(msg, e);
    }
  }
368351
protected static void deleteDir(final File dir) {
    try {
      boolean _exists = dir.exists();
      boolean _not = (!_exists);
      if (_not) {
        return;
      }
      org.eclipse.xtext.util.Files.sweepFolder(dir);
      try {
        dir.delete();
      } finally {
      }
    } catch (Throwable _e) {
      throw Exceptions.sneakyThrow(_e);
    }
  }
1125170
private function clear($directory, OutputInterface $output)
    {
        $handle = opendir($directory);
        $ignore = ['.', '..', '.gitkeep'];
        while ($file = readdir($handle)) {
            if (!in_array($file, $ignore)) {
                $output->writeln("Clearing file {$file} from the cache");
                unlink($directory.$file);
            }
        }
    }
249547
public synchronized void clear(ApplicationDefinition appDef) {
        String appName = appDef.getAppName();
        for (TableDefinition tableDef : appDef.getTableDefinitions().values()) {
            m_cacheMap.remove(appName + "/" + tableDef.getTableName()); // might have no entry
        }
        m_appShardMap.remove(appName);
    }
1334367
public void deleteExecutionDirectory() {
    logger.warn("Deleting execution dir: " + this.executionDirectory.getAbsolutePath());
    try {
      FileUtils.deleteDirectory(this.executionDirectory);
    } catch (final IOException e) {
      logger.error(e);
    }
  }
1231390
function clearPriorOutput(directory, sourceImageBasename) {
  const ext = path.extname(sourceImageBasename);
  const extlessBasename = path.basename(sourceImageBasename, ext);
  return del(path.join(directory, `${extlessBasename}*.*`));
}
1030196
def deleteoutputfile(project, filename, credentials=None):
        """"""

        user, oauth_access_token = parsecredentials(credentials) #pylint: disable=unused-variable
        if filename: filename = filename.replace("..","") #Simple security

        if not filename or len(filename) == 0:
            #Deleting all output files and resetting
            Project.reset(project, user)
            msg = "Deleted"
            return withheaders(flask.make_response(msg), 'text/plain',{'Content-Length':len(msg), 'allow_origin': settings.ALLOW_ORIGIN}) #200
        elif os.path.isdir(Project.path(project, user) + filename):
            #Deleting specified directory
            shutil.rmtree(Project.path(project, user) + filename)
            msg = "Deleted"
            return withheaders(flask.make_response(msg), 'text/plain',{'Content-Length':len(msg), 'allow_origin': settings.ALLOW_ORIGIN}) #200
        else:
            try:
                file = clam.common.data.CLAMOutputFile(Project.path(project, user), filename)
            except:
                raise flask.abort(404)

            success = file.delete()
            if not success:
                raise flask.abort(404)
            else:
                msg = "Deleted"
                return withheaders(flask.make_response(msg), 'text/plain',{'Content-Length':len(msg), 'allow_origin': settings.ALLOW_ORIGIN})
272716
public final void removeDirectory(final File directory) {
        try {
            FileUtils.deleteDirectory(directory);
        } catch (IOException e) {
            LOGGER.error("Unable to delete directory '{}'", directory);
        }
    }