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.InitializingBean
Exception
public void createNewFileData(FileData fileData)
FileDataService
createNewFileData
in interface FileDataService
public long fileCount(String fileset)
FileDataService
fileCount
in interface FileDataService
public FileData findFile(String fileset, String remoteName)
FileDataService
findFile
in interface FileDataService
fileset
- the name of the filesetremoteName
- the name of the file in the remote storepublic void removeFile(String fileset, String remoteName)
FileDataService
removeFile
in interface FileDataService
fileset
- the name of the filesetremoteName
- the name of the file in the remote storepublic FileData getRandomFile(String fileset)
FileDataService
getRandomFile
in interface FileDataService
fileset
- the name of a dataset to choose a file frompublic FileData getRandomFile(String fileset, String extension)
FileDataService
getRandomFile
in interface FileDataService
fileset
- the name of a dataset to choose a file fromextension
- the extension e.g. 'txt'
Copyright © 2014. All rights reserved.