Interface FileResource

  • All Known Implementing Classes:
    FileResourceImpl

    public interface FileResource
    • Method Detail

      • getData

        InputStream getData()
        Return the inputstream for the resource
        Returns:
        InputStream of the resource
      • getFileName

        String getFileName()
        Return the filename for the resource
        Returns:
        File name of the resource
      • getLastModified

        Calendar getLastModified()
        Return the last modified date of the resource
        Returns:
        Calendar with the last modified date of the resource
      • getMimeType

        String getMimeType()
        Return the mimetype of the resource
        Returns:
        Mimetype of the resource
      • getSize

        long getSize()
        Returns the size in bytes of the resource
        Returns:
        Size in bytes of the resource
      • getServerName

        String getServerName()
        Return the servername on which the resource is stored.
        Returns:
      • getURL

        @Deprecated
        String getURL()
        Deprecated.
        this probably needs to go away.
        Return the URL that serves the file
        Returns:
        URL that serves the file
      • getURL

        String getURL​(String ownerUUID)
        Return the URL that serves the file. The URL points at the file resource controller, and the owner object is used as the starting point for determining if the file request is permitted.
        Parameters:
        ownerUUID - The UUID of an object which implements the FileResourceSecurityCheckPoint interface.
        Returns:
        URL that serves the file
      • isPublic

        boolean isPublic()
        Indicates if this file is 'public'. If it is indicated public it is copied to and served by the webserver. If public is false the file is only available on the application server (in the JCR). In the latter case an authorisation callback is invoked to determined if the file may be served to the user requesting it.
        Returns:
        true if the file is public, false otherwise
      • setPublic

        void setPublic​(boolean isPublic)
        Sets whether this file is 'public'. This method should not be used to change the public state of a FileResource.
        Parameters:
        public - indicates whether this FileResource should be public.
      • getId

        String getId()
        Returns the id (which is the JCR node UUID) of the file.
        Returns:
        The id of the file
      • mayView

        boolean mayView​(javax.servlet.http.HttpServletRequest request)
        This method is invoked when a not public file is requested.
        Returns:
        true is the user requesting the file is authorized for doing so, false otherwise
      • getMultipartFile

        org.springframework.web.multipart.MultipartFile getMultipartFile()
        This method returns the belonging MultipartFile
        Returns:
        The encapsulated MultipartFile if present, else null