Class FileSystemContentStoreAdapter
- java.lang.Object
-
- org.craftercms.core.store.impl.AbstractCachedContentStoreAdapter
-
- org.craftercms.core.store.impl.AbstractFileBasedContentStoreAdapter
-
- org.craftercms.core.store.impl.filesystem.FileSystemContentStoreAdapter
-
- All Implemented Interfaces:
ContentStoreAdapter
,org.springframework.beans.factory.Aware
,org.springframework.context.ResourceLoaderAware
public class FileSystemContentStoreAdapter extends AbstractFileBasedContentStoreAdapter implements org.springframework.context.ResourceLoaderAware
Implementation ofContentStoreAdapter
that enables access to a store in the filesystem.- Author:
- Alfonso Vásquez
-
-
Field Summary
Fields Modifier and Type Field Description static String
STORE_TYPE
-
Fields inherited from class org.craftercms.core.store.impl.AbstractFileBasedContentStoreAdapter
charset, DEFAULT_CHARSET, descriptorFileExtension, metadataFileExtension, pathValidator
-
Fields inherited from class org.craftercms.core.store.impl.AbstractCachedContentStoreAdapter
cacheTemplate, CONST_KEY_ELEM_CONTENT, CONST_KEY_ELEM_EXISTS, CONST_KEY_ELEM_ITEM, CONST_KEY_ELEM_ITEMS, defaultCachingOptions
-
-
Constructor Summary
Constructors Constructor Description FileSystemContentStoreAdapter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Context
createContext(String id, String rootFolderPath, boolean mergingOn, boolean cacheOn, int maxAllowedItemsInCache, boolean ignoreHiddenFiles)
void
destroyContext(Context context)
protected File
findFile(Context context, CachingOptions cachingOptions, String path)
Returns theFile
at the given path, returning null if not found.protected List<File>
getChildren(Context context, CachingOptions cachingOptions, File dir)
Returns the list of children of the given directory.protected Content
getContent(Context context, CachingOptions cachingOptions, File file)
Returns theContent
for the given file.void
setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader)
boolean
validate(Context context)
-
Methods inherited from class org.craftercms.core.store.impl.AbstractFileBasedContentStoreAdapter
createXmlReader, doExists, doFindContent, doFindItem, doFindItems, setCharset, setDescriptorFileExtension, setMetadataFileExtension, setPathValidator, validatePath
-
Methods inherited from class org.craftercms.core.store.impl.AbstractCachedContentStoreAdapter
exists, findContent, findItem, findItems, setCacheTemplate, setDefaultCachingOptions
-
-
-
-
Field Detail
-
STORE_TYPE
public static final String STORE_TYPE
- See Also:
- Constant Field Values
-
-
Method Detail
-
setResourceLoader
public void setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader)
- Specified by:
setResourceLoader
in interfaceorg.springframework.context.ResourceLoaderAware
-
createContext
public Context createContext(String id, String rootFolderPath, boolean mergingOn, boolean cacheOn, int maxAllowedItemsInCache, boolean ignoreHiddenFiles) throws RootFolderNotFoundException, StoreException, AuthenticationException
- Specified by:
createContext
in interfaceContentStoreAdapter
- Throws:
RootFolderNotFoundException
StoreException
AuthenticationException
-
validate
public boolean validate(Context context) throws InvalidContextException, StoreException, AuthenticationException
- Specified by:
validate
in interfaceContentStoreAdapter
- Throws:
InvalidContextException
StoreException
AuthenticationException
-
destroyContext
public void destroyContext(Context context) throws InvalidContextException, StoreException, AuthenticationException
- Specified by:
destroyContext
in interfaceContentStoreAdapter
- Throws:
InvalidContextException
StoreException
AuthenticationException
-
getContent
protected Content getContent(Context context, CachingOptions cachingOptions, File file) throws InvalidContextException, StoreException
Description copied from class:AbstractFileBasedContentStoreAdapter
Returns theContent
for the given file.- Specified by:
getContent
in classAbstractFileBasedContentStoreAdapter
- Throws:
InvalidContextException
StoreException
-
findFile
protected File findFile(Context context, CachingOptions cachingOptions, String path)
Description copied from class:AbstractFileBasedContentStoreAdapter
Returns theFile
at the given path, returning null if not found.- Specified by:
findFile
in classAbstractFileBasedContentStoreAdapter
-
getChildren
protected List<File> getChildren(Context context, CachingOptions cachingOptions, File dir)
Description copied from class:AbstractFileBasedContentStoreAdapter
Returns the list of children of the given directory.- Specified by:
getChildren
in classAbstractFileBasedContentStoreAdapter
-
-