ContentDescriptor, AbstractReadHandle, AbstractWriteHandle, BinaryReadHandle, BinaryWriteHandle, BufferableHandle, ContentHandle<java.io.File>, CtsQueryWriteHandle, DocumentMetadataReadHandle, DocumentMetadataWriteHandle, DocumentPatchHandle, GenericReadHandle, GenericWriteHandle, JSONReadHandle, JSONWriteHandle, QuadsWriteHandle, QueryOptionsListReadHandle, QueryOptionsReadHandle, QueryOptionsWriteHandle, RuleListReadHandle, RuleReadHandle, RuleWriteHandle, SearchReadHandle, SPARQLResultsReadHandle, StructureReadHandle, StructureWriteHandle, TextReadHandle, TextWriteHandle, TriplesReadHandle, TriplesWriteHandle, TuplesReadHandle, ValuesListReadHandle, ValuesReadHandle, XMLReadHandle, XMLWriteHandlepublic class FileHandle extends BaseHandle<java.io.File,java.io.File> implements ContentHandle<java.io.File>, BinaryReadHandle, BinaryWriteHandle, GenericReadHandle, GenericWriteHandle, JSONReadHandle, JSONWriteHandle, TextReadHandle, TextWriteHandle, XMLReadHandle, XMLWriteHandle, StructureReadHandle, StructureWriteHandle, CtsQueryWriteHandle, QuadsWriteHandle, TriplesReadHandle, TriplesWriteHandle, BufferableHandle
UNKNOWN_LENGTH| Constructor | Description |
|---|---|
FileHandle() |
Zero-argument constructor.
|
FileHandle(java.io.File content) |
Initializes the handle with a file containing the content.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
fromBuffer(byte[] buffer) |
Sets the content of the handle by copying from a byte array buffer
encoded in UTF-8.
|
java.io.File |
get() |
Returns the file for the handle content.
|
static ContentHandleFactory |
newFactory() |
Creates a factory to create a FileHandle for a file.
|
protected java.lang.Class<java.io.File> |
receiveAs() |
|
protected void |
receiveContent(java.io.File content) |
|
protected java.io.File |
sendContent() |
|
void |
set(java.io.File content) |
Assigns a file as the content.
|
byte[] |
toBuffer() |
Copies the content of the handle to a byte array buffer
encoded in UTF-8.
|
FileHandle |
with(java.io.File content) |
Assigns a file as the content and returns the handle
as a fluent convenience.
|
FileHandle |
withFormat(Format format) |
Specifies the format of the content and returns the handle
as a fluent convenience.
|
FileHandle |
withMimetype(java.lang.String mimetype) |
Specifies the mime type of the content and returns the handle
as a fluent convenience.
|
getByteLength, getFormat, getMimetype, getServerTimestamp, setByteLength, setFormat, setMimetype, setServerTimestamppublic FileHandle()
public FileHandle(java.io.File content)
content - the filepublic static ContentHandleFactory newFactory()
public java.io.File get()
get in interface ContentHandle<java.io.File>public void set(java.io.File content)
set in interface ContentHandle<java.io.File>content - the filepublic FileHandle with(java.io.File content)
content - the filepublic FileHandle withFormat(Format format)
format - the format of the contentpublic FileHandle withMimetype(java.lang.String mimetype)
mimetype - the mime type of the contentprotected java.lang.Class<java.io.File> receiveAs()
receiveAs in class com.marklogic.client.impl.HandleImplementation<java.io.File,java.io.File>protected void receiveContent(java.io.File content)
receiveContent in class com.marklogic.client.impl.HandleImplementation<java.io.File,java.io.File>protected java.io.File sendContent()
sendContent in class com.marklogic.client.impl.HandleImplementation<java.io.File,java.io.File>public void fromBuffer(byte[] buffer)
BufferableHandlefromBuffer in interface BufferableHandlebuffer - the byte arraypublic byte[] toBuffer()
BufferableHandletoBuffer in interface BufferableHandleCopyright © 2013-2019 MarkLogic Corporation.