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

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

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

FileUtils.getFileNameList介绍

暂无

代码示例

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

public static String[] getFileNameList(String directory, String extension) {
  return getFileNameList(directory, extension, true);
}

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

public static String[] getFileNameList(String directory, String extension) {
  return getFileNameList(directory, extension, true);
}

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

public static void changeFileExtensions(String folder, String oldExt, String newExt) {
  String[] files = getFileNameList(folder, oldExt);
  folder = StringUtils.checkLastSlash(folder);
  newExt = StringUtils.checkFirstDot(newExt);
  if (files != null) {
    for (int i = 0; i < files.length; i++) {
      int ind = files[i].lastIndexOf(oldExt);
      String newFile = folder + files[i].substring(0, ind) + newExt;
      FileUtils.rename(files[i], newFile);
      System.out.println("Changed extension " + String.valueOf(i + 1) + " of " + String.valueOf(files.length));
    }
  }
}

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

public static void changeFileExtensions(String folder, String oldExt, String newExt) {
  String[] files = getFileNameList(folder, oldExt);
  folder = StringUtils.checkLastSlash(folder);
  newExt = StringUtils.checkFirstDot(newExt);
  if (files != null) {
    for (int i = 0; i < files.length; i++) {
      int ind = files[i].lastIndexOf(oldExt);
      String newFile = folder + files[i].substring(0, ind) + newExt;
      FileUtils.rename(files[i], newFile);
      System.out.println("Changed extension " + String.valueOf(i + 1) + " of " + String.valueOf(files.length));
    }
  }
}

相关文章