Package no.unit.nva.model
Class File
- java.lang.Object
-
- no.unit.nva.model.File
-
public class File extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFile.Builder
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringMISSING_LICENSE
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)java.time.InstantgetEmbargoDate()java.util.UUIDgetIdentifier()LicensegetLicense()java.lang.StringgetMimeType()java.lang.StringgetName()java.lang.LonggetSize()inthashCode()booleanisAdministrativeAgreement()booleanisPublisherAuthority()voidvalidate()Validate the file.
-
-
-
Field Detail
-
MISSING_LICENSE
public static final java.lang.String MISSING_LICENSE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
File
public File(java.util.UUID identifier, java.lang.String name, java.lang.String mimeType, java.lang.Long size, License license, boolean administrativeAgreement, boolean publisherAuthority, java.time.Instant embargoDate)Constructor for File objects. A file object is valid if it has a license or is explicitly marked as being an administrative agreement.- Parameters:
identifier- A UUID that identifies the file in storagename- The original name of the filemimeType- The mimetype of the filesize- The size of the filelicense- The license for the file, may be null if and only if the file is an administrative agreementadministrativeAgreement- True if the file is an administrative agreementpublisherAuthority- True if the file owner has publisher authorityembargoDate- 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 License getLicense()
-
isAdministrativeAgreement
public boolean isAdministrativeAgreement()
-
isPublisherAuthority
public boolean isPublisherAuthority()
-
getEmbargoDate
public java.time.Instant getEmbargoDate()
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-