public class AmetysResourceReader extends AbstractResourceReader implements Serviceable, CacheableProcessingComponent
Resource
Modifier and Type | Field and Description |
---|---|
protected CurrentUserProvider |
_currentUserProvider
The current user provider
|
protected Resource |
_object
The resource
|
protected AmetysObjectResolver |
_resolver
The Ametys object resolver
|
protected RightManager |
_rightManager
The right manager
|
objectModel, out, parameters, resolver, source
Constructor and Description |
---|
AmetysResourceReader() |
Modifier and Type | Method and Description |
---|---|
protected String |
_decodePath(String path)
Decode the resource path
|
protected void |
checkUserAccess()
Check the user access
|
protected void |
doSetup(SourceResolver res,
Map objModel,
String src,
Parameters par)
|
protected String |
getEncodedFilename()
If needed, returns the resource's name, properly encoded for using in a "Content-Disposition" HTTP header.
May be null, in which case the result of AbstractResourceReader.getFilename() is used instead. |
protected String |
getFilename()
Returns the resource's name.
|
protected InputStream |
getInputStream()
Returns the resource's
InputStream . |
Serializable |
getKey() |
long |
getLastModified() |
protected long |
getLength()
Returns the resource's length.
|
String |
getMimeType() |
SourceValidity |
getValidity() |
void |
recycle() |
void |
service(ServiceManager sManager) |
generate, getKeySuffix, processImage, setup
setOutputStream, shouldSetContentLength
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
protected AmetysObjectResolver _resolver
protected RightManager _rightManager
protected CurrentUserProvider _currentUserProvider
public AmetysResourceReader()
public void service(ServiceManager sManager) throws ServiceException
service
in interface Serviceable
ServiceException
protected void doSetup(SourceResolver res, Map objModel, String src, Parameters par) throws ProcessingException, IOException
AbstractResourceReader
AbstractResourceReader.setup(SourceResolver, Map, String, Parameters)
. This method should be implemented by subclasses to retrieve the actual resource.doSetup
in class AbstractResourceReader
res
- the SourceResolver
.objModel
- the Cocoon's object model.src
- the source, as given by the sitemap.par
- the parameters, as given by the sitemap.ProcessingException
- if an error occurs while processing the resource.IOException
- if an error occurs while accessing the resource.protected InputStream getInputStream()
AbstractResourceReader
InputStream
.getInputStream
in class AbstractResourceReader
InputStream
.protected String getFilename()
AbstractResourceReader
getFilename
in class AbstractResourceReader
protected String getEncodedFilename()
AbstractResourceReader
AbstractResourceReader.getFilename()
is used instead.getEncodedFilename
in class AbstractResourceReader
protected long getLength()
AbstractResourceReader
getLength
in class AbstractResourceReader
protected void checkUserAccess() throws AuthorizationRequiredException, AccessDeniedException
AuthorizationRequiredException
- if authorization is requiredAccessDeniedException
- if user has no accessprotected String _decodePath(String path) throws UnsupportedEncodingException
path
- the resource pathUnsupportedEncodingException
- if UTF-8 encoding is not supportedpublic Serializable getKey()
getKey
in interface CacheableProcessingComponent
public SourceValidity getValidity()
getValidity
in interface CacheableProcessingComponent
public long getLastModified()
getLastModified
in interface Reader
getLastModified
in class AbstractReader
public String getMimeType()
getMimeType
in interface SitemapOutputComponent
getMimeType
in class AbstractReader
public void recycle()
recycle
in interface Recyclable
recycle
in class AbstractReader