@Test public void testGetUri() { assertEquals(URIUtils.getUri("http: assertEquals(URIUtils.getUri("http: assertEquals(URIUtils.getUri("http: "http: assertEquals(URIUtils.getUri("/foo/bar", "table", "segment+%25").toString(), "file:/foo/bar/table/segment+%25"); assertEquals(URIUtils.getUri("file:/foo/bar", "table", "segment+%25").toString(), "file:/foo/bar/table/segment+%25"); }
public static URI getUri(String basePath, String... parts) { String path = getPath(basePath, parts); try { URI uri = new URI(path); if (uri.getScheme() != null) { return uri; } else { return new URI(CommonConstants.Segment.LOCAL_SEGMENT_SCHEME + ":" + path); } } catch (URISyntaxException e) { throw new IllegalArgumentException("Illegal URI path: " + path, e); } }
URIUtils { public static URI getUri(String basePath, String... parts) { String path = getPath(basePath, parts); try { URI uri = new URI(path); if (uri.getScheme() != null) { return uri; } else { return new URI(CommonConstants.Segment.LOCAL_SEGMENT_SCHEME + ":" + path); } } catch (URISyntaxException e) { throw new IllegalArgumentException("Illegal URI path: " + path, e); } } }
URIUtils { public static URI getUri(String basePath, String... parts) { String path = getPath(basePath, parts); try { URI uri = new URI(path); if (uri.getScheme() != null) { return uri; } else { return new URI(CommonConstants.Segment.LOCAL_SEGMENT_SCHEME + ":" + path); } } catch (URISyntaxException e) { throw new IllegalArgumentException("Illegal URI path: " + path, e); } } private  URIUtils(); }
URIUtils { public static URI getUri(String basePath, String... parts) { String path = getPath(basePath, parts); try { URI uri = new URI(path); if (uri.getScheme() != null) { return uri; } else { return new URI(CommonConstants.Segment.LOCAL_SEGMENT_SCHEME + ":" + path); } } catch (URISyntaxException e) { throw new IllegalArgumentException("Illegal URI path: " + path, e); } } private  URIUtils(); static URI getUri(String basePath, String... parts); static String getPath(String basePath, String... parts); static String constructDownloadUrl(String baseUrl, String rawTableName, String segmentName); static String encode(String string); static String decode(String string); }
URIUtils { public static URI getUri(String basePath, String... parts) { String path = getPath(basePath, parts); try { URI uri = new URI(path); if (uri.getScheme() != null) { return uri; } else { return new URI(CommonConstants.Segment.LOCAL_SEGMENT_SCHEME + ":" + path); } } catch (URISyntaxException e) { throw new IllegalArgumentException("Illegal URI path: " + path, e); } } private  URIUtils(); static URI getUri(String basePath, String... parts); static String getPath(String basePath, String... parts); static String constructDownloadUrl(String baseUrl, String rawTableName, String segmentName); static String encode(String string); static String decode(String string);  }