com.wewebu.ow.server.servlets
Class OwMultifileDownload.OwBufferedSingleContentEntry

java.lang.Object
  extended by com.wewebu.ow.server.servlets.OwMultifileDownload.OwBufferedSingleContentEntry
All Implemented Interfaces:
OwMultifileDownload.OwContentArchiveEntry
Direct Known Subclasses:
OwMultifileDownload.OwContentElementEntry
Enclosing class:
OwMultifileDownload

protected abstract class OwMultifileDownload.OwBufferedSingleContentEntry
extends Object
implements OwMultifileDownload.OwContentArchiveEntry

An archive entry containing a single content file.


Constructor Summary
protected OwMultifileDownload.OwBufferedSingleContentEntry()
           
 
Method Summary
protected abstract  String createMimeType()
          (overridable) MIME type creating hook method.
protected abstract  void downloadFile(javax.servlet.ServletOutputStream responseOutputStream_p)
          (overridable) method
 int fileCount()
           
 void serveSingleFileOn(javax.servlet.http.HttpServletRequest request_p, javax.servlet.http.HttpServletResponse response_p, String fileName_p)
          Serializes the content on the HttpServletResponse parameter using the content type acquired through createMimeType().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.wewebu.ow.server.servlets.OwMultifileDownload.OwContentArchiveEntry
zipIt
 

Constructor Detail

OwMultifileDownload.OwBufferedSingleContentEntry

protected OwMultifileDownload.OwBufferedSingleContentEntry()
Method Detail

fileCount

public final int fileCount()
Specified by:
fileCount in interface OwMultifileDownload.OwContentArchiveEntry
Returns:
the number of files contained by this entry and all its sub entries

downloadFile

protected abstract void downloadFile(javax.servlet.ServletOutputStream responseOutputStream_p)
                              throws Exception
(overridable) method

Throws:
Exception
Since:
3.1.0.0

createMimeType

protected abstract String createMimeType()
                                  throws Exception
(overridable) MIME type creating hook method.

Returns:
a MIME type String
Throws:
Exception

serveSingleFileOn

public final void serveSingleFileOn(javax.servlet.http.HttpServletRequest request_p,
                                    javax.servlet.http.HttpServletResponse response_p,
                                    String fileName_p)
                             throws OwInvalidOperationException
Serializes the content on the HttpServletResponse parameter using the content type acquired through createMimeType().

Specified by:
serveSingleFileOn in interface OwMultifileDownload.OwContentArchiveEntry
Parameters:
request_p - HttpServletRequest
response_p - the HTTP response to serialize the content on
fileName_p - the name under which the content should be serialized
Throws:
OwInvalidOperationException - if the response serialization is not possible (for example because this entry contains multiple files)


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.