-
Notifications
You must be signed in to change notification settings - Fork 0
/
PdfResource.java
75 lines (62 loc) · 1.69 KB
/
PdfResource.java
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
package com.dynamicpdf.api;
import java.io.InputStream;
/**
* Represents a pdf resource.
*/
public class PdfResource extends Resource {
private ResourceType resourceType = ResourceType.PDF;
/**
* Initializes a new instance of the <code>PdfResource</code> class.
* @param filePath The pdf file path.
* @param resourceName The name of the resource.
*/
public PdfResource(String filePath, String resourceName) {
super(filePath, resourceName);
}
/**
* Initializes a new instance of the <code>PdfResource</code> class.
* @param filePath The pdf file path.
*/
public PdfResource(String filePath) {
super(filePath, null);
}
/**
* Initializes a new instance of the <code>PdfResource</code> class.
* @param value The byte array of the pdf file.
* @param resourceName The name of the resource.
*/
public PdfResource(byte[] value, String resourceName) {
super(value, resourceName);
}
/**
* Initializes a new instance of the <code>PdfResource</code> class.
* @param value The byte array of the pdf file.
*/
public PdfResource(byte[] value) {
super(value, null);
}
/**
* Initializes a new instance of the <code>PdfResource</code> class.
* @param data The stream of the pdf file.
* @param resourceName The name of the resource.
*/
public PdfResource(InputStream data, String resourceName) {
super(data, resourceName);
}
/**
* Initializes a new instance of the <code>PdfResource</code> class.
* @param data The stream of the pdf file.
*/
public PdfResource(InputStream data) {
super(data, null);
}
ResourceType getType() {
return resourceType;
}
String getFileExtension() {
return ".pdf";
}
String getMimeType() {
return "application/pdf";
}
}