Interface FileSystem


  • @Role
    @Unstable
    public interface FileSystem
    Represents the file system.
    Since:
    2.0M1
    Version:
    $Id$
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean canDelete​(org.xwiki.model.reference.DocumentReference reference)  
      boolean canEdit​(org.xwiki.model.reference.DocumentReference reference)  
      boolean canView​(org.xwiki.model.reference.DocumentReference reference)  
      void copy​(org.xwiki.model.reference.DocumentReference source, org.xwiki.model.reference.DocumentReference target)
      Copy a file or a folder.
      void delete​(org.xwiki.model.reference.DocumentReference reference)
      Delete a file or a folder.
      boolean exists​(org.xwiki.model.reference.DocumentReference reference)  
      File getFile​(org.xwiki.model.reference.DocumentReference fileReference)  
      Folder getFolder​(org.xwiki.model.reference.DocumentReference folderReference)  
      void rename​(org.xwiki.model.reference.DocumentReference oldReference, org.xwiki.model.reference.DocumentReference newReference)
      Renames the specified file or folder.
      void save​(Document document)
      Save a file or a folder.
    • Method Detail

      • getFolder

        Folder getFolder​(org.xwiki.model.reference.DocumentReference folderReference)
        Parameters:
        folderReference - a folder reference
        Returns:
        the corresponding folder, null if it doesn't exist
      • getFile

        File getFile​(org.xwiki.model.reference.DocumentReference fileReference)
        Parameters:
        fileReference - a file reference
        Returns:
        the corresponding file, null if it doesn't exist
      • exists

        boolean exists​(org.xwiki.model.reference.DocumentReference reference)
        Parameters:
        reference - a reference to a file or folder
        Returns:
        true if the referenced entity exists, false otherwise
      • canView

        boolean canView​(org.xwiki.model.reference.DocumentReference reference)
        Parameters:
        reference - a reference to a file or folder
        Returns:
        true if the referenced entity can be viewed by the current user
      • canEdit

        boolean canEdit​(org.xwiki.model.reference.DocumentReference reference)
        Parameters:
        reference - a reference to a file or folder
        Returns:
        true if the referenced entity can be edited by the current user
      • canDelete

        boolean canDelete​(org.xwiki.model.reference.DocumentReference reference)
        Parameters:
        reference - a reference to a file or folder
        Returns:
        true if the referenced entity can be deleted by the current user
      • save

        void save​(Document document)
        Save a file or a folder.
        Parameters:
        document - a file or a folder
      • delete

        void delete​(org.xwiki.model.reference.DocumentReference reference)
        Delete a file or a folder.
        Parameters:
        reference - a reference to a file or a folder
      • rename

        void rename​(org.xwiki.model.reference.DocumentReference oldReference,
                    org.xwiki.model.reference.DocumentReference newReference)
        Renames the specified file or folder.
        Parameters:
        oldReference - the document to rename
        newReference - the new reference
      • copy

        void copy​(org.xwiki.model.reference.DocumentReference source,
                  org.xwiki.model.reference.DocumentReference target)
        Copy a file or a folder.
        Parameters:
        source - the reference to the file or folder to copy
        target - the reference to the file or folder to create