nl.gx.webmanager.cms.core
Interface FileResource

All Known Implementing Classes:
FileResourceImpl

public interface FileResource


Method Summary
 java.io.InputStream getData()
          Return the inputstream for the resource
 java.lang.String getFileName()
          Return the filename for the resource
 java.lang.String getId()
          Returns the id (which is the JCR node UUID) of the file.
 java.util.Calendar getLastModified()
          Return the last modified date of the resource
 java.lang.String getMimeType()
          Return the mimetype of the resource
 org.springframework.web.multipart.MultipartFile getMultipartFile()
          This method returns the belonging MultipartFile
 java.lang.String getServerName()
          Return the servername on which the resource is stored.
 long getSize()
          Returns the size in bytes of the resource
 java.lang.String getURL()
          Deprecated. this probably needs to go away.
 java.lang.String getURL(java.lang.String ownerUUID)
          Return the URL that serves the file.
 boolean isPublic()
          Indicates if this file is 'public'.
 boolean mayView(javax.servlet.http.HttpServletRequest request)
          This method is invoked when a not public file is requested.
 void setPublic(boolean isPublic)
          Sets whether this file is 'public'.
 

Method Detail

getData

java.io.InputStream getData()
Return the inputstream for the resource

Returns:
InputStream of the resource

getFileName

java.lang.String getFileName()
Return the filename for the resource

Returns:
File name of the resource

getLastModified

java.util.Calendar getLastModified()
Return the last modified date of the resource

Returns:
Calendar with the last modified date of the resource

getMimeType

java.lang.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

java.lang.String getServerName()
Return the servername on which the resource is stored.

Returns:

getURL

@Deprecated
java.lang.String getURL()
Deprecated. this probably needs to go away.

Return the URL that serves the file

Returns:
URL that serves the file

getURL

java.lang.String getURL(java.lang.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

java.lang.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


Copyright © 2007-2011 GX Software BV. All Rights Reserved.