public 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
UNKNOWN_LENGTH
Constructor and Description |
---|
FileHandle()
Zero-argument constructor.
|
FileHandle(java.io.File content)
Initializes the handle with a file containing the content.
|
Modifier and Type | Method and Description |
---|---|
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.
|
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, setServerTimestamp
public 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>
Copyright © 2013-2018 MarkLogic Corporation.