Class DataSet


  • public class DataSet
    extends java.lang.Object
    A class that provides uniform access to data set metadata (from the openBIS AS) and data (from the openBIS DSS).
    • Constructor Detail

      • DataSet

        protected DataSet()
      • DataSet

        public DataSet​(IOpenbisServiceFacade facade,
                       IDssComponent dssComponent,
                       DataSet metadata,
                       IDataSetDss dataSetDss)
        Constructor.
        Parameters:
        facade - The facade used to get access to the server.
        metadata - The metadata. May be null if not available at construction time.
        dataSetDss - The data. May be null if not available at construction time.
    • Method Detail

      • getProperties

        public java.util.HashMap<java.lang.String,​java.lang.String> getProperties()
        See Also:
        DataSet.getProperties()
      • getExternalDataManagementSystem

        public ch.systemsx.cisd.openbis.generic.shared.basic.dto.ExternalDataManagementSystem getExternalDataManagementSystem()
        See Also:
        DataSet.getExternalDataManagementSystem()
      • knowsContainer

        public boolean knowsContainer()
        Returns true, if result of getContainerOrNull() can be trusted and false, if it cannot be trusted because the server is too old to deliver this information.
      • getPrimaryDataSetOrNull

        public DataSet getPrimaryDataSetOrNull()
        Returns the primary data set. For a non-container data set, this is itself. For a container data set, this is the one contained data set that is considered primary.
        Returns:
        The data set that is considered primary, or null if the primary data set cannot be determined.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
        See Also:
        DataSet.hashCode()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
        See Also:
        DataSet.toString()
      • listFiles

        public FileInfoDssDTO[] listFiles​(java.lang.String startPath,
                                          boolean isRecursive)
                                   throws java.lang.IllegalArgumentException,
                                          ch.systemsx.cisd.common.exceptions.InvalidSessionException
        Parameters:
        startPath -
        isRecursive -
        Throws:
        java.lang.IllegalArgumentException
        ch.systemsx.cisd.common.exceptions.InvalidSessionException
        See Also:
        IDataSetDss.listFiles(java.lang.String, boolean)
      • getFile

        public java.io.InputStream getFile​(java.lang.String path)
                                    throws java.lang.IllegalArgumentException,
                                           ch.systemsx.cisd.common.exceptions.InvalidSessionException
        Parameters:
        path -
        Throws:
        java.lang.IllegalArgumentException
        ch.systemsx.cisd.common.exceptions.InvalidSessionException
        See Also:
        IDataSetDss.getFile(java.lang.String)
      • tryLinkToContents

        public java.io.File tryLinkToContents​(java.lang.String overrideStoreRootPathOrNull)
                                       throws java.lang.IllegalArgumentException,
                                              ch.systemsx.cisd.common.exceptions.InvalidSessionException
        Parameters:
        overrideStoreRootPathOrNull -
        Throws:
        java.lang.IllegalArgumentException
        ch.systemsx.cisd.common.exceptions.InvalidSessionException
        See Also:
        IDataSetDss.tryLinkToContents(java.lang.String)
      • getLinkOrCopyOfContents

        public java.io.File getLinkOrCopyOfContents​(java.lang.String overrideStoreRootPathOrNull,
                                                    java.io.File downloadDir)
                                             throws java.lang.IllegalArgumentException,
                                                    ch.systemsx.cisd.common.exceptions.InvalidSessionException
        Parameters:
        overrideStoreRootPathOrNull -
        downloadDir -
        Throws:
        java.lang.IllegalArgumentException
        ch.systemsx.cisd.common.exceptions.InvalidSessionException
        See Also:
        IDataSetDss.getLinkOrCopyOfContents(java.lang.String, java.io.File)
      • getLinkOrCopyOfContent

        public java.io.File getLinkOrCopyOfContent​(java.lang.String overrideStoreRootPathOrNull,
                                                   java.io.File downloadDir,
                                                   java.lang.String pathInDataSet)
                                            throws java.lang.IllegalArgumentException,
                                                   ch.systemsx.cisd.common.exceptions.InvalidSessionException
        Parameters:
        overrideStoreRootPathOrNull -
        downloadDir -
        pathInDataSet -
        Throws:
        java.lang.IllegalArgumentException
        ch.systemsx.cisd.common.exceptions.InvalidSessionException
        See Also:
        IDataSetDss.getLinkOrCopyOfContent(java.lang.String, java.io.File, java.lang.String)
      • getSessionURLForFile

        public java.lang.String getSessionURLForFile​(java.lang.String path)
                                              throws java.lang.IllegalArgumentException,
                                                     ch.systemsx.cisd.common.exceptions.InvalidSessionException
        Throws:
        java.lang.IllegalArgumentException
        ch.systemsx.cisd.common.exceptions.InvalidSessionException
        See Also:
        IDataSetDss.getSessionURLForFile(java.lang.String)
      • getURLForFileWithTimeout

        public java.lang.String getURLForFileWithTimeout​(java.lang.String path,
                                                         long validityDurationInSeconds)
                                                  throws java.lang.IllegalArgumentException,
                                                         ch.systemsx.cisd.common.exceptions.InvalidSessionException
        Throws:
        java.lang.IllegalArgumentException
        ch.systemsx.cisd.common.exceptions.InvalidSessionException
        See Also:
        IDataSetDss.getURLForFileWithTimeout(String, long)
      • tryGetInternalPathInDataStore

        public java.lang.String tryGetInternalPathInDataStore()
      • getDataSetDss

        public IDataSetDss getDataSetDss()
        Internal accessor, made public for testing, but clients should not need it.