Package com.dnanexus
Class DXContainer
- java.lang.Object
-
- com.dnanexus.DXObject
-
- com.dnanexus.DXContainer
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDXContainer.FolderContentsRepresents the contents of a folder.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DXContainergetInstance(String projectOrContainerId)Returns aDXProjectorDXContainerassociated with an existing project or container.static DXContainergetInstanceWithEnvironment(String projectOrContainerId, DXEnvironment env)Returns aDXProjectorDXContainerassociated with an existing project or container, using the specified environment.DXContainer.FolderContentslistFolder(String folderPath)Lists the data objects and subfolders inside the specified folder.voidmove(List<? extends DXDataObject> objects, List<String> folders, String destinationFolder)Moves the specified data objects and folders to a destination folder in the same container.voidmoveFolders(List<String> folders, String destinationFolder)Moves the specified folders to a destination folder in the same container.voidmoveObjects(List<? extends DXDataObject> objects, String destinationFolder)Moves the specified data objects to a destination folder in the same container.voidnewFolder(String folderPath)Creates the specified folder.voidnewFolder(String folderPath, boolean parents)Creates the specified folder, optionally creating parent folders as well.voidremoveFolder(String folderPath)Removes the specified folder.voidremoveFolder(String folderPath, boolean recurse)Removes the specified folder, optionally removing all subfolders as well.voidremoveObjects(List<? extends DXDataObject> objects)Removes the specified objects from the container.voidrenameFolder(String folderPath, String name)Renames the specified folder.-
Methods inherited from class com.dnanexus.DXObject
apiCallOnObject, apiCallOnObject, equals, getId, hashCode, toString
-
-
-
-
Method Detail
-
getInstance
public static DXContainer getInstance(String projectOrContainerId)
Returns aDXProjectorDXContainerassociated with an existing project or container.- Parameters:
projectOrContainerId- String starting with"container-"or"project-"- Returns:
DXProjectorDXContainer- Throws:
NullPointerException- ifprojectOrContainerIdis null
-
getInstanceWithEnvironment
public static DXContainer getInstanceWithEnvironment(String projectOrContainerId, DXEnvironment env)
Returns aDXProjectorDXContainerassociated with an existing project or container, using the specified environment.- Parameters:
projectOrContainerId- String starting with"container-"or"project-"env- environment to use to make subsequent API requests- Returns:
DXProjectorDXContainer- Throws:
NullPointerException- ifprojectOrContainerIdorenvis null
-
move
public void move(List<? extends DXDataObject> objects, List<String> folders, String destinationFolder)
Moves the specified data objects and folders to a destination folder in the same container.- Parameters:
objects- data objects to be movedfolders- full paths to the folders to be moved (Strings starting with"/")destinationFolder- full path to the destination folder (a String starting with"/")
-
moveFolders
public void moveFolders(List<String> folders, String destinationFolder)
Moves the specified folders to a destination folder in the same container.- Parameters:
folders- full paths to the folders to be moved (Strings starting with"/")destinationFolder- full path to the destination folder (a String starting with"/")
-
moveObjects
public void moveObjects(List<? extends DXDataObject> objects, String destinationFolder)
Moves the specified data objects to a destination folder in the same container.- Parameters:
objects- data objects to be moveddestinationFolder- full path to the destination folder (A String starting with"/")
-
newFolder
public void newFolder(String folderPath)
Creates the specified folder.- Parameters:
folderPath- full path to the folder to be created (a String starting with"/")
-
newFolder
public void newFolder(String folderPath, boolean parents)
Creates the specified folder, optionally creating parent folders as well.- Parameters:
folderPath- full path to the folder to be created (a String starting with"/")parents- if true, create all parent folders of the requested path
-
renameFolder
public void renameFolder(String folderPath, String name)
Renames the specified folder.This method renames a folder in the same parent folder (i.e. only changes its basename).
- Parameters:
folderPath- full path to the folder being renamed (a String starting with"/")name- new basename for the folder
-
removeFolder
public void removeFolder(String folderPath)
Removes the specified folder.- Parameters:
folderPath- path to the folder to be removed (String starting with"/")
-
removeFolder
public void removeFolder(String folderPath, boolean recurse)
Removes the specified folder, optionally removing all subfolders as well.- Parameters:
folderPath- full path to the folder to be removed (a String starting with"/")recurse- if true, deletes all objects and subfolders in the folder as well
-
removeObjects
public void removeObjects(List<? extends DXDataObject> objects)
Removes the specified objects from the container.Removal propagates to hidden linked objects in the same container that are no longer reachable from any visible object.
- Parameters:
objects- List of objects to be removed
-
listFolder
public DXContainer.FolderContents listFolder(String folderPath)
Lists the data objects and subfolders inside the specified folder.- Parameters:
folderPath- full path to a folder (a String starting with"/")- Returns:
- a
FolderContentsgiving the contents of the specified folder
-
-