public class UploadReader extends AbstractResourceReader implements Serviceable
Reader
for generating binary output of previously uploaded file.Modifier and Type | Field and Description |
---|---|
private CurrentUserProvider |
_currentUserProvider |
private Upload |
_upload |
private UploadManager |
_uploadManager |
objectModel, out, parameters, resolver, source
Constructor and Description |
---|
UploadReader() |
Modifier and Type | Method and Description |
---|---|
protected void |
doSetup(SourceResolver res,
Map objModel,
String src,
Parameters par)
|
void |
generate() |
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 . |
long |
getLastModified() |
protected long |
getLength()
Returns the resource's length.
|
String |
getMimeType() |
void |
recycle() |
void |
service(ServiceManager serviceManager) |
getKeySuffix, processImage, setup
setOutputStream, shouldSetContentLength
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
private CurrentUserProvider _currentUserProvider
private UploadManager _uploadManager
public UploadReader()
public void service(ServiceManager serviceManager) throws ServiceException
service
in interface Serviceable
ServiceException
protected void doSetup(SourceResolver res, Map objModel, String src, Parameters par)
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.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
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
generate
in class AbstractResourceReader
IOException
SAXException
ProcessingException
public void recycle()
recycle
in interface Recyclable
recycle
in class AbstractReader