1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.vafer.jdeb.descriptors;
17
18 import java.io.IOException;
19 import java.io.InputStream;
20 import java.text.ParseException;
21
22 import org.vafer.jdeb.utils.VariableResolver;
23
24
25
26
27
28
29 public final class PackageDescriptor extends AbstractDescriptor {
30
31 private final static String[] keys = {
32 "Package",
33 "Source",
34 "Version",
35 "Section",
36 "Priority",
37 "Architecture",
38 "Essential",
39 "Depends",
40 "Pre-Depends",
41 "Recommends",
42 "Suggests",
43 "Breaks",
44 "Enhances",
45 "Conflicts",
46 "Provides",
47 "Replaces",
48 "Installed-Size",
49 "Maintainer",
50 "Description",
51 "Homepage",
52 };
53
54 private final static String[] mandatoryKeys = {
55 "Package",
56 "Version",
57 "Section",
58 "Priority",
59 "Architecture",
60 "Maintainer",
61 "Description"
62 };
63
64 public PackageDescriptor() {
65 this(null);
66 }
67
68 public PackageDescriptor( final VariableResolver pResolver ) {
69 super(pResolver);
70 }
71
72 public PackageDescriptor( final InputStream pInput, final VariableResolver pResolver ) throws IOException, ParseException {
73 this(pResolver);
74 parse(pInput);
75 }
76
77 public String[] getMandatoryKeys() {
78 return mandatoryKeys;
79 }
80
81 public String toString() {
82 return toString(keys);
83 }
84
85 }