Class FileMetadata
java.lang.Object
org.c02e.jpgpj.FileMetadata
Optional PGP message metadata.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumFormat for line-ending normalization.static classSignature found by decryptor. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final FileMetadata.Formatstatic final Stringprivate FileMetadata.Formatprivate longprivate longprivate Stringprivate final List<FileMetadata.Signature> private final Ring -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a metadata object with default values.FileMetadata(File file) Constructs a metadata object from a file.FileMetadata(String name) Constructs a metadata object with the specified file name .FileMetadata(String name, FileMetadata.Format format) Constructs a metadata object with the specified file name and line-ending format.FileMetadata(String name, FileMetadata.Format format, long length, long lastModified) Constructs a metadata object with the specified file name, line-ending format, length in bytes, and modified date in ms since the epoch.FileMetadata(Path file) Constructs a metadata object from a file.FileMetadata(org.bouncycastle.openpgp.PGPLiteralData data) Constructs a metadata object from Bouncy Castle message data. -
Method Summary
Modifier and TypeMethodDescriptionbooleanlonglonggetName()Signatures found on the file, including unverified signatures.intPGP code for the signature type appropriate for the line-ending format of the original file.Keys that signed the file with a verified signature.inthashCode()voidvoidvoidvoidsetLastModified(long x) voidsetLength(long x) voidtoString()withLastModified(long x) withLength(long x)
-
Field Details
-
DEFAULT_NAME
- See Also:
-
DEFAULT_FORMAT
-
name
-
format
-
length
private long length -
lastModified
private long lastModified -
signatures
-
verified
-
-
Constructor Details
-
FileMetadata
public FileMetadata()Constructs a metadata object with default values. -
FileMetadata
public FileMetadata(org.bouncycastle.openpgp.PGPLiteralData data) Constructs a metadata object from Bouncy Castle message data. -
FileMetadata
Constructs a metadata object from a file. -
FileMetadata
Constructs a metadata object from a file. -
FileMetadata
Constructs a metadata object with the specified file name . -
FileMetadata
Constructs a metadata object with the specified file name and line-ending format. -
FileMetadata
Constructs a metadata object with the specified file name, line-ending format, length in bytes, and modified date in ms since the epoch.
-
-
Method Details
-
getName
-
setName
-
withName
- See Also:
-
getLength
public long getLength()- Returns:
- Original file length in bytes, or 0.
-
setLength
public void setLength(long x) - Parameters:
x- Original file length in bytes, or 0.
-
withLength
- See Also:
-
getLastModified
public long getLastModified()- Returns:
- Original file modified date in ms since epoch, or 0.
-
setLastModified
public void setLastModified(long x) - Parameters:
x- Original file modified date in ms since epoch, or 0.
-
withLastModified
- See Also:
-
getLastModifiedDate
- Returns:
- Original file modified date, or date of the epoch.
- See Also:
-
getFormat
- Returns:
- Original file format, or binary.
-
setFormat
- Parameters:
x- Original file format, orDEFAULT_FORMATifnull.
-
withFormat
- See Also:
-
getVerified
Keys that signed the file with a verified signature. If a specific userid was included in a key's signature (such as "Alice <alice@example.com>"), it will be available via the key'sKey.getSigningUid()method. -
getSignatures
Signatures found on the file, including unverified signatures. -
setFile
- Parameters:
file- OriginalFilefrom which to extract the metadata - ignored ifnullDoes not extractFileMetadata.Formatmetadata.
-
setFile
- Parameters:
file- OriginalPathfrom which to extract the metadata - ignored ifnullDoes not extractFileMetadata.Formatmetadata.
-
withFile
- See Also:
-
withFile
- See Also:
-
getSignatureType
public int getSignatureType()PGP code for the signature type appropriate for the line-ending format of the original file. -
hashCode
-
equals
-
toString
-