marytts.util.io.FileUtils.createDirectory()方法的使用及代码示例

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

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

FileUtils.createDirectory介绍

暂无

代码示例

代码示例来源:origin: marytts/marytts

FileUtils.createDirectory(args[1]);

代码示例来源:origin: marytts/marytts

FileUtils.createDirectory(args[1]);

代码示例来源:origin: marytts/marytts

public static void copyFolderRecursive(String sourceFolder, String targetFolder, boolean bForceDeleteTarget)
    throws IOException {
  String fileSeparator = System.getProperty("file.separator");
  if (exists(sourceFolder)) {
    if (exists(targetFolder) && bForceDeleteTarget)
      delete(targetFolder);
    createDirectory(targetFolder);
    if (exists(targetFolder)) {
      String[] fileList = new File(sourceFolder).list();
      if (fileList != null) {
        for (int i = 0; i < fileList.length; i++) {
          if (!fileList[i].startsWith(".")) {
            String source = StringUtils.checkLastSlash(sourceFolder) + fileList[i];
            if (new File(source).isDirectory()) {
              String newTargetFolder = StringUtils.checkLastSlash(targetFolder) + fileList[i];
              copyFolderRecursive(source, newTargetFolder, bForceDeleteTarget);
            } else {
              String targetFile = StringUtils.checkLastSlash(targetFolder) + fileList[i];
              copy(source, targetFile);
            }
          }
        }
      }
    } else
      System.out.println("Could not create target folder!");
  } else
    System.out.println("Source folder does not exist!");
}

代码示例来源:origin: marytts/marytts

public static void copyFolderRecursive(String sourceFolder, String targetFolder, boolean bForceDeleteTarget)
    throws IOException {
  String fileSeparator = System.getProperty("file.separator");
  if (exists(sourceFolder)) {
    if (exists(targetFolder) && bForceDeleteTarget)
      delete(targetFolder);
    createDirectory(targetFolder);
    if (exists(targetFolder)) {
      String[] fileList = new File(sourceFolder).list();
      if (fileList != null) {
        for (int i = 0; i < fileList.length; i++) {
          if (!fileList[i].startsWith(".")) {
            String source = StringUtils.checkLastSlash(sourceFolder) + fileList[i];
            if (new File(source).isDirectory()) {
              String newTargetFolder = StringUtils.checkLastSlash(targetFolder) + fileList[i];
              copyFolderRecursive(source, newTargetFolder, bForceDeleteTarget);
            } else {
              String targetFile = StringUtils.checkLastSlash(targetFolder) + fileList[i];
              copy(source, targetFile);
            }
          }
        }
      }
    } else
      System.out.println("Could not create target folder!");
  } else
    System.out.println("Source folder does not exist!");
}

代码示例来源:origin: marytts/marytts

FileUtils.createDirectory(params.outputBaseFolder);
FileUtils.createDirectory(params.outputFolder);

代码示例来源:origin: marytts/marytts

public boolean checkParams() {
  boolean bContinue = true;
  wcParams.trainingBaseFolder = StringUtils.checkLastSlash(wcParams.trainingBaseFolder);
  wcParams.sourceTrainingFolder = StringUtils.checkLastSlash(wcParams.sourceTrainingFolder);
  wcParams.targetTrainingFolder = StringUtils.checkLastSlash(wcParams.targetTrainingFolder);
  FileUtils.createDirectory(wcParams.trainingBaseFolder);
  if (!FileUtils.exists(wcParams.trainingBaseFolder) || !FileUtils.isDirectory(wcParams.trainingBaseFolder)) {
    System.out.println("Error! Training base folder " + wcParams.trainingBaseFolder + " not found.");
    bContinue = false;
  }
  if (!FileUtils.exists(wcParams.sourceTrainingFolder) || !FileUtils.isDirectory(wcParams.sourceTrainingFolder)) {
    System.out.println("Error! Source training folder " + wcParams.sourceTrainingFolder + " not found.");
    bContinue = false;
  }
  if (!FileUtils.exists(wcParams.targetTrainingFolder) || !FileUtils.isDirectory(wcParams.targetTrainingFolder)) {
    System.out.println("Error! Target training folder " + wcParams.targetTrainingFolder + " not found.");
    bContinue = false;
  }
  wcParams.temporaryCodebookFile = wcParams.codebookFile + ".temp";
  return bContinue;
}

代码示例来源:origin: marytts/marytts

FileUtils.createDirectory(params.outputBaseFolder);
FileUtils.createDirectory(params.outputFolder);

代码示例来源:origin: marytts/marytts

public boolean checkParams() {
  boolean bContinue = true;
  wcParams.trainingBaseFolder = StringUtils.checkLastSlash(wcParams.trainingBaseFolder);
  wcParams.sourceTrainingFolder = StringUtils.checkLastSlash(wcParams.sourceTrainingFolder);
  wcParams.targetTrainingFolder = StringUtils.checkLastSlash(wcParams.targetTrainingFolder);
  FileUtils.createDirectory(wcParams.trainingBaseFolder);
  if (!FileUtils.exists(wcParams.trainingBaseFolder) || !FileUtils.isDirectory(wcParams.trainingBaseFolder)) {
    System.out.println("Error! Training base folder " + wcParams.trainingBaseFolder + " not found.");
    bContinue = false;
  }
  if (!FileUtils.exists(wcParams.sourceTrainingFolder) || !FileUtils.isDirectory(wcParams.sourceTrainingFolder)) {
    System.out.println("Error! Source training folder " + wcParams.sourceTrainingFolder + " not found.");
    bContinue = false;
  }
  if (!FileUtils.exists(wcParams.targetTrainingFolder) || !FileUtils.isDirectory(wcParams.targetTrainingFolder)) {
    System.out.println("Error! Target training folder " + wcParams.targetTrainingFolder + " not found.");
    bContinue = false;
  }
  wcParams.temporaryCodebookFile = wcParams.codebookFile + ".temp";
  return bContinue;
}

代码示例来源:origin: marytts/marytts

FileUtils.createDirectory(params.outputBaseFolder);
FileUtils.createDirectory(params.outputFolder);

代码示例来源:origin: marytts/marytts

FileUtils.createDirectory(params.outputBaseFolder);
FileUtils.createDirectory(params.outputFolder);

代码示例来源:origin: marytts/marytts

public static void copyFolder(String sourceFolder, String targetFolder, boolean bForceDeleteTarget) throws IOException {
  if (exists(sourceFolder)) {
    if (exists(targetFolder) && bForceDeleteTarget)
      delete(targetFolder);
    createDirectory(targetFolder);
    if (exists(targetFolder)) {
      String[] fileList = FileUtils.getFileList(sourceFolder, "*.*");
      if (fileList != null) {
        for (int i = 0; i < fileList.length; i++) {
          String targetFile = StringUtils.checkLastSlash(targetFolder)
              + StringUtils.getFileName(fileList[i], false);
          copy(fileList[i], targetFile);
        }
      }
    } else
      System.out.println("Could not create target folder!");
  } else
    System.out.println("Source folder does not exist!");
}

代码示例来源:origin: marytts/marytts

public static void copyFolder(String sourceFolder, String targetFolder, boolean bForceDeleteTarget) throws IOException {
  if (exists(sourceFolder)) {
    if (exists(targetFolder) && bForceDeleteTarget)
      delete(targetFolder);
    createDirectory(targetFolder);
    if (exists(targetFolder)) {
      String[] fileList = FileUtils.getFileList(sourceFolder, "*.*");
      if (fileList != null) {
        for (int i = 0; i < fileList.length; i++) {
          String targetFile = StringUtils.checkLastSlash(targetFolder)
              + StringUtils.getFileName(fileList[i], false);
          copy(fileList[i], targetFile);
        }
      }
    } else
      System.out.println("Could not create target folder!");
  } else
    System.out.println("Source folder does not exist!");
}

代码示例来源:origin: marytts/marytts

FileUtils.createDirectory(sourceTrainingBaseDir);
FileUtils.createDirectory(targetTrainingBaseDir);

代码示例来源:origin: marytts/marytts

FileUtils.createDirectory(sourceTrainingBaseDir);
FileUtils.createDirectory(targetTrainingBaseDir);

相关文章