@Test public void testUnix_illegalCharacters() { try { PathType.unix().parsePath("/foo/bar\0"); fail(); } catch (InvalidPathException expected) { assertEquals(8, expected.getIndex()); } try { PathType.unix().parsePath("/\u00001/foo"); fail(); } catch (InvalidPathException expected) { assertEquals(1, expected.getIndex()); } }
@Override public ParseResult parsePath(String path) { if (path.isEmpty()) { return emptyPath(); } checkValid(path); String root = path.startsWith("/") ? "/" : null; return new ParseResult(root, splitter().split(path)); }
UnixPathType extends PathType { @Override public ParseResult parsePath(String path) { if (path.isEmpty()) { return emptyPath(); } checkValid(path); String root = path.startsWith("/") ? "/" : null; return new ParseResult(root, splitter().split(path)); } }
UnixPathType extends PathType { @Override public ParseResult parsePath(String path) { if (path.isEmpty()) { return emptyPath(); } checkValid(path); String root = path.startsWith("/") ? "/" : null; return new ParseResult(root, splitter().split(path)); } private  UnixPathType(); }
UnixPathType extends PathType { @Override public ParseResult parsePath(String path) { if (path.isEmpty()) { return emptyPath(); } checkValid(path); String root = path.startsWith("/") ? "/" : null; return new ParseResult(root, splitter().split(path)); } private  UnixPathType(); @Override ParseResult parsePath(String path); @Override String toString(@NullableDecl String root, Iterable<String> names); @Override String toUriPath(String root, Iterable<String> names, boolean directory); @Override ParseResult parseUriPath(String uriPath); }
UnixPathType extends PathType { @Override public ParseResult parsePath(String path) { if (path.isEmpty()) { return emptyPath(); } checkValid(path); String root = path.startsWith("/") ? "/" : null; return new ParseResult(root, splitter().split(path)); } private  UnixPathType(); @Override ParseResult parsePath(String path); @Override String toString(@NullableDecl String root, Iterable<String> names); @Override String toUriPath(String root, Iterable<String> names, boolean directory); @Override ParseResult parseUriPath(String uriPath);  }