public class AmetysResourceReader extends ServiceableReader implements CacheableProcessingComponent
Resource
Modifier and Type | Field and Description |
---|---|
private Collection<String> |
_allowedFormats |
protected CurrentUserProvider |
_currentUserProvider
The current user provider
|
private int |
_height |
private int |
_maxHeight |
private int |
_maxWidth |
protected Resource |
_object
The resource
|
private boolean |
_readForDownload |
protected AmetysObjectResolver |
_resolver
The Ametys object resolver
|
protected RightManager |
_rightManager
The right manager
|
private int |
_width |
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 boolean |
_isImage()
Determines if the file is an image
|
protected void |
checkUserAccess()
Check the user access
|
void |
generate() |
Serializable |
getKey() |
long |
getLastModified() |
String |
getMimeType() |
SourceValidity |
getValidity() |
void |
recycle() |
void |
service(ServiceManager sManager) |
void |
setup(SourceResolver sResolver,
Map objModel,
String src,
Parameters par) |
setOutputStream, shouldSetContentLength
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
protected AmetysObjectResolver _resolver
protected RightManager _rightManager
protected CurrentUserProvider _currentUserProvider
private boolean _readForDownload
private Collection<String> _allowedFormats
private int _width
private int _height
private int _maxWidth
private int _maxHeight
public AmetysResourceReader()
public void service(ServiceManager sManager) throws ServiceException
service
in interface Serviceable
service
in class ServiceableReader
ServiceException
public void setup(SourceResolver sResolver, Map objModel, String src, Parameters par) throws ProcessingException, SAXException, IOException
setup
in interface SitemapModelComponent
setup
in class AbstractReader
ProcessingException
SAXException
IOException
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 generate() throws IOException, SAXException, ProcessingException
generate
in interface Reader
IOException
SAXException
ProcessingException
protected boolean _isImage()
true
if file is a imagepublic void recycle()
recycle
in interface Recyclable
recycle
in class AbstractReader