Run "svn cleanup" on the given working copy.

@param directory The local working directory
@throws IOException Execution of the SVN sub-process failed or the
sub-process returned a exit value indicating a failure
423663
public static void cleanup(File directory) throws IOException {
        log.info("Cleaning SVN Working copy at " + directory);

        CommandLine cmdLine = new CommandLine(SVN_CMD);
        cmdLine.addArgument("cleanup");
        addDefaultArguments(cmdLine, null, null);

        try (InputStream result = ExecutionHelper.getCommandResult(cmdLine, directory, 0, 360000)) {
            log.info("Svn-Cleanup reported:\n" + extractResult(result));
        }
    }
838830
public static void deleteDirectory(File directory) throws IOException {
    requireNonNull(directory, DIRECTORY_CAN_NOT_BE_NULL);
    deleteDirectoryImpl(directory.toPath());
  }
694218
private void cleanTargetDirectory(PrintStream logger, String targetDirectory) throws IOException {
        File target = new File(targetDirectory);
        if (target.exists()) {
            File[] subfolders = target.listFiles((FilenameFilter) DirectoryFileFilter.INSTANCE);
            if (subfolders.length > 0) {
                logger.println("  Cleaning target directory...");
            }
            for (File subfolder : subfolders) {
                if (subfolder.listFiles((FilenameFilter) new SuffixFileFilter(".vproj")).length > 0) {
                    logger.println("    Deleting subfolder of target directory: " + subfolder.getAbsolutePath());
                    FileUtils.deleteDirectory(subfolder);
                } else {
                    logger.println("    Skipping delete of directory '" + subfolder.getAbsolutePath() + "' because it does not contain any *.vproj file.");
                }
            }
        }
    }
1118339
private void cleanDir(File dir) {
        File[] files = dir.listFiles();
        if (files != null && files.length > 0) {
            for (int i = 0; i < files.length; i++) {
                File file = files[i];
                // if file is a directory, first delete all the files inside, then delete the directory itself.
                if (file.isDirectory()) {
                    cleanDir(file);
                }
                if (!file.delete()) {
                    throw new BuildException(MessageFormat.format(messages.getString("error.cannot.delete.file"), file.getAbsolutePath()));
                }
            }
        }
    }
1304534
public static boolean clean(File directory) throws IORuntimeException {
		if (directory == null || directory.exists() == false || false == directory.isDirectory()) {
			return true;
		}

		final File[] files = directory.listFiles();
		boolean isOk;
		for (File childFile : files) {
			isOk = del(childFile);
			if (isOk == false) {
				// 删除一个出错则本次删除任务失败
				return false;
			}
		}
		return true;
	}
147495
private void delete(DirectoryEntry entry, DeleteMode deleteMode, JimfsPath pathForException)
      throws IOException {
    Directory parent = entry.directory();
    File file = entry.file();

    checkDeletable(file, deleteMode, pathForException);
    parent.unlink(entry.name());
    parent.updateModifiedTime();

    file.deleted();
  }
522411
static public void emptyDirectory(File dir) throws Exception {
		String[] fileNames = dir.list();
		if( null != fileNames ) {
			for(String fileName : fileNames){
				File file = new File(dir,fileName);
				if( file.isDirectory() ) {
					emptyDirectory(file);
				}
				boolean deleted = false;
				try {
					deleted = file.delete();
				} catch(Exception e) {
					throw new Exception("Unable to delete: "+file.getAbsolutePath(),e);
				}
				if( !deleted ){
					throw new Exception("Unable to delete: "+file.getAbsolutePath());
				}
			}
		}
	}
814580
public static void delete(@NonNull String name, @NonNull File directory) throws CouchbaseLiteException {
        if (name == null) { throw new IllegalArgumentException("name cannot be null."); }
        if (directory == null) { throw new IllegalArgumentException("directory cannot be null."); }
        if (!exists(name, directory)) {
            throw new CouchbaseLiteException(
                CBLError.Domain.CBLITE,
                CBLError.Code.NOT_FOUND);
        }

        final File path = getDatabasePath(directory, name);
        try {
            Log.i(DOMAIN, "delete(): path=%s", path.toString());
            C4Database.deleteAtPath(path.getPath());
        }
        catch (LiteCoreException e) {
            throw CBLStatus.convertException(e);
        }
    }
415573
public static void deleteRecursive(@Nonnull File dir) throws IOException {
        deleteRecursive(fileToPath(dir), PathRemover.PathChecker.ALLOW_ALL);
    }
944512
public static void deleteDirectory(File directory) throws IOException {
    if (!directory.exists()) {
      return;
    }

    if (!isSymlink(directory)) {
      cleanDirectory(directory);
    }

    if (!directory.delete()) {
      String message =
          "Unable to delete directory " + directory + ".";
      throw new IOException(message);
    }
  }
492455
@Override
  public void close()
  {
    if (!closed)
    {
      try
      {
        if (Files.isDirectory(bindDir))
        {
          String[] dir = bindDir.toFile().list();
          if (dir != null)
          {
            for (String fileName : dir)
            {
              Files.delete(bindDir.resolve(fileName));
            }
          }
          Files.delete(bindDir);
        }
      }
      catch (IOException ex)
      {
        logger.debug("Exception encountered while trying to clean local directory. ", ex);
      }
      finally
      {
        closed = true;
      }
    }
  }
125631
public PurgeResponse purgeDirectory(String directory) {
        return purge(new PurgeRequest().addTask(new PurgeTask().withDirectory(directory)));
    }
673178
@Override
	public boolean cd(String directory) {
		boolean flag = true;
		try {
			flag = client.changeWorkingDirectory(directory);
		} catch (IOException e) {
			throw new FtpException(e);
		}
		return flag;
	}
598159
def __delete_directory(self, directory):
        

        for node in itertools.chain(self.__script_editor.model.get_project_nodes(directory),
                                    self.__script_editor.model.get_directory_nodes(directory)):
            self.__script_editor.model.unregister_project_nodes(node)
            if node.family == "Directory":
                self.__script_editor.model.unregister_project_nodes(node)
                self.__script_editor.model.unregister_directory(node)
            elif node.family == "Project":
                self.__script_editor.remove_project(directory)
            self.__delete_path(directory)
163884
public static void deleteDirectory(File dir) {
        if (!dir.exists()) {
            return;
        }

        if (dir.isDirectory()) {
            for (File child : dir.listFiles()) {
                deleteDirectory(child);
            }
            dir.delete();
        } else {
            dir.delete();
        }
    }
948605
protected void deleteWsdlPublishDirectory(File dir) throws IOException
   {
      String[] files = dir.list();
      for (int i = 0; files != null && i < files.length; i++)
      {
         String fileName = files[i];
         File file = new File(dir + "/" + fileName);
         if (file.isDirectory())
         {
            deleteWsdlPublishDirectory(file);
         }
         else
         {
            if (file.delete() == false)
               DEPLOYMENT_LOGGER.cannotDeletePublishedWsdlDoc(file.toURI().toURL());
         }
      }

      // delete the directory as well
      if (dir.delete() == false) {
         DEPLOYMENT_LOGGER.cannotDeletePublishedWsdlDoc(dir.toURI().toURL());
      }
   }
734433
public static void deleteDir(Path dir) throws IOException {
		Validate.isTrue(isDirExists(dir), "%s is not exist or not a dir", dir);

		// 后序遍历，先删掉子目录中的文件/目录
		Files.walkFileTree(dir, deleteFileVisitor);
	}