public class FileHandle extends BaseHandle<File,File> implements ContentHandle<File>, BinaryReadHandle, BinaryWriteHandle, GenericReadHandle, GenericWriteHandle, JSONReadHandle, JSONWriteHandle, TextReadHandle, TextWriteHandle, XMLReadHandle, XMLWriteHandle, StructureReadHandle, StructureWriteHandle, QuadsWriteHandle, TriplesReadHandle, TriplesWriteHandle
UNKNOWN_LENGTH
Constructor and Description |
---|
FileHandle()
Zero-argument constructor.
|
FileHandle(File content)
Initializes the handle with a file containing the content.
|
Modifier and Type | Method and Description |
---|---|
File |
get()
Returns the file for the handle content.
|
static ContentHandleFactory |
newFactory()
Creates a factory to create a FileHandle for a file.
|
void |
set(File content)
Assigns a file as the content.
|
FileHandle |
with(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(String mimetype)
Specifies the mime type of the content and returns the handle
as a fluent convenience.
|
getByteLength, getFormat, getMimetype, setByteLength, setFormat, setMimetype
public FileHandle()
public FileHandle(File content)
content
- the filepublic static ContentHandleFactory newFactory()
public File get()
get
in interface ContentHandle<File>
public void set(File content)
set
in interface ContentHandle<File>
content
- the filepublic FileHandle with(File content)
content
- the filepublic FileHandle withFormat(Format format)
format
- the format of the contentpublic FileHandle withMimetype(String mimetype)
mimetype
- the mime type of the contentCopyright © 2013-2016 MarkLogic Corporation.