public class FileFolderLoader extends Object
Constructor and Description |
---|
FileFolderLoader(RepositoryState repoState,
TransactionService transactionService,
Repository repositoryHelper,
FileFolderService fileFolderService,
org.alfresco.service.cmr.repository.NodeService nodeService,
ContentService contentService,
BehaviourFilter policyBehaviourFilter) |
Modifier and Type | Method and Description |
---|---|
int |
createFiles(String folderPath,
int fileCount,
int filesPerTxn,
long minFileSize,
long maxFileSize,
long maxUniqueDocuments,
boolean forceBinaryStorage,
int descriptionCount,
long descriptionSize)
Attempt to create a given number of text files within a specified folder.
|
Repository |
getRepository() |
public FileFolderLoader(RepositoryState repoState, TransactionService transactionService, Repository repositoryHelper, FileFolderService fileFolderService, org.alfresco.service.cmr.repository.NodeService nodeService, ContentService contentService, BehaviourFilter policyBehaviourFilter)
repoState
- keep track of repository readinesstransactionService
- ensure proper rollback, where requiredrepositoryHelper
- access standard repository pathsfileFolderService
- perform actual file-folder manipulationpublic Repository getRepository()
public int createFiles(String folderPath, int fileCount, int filesPerTxn, long minFileSize, long maxFileSize, long maxUniqueDocuments, boolean forceBinaryStorage, int descriptionCount, long descriptionSize) throws FileNotFoundException
Attempt to create a given number of text files within a specified folder. The load tolerates failures unless these prevent any files from being created. Options exist to control the file size and text content distributions. The cm:auditable aspect automatically applied to each node as part of Alfresco. Additionally, extra residual text properties can be added in order to increase the size of the database storage.
The files are created regardless of the read-write state of the server.
The current thread's authentication determines the user context and the authenticated user has to have sufficient
permissions to create children
within the folder. This will be enforced
by the FileFolderService
.
folderPath
- the full path to the folder within the context of the
Alfresco Company Home
folder e.g.
/Sites/Site.default.00009/documentLibrary.
fileCount
- the number of files to createfilesPerTxn
- the number of files to create in a transaction. Any failures within a
transaction (batch) will force the transaction to rollback; normal
retrying semantics
are employed.minFileSize
- the smallest file size (all sizes within 1 standard deviation of the mean)maxFileSize
- the largest file size (all sizes within 1 standard deviation of the mean)maxUniqueDocuments
- the maximum number of unique documents that should be created globally.
A value of 1 means that all documents will be the same document;
10,000,000 will mean that there will be 10M unique text sequences used.forceBinaryStorage
- true to actually write the spoofed text data to the binary store
i.e. the physical underlying storage will contain the binary data, allowing
IO to be realistically stressed if that is a requirement. To save disk
space, set this value to false, which will see all file data get
generated on request using a repeatable algorithm.descriptionCount
- the number of cm:description multilingual entries to create. The current locale
is used for the first entry and additional locales are added using the
Java basic languages list
. The total count cannot
exceed the total number of languages available.
TODO: Note that the actual text stored is not (yet) localized.descriptionSize
- the size (in bytes) for each cm:description property created; values from 16 bytes to 1024 bytes are supportedFileNotFoundException
- if the folder path does not existIllegalStateException
- if the repository is not readyCopyright © 2005–2017 Alfresco Software. All rights reserved.