@Response public class ZipFileList extends LinkedList<ZipFileList.ZipFileEntry> implements Streamable
Generally associated with RestServlets
using the responseHandlers
annotation so that
REST methods can easily create ZIP file responses by simply returning instances of this class.
Modifier and Type | Class and Description |
---|---|
static class |
ZipFileList.FileEntry
ZipFileList entry for File entry types.
|
static interface |
ZipFileList.ZipFileEntry
Interface for ZipFileList entries.
|
Modifier and Type | Field and Description |
---|---|
String |
fileName
The name of the zip file.
|
modCount
Constructor and Description |
---|
ZipFileList(String fileName)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
ZipFileList |
append(ZipFileList.ZipFileEntry e)
Add an entry to this list.
|
String |
getContentDisposition()
Returns the value for the
Content-Disposition header. |
MediaType |
getMediaType()
Returns the serialized media type for this resource (e.g.
|
void |
streamTo(OutputStream os)
Serialize this object to the specified output stream.
|
add, add, addAll, addAll, addFirst, addLast, clear, clone, contains, descendingIterator, element, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, remove, remove, remove, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, set, size, spliterator, toArray, toArray
iterator
equals, hashCode, listIterator, removeRange, subList
containsAll, isEmpty, removeAll, retainAll, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
containsAll, equals, hashCode, isEmpty, iterator, listIterator, removeAll, replaceAll, retainAll, sort, subList
parallelStream, removeIf, stream
public ZipFileList(String fileName)
fileName
- The file name of the zip file to create.@Header(value="Content-Type") public MediaType getMediaType()
Streamable
getMediaType
in interface Streamable
@Header(value="Content-Disposition") public String getContentDisposition()
Content-Disposition
header.Content-Disposition
header.@ResponseBody public void streamTo(OutputStream os) throws IOException
Streamable
streamTo
in interface Streamable
os
- The output stream to stream to.IOException
public ZipFileList append(ZipFileList.ZipFileEntry e)
e
- The zip file entry.Copyright © 2018 Apache. All rights reserved.