| Modifier and Type | Field and Description |
|---|---|
| private File | |
| private FileChannel | |
| private boolean | |
| private static final InternalLogger |
| Access | Constructor and Description |
|---|---|
| protected | |
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public void | addContent(Buffer
must be not null except if last is set to False buffer, boolean True of the buffer is the last one last)Implements io.
|
| public void | delete()
Implements io. |
| protected abstract boolean | |
| public byte[] | get()
Implements io. |
| protected abstract String | |
| private static Buffer | |
| public Buffer | getChunk(int length)
Implements io. |
| protected Buffer | |
| protected abstract String | |
| public File | |
| protected abstract String | |
| protected abstract String | |
| public String | getString()
Implements io. |
| public String | getString(Charset
the charset to use encoding)Implements io. |
| public boolean | isInMemory()
Implements io. |
| private static byte[] | |
| public boolean | renameTo(File
destination file - must be not null dest)Implements io. |
| public void | setContent(Buffer
must be not null buffer)Implements io.
|
| public void | setContent(File
must be not null file)Implements io. |
| public void | setContent(InputStream
must be not null inputStream)Implements io. |
| private File | Returns: a new Temp File from getDiskFilename(), default prefix, postfix and baseDirectory
|
| public <E extends Exception> void | usingBuffer(Helpers.
The file item buffer callback callbackImplements io. |
| file | back to summary |
|---|---|
| private File file | |
| fileChannel | back to summary |
|---|---|
| private FileChannel fileChannel | |
| isRenamed | back to summary |
|---|---|
| private boolean isRenamed | |
| logger | back to summary |
|---|---|
| private static final InternalLogger logger | |
| AbstractDiskHttpData | back to summary |
|---|---|
| protected AbstractDiskHttpData(String name, Charset charset, long size) | |
| AbstractDiskHttpData | back to summary |
|---|---|
| protected AbstractDiskHttpData(AbstractDiskHttpData copy) | |
| addContent | back to summary |
|---|---|
| public void addContent(Buffer buffer, boolean last) throws IOException Implements io. Doc from io. Add the content from the ChannelBuffer
| |
| delete | back to summary |
|---|---|
| public void delete() Implements io. Doc from io. Deletes the underlying storage for a file item, including deleting any associated temporary disk file.
| |
| deleteOnExit | back to summary |
|---|---|
protected abstract boolean deleteOnExit()
| |
| get | back to summary |
|---|---|
| public byte[] get() throws IOException Implements io. Doc from io. Returns the contents of the file item as an array of bytes. Note this method will allocate a lot of memory, if the data is currently stored on the file system.
| |
| getBaseDirectory | back to summary |
|---|---|
protected abstract String getBaseDirectory()
| |
| getBufferFrom | back to summary |
|---|---|
| private static Buffer getBufferFrom(File src) throws IOException | |
| getChunk | back to summary |
|---|---|
| public Buffer getChunk(int length) throws IOException Implements io. Doc from io. Returns a ChannelBuffer for the content from the current position with at most length read bytes, increasing the current position of the Bytes read. Once it arrives at the end, it returns an EMPTY_BUFFER and it resets the current position to 0. Buffer ownersip: The buffer ownership of the returned buffer is transferred to the caller | |
| getContent | back to summary |
|---|---|
| protected Buffer getContent() Returns a copy of the current file content. The buffer ownership is returned to the caller | |
| getDiskFilename | back to summary |
|---|---|
protected abstract String getDiskFilename()
| |
| getFile | back to summary |
|---|---|
| public File getFile() throws IOException Implements io.
| |
| getPostfix | back to summary |
|---|---|
protected abstract String getPostfix()
| |
| getPrefix | back to summary |
|---|---|
protected abstract String getPrefix()
| |
| getString | back to summary |
|---|---|
| public String getString() throws IOException Implements io. Doc from io. Returns the contents of the file item as a String, using the default character encoding. | |
| getString | back to summary |
|---|---|
| public String getString(Charset encoding) throws IOException Implements io. Doc from io. Returns the contents of the file item as a String, using the specified charset. | |
| isInMemory | back to summary |
|---|---|
| public boolean isInMemory() Implements io. Doc from io. Provides a hint as to whether or not the file contents will be read from memory.
| |
| readFrom | back to summary |
|---|---|
| private static byte[] readFrom(File src) throws IOException Utility function
| |
| renameTo | back to summary |
|---|---|
| public boolean renameTo(File dest) throws IOException Implements io. Doc from io. A convenience getMethod to write an uploaded item to disk. If a previous one exists, it will be deleted. Once this getMethod is called, if successful, the new file will be out of the cleaner of the factory that creates the original InterfaceHttpData object. | |
| setContent | back to summary |
|---|---|
| public void setContent(Buffer buffer) throws IOException Implements io. Doc from io. Set the content from the ChannelBuffer (erase any previous data)
| |
| setContent | back to summary |
|---|---|
| public void setContent(File file) throws IOException Implements io. Doc from io. Set the content from the file (erase any previous data) | |
| setContent | back to summary |
|---|---|
| public void setContent(InputStream inputStream) throws IOException Implements io. Doc from io. Set the content from the inputStream (erase any previous data)
| |
| tempFile | back to summary |
|---|---|
private File tempFile() throws IOException
| |
| usingBuffer | back to summary |
|---|---|
| public <E extends Exception> void usingBuffer(Helpers. Implements io. Doc from io. Calls the passed callback to operate on the file item as a Buffer. Note this method will allocate a lot of memory, if the data is currently stored on the file system. Buffer ownersip: The ownership of the buffer passed to the callack is not transferred and remains to this HttpData interface.
| |