@AlfrescoPublicApi public abstract class AbstractContentStore extends Object implements org.alfresco.repo.content.ContentStore
Since content URLs have to be consistent across all stores for reasons of replication and backup, the most important functionality provided is the generation of new content URLs and the checking of existing URLs.
Implementations must override either of the getWriter methods;
getWriter(ContentContext) or getWriterInternal(ContentReader, String).
getWriter(org.alfresco.repo.content.ContentContext),
getWriterInternal(ContentReader, String)| Modifier and Type | Field and Description |
|---|---|
protected ContentLimitProvider |
contentLimitProvider |
| Constructor and Description |
|---|
AbstractContentStore() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
delete(String contentUrl)
Override if the derived class supports the operation.
|
boolean |
exists(String contentUrl)
Simple implementation that uses the
reader's exists method as its implementation. |
protected org.alfresco.util.Pair<String,String> |
getContentUrlParts(String contentUrl)
Splits the content URL into its component parts as separated by
protocol delimiter. |
String |
getRootLocation() |
long |
getSpaceFree() |
long |
getSpaceTotal() |
org.alfresco.service.cmr.repository.ContentWriter |
getWriter(org.alfresco.repo.content.ContentContext context)
An implementation that does some sanity checking before requesting a writer from the
store.
|
protected org.alfresco.service.cmr.repository.ContentWriter |
getWriterInternal(org.alfresco.service.cmr.repository.ContentReader existingContentReader,
String newContentUrl)
Implement to supply a store-specific writer for the given existing content
and optional target content URL.
|
boolean |
isContentUrlSupported(String contentUrl)
Override this method to supply a efficient and direct check of the URL supplied.
|
static boolean |
isValidContentUrl(String contentUrl)
Checks that the content conforms to the format protocol://identifier
as specified in the contract of the
ContentStore interface. |
void |
setContentLimitProvider(ContentLimitProvider contentLimitProvider)
An object that prevents abuse of the underlying store(s)
|
protected ContentLimitProvider contentLimitProvider
public static final boolean isValidContentUrl(String contentUrl)
ContentStore interface.contentUrl - the content URL to checkpublic void setContentLimitProvider(ContentLimitProvider contentLimitProvider)
protected org.alfresco.util.Pair<String,String> getContentUrlParts(String contentUrl)
protocol delimiter.contentUrl - the content URL to splitUnsupportedContentUrlException - if the content URL is invalidpublic boolean isContentUrlSupported(String contentUrl)
ContentStore.getReader(String)
throws the UnsupportedContentUrlException exception.isContentUrlSupported in interface org.alfresco.repo.content.ContentStorepublic boolean delete(String contentUrl)
delete in interface org.alfresco.repo.content.ContentStoreUnsupportedOperationException - alwaysprotected org.alfresco.service.cmr.repository.ContentWriter getWriterInternal(org.alfresco.service.cmr.repository.ContentReader existingContentReader,
String newContentUrl)
existingContentReader - a reader onto any content to initialize the new writer withnewContentUrl - an optional target for the new contentUnsupportedContentUrlException - if the content URL supplied is not supported by the storeContentExistsException - if the content URL is already in useorg.alfresco.service.cmr.repository.ContentIOException - if an IO error occurspublic org.alfresco.service.cmr.repository.ContentWriter getWriter(org.alfresco.repo.content.ContentContext context)
getWriterInternal(ContentReader, String) must be supplied.getWriter in interface org.alfresco.repo.content.ContentStoregetWriterInternal(ContentReader, String)public boolean exists(String contentUrl)
reader's exists method as its implementation.
Override this method if a more efficient implementation is possible.exists in interface org.alfresco.repo.content.ContentStorepublic long getSpaceFree()
getSpaceFree in interface org.alfresco.repo.content.ContentStorepublic long getSpaceTotal()
getSpaceTotal in interface org.alfresco.repo.content.ContentStorepublic String getRootLocation()
getRootLocation in interface org.alfresco.repo.content.ContentStoreCopyright © 2005–2018 Alfresco Software. All rights reserved.