/** * Construct a Path from a scheme, an authority and a path string. * * @param scheme * the scheme string * @param authority * the authority string * @param path * the path string */ public Path(String scheme, String authority, String path) { path = checkAndTrimPathArg(path); initialize(scheme, authority, path); }
/** * Resolve a child path against a parent path. * * @param parent * the parent path * @param child * the child path */ public Path(Path parent, Path child) { // Add a slash to parent's path so resolution is compatible with URI's URI parentUri = parent.uri; final String parentPath = parentUri.getPath(); if (!(parentPath.equals("/") || parentPath.equals(""))) { try { parentUri = new URI(parentUri.getScheme(), parentUri.getAuthority(), parentUri.getPath() + "/", null, null); } catch (URISyntaxException e) { throw new IllegalArgumentException(e); } } if (child.uri.getPath().startsWith(Path.SEPARATOR)) { child = new Path(child.uri.getScheme(), child.uri.getAuthority(), child.uri.getPath().substring(1)); } final URI resolved = parentUri.resolve(child.uri); initialize(resolved.getScheme(), resolved.getAuthority(), normalizePath(resolved.getPath())); }
initialize(scheme, authority, path);
/** * Construct a Path from a scheme, an authority and a path string. * * @param scheme * the scheme string * @param authority * the authority string * @param path * the path string */ public Path(String scheme, String authority, String path) { path = checkAndTrimPathArg(path); initialize(scheme, authority, path); }
/** * Construct a Path from a scheme, an authority and a path string. * * @param scheme * the scheme string * @param authority * the authority string * @param path * the path string */ public Path(String scheme, String authority, String path) { path = checkAndTrimPathArg(path); initialize(scheme, authority, path); }
/** * Resolve a child path against a parent path. * * @param parent * the parent path * @param child * the child path */ public Path(Path parent, Path child) { // Add a slash to parent's path so resolution is compatible with URI's URI parentUri = parent.uri; final String parentPath = parentUri.getPath(); if (!(parentPath.equals("/") || parentPath.equals(""))) { try { parentUri = new URI(parentUri.getScheme(), parentUri.getAuthority(), parentUri.getPath() + "/", null, null); } catch (URISyntaxException e) { throw new IllegalArgumentException(e); } } if (child.uri.getPath().startsWith(Path.SEPARATOR)) { child = new Path(child.uri.getScheme(), child.uri.getAuthority(), child.uri.getPath().substring(1)); } final URI resolved = parentUri.resolve(child.uri); initialize(resolved.getScheme(), resolved.getAuthority(), normalizePath(resolved.getPath())); }
/** * Resolve a child path against a parent path. * * @param parent * the parent path * @param child * the child path */ public Path(Path parent, Path child) { // Add a slash to parent's path so resolution is compatible with URI's URI parentUri = parent.uri; final String parentPath = parentUri.getPath(); if (!(parentPath.equals("/") || parentPath.equals(""))) { try { parentUri = new URI(parentUri.getScheme(), parentUri.getAuthority(), parentUri.getPath() + "/", null, null); } catch (URISyntaxException e) { throw new IllegalArgumentException(e); } } if (child.uri.getPath().startsWith(Path.SEPARATOR)) { child = new Path(child.uri.getScheme(), child.uri.getAuthority(), child.uri.getPath().substring(1)); } final URI resolved = parentUri.resolve(child.uri); initialize(resolved.getScheme(), resolved.getAuthority(), normalizePath(resolved.getPath())); }
initialize(scheme, authority, path);
initialize(scheme, authority, path);