ContentDescriptor, AbstractReadHandle, AbstractWriteHandle, BinaryReadHandle, BinaryWriteHandle, BufferableContentHandle<java.io.File,java.io.File>, BufferableHandle, ContentHandle<java.io.File>, CtsQueryWriteHandle, DocumentMetadataReadHandle, DocumentMetadataWriteHandle, DocumentPatchHandle, GenericReadHandle, GenericWriteHandle, JSONReadHandle, JSONWriteHandle, QuadsWriteHandle, QueryOptionsListReadHandle, QueryOptionsReadHandle, QueryOptionsWriteHandle, ResendableContentHandle<java.io.File,java.io.File>, 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 ResendableContentHandle<java.io.File,java.io.File>, BinaryReadHandle, BinaryWriteHandle, GenericReadHandle, GenericWriteHandle, JSONReadHandle, JSONWriteHandle, TextReadHandle, TextWriteHandle, XMLReadHandle, XMLWriteHandle, StructureReadHandle, StructureWriteHandle, CtsQueryWriteHandle, QuadsWriteHandle, TriplesReadHandle, TriplesWriteHandle
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 |
|---|---|---|
java.io.File |
bytesToContent(byte[] buffer) |
Converts a byte serialization to the content representation.
|
byte[] |
contentToBytes(java.io.File content) |
Converts the content representation to bytes.
|
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.
|
java.lang.Class<java.io.File> |
getContentClass() |
Returns the class of the handled content, which may be a base
class of the actual class of a content object.
|
java.io.File[] |
newArray(int length) |
Constructs an array for the handled content representation
|
static ContentHandleFactory |
newFactory() |
Creates a factory to create a FileHandle for a file.
|
FileHandle |
newHandle() |
Constructs a new handle for the same content representation,
initializing the new handle with the same format and mime type.
|
FileHandle[] |
newHandleArray(int length) |
Constructs an uninitialized array with the specified length with items
of the same content representation.
|
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.
|
java.io.File |
toContent(java.io.File serialization) |
Converts the serialization to the content representation.
|
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, setServerTimestampresendableHandleForgetPointInTimeQueryTimestamp, isResendable, setPointInTimeQueryTimestamp, setResendable, setResponseServerTimestampclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitnewHandle, resendableHandleForpublic 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 java.lang.Class<java.io.File> getContentClass()
ContentHandlegetContentClass in interface ContentHandle<java.io.File>public FileHandle newHandle()
ContentHandlenewHandle in interface BufferableContentHandle<java.io.File,java.io.File>newHandle in interface ContentHandle<java.io.File>newHandle in interface ResendableContentHandle<java.io.File,java.io.File>public FileHandle[] newHandleArray(int length)
BufferableContentHandlenewHandleArray in interface BufferableContentHandle<java.io.File,java.io.File>newHandleArray in interface ResendableContentHandle<java.io.File,java.io.File>length - the number of positions in the arraypublic java.io.File[] newArray(int length)
ContentHandlenewArray in interface ContentHandle<java.io.File>length - the size of the array (zero or more)public FileHandle withFormat(Format format)
format - the format of the contentpublic FileHandle withMimetype(java.lang.String mimetype)
mimetype - the mime type of the contentpublic java.io.File toContent(java.io.File serialization)
BufferableContentHandletoContent in interface BufferableContentHandle<java.io.File,java.io.File>serialization - a serialization 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 BufferableHandlepublic java.io.File bytesToContent(byte[] buffer)
BufferableContentHandlebytesToContent in interface BufferableContentHandle<java.io.File,java.io.File>buffer - the byte serializationpublic byte[] contentToBytes(java.io.File content)
BufferableContentHandlecontentToBytes in interface BufferableContentHandle<java.io.File,java.io.File>content - the contentCopyright © 2013-2021 MarkLogic Corporation.