org.apache.cxf.helpers.FileUtils.doMkDirs()方法的使用及代码示例

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

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

FileUtils.doMkDirs介绍

[英]Attempt to fix possible race condition when creating directories on WinXP, also Windows2000. If the mkdirs does not work, wait a little and try again.
[中]尝试修复在WinXP和Windows2000上创建目录时可能出现的争用情况。如果mkdirs不工作,请稍等,然后重试。

代码示例

代码示例来源:origin: org.apache.cxf/cxf-core

public static void mkDir(File dir) {
  if (dir == null) {
    throw new RuntimeException("dir attribute is required");
  }
  if (dir.isFile()) {
    throw new RuntimeException("Unable to create directory as a file "
                + "already exists with that name: " + dir.getAbsolutePath());
  }
  if (!dir.exists()) {
    boolean result = doMkDirs(dir);
    if (!result) {
      String msg = "Directory " + dir.getAbsolutePath()
             + " creation was not successful for an unknown reason";
      throw new RuntimeException(msg);
    }
  }
}

代码示例来源:origin: org.apache.cxf/cxf-api

public static void mkDir(File dir) {
  if (dir == null) {
    throw new RuntimeException("dir attribute is required");
  }
  if (dir.isFile()) {
    throw new RuntimeException("Unable to create directory as a file "
                + "already exists with that name: " + dir.getAbsolutePath());
  }
  if (!dir.exists()) {
    boolean result = doMkDirs(dir);
    if (!result) {
      String msg = "Directory " + dir.getAbsolutePath()
             + " creation was not successful for an unknown reason";
      throw new RuntimeException(msg);
    }
  }
}

代码示例来源:origin: apache/cxf

public static void mkDir(File dir) {
  if (dir == null) {
    throw new RuntimeException("dir attribute is required");
  }
  if (dir.isFile()) {
    throw new RuntimeException("Unable to create directory as a file "
                + "already exists with that name: " + dir.getAbsolutePath());
  }
  if (!dir.exists()) {
    boolean result = doMkDirs(dir);
    if (!result) {
      String msg = "Directory " + dir.getAbsolutePath()
             + " creation was not successful for an unknown reason";
      throw new RuntimeException(msg);
    }
  }
}

代码示例来源:origin: org.apache.cxf/cxf-bundle-jaxrs

public static void mkDir(File dir) {
  if (dir == null) {
    throw new RuntimeException("dir attribute is required");
  }
  if (dir.isFile()) {
    throw new RuntimeException("Unable to create directory as a file "
                + "already exists with that name: " + dir.getAbsolutePath());
  }
  if (!dir.exists()) {
    boolean result = doMkDirs(dir);
    if (!result) {
      String msg = "Directory " + dir.getAbsolutePath()
             + " creation was not successful for an unknown reason";
      throw new RuntimeException(msg);
    }
  }
}

代码示例来源:origin: org.apache.cxf/cxf-common-utilities

public static void mkDir(File dir) {
  if (dir == null) {
    throw new RuntimeException("dir attribute is required");
  }
  if (dir.isFile()) {
    throw new RuntimeException("Unable to create directory as a file "
                + "already exists with that name: " + dir.getAbsolutePath());
  }
  if (!dir.exists()) {
    boolean result = doMkDirs(dir);
    if (!result) {
      String msg = "Directory " + dir.getAbsolutePath()
             + " creation was not successful for an unknown reason";
      throw new RuntimeException(msg);
    }
  }
}

相关文章