public class ArvadosFacade
extends java.lang.Object
| Constructor and Description |
|---|
ArvadosFacade() |
ArvadosFacade(ConfigProvider config) |
| Modifier and Type | Method and Description |
|---|---|
Collection |
createEmptyCollection(java.lang.String collectionName,
java.lang.String projectUuid)
Creates and uploads new empty collection to specified project.
|
Group |
createNewProject(java.lang.String projectName)
Creates new project that will be a subproject of "home" for current user.
|
Collection |
deleteCollection(java.lang.String collectionUuid)
Deletes collection with specified uuid.
|
java.util.List<java.io.File> |
downloadCollectionFiles(java.lang.String collectionUuid,
java.lang.String pathToDownloadFolder,
boolean usingKeepWeb)
This method downloads all files from collection.
|
java.io.File |
downloadFile(java.lang.String filePathName,
java.lang.String collectionUuid,
java.lang.String pathToDownloadFolder)
This method downloads single file from collection using Arvados Keep-Web.
|
CollectionList |
getCollectionsFromProjectByName(java.lang.String collectionName,
java.lang.String projectUuid)
Filters all collections from selected project and returns list of those that contain passed String in their name.
|
User |
getCurrentUser()
Returns current user information based on Api Token provided via configuration
|
Group |
getProjectByUuid(java.lang.String projectUuid)
Gets project details by uuid.
|
java.util.List<FileToken> |
listFileInfoFromCollection(java.lang.String collectionUuid)
Lists all FileTokens (objects containing information about files) for
specified collection.
|
GroupList |
showGroupsAccessibleByCurrentUser()
Gets uuid of current user based on api Token provided in configuration and uses it to list all
projects that this user has read access to in Arvados.
|
GroupList |
showGroupsOwnedByCurrentUser()
Gets uuid of current user based on api Token provided in configuration and uses it to list all
projects that this user owns in Arvados.
|
Collection |
upload(java.io.File file)
Creates and uploads new collection containing a single file.
|
Collection |
upload(java.util.List<java.io.File> files)
Creates and uploads new collection containing passed files.
|
Collection |
upload(java.util.List<java.io.File> sourceFiles,
java.lang.String collectionName,
java.lang.String projectUuid)
Uploads new collection with specified name and containing selected files
to an existing project.
|
Collection |
uploadToExistingCollection(java.io.File file,
java.lang.String collectionUUID)
Uploads a file to a specified collection.
|
Collection |
uploadToExistingCollection(java.util.List<java.io.File> files,
java.lang.String collectionUUID)
Uploads multiple files to an existing collection.
|
public ArvadosFacade(ConfigProvider config)
public ArvadosFacade()
public java.io.File downloadFile(java.lang.String filePathName,
java.lang.String collectionUuid,
java.lang.String pathToDownloadFolder)
filePathName - path to the file in collection. If requested file is stored
directly in collection (not within its subdirectory) this
would be just the name of file (ex. 'file.txt').
Otherwise full file path must be passed (ex. 'folder/file.txt')collectionUuid - uuid of collection containing requested filepathToDownloadFolder - path to location in which file should be saved.
Passed location must be a directory in which file of
that name does not already exist.public java.util.List<java.io.File> downloadCollectionFiles(java.lang.String collectionUuid,
java.lang.String pathToDownloadFolder,
boolean usingKeepWeb)
collectionUuid - uuid of collection from which files are downloadedpathToDownloadFolder - path to location in which files should be saved.
New folder named by collection uuid, containing
downloaded files, is created in this location.
Passed location must be a directory in which folder
of that name does not already exist.usingKeepWeb - if set to true files will be downloaded using Keep Web.
If set to false files will be downloaded using Keep Server API.public java.util.List<FileToken> listFileInfoFromCollection(java.lang.String collectionUuid)
collectionUuid - uuid of collection for which FileTokens are listedpublic Collection upload(java.util.List<java.io.File> files)
files - list of files to be uploaded within new collectionupload(List, String, String)public Collection upload(java.io.File file)
file - file to be uploadedupload(List, String, String)public Collection upload(java.util.List<java.io.File> sourceFiles, java.lang.String collectionName, java.lang.String projectUuid)
sourceFiles - list of files to be uploaded within new collectioncollectionName - name for the newly created collection.
Collection with that name cannot be already created
in specified project. If null is passed
then collection name is set to default, containing
phrase 'New Collection' and a timestamp.projectUuid - uuid of the project in which created collection is to be included.
If null is passed then collection is uploaded to user's 'Home' project.public Collection uploadToExistingCollection(java.io.File file, java.lang.String collectionUUID)
file - file to be uploaded to existing collection. Filenames must be unique
in comparison with files already existing within collection.collectionUUID - UUID of collection to which files should be uploadeduploadToExistingCollection(List, String)public Collection uploadToExistingCollection(java.util.List<java.io.File> files, java.lang.String collectionUUID)
files - list of files to be uploaded to existing collection.
File names must be unique - both within passed list and
in comparison with files already existing within collection.collectionUUID - UUID of collection to which files should be uploadedpublic Collection createEmptyCollection(java.lang.String collectionName, java.lang.String projectUuid)
collectionName - name for the newly created collection.
Collection with that name cannot be already created
in specified project.projectUuid - uuid of project that will contain uploaded empty collection.
To select home project pass current user's uuid from getCurrentUser()getCurrentUser()public User getCurrentUser()
public GroupList showGroupsOwnedByCurrentUser()
getCurrentUser()public GroupList showGroupsAccessibleByCurrentUser()
public CollectionList getCollectionsFromProjectByName(java.lang.String collectionName, java.lang.String projectUuid)
collectionName - collections containing this param in their name will be returned.
Passing a wildcard is possible - for example passing "a%" searches for
all collections starting with "a".projectUuid - uuid of project in which will be searched for collections with given name. To search home
project provide user uuid (from getCurrentUser())getCurrentUser()public Group getProjectByUuid(java.lang.String projectUuid)
projectUuid - uuid of projectpublic Group createNewProject(java.lang.String projectName)
projectName - name for the newly created projectpublic Collection deleteCollection(java.lang.String collectionUuid)
collectionUuid - uuid of collection to be deleted. User whose token is provided in configuration
must be authorized to delete such collection.