Package com.logicaldoc.core.store
Class MockStore
java.lang.Object
com.logicaldoc.core.store.AbstractStore
com.logicaldoc.core.store.FSStore
com.logicaldoc.core.store.MockStore
- All Implemented Interfaces:
- Store,- Comparable<Store>
This is basically a 
FSStore but with a flag that if active makes the
 store method to return an exception- Since:
- 8.4.2
- Author:
- Marco Meschieri - LogicalDOC
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionObtains the document's content for the specified resourcebooleanbooleanintmoveResourcesToStore(long docId, int targetStoreId) Moves all the resources of a document from it's original location to a different storevoidsetDummyFile(File dummyFile) voidsetErrorOnStore(boolean errorOnStore) voidsetUseDummyFile(boolean useDummyFile) voidStores a filevoidstore(InputStream stream, long docId, String resource) This method has to store a resource in the document's container.Methods inherited from class com.logicaldoc.core.store.FSStoredelete, delete, exists, getBytes, getContainer, getParameterNames, getRoot, getTotalSize, listResources, size, writeToFileMethods inherited from class com.logicaldoc.core.store.AbstractStorecompareTo, destroy, equals, getBytes, getConfig, getId, getParameters, getResourceName, getResourceName, getStoreDefinitions, getString, hashCode, init, isEnabled, newStore, setConfig, setId, test, toString, writeToStream, writeToStream
- 
Constructor Details- 
MockStorepublic MockStore()
 
- 
- 
Method Details- 
isRaiseErrorpublic boolean isRaiseError()
- 
setErrorOnStorepublic void setErrorOnStore(boolean errorOnStore) 
- 
storeDescription copied from interface:StoreStores a file- Specified by:
- storein interface- Store
- Overrides:
- storein class- FSStore
- Parameters:
- file- the file to store
- docId- identifier of the document
- resource- name of the resource
- Throws:
- IOException- the content cannot be stored
- See Also:
 
- 
storeDescription copied from interface:StoreThis method has to store a resource in the document's container. The location where (DBMS, Filesystem, other) the document should be stored is defined by the concrete implementation. It is possible to store a new document or a new version of an existing document.- Specified by:
- storein interface- Store
- Overrides:
- storein class- FSStore
- Parameters:
- stream- Document as InputStream
- docId- The document identifier
- resource- Name of the resource to be stored
- Throws:
- IOException- the content cannot be stored
 
- 
getStreamDescription copied from interface:StoreObtains the document's content for the specified resource- Specified by:
- getStreamin interface- Store
- Overrides:
- getStreamin class- FSStore
- Parameters:
- docId- The document's identifier
- resource- Name of the resource
- Returns:
- The document file's content
- Throws:
- IOException- cannot open the stream
 
- 
isUseDummyFilepublic boolean isUseDummyFile()
- 
setUseDummyFilepublic void setUseDummyFile(boolean useDummyFile) 
- 
moveResourcesToStoreDescription copied from interface:StoreMoves all the resources of a document from it's original location to a different store- Specified by:
- moveResourcesToStorein interface- Store
- Overrides:
- moveResourcesToStorein class- FSStore
- Parameters:
- docId- identifier of the document to process
- targetStoreId- identifier of the store that will receive the files
- Returns:
- number of moved resources
- Throws:
- IOException- In case of error during the process
 
- 
getDummyFile
- 
setDummyFile
 
-