@Deprecated public abstract class AbstractContentProvider extends Object implements ContentProvider
CNT_ID_DELIMITER
Constructor and Description |
---|
AbstractContentProvider(String temporaryDirectoryPath)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
addListener(ContentActionListener providerListener)
Deprecated.
Registers the given provider listener with the underlying content providing component/subsystem.
|
ContentReference |
createContent(ContentDefinitionId contentDefinitionId,
String contentIdPrefix,
InputStream inputStream,
Long contentLength,
ContentRelations contentRelations)
Deprecated.
Uploads new content to this content provider based on the given content definition which of course must initially being created by this same content provider.
|
protected ContentId |
createContentId(ContentDefinitionId contentDefinitionId,
String contentIdPrefix)
Deprecated.
Internal hook method to create a new content id.
|
protected abstract void |
createContentInternal(ContentReference contentReference,
String contentIdPrefix,
File temporaryContentDirectory,
File temporaryContentFile)
Deprecated.
Abstract method to be implemented by concrete content providers to actually store the given content file according to the providers storage implementation.
|
protected ContentReference |
createContentReference(ContentDefinitionId contentDefinitionId,
String contentIdPrefix)
Deprecated.
|
protected File |
createTemporaryDirectory()
Deprecated.
|
void |
deleteContent(ContentReference contentReference,
ContentRelations contentRelations)
Deprecated.
Removes all content for the given reference.
|
protected abstract void |
deleteContentInternal(ContentReference contentReference)
Deprecated.
Abstract method to be implemented by concrete content providers to actually delete the given referenced content.
|
void |
deleteContentVersion(ContentReference contentReference,
String version,
ContentRelations contentRelations)
Deprecated.
Removes the given version of the referenced content.
|
protected abstract void |
deleteContentVersionInternal(ContentReference contentReference,
String version)
Deprecated.
Abstract method to be implemented by concrete content providers to actually delete the given referenced content version.
|
protected void |
deleteTemporaryDirectory(File tempDir)
Deprecated.
|
protected void |
ensureTemporaryDirectory(String temporaryDirectoryPath)
Deprecated.
|
protected String |
getDefaultBaseDirectory()
Deprecated.
Returns the default base directory for content providers with a trailing separator.
|
File |
getTemporaryDirectory()
Deprecated.
|
protected void |
invokeContentActionListeners(ContentActionEvent event,
boolean preInvocation)
Deprecated.
|
void |
removeListener(ContentActionListener providerListener)
Deprecated.
Unregisters the given provider listener from the underlying content providing subsystem.
|
protected File |
streamIntoTempFile(File tempDir,
InputStream inputStream)
Deprecated.
|
void |
updateContent(ContentReference contentReference,
InputStream inputStream,
Long contentLength,
ContentRelations contentRelations)
Deprecated.
Uploads new content of an existing content object referenced by the given content reference previously retrieved by creating the content object.
|
protected abstract void |
updateContentInternal(ContentReference contentReference,
File temporaryContentDirectory,
File temporaryContentFile)
Deprecated.
Abstract method to be implemented by concrete content providers to actually update the given content file according to the providers storage implementation.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAllContentReferences, getContentVersion, getDefinitions, getId, getLatestContent, listVersions
public AbstractContentProvider(String temporaryDirectoryPath)
public final ContentReference createContent(ContentDefinitionId contentDefinitionId, String contentIdPrefix, InputStream inputStream, Long contentLength, ContentRelations contentRelations)
ContentProvider
createContent
in interface ContentProvider
contentDefinitionId
- the id of the content definition this content is based on (typically the definition contains information about the storage type, encryption,
versioning, etc needed by the provider to distinguish on how to store the content)contentIdPrefix
- the optional prefix used for the content id, this allows the provider to organize and browse keys hierarchically, similar to how a file system
organizes files into directories (might be null
), the prefix will be used to create the content id and is delimited using the CNT_ID_DELIMITER
, so
you don't have to add the delimiter after the end of the prefix, this is done by the provider automaticallyinputStream
- the input stream serving the content to be storedcontentLength
- the optional length of the content input stream, if known (if the content length is not specified, be aware as this might be resulting in out of memory
as the content might need to be buffered in order to store in the underlying provider)contentRelations
- the optional content usage parameter to be passed along to content action listeners containing information about the relation of the content to be
storedprotected abstract void createContentInternal(ContentReference contentReference, String contentIdPrefix, File temporaryContentDirectory, File temporaryContentFile) throws IOException
contentReference
- the content reference containing the definition id and content id of the content to be storedcontentIdPrefix
- the optional content id prefix, might be null
temporaryContentDirectory
- the temporary directory which was created to handle the new content storagetemporaryContentFile
- the temporary file with the content to be storedIOException
- if there is some errorprotected ContentReference createContentReference(ContentDefinitionId contentDefinitionId, String contentIdPrefix)
protected ContentId createContentId(ContentDefinitionId contentDefinitionId, String contentIdPrefix)
contentDefinitionId
- the definition id of the content to create a new id forcontentIdPrefix
- the optional prefix for the new content id to be created, might be null
public final void updateContent(ContentReference contentReference, InputStream inputStream, Long contentLength, ContentRelations contentRelations)
ContentProvider
updateContent
in interface ContentProvider
contentReference
- the reference of the content to be overwritten or stored as a new content versioninputStream
- the input stream serving the content to be storedcontentLength
- the optional length of the content input stream, if known (if the content length is not specified, be aware as this might be resulting in out of memory
as the content might need to be buffered in order to store in the underlying provider)contentRelations
- the optional content usage parameter to be passed along to content action listeners containing information about the relation of the content to be
storedprotected abstract void updateContentInternal(ContentReference contentReference, File temporaryContentDirectory, File temporaryContentFile) throws IOException
contentReference
- the content reference containing the definition id and content id of the content to be storedtemporaryContentDirectory
- the temporary directory which was created to handle the new content storagetemporaryContentFile
- the temporary file with the content to be storedIOException
- if there is some errorpublic final void deleteContent(ContentReference contentReference, ContentRelations contentRelations)
ContentProvider
deleteContent
in interface ContentProvider
contentReference
- the reference of the content to be deletedcontentRelations
- the optional content usage parameter to be passed along to content action listeners containing information about the relation of the content to be
storedprotected abstract void deleteContentInternal(ContentReference contentReference)
contentReference
- the reference of the content to be deletedpublic final void deleteContentVersion(ContentReference contentReference, String version, ContentRelations contentRelations)
ContentProvider
deleteContentVersion
in interface ContentProvider
contentReference
- the referenced content to remove one specific version ofversion
- the version of the content to be deletedcontentRelations
- the optional content usage parameter to be passed along to content action listeners containing information about the relation of the content to be
storedprotected abstract void deleteContentVersionInternal(ContentReference contentReference, String version)
contentReference
- the reference of the content to be deletedversion
- the specific version of the content to be deletedprotected void deleteTemporaryDirectory(File tempDir)
protected File createTemporaryDirectory()
protected File streamIntoTempFile(File tempDir, InputStream inputStream) throws IOException
IOException
public void addListener(ContentActionListener providerListener)
ContentProvider
addListener
in interface ContentProvider
providerListener
- the provider listener to be registeredpublic void removeListener(ContentActionListener providerListener)
ContentProvider
removeListener
in interface ContentProvider
providerListener
- the provider listener to be unregisteredprotected void invokeContentActionListeners(ContentActionEvent event, boolean preInvocation)
protected void ensureTemporaryDirectory(String temporaryDirectoryPath)
public File getTemporaryDirectory()
protected String getDefaultBaseDirectory()
Copyright © 2010 - 2017 edorasware ag. All Rights Reserved.