Class SimpleWbeFile

    • Field Detail

      • MUTEX

        protected static final Object MUTEX
    • Constructor Detail

      • SimpleWbeFile

        public SimpleWbeFile​(File file)
    • Method Detail

      • silverpeasId

        public String silverpeasId()
        Description copied from class: WbeFile
        Silverpeas's identifier identifies the file from point of view of Silverpeas's platform.

        In most of case, WbeFile.id() will return same identifier as WbeFile.silverpeasId() returns.

        But sometimes, when a temporary view exists for a file and that the temporary view is the content exposed for modifications, WbeFile.silverpeasId() returns the identifier of the document and WbeFile.id() returns the identifier of the view (the one used by Web Browser Edition exchanges).

        Specified by:
        silverpeasId in class WbeFile
        Returns:
        a unique identifier as string.
      • owner

        public User owner()
        Description copied from class: WbeFile
        A string that uniquely identifies the owner of the file. In most cases, the user who uploaded or created the file should be considered the owner.
        Specified by:
        owner in class WbeFile
        Returns:
        the User which is the owner.
      • name

        public String name()
        Description copied from class: WbeFile
        Gets the string name of the file, including extension, without a path. Used for display in user interface (UI), and determining the extension of the file.
        Specified by:
        name in class WbeFile
        Returns:
        a string representing a file name.
      • mimeType

        public String mimeType()
        Description copied from class: WbeFile
        Gets the mime type of the file.
        Specified by:
        mimeType in class WbeFile
        Returns:
        a string representing a mime-type.
      • size

        public long size()
        Description copied from class: WbeFile
        Gets the size of the file in bytes.
        Specified by:
        size in class WbeFile
        Returns:
        a long representing a file content length.
      • updateFrom

        public void updateFrom​(InputStream input)
                        throws IOException
        Description copied from class: WbeFile
        Updates the content of underlying Silverpeas's file from data provided by the given InputStream.
        Specified by:
        updateFrom in class WbeFile
        Parameters:
        input - an InputStream from which the data are written.
        Throws:
        IOException - when it is not possible to write into the physical file.
      • loadInto

        public void loadInto​(OutputStream output)
                      throws IOException
        Description copied from class: WbeFile
        Loads the content of the underlying Silverpeas's file into the given OutputStream.
        Specified by:
        loadInto in class WbeFile
        Parameters:
        output - the stream into which content file MUST be loaded.
        Throws:
        IOException - when it is not possible to read the physical file.
      • canBeAccessedBy

        public boolean canBeAccessedBy​(User user)
        Description copied from interface: Securable
        Checks the given user can access this resource.
        Parameters:
        user - a user in Silverpeas.
        Returns:
        true if the user can access the data managed by this instance, false otherwise.