Class Path

java.lang.Object
org.xwiki.filemanager.Path

@Unstable public class Path extends Object
Represents a path in the file system. A path is uniquely determined either by a folder or by a (folder, file) pair. A file cannot specify the path alone because files can have multiple parent folders (so a file can have multiple paths).
Since:
2.0M1
Version:
$Id$
  • Constructor Summary

    Constructors
    Constructor
    Description
    Path(org.xwiki.model.reference.DocumentReference folderReference)
    Creates a new path that is determined by the specified folder.
    Path(org.xwiki.model.reference.DocumentReference folderReference, org.xwiki.model.reference.DocumentReference fileReference)
    Creates a new path that is determined by the given (folder, file) pair.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    org.xwiki.model.reference.DocumentReference
     
    org.xwiki.model.reference.DocumentReference
     
    int
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Path

      public Path(org.xwiki.model.reference.DocumentReference folderReference)
      Creates a new path that is determined by the specified folder. Folders have one single path.
      Parameters:
      folderReference - a reference to a document that represents a folder
    • Path

      public Path(org.xwiki.model.reference.DocumentReference folderReference, org.xwiki.model.reference.DocumentReference fileReference)
      Creates a new path that is determined by the given (folder, file) pair. Files can have multiple paths (because they can have multiple parent folders) so you need to choose a parent in order to determine the path.
      Parameters:
      folderReference - a reference to a document that represents a folder
      fileReference - a reference to a document that represents a file
  • Method Details

    • getFolderReference

      public org.xwiki.model.reference.DocumentReference getFolderReference()
      Returns:
      the folder reference
    • getFileReference

      public org.xwiki.model.reference.DocumentReference getFileReference()
      Returns:
      the file reference, or null if this path was specified only by its folder
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object