public class FileDataServiceImpl extends Object implements FileDataService, org.springframework.beans.factory.InitializingBean
FileDataService based on MongoDB.| Constructor and Description |
|---|
FileDataServiceImpl(org.springframework.data.mongodb.core.MongoTemplate mongo,
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 FileDataServiceImpl(org.springframework.data.mongodb.core.MongoTemplate mongo,
String collection)
public void afterPropertiesSet()
throws Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanExceptionpublic 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 © 2014. All rights reserved.