PathValidator class

Default implementation of IPathValidator.

Validates paths and names to ensure they are safe for file system storage.

Rules

Collection names and Item IDs:

  • Cannot be empty
  • Cannot contain: / \ : * ? " < > |
  • Cannot start or end with spaces
  • Cannot be "." or ".."
  • Maximum length: 255 characters

Paths:

  • Cannot be empty
  • Cannot contain: \ : * ? " < > |
  • Cannot contain ".."
  • Cannot start or end with spaces
Implemented types

Constructors

PathValidator()

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

isValidCollectionName(String collection) → bool
Checks if a collection name is valid without throwing.
override
isValidItemId(String id) → bool
Checks if an item ID is valid without throwing.
override
isValidPath(String path) → bool
Checks if a path is valid without throwing.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited
validateCollectionName(String collection) → void
Validates a collection name.
override
validateItemId(String id) → void
Validates an item ID.
override
validatePath(String path) → void
Validates a document path.
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited