本文整理了Java中org.openide.filesystems.FileUtil.wrapFileNoCanonicalize()
方法的一些代码示例,展示了FileUtil.wrapFileNoCanonicalize()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FileUtil.wrapFileNoCanonicalize()
方法的具体详情如下:
包路径:org.openide.filesystems.FileUtil
类名称:FileUtil
方法名:wrapFileNoCanonicalize
暂无
代码示例来源:origin: org.netbeans.api/org-openide-filesystems
private static File[] wrapFilesNoCanonicalize(File[] fs) {
if (fs != null) {
for (int i = 0; i < fs.length; i++) {
fs[i] = wrapFileNoCanonicalize(fs[i]);
}
}
return fs;
}
代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide
private static File[] wrapFilesNoCanonicalize(File[] fs) {
if (fs != null) {
for (int i = 0; i < fs.length; i++) {
fs[i] = wrapFileNoCanonicalize(fs[i]);
}
}
return fs;
}
代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide
private static File[] wrapFilesNoCanonicalize(File[] fs) {
if (fs != null) {
for (int i = 0; i < fs.length; i++) {
fs[i] = wrapFileNoCanonicalize(fs[i]);
}
}
return fs;
}
代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide
/**
* Make sure that a JFileChooser does not traverse symlinks on Unix.
* @param chooser a file chooser
* @param currentDirectory if not null, a file to set as the current directory
* using {@link JFileChooser#setCurrentDirectory} without canonicalizing
* @see <a href="http://www.netbeans.org/issues/show_bug.cgi?id=46459">Issue #46459</a>
* @see <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4906607">JRE bug #4906607</a>
* @since org.openide/1 4.42
*/
public static void preventFileChooserSymlinkTraversal(JFileChooser chooser, File currentDirectory) {
if (!(Utilities.isWindows () || (Utilities.getOperatingSystem () == Utilities.OS_OS2))) {
chooser.setCurrentDirectory(wrapFileNoCanonicalize(currentDirectory));
chooser.setFileSystemView(new NonCanonicalizingFileSystemView());
} else {
chooser.setCurrentDirectory(currentDirectory);
}
}
代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide
/**
* Make sure that a JFileChooser does not traverse symlinks on Unix.
* @param chooser a file chooser
* @param currentDirectory if not null, a file to set as the current directory
* using {@link JFileChooser#setCurrentDirectory} without canonicalizing
* @see <a href="http://www.netbeans.org/issues/show_bug.cgi?id=46459">Issue #46459</a>
* @see <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4906607">JRE bug #4906607</a>
* @since org.openide/1 4.42
*/
public static void preventFileChooserSymlinkTraversal(JFileChooser chooser, File currentDirectory) {
if (!(Utilities.isWindows () || (Utilities.getOperatingSystem () == Utilities.OS_OS2))) {
chooser.setCurrentDirectory(wrapFileNoCanonicalize(currentDirectory));
chooser.setFileSystemView(new NonCanonicalizingFileSystemView());
} else {
chooser.setCurrentDirectory(currentDirectory);
}
}
内容来源于网络,如有侵权,请联系作者删除!