public class FileContentReferenceHandlerImpl extends Object implements FileContentReferenceHandler
File content reference handler implementation.
Content reference creation is delegated to FileProvider.
| Modifier and Type | Field and Description |
|---|---|
static String |
URI_SCHEME_FILE |
| Constructor and Description |
|---|
FileContentReferenceHandlerImpl() |
| Modifier and Type | Method and Description |
|---|---|
ContentReference |
createContentReference(String fileName,
String mediaType)
Creates a content reference of the given file name and media type.
|
void |
delete(ContentReference contentReference)
Deletes the given content reference
|
File |
getFile(ContentReference contentReference,
boolean waitForTransfer)
Gets a File object for the given content reference, optionally waiting for the
file to be available and match the expected file size.
|
InputStream |
getInputStream(ContentReference contentReference,
boolean waitForAvailability)
Gets an input stream for the given content reference
|
boolean |
isAvailable()
Determines whether or not the handler is currently available, i.e.
|
boolean |
isContentReferenceExists(ContentReference contentReference)
Determines whether the given content reference exists
|
boolean |
isContentReferenceSupported(ContentReference contentReference)
Determines whether the given content reference is supported by the handler
|
long |
putInputStream(InputStream sourceInputStream,
ContentReference targetContentReference)
Writes the given source input stream into the given target content reference.
|
void |
setFileProvider(FileProvider fileProvider) |
void |
setFileProviderDirectoryPath(String directoryPath) |
void |
setTransferCheckPeriodMs(long transferCheckPeriodMs)
Sets the interval to check for transfer
|
void |
setTransferCheckTimeoutMs(long transferCheckTimeoutMs)
Sets the transfer check timeout
|
String |
toString() |
public static final String URI_SCHEME_FILE
public void setFileProvider(FileProvider fileProvider)
public void setTransferCheckPeriodMs(long transferCheckPeriodMs)
transferCheckPeriodMs - public void setTransferCheckTimeoutMs(long transferCheckTimeoutMs)
transferCheckTimeoutMs - public void setFileProviderDirectoryPath(String directoryPath)
public boolean isContentReferenceSupported(ContentReference contentReference)
ContentReferenceHandlerisContentReferenceSupported in interface ContentReferenceHandlerpublic boolean isContentReferenceExists(ContentReference contentReference)
ContentReferenceHandlerisContentReferenceExists in interface ContentReferenceHandlerpublic ContentReference createContentReference(String fileName, String mediaType) throws ContentIOException
ContentReferenceHandlercreateContentReference in interface ContentReferenceHandlerContentIOExceptionpublic File getFile(ContentReference contentReference, boolean waitForTransfer) throws ContentIOException, InterruptedException
FileContentReferenceHandlerThis is useful for implementations that already use a file-based implementation and can prevent workers from unnecessarily copying I/O streams.
getFile in interface FileContentReferenceHandlerContentIOExceptionInterruptedExceptionpublic InputStream getInputStream(ContentReference contentReference, boolean waitForAvailability) throws ContentIOException
ContentReferenceHandlergetInputStream in interface ContentReferenceHandlerwaitForAvailability - whether or not to check and wait for availabilityContentIOExceptionpublic long putInputStream(InputStream sourceInputStream, ContentReference targetContentReference) throws ContentIOException
ContentReferenceHandlerImplementations should close both streams.
putInputStream in interface ContentReferenceHandlerContentIOExceptionpublic void delete(ContentReference contentReference) throws ContentIOException
ContentReferenceHandlerdelete in interface ContentReferenceHandlerContentIOExceptionpublic boolean isAvailable()
ContentReferenceHandlerisAvailable in interface ContentReferenceHandlerCopyright © 2017 Alfresco Software. All rights reserved.