com.sun.enterprise.util.io.FileUtils.whackResolvedDirectory()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(3.6k)|赞(0)|评价(0)|浏览(143)

本文整理了Java中com.sun.enterprise.util.io.FileUtils.whackResolvedDirectory()方法的一些代码示例,展示了FileUtils.whackResolvedDirectory()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FileUtils.whackResolvedDirectory()方法的具体详情如下:
包路径:com.sun.enterprise.util.io.FileUtils
类名称:FileUtils
方法名:whackResolvedDirectory

FileUtils.whackResolvedDirectory介绍

[英]Deletes a directory and its contents.

The whackResolvedDirectory method is invoked with a File argument in which any upstream file system links have already been resolved. This method will treate Any file passed in that does not have the same absolute and canonical path - as evaluated in safeIsRealDirectory - as a link and will delete the link without deleting any files in the linked directory.
[中]删除目录及其内容。
使用文件参数调用whackResolvedDirectory方法,其中任何上游文件系统链接都已解析。此方法将把传入的任何不具有相同绝对路径和规范路径的文件(如在safeIsRealDirectory中评估的)视为链接,并将删除链接而不删除链接目录中的任何文件。

代码示例

代码示例来源:origin: org.glassfish.common/common-util

/**
 * Deletes a directory and its contents.
 * <p/>
 * If this method encounters a symbolic link in the subtree below "parent"
 * then it deletes the link but not any of the files pointed to by the link.
 * Note that whack will delete files if a symbolic link appears in the
 * path above the specified parent directory in the path.
 *
 * @param parent the File at the top of the subtree to delete
 * @return success or failure of deleting the directory
 */
public static boolean whack(File parent, Collection<File> undeletedFiles) {
  try {
    /*
    *Resolve any links up-stream from this parent directory and
    *then whack the resulting resolved directory.
    */
    return whackResolvedDirectory(parent.getCanonicalFile(), undeletedFiles);
  } catch (IOException ioe) {
    _utillogger.log(Level.SEVERE, "iplanet_util.io_exception", ioe);
    return false;
  }
}

代码示例来源:origin: org.glassfish.main.common/common-util

/**
 * Deletes a directory and its contents.
 * <p/>
 * If this method encounters a symbolic link in the subtree below "parent"
 * then it deletes the link but not any of the files pointed to by the link.
 * Note that whack will delete files if a symbolic link appears in the
 * path above the specified parent directory in the path.
 *
 * @param parent the File at the top of the subtree to delete
 * @return success or failure of deleting the directory
 */
public static boolean whack(File parent, Collection<File> undeletedFiles) {
  try {
    /*
    *Resolve any links up-stream from this parent directory and
    *then whack the resulting resolved directory.
    */
    return whackResolvedDirectory(parent.getCanonicalFile(), undeletedFiles);
  } catch (IOException ioe) {
    _utillogger.log(Level.SEVERE, CULoggerInfo.exceptionIO, ioe);
    return false;
  }
}

代码示例来源:origin: eclipse-ee4j/glassfish

/**
 * Deletes a directory and its contents.
 * <p/>
 * If this method encounters a symbolic link in the subtree below "parent"
 * then it deletes the link but not any of the files pointed to by the link.
 * Note that whack will delete files if a symbolic link appears in the
 * path above the specified parent directory in the path.
 *
 * @param parent the File at the top of the subtree to delete
 * @return success or failure of deleting the directory
 */
public static boolean whack(File parent, Collection<File> undeletedFiles) {
  try {
    /*
    *Resolve any links up-stream from this parent directory and
    *then whack the resulting resolved directory.
    */
    return whackResolvedDirectory(parent.getCanonicalFile(), undeletedFiles);
  } catch (IOException ioe) {
    _utillogger.log(Level.SEVERE, CULoggerInfo.exceptionIO, ioe);
    return false;
  }
}

代码示例来源:origin: org.glassfish.main.common/common-util

whackResolvedDirectory(f, undeletedFiles);
else if (!deleteFile(f) && undeletedFiles != null) {
  undeletedFiles.add(f);

代码示例来源:origin: org.glassfish.common/common-util

whackResolvedDirectory(f, undeletedFiles);
else if (!deleteFile(f) && undeletedFiles != null) {
  undeletedFiles.add(f);

代码示例来源:origin: eclipse-ee4j/glassfish

whackResolvedDirectory(f, undeletedFiles);
else if (!deleteFile(f) && undeletedFiles != null) {
  undeletedFiles.add(f);

相关文章