- java.lang.Object
-
- com.aoindustries.aoserv.client.linux.PosixPath
-
- All Implemented Interfaces:
DtoFactory<PosixPath>,Internable<PosixPath>,Serializable,Comparable<PosixPath>
public final class PosixPath extends Object implements Comparable<PosixPath>, Serializable, DtoFactory<PosixPath>, Internable<PosixPath>
Represents a full path in POSIX style. Paths must:- Be non-null
- Be non-empty
- Start with a
/ - Not contain any null characters
- Not contain any /../ or /./ path elements
- Not end with / unless "/"
- Not end with /.. or /.
- Not contain any // in the path
TODO: This matches
Pathwith the exception of disallowing trailing slash except for "/". Remove this redundancy? SubclassPath?- Author:
- AO Industries, Inc.
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(PosixPath other)booleanequals(Object O)PosixPathgetDto()inthashCode()PosixPathintern()Interns this path much in the same fashion asString.intern().StringtoString()static ValidationResultvalidate(String path)static PosixPathvalueOf(String path)
-
-
-
Method Detail
-
validate
public static ValidationResult validate(String path)
-
valueOf
public static PosixPath valueOf(String path) throws ValidationException
- Parameters:
path- whennull, returnsnull- Throws:
ValidationException
-
compareTo
public int compareTo(PosixPath other)
- Specified by:
compareToin interfaceComparable<PosixPath>
-
intern
public PosixPath intern()
Interns this path much in the same fashion asString.intern().- Specified by:
internin interfaceInternable<PosixPath>- See Also:
String.intern()
-
getDto
public PosixPath getDto()
- Specified by:
getDtoin interfaceDtoFactory<PosixPath>
-
-