org.openide.filesystems.FileUtil.checkFreeName()方法的使用及代码示例

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

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

FileUtil.checkFreeName介绍

[英]Test if given name is free in given folder.
[中]测试给定名称在给定文件夹中是否可用。

代码示例

代码示例来源:origin: org.netbeans.api/org-openide-filesystems

/** Finds an unused folder name similar to that requested in the same parent folder.
 * <p>See caveat for <code>findFreeFileName</code>.
 * @see #findFreeFileName findFreeFileName
* @param folder parent folder
* @param name preferred folder name
* @return a free folder name
*/
public static String findFreeFolderName(FileObject folder, String name) {
  if (checkFreeName(folder, name, null)) {
    return name;
  }
  for (int i = 1;; i++) {
    String destName = name + "_" + i; // NOI18N
    if (checkFreeName(folder, destName, null)) {
      return destName;
    }
  }
}

代码示例来源:origin: org.netbeans.api/org-openide-filesystems

if (checkFreeName(folder, name, ext)) {
  return name;
  String destName = name + "_" + i; // NOI18N
  if (checkFreeName(folder, destName, ext)) {
    return destName;

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

/** Finds an unused folder name similar to that requested in the same parent folder.
 * <p>See caveat for <code>findFreeFileName</code>.
 * @see #findFreeFileName findFreeFileName
* @param folder parent folder
* @param name preferred folder name
* @return a free folder name
*/
public static String findFreeFolderName (
  FileObject folder, String name
) {
  if (checkFreeName (folder, name, null)) {
    return name;
  }
  for (int i = 1;;i++) {
    String destName = name + "_"+i; // NOI18N
    if (checkFreeName (folder, destName, null)) {
      return destName;
    }
  }
}

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

/** Finds an unused folder name similar to that requested in the same parent folder.
 * <p>See caveat for <code>findFreeFileName</code>.
 * @see #findFreeFileName findFreeFileName
* @param folder parent folder
* @param name preferred folder name
* @return a free folder name
*/
public static String findFreeFolderName (
  FileObject folder, String name
) {
  if (checkFreeName (folder, name, null)) {
    return name;
  }
  for (int i = 1;;i++) {
    String destName = name + "_"+i; // NOI18N
    if (checkFreeName (folder, destName, null)) {
      return destName;
    }
  }
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

FileObject folder, String name, String ext
) {
  if (checkFreeName (folder, name, ext)) {
    return name;
    if (checkFreeName (folder, destName, ext)) {
      return destName;

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

FileObject folder, String name, String ext
) {
  if (checkFreeName (folder, name, ext)) {
    return name;
    if (checkFreeName (folder, destName, ext)) {
      return destName;

相关文章