/** * Construct a new PathResource from a Path object. * * @param path the path to use */ public PathResource(Path path) { this.path = path.toAbsolutePath(); assertValidPath(path); this.uri = this.path.toUri(); this.alias = checkAliasPath(); }
/** * Construct a new PathResource from a parent PathResource * and child sub path * * @param parent the parent path resource * @param childPath the child sub path */ private PathResource(PathResource parent, String childPath) { // Calculate the URI and the path separately, so that any aliasing done by // FileSystem.getPath(path,childPath) is visible as a difference to the URI // obtained via URIUtil.addDecodedPath(uri,childPath) this.path = parent.path.getFileSystem().getPath(parent.path.toString(), childPath); if (isDirectory() && !childPath.endsWith("/")) childPath += "/"; this.uri = URIUtil.addPath(parent.uri, childPath); this.alias = checkAliasPath(); }
this.alias = checkAliasPath();
/** * Construct a new PathResource from a Path object. * * @param path the path to use */ public PathResource(Path path) { this.path = path.toAbsolutePath(); assertValidPath(path); this.uri = this.path.toUri(); this.alias = checkAliasPath(); }
/** * Construct a new PathResource from a parent PathResource * and child sub path * * @param parent the parent path resource * @param childPath the child sub path */ private PathResource(PathResource parent, String childPath) { // Calculate the URI and the path separately, so that any aliasing done by // FileSystem.getPath(path,childPath) is visible as a difference to the URI // obtained via URIUtil.addDecodedPath(uri,childPath) this.path = parent.path.getFileSystem().getPath(parent.path.toString(), childPath); if (isDirectory() && !childPath.endsWith("/")) childPath += "/"; this.uri = URIUtil.addPath(parent.uri, childPath); this.alias = checkAliasPath(); }
this.alias = checkAliasPath();