|
|||||||||
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(org.springframework.context.ApplicationContext context,
java.io.File rootDirectory)
Public constructor for programmatic use. |
|
FileContentStore(org.springframework.context.ApplicationContext context,
java.lang.String rootDirectoryStr)
Public constructor for programmatic use. |
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. |
org.alfresco.service.cmr.repository.ContentReader |
getReader(java.lang.String contentUrl)
This implementation requires that the URL start with FileContentStore.STORE_PROTOCOL . |
java.lang.String |
getRootLocation()
Get the location where the store is rooted. |
long |
getSpaceFree()
Get the filesystem's free space. |
long |
getSpaceTotal()
Get the filesystem's total space. |
long |
getSpaceUsed()
Performs a full, deep size calculation |
void |
getUrls(java.util.Date createdAfter,
java.util.Date createdBefore,
ContentStore.ContentUrlHandler handler)
Gets the urls. |
org.alfresco.service.cmr.repository.ContentWriter |
getWriterInternal(org.alfresco.service.cmr.repository.ContentReader existingContentReader,
java.lang.String newContentUrl)
Returns a writer onto a location based on the date. |
boolean |
isWriteSupported()
Check if the store supports write requests. |
void |
onApplicationEvent(org.springframework.context.ApplicationEvent event)
|
void |
setAllowRandomAccess(boolean allowRandomAccess)
Stores may optionally produce readers and writers that support random access. |
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
|
void |
setDeleteEmptyDirs(boolean deleteEmptyDirs)
Configure the FileContentStore to delete empty parent directories upon deleting a content URL. |
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, getTotalSize, 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 ValuesConstructor Detail |
---|
public FileContentStore(org.springframework.context.ApplicationContext context, java.lang.String rootDirectoryStr)
context
- application context through which events can be publishedrootDirectoryStr
- the root under which files will be stored. The directory will be created if it does not exist.FileContentStore.FileContentStore(File)
public FileContentStore(org.springframework.context.ApplicationContext context, java.io.File rootDirectory)
context
- application context through which events can be publishedrootDirectory
- 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.Object
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
org.springframework.beans.BeansException
public 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
isWriteSupported
in interface ContentStore
public boolean exists(java.lang.String contentUrl)
exists
in interface ContentStore
exists
in class AbstractContentStore
contentUrl
- the path to the content
ContentReader.exists()
public long getSpaceUsed()
getSpaceUsed
in interface ContentStore
getSpaceUsed
in class AbstractContentStore
public long getSpaceFree()
getSpaceFree
in interface ContentStore
getSpaceFree
in class AbstractContentStore
free space
public long getSpaceTotal()
getSpaceTotal
in interface ContentStore
getSpaceTotal
in class AbstractContentStore
total space
public java.lang.String getRootLocation()
AbstractContentStore
getRootLocation
in interface ContentStore
getRootLocation
in class AbstractContentStore
public org.alfresco.service.cmr.repository.ContentReader getReader(java.lang.String contentUrl)
FileContentStore.STORE_PROTOCOL
.
getReader
in interface ContentStore
contentUrl
- the path to where the content is located
ContentStore.exists(String)
,
ContentReader.exists()
,
EmptyContentReader
public org.alfresco.service.cmr.repository.ContentWriter getWriterInternal(org.alfresco.service.cmr.repository.ContentReader existingContentReader, java.lang.String newContentUrl)
getWriterInternal
in class AbstractContentStore
existingContentReader
- the existing content readernewContentUrl
- the new content url
public void getUrls(java.util.Date createdAfter, java.util.Date createdBefore, ContentStore.ContentUrlHandler handler)
getUrls
in interface ContentStore
getUrls
in class AbstractContentStore
createdAfter
- the created after datecreatedBefore
- the created before dat6ehandler
- the handlerpublic boolean delete(java.lang.String contentUrl)
delete
in interface ContentStore
delete
in class AbstractContentStore
contentUrl
- the URL of the content to delete
java.lang.UnsupportedOperationException
- if the store is read-onlyFileContentStore.setReadOnly(boolean)
public static java.lang.String createNewFileStoreUrl()
public void onApplicationEvent(org.springframework.context.ApplicationEvent event)
onApplicationEvent
in interface org.springframework.context.ApplicationListener
public void setDeleteEmptyDirs(boolean deleteEmptyDirs)
deleteEmptyDirs
- the deleteEmptyDirs to set
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |