@Test public void testToUri() { URI fileUri = type.toUri(fileSystemUri, "$", ImmutableList.of("foo", "bar"), false); assertThat(fileUri.toString()).isEqualTo("jimfs: assertThat(fileUri.getPath()).isEqualTo("/$/foo/bar"); URI directoryUri = type.toUri(fileSystemUri, "$", ImmutableList.of("foo", "bar"), true); assertThat(directoryUri.toString()).isEqualTo("jimfs: assertThat(directoryUri.getPath()).isEqualTo("/$/foo/bar/"); URI rootUri = type.toUri(fileSystemUri, "$", ImmutableList.<String>of(), true); assertThat(rootUri.toString()).isEqualTo("jimfs: assertThat(rootUri.getPath()).isEqualTo("/$/"); }
public final URI toUri( URI fileSystemUri, String root, Iterable<String> names, boolean directory) { String path = toUriPath(root, names, directory); try { return new URI( fileSystemUri.getScheme(), fileSystemUri.getUserInfo(), fileSystemUri.getHost(), fileSystemUri.getPort(), path, null, null); } catch (URISyntaxException e) { throw new AssertionError(e); } }
PathType { public final URI toUri( URI fileSystemUri, String root, Iterable<String> names, boolean directory) { String path = toUriPath(root, names, directory); try { return new URI( fileSystemUri.getScheme(), fileSystemUri.getUserInfo(), fileSystemUri.getHost(), fileSystemUri.getPort(), path, null, null); } catch (URISyntaxException e) { throw new AssertionError(e); } } }
PathType { public final URI toUri( URI fileSystemUri, String root, Iterable<String> names, boolean directory) { String path = toUriPath(root, names, directory); try { return new URI( fileSystemUri.getScheme(), fileSystemUri.getUserInfo(), fileSystemUri.getHost(), fileSystemUri.getPort(), path, null, null); } catch (URISyntaxException e) { throw new AssertionError(e); } } protected  PathType(boolean allowsMultipleRoots, char separator, char... otherSeparators); }
PathType { public final URI toUri( URI fileSystemUri, String root, Iterable<String> names, boolean directory) { String path = toUriPath(root, names, directory); try { return new URI( fileSystemUri.getScheme(), fileSystemUri.getUserInfo(), fileSystemUri.getHost(), fileSystemUri.getPort(), path, null, null); } catch (URISyntaxException e) { throw new AssertionError(e); } } protected  PathType(boolean allowsMultipleRoots, char separator, char... otherSeparators); static PathType unix(); static PathType windows(); final boolean allowsMultipleRoots(); final String getSeparator(); final String getOtherSeparators(); final Joiner joiner(); final Splitter splitter(); abstract ParseResult parsePath(String path); @Override String toString(); abstract String toString(@NullableDecl String root, Iterable<String> names); final URI toUri(
      URI fileSystemUri, String root, Iterable<String> names, boolean directory); final ParseResult fromUri(URI uri); }
PathType { public final URI toUri( URI fileSystemUri, String root, Iterable<String> names, boolean directory) { String path = toUriPath(root, names, directory); try { return new URI( fileSystemUri.getScheme(), fileSystemUri.getUserInfo(), fileSystemUri.getHost(), fileSystemUri.getPort(), path, null, null); } catch (URISyntaxException e) { throw new AssertionError(e); } } protected  PathType(boolean allowsMultipleRoots, char separator, char... otherSeparators); static PathType unix(); static PathType windows(); final boolean allowsMultipleRoots(); final String getSeparator(); final String getOtherSeparators(); final Joiner joiner(); final Splitter splitter(); abstract ParseResult parsePath(String path); @Override String toString(); abstract String toString(@NullableDecl String root, Iterable<String> names); final URI toUri(
      URI fileSystemUri, String root, Iterable<String> names, boolean directory); final ParseResult fromUri(URI uri);  }