本文整理了Java中org.openide.filesystems.FileUtil.checkFreeName()
方法的一些代码示例,展示了FileUtil.checkFreeName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FileUtil.checkFreeName()
方法的具体详情如下:
包路径:org.openide.filesystems.FileUtil
类名称: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;
内容来源于网络,如有侵权,请联系作者删除!