Class Path

All Implemented Interfaces:
DtoFactory<Path>, Internable<Path>, Serializable, Comparable<Path>

public final class Path extends Object implements Comparable<Path>, Serializable, DtoFactory<Path>, Internable<Path>
Represents a full path. 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 /.. or /.
  • Not contain any // in the path

Note, this concept of path is minimally restrictive and only represents a well-formed path. The path may not be valid for some contexts, such as the path part of a URL. This does not implement RFC 3986.

TODO: Should we disallow any number path element that is all dots, such as "...." and not just "." and ".."?

TODO: This matches UnixPath in aoserv-client with the exception of allowing trailing slash. Remove this redundancy?

AO Industries, Inc.
See Also: