public class FileDataServiceImpl extends Object implements FileDataService, org.springframework.beans.factory.InitializingBean
FileDataService based on MongoDB.| Modifier and Type | Field and Description |
|---|---|
static String |
FIELD_ENCODING |
static String |
FIELD_EXTENSION |
static String |
FIELD_FILESET |
static String |
FIELD_LOCAL_NAME |
static String |
FIELD_LOCALE |
static String |
FIELD_RANDOMIZER |
static String |
FIELD_REMOTE_NAME |
static String |
FIELD_SIZE |
| Constructor and Description |
|---|
FileDataServiceImpl(com.mongodb.DB db,
String collection) |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
void |
createNewFileData(FileData fileData)
Insert new data about a file
|
long |
fileCount(String fileset)
Get the number of files in a given fileset
|
FileData |
findFile(String fileset,
String remoteName)
Find a specific file based on the file name in the remote store
|
FileData |
getRandomFile(String fileset)
Get a random file description from a given dataset
|
FileData |
getRandomFile(String fileset,
String extension)
Get a random file description from a given dataset and with the given file extension
|
void |
removeFile(String fileset,
String remoteName)
Remove a specific file index based on the file name in the remote store
|
public static final String FIELD_FILESET
public static final String FIELD_REMOTE_NAME
public static final String FIELD_LOCAL_NAME
public static final String FIELD_EXTENSION
public static final String FIELD_ENCODING
public static final String FIELD_LOCALE
public static final String FIELD_SIZE
public static final String FIELD_RANDOMIZER
public FileDataServiceImpl(com.mongodb.DB db,
String collection)
public void afterPropertiesSet()
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanpublic void createNewFileData(FileData fileData)
FileDataServicecreateNewFileData in interface FileDataServicepublic long fileCount(String fileset)
FileDataServicefileCount in interface FileDataServicepublic FileData findFile(String fileset, String remoteName)
FileDataServicefindFile in interface FileDataServicefileset - the name of the filesetremoteName - the name of the file in the remote storepublic void removeFile(String fileset, String remoteName)
FileDataServiceremoveFile in interface FileDataServicefileset - the name of the filesetremoteName - the name of the file in the remote storepublic FileData getRandomFile(String fileset)
FileDataServicegetRandomFile in interface FileDataServicefileset - the name of a dataset to choose a file frompublic FileData getRandomFile(String fileset, String extension)
FileDataServicegetRandomFile in interface FileDataServicefileset - the name of a dataset to choose a file fromextension - the extension e.g. 'txt'Copyright © 2005–2018 Alfresco Software. All rights reserved.