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 ofContentStoreAdapterthat enables access to a store in the filesystem.- Author:
- Alfonso Vásquez
-
-
Field Summary
Fields Modifier and Type Field Description static StringSTORE_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 ContextcreateContext(String id, String rootFolderPath, boolean mergingOn, boolean cacheOn, int maxAllowedItemsInCache, boolean ignoreHiddenFiles)voiddestroyContext(Context context)protected FilefindFile(Context context, CachingOptions cachingOptions, String path)Returns theFileat 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 ContentgetContent(Context context, CachingOptions cachingOptions, File file)Returns theContentfor the given file.voidsetResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader)booleanvalidate(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:
setResourceLoaderin 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:
createContextin interfaceContentStoreAdapter- Throws:
RootFolderNotFoundExceptionStoreExceptionAuthenticationException
-
validate
public boolean validate(Context context) throws InvalidContextException, StoreException, AuthenticationException
- Specified by:
validatein interfaceContentStoreAdapter- Throws:
InvalidContextExceptionStoreExceptionAuthenticationException
-
destroyContext
public void destroyContext(Context context) throws InvalidContextException, StoreException, AuthenticationException
- Specified by:
destroyContextin interfaceContentStoreAdapter- Throws:
InvalidContextExceptionStoreExceptionAuthenticationException
-
getContent
protected Content getContent(Context context, CachingOptions cachingOptions, File file) throws InvalidContextException, StoreException
Description copied from class:AbstractFileBasedContentStoreAdapterReturns theContentfor the given file.- Specified by:
getContentin classAbstractFileBasedContentStoreAdapter- Throws:
InvalidContextExceptionStoreException
-
findFile
protected File findFile(Context context, CachingOptions cachingOptions, String path)
Description copied from class:AbstractFileBasedContentStoreAdapterReturns theFileat the given path, returning null if not found.- Specified by:
findFilein classAbstractFileBasedContentStoreAdapter
-
getChildren
protected List<File> getChildren(Context context, CachingOptions cachingOptions, File dir)
Description copied from class:AbstractFileBasedContentStoreAdapterReturns the list of children of the given directory.- Specified by:
getChildrenin classAbstractFileBasedContentStoreAdapter
-
-