Package com.dnanexus

Class DXContainer

  • Direct Known Subclasses:
    DXProject

    public class DXContainer
    extends DXObject
    A container (a logical collection for storage and organization of data).
    • Method Detail

      • getInstance

        public static DXContainer getInstance​(String projectOrContainerId)
        Returns a DXProject or DXContainer associated with an existing project or container.
        Parameters:
        projectOrContainerId - String starting with "container-" or "project-"
        Returns:
        DXProject or DXContainer
        Throws:
        NullPointerException - if projectOrContainerId is null
      • getInstanceWithEnvironment

        public static DXContainer getInstanceWithEnvironment​(String projectOrContainerId,
                                                             DXEnvironment env)
        Returns a DXProject or DXContainer associated 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:
        DXProject or DXContainer
        Throws:
        NullPointerException - if projectOrContainerId or env is 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 moved
        folders - 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 moved
        destinationFolder - 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 FolderContents giving the contents of the specified folder