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

x33g5p2x  于2022-01-30 转载在 其他  
字(2.2k)|赞(0)|评价(0)|浏览(79)

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

Transfer.encodeUri介绍

暂无

代码示例

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

public static String encodeUriButKeepSlashes(String uri) {
  return encodeUri(uri).replace("%2F", "/"); // better not .replace("%3A", ":");
}

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

private TileCache createTileCache(String cacheId) {
  TileCache firstLevelTileCache = new InMemoryTileCache(preferences.getInt(FIRST_LEVEL_TILE_CACHE_SIZE_PREFERENCE, 256));
  File cacheDirectory = new File(getTemporaryDirectory(), encodeUri(cacheId));
  TileCache secondLevelTileCache = new FileSystemTileCache(preferences.getInt(SECOND_LEVEL_TILE_CACHE_SIZE_PREFERENCE, 2048), cacheDirectory, GRAPHIC_FACTORY);
  return new TwoLevelTileCache(firstLevelTileCache, secondLevelTileCache);
}

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

public List<NavigationPosition> getPositionsFor(String address) throws IOException {
  FeatureCollection collection = getResultFor("/api/?q=" + encodeUri(address) + "&limit=10");
  if (collection == null)
    return null;
  return extractPositions(collection.getFeatures());
}

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

public List<NavigationPosition> getPositionsFor(String address) throws IOException {
  SearchresultsType result = getSearchFor("search/?q=" + encodeUri(address) + "&limit=10&format=xml");
  if (result == null)
    return null;
  return extractPositions(result.getPlace());
}

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

public List<NavigationPosition> getPositionsFor(String address) throws IOException {
  String url = getGeocodingUrl("address=" + encodeUri(address));
  Get get = get(url);
  log.info("Getting positions for " + address);
  String result = get.executeAsString();
  if (get.isSuccessful())
    try {
      GeocodeResponse geocodeResponse = unmarshalGeocode(result);
      if (geocodeResponse != null) {
        String status = geocodeResponse.getStatus();
        checkForError(url, status);
        return extractAdresses(geocodeResponse.getResult());
      }
    } catch (JAXBException e) {
      throw new IOException("Cannot unmarshall " + result + ": " + e, e);
    }
  return null;
}

相关文章