|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.alfresco.repo.content.AbstractContentStore
org.alfresco.repo.content.filestore.FileContentStore
public class FileContentStore
Provides a store of node content directly to the file system. The writers
are generated using information from the simple content context.
The file names obey, as they must, the URL naming convention
as specified in the ContentStore interface.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.alfresco.repo.content.ContentStore |
|---|
ContentStore.ContentUrlHandler |
| Field Summary | |
|---|---|
static java.lang.String |
STORE_PROTOCOL
store is the new prefix for file content URLs |
| Fields inherited from interface org.alfresco.repo.content.ContentStore |
|---|
NEW_CONTENT_CONTEXT, PROTOCOL_DELIMITER |
| Constructor Summary | |
|---|---|
FileContentStore(java.io.File rootDirectory)
|
|
FileContentStore(java.lang.String rootDirectoryStr)
|
|
| Method Summary | |
|---|---|
static java.lang.String |
createNewFileStoreUrl()
Creates a new content URL. |
boolean |
delete(java.lang.String contentUrl)
Attempts to delete the content. |
boolean |
exists(java.lang.String contentUrl)
Performs a direct check against the file for its existence. |
ContentReader |
getReader(java.lang.String contentUrl)
This implementation requires that the URL start with FileContentStore.STORE_PROTOCOL. |
void |
getUrls(java.util.Date createdAfter,
java.util.Date createdBefore,
ContentStore.ContentUrlHandler handler)
Override to provide an implementation. |
ContentWriter |
getWriterInternal(ContentReader existingContentReader,
java.lang.String newContentUrl)
Implement to supply a store-specific writer for the given existing content and optional target content URL. |
boolean |
isWriteSupported()
Check if the store supports write requests. |
void |
setAllowRandomAccess(boolean allowRandomAccess)
Stores may optionally produce readers and writers that support random access. |
void |
setReadOnly(boolean readOnly)
File stores may optionally be declared read-only. |
java.lang.String |
toString()
|
| Methods inherited from class org.alfresco.repo.content.AbstractContentStore |
|---|
getContentUrlParts, getUrls, getWriter, getWriter, isContentUrlSupported, isValidContentUrl |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String STORE_PROTOCOL
ContentStore.PROTOCOL_DELIMITER,
Constant Field Values| Constructor Detail |
|---|
public FileContentStore(java.lang.String rootDirectoryStr)
rootDirectoryStr - the root under which files will be stored.
The directory will be created if it does not exist.FileContentStore.FileContentStore(File)public FileContentStore(java.io.File rootDirectory)
rootDirectory - the root under which files will be stored.
The directory will be created if it does not exist.| Method Detail |
|---|
public java.lang.String toString()
toString in class java.lang.Objectpublic void setAllowRandomAccess(boolean allowRandomAccess)
This switch is primarily used during testing to ensure that the system has the ability to spoof random access in cases where the store is unable to produce readers and writers that allow random access. Typically, stream-based access would be an example.
allowRandomAccess - true to allow random access, false to have it fakedpublic void setReadOnly(boolean readOnly)
readOnly - true to force the store to only allow reads.public boolean isWriteSupported()
ContentStore
public boolean exists(java.lang.String contentUrl)
exists in interface ContentStoreexists in class AbstractContentStorecontentUrl - the path to the content
ContentReader.exists()public ContentReader getReader(java.lang.String contentUrl)
FileContentStore.STORE_PROTOCOL.
contentUrl - the path to where the content is located
ContentStore.exists(String),
ContentReader.exists(),
EmptyContentReader
public ContentWriter getWriterInternal(ContentReader existingContentReader,
java.lang.String newContentUrl)
AbstractContentStore
getWriterInternal in class AbstractContentStoreexistingContentReader - a reader onto any content to initialize the new writer withnewContentUrl - an optional target for the new content
public void getUrls(java.util.Date createdAfter,
java.util.Date createdBefore,
ContentStore.ContentUrlHandler handler)
AbstractContentStore
getUrls in interface ContentStoregetUrls in class AbstractContentStorecreatedAfter - all URLs returned must have been created after this date. May be null.createdBefore - all URLs returned must have been created before this date. May be null.handler - the callback that will passed each URLpublic boolean delete(java.lang.String contentUrl)
delete in interface ContentStoredelete in class AbstractContentStorecontentUrl - the URL of the content to delete
java.lang.UnsupportedOperationException - if the store is read-onlyFileContentStore.setReadOnly(boolean)public static java.lang.String createNewFileStoreUrl()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||