/** * @param parent Parent path reference * @param name Filename * @param attributes Attributes */ public Path(final Path parent, final String name, final EnumSet<Type> type, final PathAttributes attributes) { this.type = type; this.attributes = attributes; this._setPath(parent, name); }
private void setPath(final String absolute) { if(String.valueOf(Path.DELIMITER).equals(absolute)) { this._setPath(null, absolute); } else { final Path parent = new Path(PathNormalizer.parent(absolute, Path.DELIMITER), EnumSet.of(Type.directory)); parent.attributes().setRegion(attributes.getRegion()); if(parent.isRoot()) { parent.setType(EnumSet.of(Type.volume, Type.directory)); } this._setPath(parent, PathNormalizer.name(absolute)); } }
/** * @param parent the absolute directory * @param name the file relative to param path * @param type File type */ public Path(final Path parent, final String name, final EnumSet<Type> type) { this.type = type; this.attributes = new PathAttributes(); this.attributes.setRegion(parent.attributes.getRegion()); this._setPath(parent, name); }