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

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

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

FileUtil.normalizeFileOnMac介绍

暂无

代码示例

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

private static File normalizeFileImpl(File file) {
  // XXX should use NIO in JDK 7; see #6358641
  Parameters.notNull("file", file);  //NOI18N
  File retFile;
  LOG.log(Level.FINE, "FileUtil.normalizeFile for {0}", file); // NOI18N
  long now = System.currentTimeMillis();
  if ((Utilities.isWindows() || (Utilities.getOperatingSystem() == Utilities.OS_OS2))) {
    retFile = normalizeFileOnWindows(file);
  } else if (Utilities.isMac()) {
    retFile = normalizeFileOnMac(file);
  } else {
    retFile = normalizeFileOnUnixAlike(file);
  }
  File ret = (file.getPath().equals(retFile.getPath())) ? file : retFile;
  long took = System.currentTimeMillis() - now;
  if (took > 500) {
    LOG.log(Level.WARNING, "FileUtil.normalizeFile({0}) took {1} ms. Result is {2}", new Object[]{file, took, ret});
  }
  return ret;
}

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

/**
 * Normalize a file path to a clean form.
 * This method may for example make sure that the returned file uses
 * the correct case on Windows; that old Windows 8.3 filenames are changed to the long form;
 * that relative paths are changed to be
 * absolute; etc.
 * Unlike {@link File#getCanonicalFile} this method will not traverse symbolic links on Unix.
 * @param file file to normalize
 * @return normalized file
 * @since 4.48
 */
public static File normalizeFile(File file) {
  if ((Utilities.isWindows () || (Utilities.getOperatingSystem () == Utilities.OS_OS2))) {
    file = normalizeFileOnWindows(file);
  } else if (Utilities.getOperatingSystem() == Utilities.OS_MAC) {
    file = normalizeFileOnMac(file);
  } else {
    file = normalizeFileOnUnixAlike(file);
  }
  return file;
}

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

/**
 * Normalize a file path to a clean form.
 * This method may for example make sure that the returned file uses
 * the correct case on Windows; that old Windows 8.3 filenames are changed to the long form;
 * that relative paths are changed to be
 * absolute; etc.
 * Unlike {@link File#getCanonicalFile} this method will not traverse symbolic links on Unix.
 * @param file file to normalize
 * @return normalized file
 * @since 4.48
 */
public static File normalizeFile(File file) {
  if ((Utilities.isWindows () || (Utilities.getOperatingSystem () == Utilities.OS_OS2))) {
    file = normalizeFileOnWindows(file);
  } else if (Utilities.getOperatingSystem() == Utilities.OS_MAC) {
    file = normalizeFileOnMac(file);
  } else {
    file = normalizeFileOnUnixAlike(file);
  }
  return file;
}

相关文章