PDFEmbeddedFileInfo.java
5.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* com.adobe.internal.pdftoolkit.core.cos.CosDictionary
* com.adobe.internal.pdftoolkit.core.cos.CosObject
* com.adobe.internal.pdftoolkit.core.exceptions.PDFIOException
* com.adobe.internal.pdftoolkit.core.exceptions.PDFInvalidDocumentException
* com.adobe.internal.pdftoolkit.core.exceptions.PDFInvalidParameterException
* com.adobe.internal.pdftoolkit.core.exceptions.PDFSecurityException
* com.adobe.internal.pdftoolkit.core.types.ASDate
* com.adobe.internal.pdftoolkit.core.types.ASName
* com.adobe.internal.pdftoolkit.core.types.ASString
*/
package com.adobe.internal.pdftoolkit.pdf.document;
import com.adobe.internal.pdftoolkit.core.cos.CosDictionary;
import com.adobe.internal.pdftoolkit.core.cos.CosObject;
import com.adobe.internal.pdftoolkit.core.exceptions.PDFIOException;
import com.adobe.internal.pdftoolkit.core.exceptions.PDFInvalidDocumentException;
import com.adobe.internal.pdftoolkit.core.exceptions.PDFInvalidParameterException;
import com.adobe.internal.pdftoolkit.core.exceptions.PDFSecurityException;
import com.adobe.internal.pdftoolkit.core.types.ASDate;
import com.adobe.internal.pdftoolkit.core.types.ASName;
import com.adobe.internal.pdftoolkit.core.types.ASString;
import com.adobe.internal.pdftoolkit.pdf.document.PDFCosDictionary;
import com.adobe.internal.pdftoolkit.pdf.document.PDFCosObject;
import com.adobe.internal.pdftoolkit.pdf.document.PDFDocument;
import com.adobe.internal.pdftoolkit.pdf.document.PDFMacSpecificFileInfo;
public class PDFEmbeddedFileInfo
extends PDFCosDictionary {
private PDFEmbeddedFileInfo(CosObject cosObject) throws PDFInvalidDocumentException {
super(cosObject);
}
public static PDFEmbeddedFileInfo getInstance(CosObject cosObject) throws PDFInvalidDocumentException {
if (PDFCosObject.checkNullCosObject(cosObject) == null) {
return null;
}
PDFEmbeddedFileInfo pdfObject = PDFCosObject.getCachedInstance(cosObject, PDFEmbeddedFileInfo.class);
if (pdfObject == null) {
pdfObject = new PDFEmbeddedFileInfo(cosObject);
}
return pdfObject;
}
public static PDFEmbeddedFileInfo newInstance(PDFDocument pdfDocument, int size, ASDate creationDate, ASDate modificationDate) throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
CosDictionary cosObject = PDFCosObject.newCosDictionary(pdfDocument);
PDFEmbeddedFileInfo pdfObject = new PDFEmbeddedFileInfo((CosObject)cosObject);
pdfObject.setSize(size);
if (creationDate != null) {
pdfObject.setCreationDate(creationDate);
}
if (modificationDate != null) {
pdfObject.setModificationDate(modificationDate);
}
return pdfObject;
}
public boolean hasModificationDate() {
return this.getCosDictionary().containsKey((Object)ASName.k_ModDate);
}
public ASDate getModificationDate() throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
return this.hasModificationDate() ? this.getDictionaryDateValue(ASName.k_ModDate) : null;
}
public void setModificationDate(ASDate date) throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
this.setDictionaryDateValue(ASName.k_ModDate, date);
}
public boolean hasCreationDate() {
return this.getCosDictionary().containsKey((Object)ASName.k_CreationDate);
}
public ASDate getCreationDate() throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
return this.hasCreationDate() ? this.getDictionaryDateValue(ASName.k_CreationDate) : null;
}
public void setCreationDate(ASDate date) throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
this.setDictionaryDateValue(ASName.k_CreationDate, date);
}
public boolean hasChecksum() {
return this.getCosDictionary().containsKey((Object)ASName.k_CheckSum);
}
public ASString getCheckSum() throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
return this.hasChecksum() ? this.getCosDictionary().getString(ASName.k_CheckSum) : null;
}
public void setCheckSum(byte[] chk) throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
this.setDictionaryASStringValue(ASName.k_CheckSum, new ASString(chk));
}
public boolean hasSize() {
return this.getCosDictionary().containsKey((Object)ASName.k_Size);
}
public int getSize() throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
return this.getCosDictionary().getInt(ASName.k_Size);
}
public void setSize(String size) throws PDFInvalidDocumentException, PDFIOException, PDFInvalidParameterException, PDFSecurityException {
this.setDictionaryIntValue(ASName.k_Size, size);
}
public void setSize(int size) throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
this.setDictionaryIntValue(ASName.k_Size, size);
}
public PDFMacSpecificFileInfo getMac() throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
return PDFMacSpecificFileInfo.getInstance(this.getDictionaryCosObjectValue(ASName.k_Mac));
}
public void setMac(PDFMacSpecificFileInfo value) throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
this.setDictionaryValue(ASName.k_Mac, value);
}
public boolean hasMac() throws PDFInvalidDocumentException, PDFIOException, PDFSecurityException {
return this.dictionaryContains(ASName.k_Mac);
}
}