Class File

    • Field Detail

      • IDENTIFIER_FIELD

        public static final java.lang.String IDENTIFIER_FIELD
        See Also:
        Constant Field Values
      • ADMINISTRATIVE_AGREEMENT_FIELD

        public static final java.lang.String ADMINISTRATIVE_AGREEMENT_FIELD
        See Also:
        Constant Field Values
      • PUBLISHER_AUTHORITY_FIELD

        public static final java.lang.String PUBLISHER_AUTHORITY_FIELD
        See Also:
        Constant Field Values
      • EMBARGO_DATE_FIELD

        public static final java.lang.String EMBARGO_DATE_FIELD
        See Also:
        Constant Field Values
      • LICENSE_MAP

        public static final java.util.Map<java.lang.String,​java.net.URI> LICENSE_MAP
      • logger

        public static final org.slf4j.Logger logger
    • Constructor Detail

      • File

        protected File​(java.util.UUID identifier,
                       java.lang.String name,
                       java.lang.String mimeType,
                       java.lang.Long size,
                       java.lang.Object license,
                       boolean administrativeAgreement,
                       boolean publisherAuthority,
                       java.time.Instant embargoDate)
        Constructor for no.unit.nva.file.model.File objects. A file object is valid if it has a license or is explicitly marked as an administrative agreement.
        Parameters:
        identifier - A UUID that identifies the file in storage
        name - The original name of the file
        mimeType - The mimetype of the file
        size - The size of the file
        license - The license for the file, may be null if and only if the file is an administrative agreement
        administrativeAgreement - True if the file is an administrative agreement
        publisherAuthority - True if the file owner has publisher authority
        embargoDate - The date after which the file may be published
    • Method Detail

      • validate

        public void validate()
        Validate the file.
      • getIdentifier

        public java.util.UUID getIdentifier()
      • getName

        public java.lang.String getName()
      • getMimeType

        public java.lang.String getMimeType()
      • getSize

        public java.lang.Long getSize()
      • getLicense

        public java.net.URI getLicense()
      • isAdministrativeAgreement

        public boolean isAdministrativeAgreement()
      • isPublisherAuthority

        public boolean isPublisherAuthority()
      • getEmbargoDate

        public java.util.Optional<java.time.Instant> getEmbargoDate()
      • fileDoesNotHaveActiveEmbargo

        public boolean fileDoesNotHaveActiveEmbargo()
      • isVisibleForNonOwner

        public abstract boolean isVisibleForNonOwner()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object