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

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

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

FileUtil.canBeCanonicalizedOnWindows介绍

暂无

代码示例

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

static URL fileToURL(File file) throws MalformedURLException {        
  URL retVal = null;
  if (canBeCanonicalizedOnWindows(file)) {
    retVal = file.toURI().toURL();            
  } else {
    retVal = new URL ("file:/"+file.getAbsolutePath ());//NOI18N
    
  }        
  return retVal;
}

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

static URL fileToURL(File file) throws MalformedURLException {        
  URL retVal = null;
  if (canBeCanonicalizedOnWindows(file)) {
    retVal = file.toURI().toURL();            
  } else {
    retVal = new URL ("file:/"+file.getAbsolutePath ());//NOI18N
    
  }        
  return retVal;
}

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

private static File normalizeFileOnWindows(final File file) {
  File retVal = null;
  
  if (canBeCanonicalizedOnWindows(file)) {
    try {
      retVal = file.getCanonicalFile();                   
    } catch (IOException e) {
      ErrorManager.getDefault().log(ErrorManager.ERROR, "getCanonicalFile() on file " + file + " failed. " + e.toString()); // NOI18N
    }
  }
  
  return (retVal != null) ? retVal : file.getAbsoluteFile();
}

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

private static File normalizeFileOnWindows(final File file) {
  File retVal = null;
  
  if (canBeCanonicalizedOnWindows(file)) {
    try {
      retVal = file.getCanonicalFile();                   
    } catch (IOException e) {
      ErrorManager.getDefault().log(ErrorManager.ERROR, "getCanonicalFile() on file " + file + " failed. " + e.toString()); // NOI18N
    }
  }
  
  return (retVal != null) ? retVal : file.getAbsoluteFile();
}

相关文章