Class StreamDescriptor

    • Field Detail

      • UNKNOWN_MIME_TYPE

        public static final String UNKNOWN_MIME_TYPE
        Constant used to indicate unknown MIME types.
        See Also:
        Constant Field Values
    • Constructor Detail

      • StreamDescriptor

        public StreamDescriptor​(String mimeType)
      • StreamDescriptor

        public StreamDescriptor()
        Default constructor leaving everything uninitialized. The MIME-type will be set to "unknown/*".
      • StreamDescriptor

        public StreamDescriptor​(StreamDescriptor parent)
        Create a new StreamDescriptor with the given parent. The MIME-type will be set to "unknown/*".
        Parameters:
        parent - a StreamDescriptor that shall be associated as a parent
      • StreamDescriptor

        public StreamDescriptor​(String mimeType,
                                StreamDescriptor parent)
        Create a new StreamDescriptor with the given MIME-type and parent.
        Parameters:
        mimeType - a MIME-type
        parent - a StreamDescriptor that shall be associated as a parent
    • Method Detail

      • setMimeType

        public void setMimeType​(String mimeType)
        Set the Multipurpose Internet Mail Extension (MIME) type. The MIME-type is encoded as a String according to RFC 2045 and 2046. It may therefore be a simple type of the form "primary-type/sub-type" or contain parameters.
        Parameters:
        mimeType - a MIME-type
      • getMimeType

        public String getMimeType()
        Get the Multipurpose Internet Mail Extension (MIME) type. The MIME-type is encoded as a String according to RFC 2045 and 2046. It is therefore not guaranteed to be a simple type of the form "primary-type/sub-type".
        In order to obtain the type without any details, use getBaseType() .
        Returns:
        the MIME type as String
      • getBaseType

        public String getBaseType()
        Get the base MIME-type consisting of primary- and sub-type in the form "primary/sub". This is a convenience method and equivalent to calling getType().getBaseType().
        Returns:
        the base MIME type
      • getType

        public MimeType getType()
        Returns:
        the pre-parsed MIME type.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • getFileName

        public String getFileName()
        Get the original file name of the stream. May be null if no file name was provided.
        Returns:
        the filename associated with the stream
      • lookupFileName

        public String lookupFileName()
        Recursively lookup the FileName for this StreamDescriptor. If this instance doesn't have a FileName, try its parent until a FileName is found or the head of the descriptor hierarchy is encountered.
        Returns:
        filename of this stream or its ancestors
        See Also:
        getFileName()
      • lookupFileName

        public String lookupFileName​(int maxRecursion)
        Recursively lookup the FileName for this StreamDescriptor. If this instance doesn't have a FileName, try its parent until a FileName is found or the head of the descriptor hierarchy is encountered until the maximum level of recursion is reached.
        Parameters:
        maxRecursion - maximum level of recursion (i.e. number of ancestors). Value must be ≥ 0
        Returns:
        filename of this stream or its ancestors
        Since:
        jadice server 4.3.1.20
        See Also:
        getFileName()
      • setFileName

        public void setFileName​(String fileName)
        Set the original file name of the stream.
        Parameters:
        fileName - the file name to set
      • getId

        public String getId()
        Get the ID of the stream. This might be an archive ID, a MIME part ID etc.
        Returns:
        a logical ID
      • setId

        public void setId​(String id)
        Get the ID of the stream. This might be an archive ID, a MIME part ID etc.
        Parameters:
        id - a logical ID
      • getProperties

        public Map<String,​Serializable> getProperties()
        Get the Stream's extended properties. The stream properties may be derived from whatever meta-data is available about the stream. Most nodes will just shunt through this data.
        Returns:
        the Stream's properties
      • getUUID

        public String getUUID()
      • getDescription

        public String getDescription()
        Get the user-friendly description of the stream. If a non- null description was set, this is what is returned from this call. Otherwise an attempt will be made to return a reasonable description by using the fist non-null property from this list:
        1. getFileName()
        2. getId()
        3. getUUID()
        Returns:
        a user-friendly description
      • setDescription

        public void setDescription​(String description)
        Set the stream's (hopefully) user-friendly description.
        Parameters:
        description - a user-friendly description
      • setSemanticType

        public void setSemanticType​(String semanticType)
        Set the semantic type of the stream. The semantic type of a stream hints about the meaning of a stream. The content of this type is not defined. However, within a domain there should be an agreed-upon set of types.

        Examples:

        • email-message
        • email-attachment
        • archive
        • archive-content
        Parameters:
        semanticType - the semantic type to set