slash.common.io.Files.createReadablePath()方法的使用及代码示例

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

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

Files.createReadablePath介绍

暂无

代码示例

代码示例来源:origin: cpesch/RouteConverter

public static String createReadablePath(URL url) {
  File file = toFile(url);
  if (file != null)
    return createReadablePath(file);
  return url.toExternalForm();
}

代码示例来源:origin: cpesch/RouteConverter

textFieldFile.setText(createReadablePath(file));
if (length != null)
  textFieldLength.setText(formatDoubleAsString(length / METERS_OF_A_KILOMETER, 1));

代码示例来源:origin: cpesch/RouteConverter

for (File target : targets) {
  if (target.exists()) {
    String path = createReadablePath(target);
    if (confirmOverwrite(path))
      return;

代码示例来源:origin: cpesch/RouteConverter

String path = createReadablePath(url);
urlModel.setString(path);
recentUrlsModel.addUrl(url);

代码示例来源:origin: cpesch/RouteConverter

private void addFileToCatalog(CategoryTreeNode categoryTreeNode, File file) {
  RouteConverter r = RouteConverter.getInstance();
  String path = createReadablePath(file);
  String description = null;
  Double length = null;
  try {
    NavigationFormatParser parser = new NavigationFormatParser(new NavigationFormatRegistry());
    ParserResult result = parser.read(file);
    if (result.isSuccessful()) {
      BaseRoute<BaseNavigationPosition, BaseNavigationFormat> route = result.getTheRoute();
      if (route != null) {
        description = createRouteDescription(route);
        length = route.getDistance();
      }
      showAddFileToCatalog(categoryTreeNode, description, length, file);
    } else
      r.handleUnsupportedFormat(path);
  } catch (BabelException e) {
    r.handleBabelError(e);
  } catch (OutOfMemoryError e) {
    handleOutOfMemoryError(e);
  } catch (FileNotFoundException e) {
    r.handleFileNotFound(path);
  } catch (Throwable t) {
    log.severe(String.format("Cannot parse description from route %s: %s", path, t));
    r.handleOpenError(t, path);
  }
}

代码示例来源:origin: cpesch/RouteConverter

final String path = createReadablePath(url);
preferences.put(READ_PATH_PREFERENCE, path);

代码示例来源:origin: cpesch/RouteConverter

try {
  for (URL url : urls) {
    String path = createReadablePath(url);

相关文章