1 package org.codehaus.mojo.webstart.generator;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import org.apache.commons.collections.CollectionUtils;
23 import org.apache.maven.artifact.Artifact;
24 import org.codehaus.mojo.webstart.JnlpConfig;
25 import org.codehaus.mojo.webstart.JnlpExtension;
26 import org.codehaus.mojo.webstart.dependency.filenaming.DependencyFilenameStrategy;
27
28 import java.util.Collection;
29 import java.util.List;
30 import java.util.Map;
31
32
33
34
35
36
37
38
39
40 public class GeneratorConfig
41 extends AbstractGeneratorExtraConfigWithDeps
42 {
43
44 private final Collection<Artifact> packagedJnlpArtifacts;
45
46 private final List<JnlpExtension> jnlpExtensions;
47
48 private final String codebase;
49
50 private final JnlpConfig jnlp;
51
52 public GeneratorConfig( String libPath, boolean pack200, boolean outputJarVersions,
53 boolean useUniqueVersions, Artifact artifactWithMainClass,
54 DependencyFilenameStrategy dependencyFilenameStrategy,
55 Collection<Artifact> packagedJnlpArtifacts, List<JnlpExtension> jnlpExtensions,
56 String codebase, JnlpConfig jnlp )
57 {
58 super( libPath, pack200, outputJarVersions, useUniqueVersions, artifactWithMainClass, dependencyFilenameStrategy );
59
60 this.packagedJnlpArtifacts = packagedJnlpArtifacts;
61 this.jnlpExtensions = jnlpExtensions;
62 this.codebase = codebase;
63 this.jnlp = jnlp;
64 }
65
66
67
68
69 public Collection<Artifact> getPackagedJnlpArtifacts()
70 {
71 return packagedJnlpArtifacts;
72 }
73
74 public List<JnlpExtension> getJnlpExtensions()
75 {
76 return jnlpExtensions;
77 }
78
79 public boolean hasJnlpExtensions()
80 {
81 return CollectionUtils.isNotEmpty( jnlpExtensions );
82 }
83
84
85
86
87 public String getJnlpSpec()
88 {
89
90
91 if ( jnlp.getSpec() != null )
92 {
93 return jnlp.getSpec();
94 }
95 return "1.0+";
96 }
97
98
99
100
101 public String getOfflineAllowed()
102 {
103 if ( jnlp.getOfflineAllowed() != null )
104 {
105 return jnlp.getOfflineAllowed();
106 }
107 return "false";
108 }
109
110
111
112
113 public String getAllPermissions()
114 {
115 if ( jnlp.getAllPermissions() != null )
116 {
117 return jnlp.getAllPermissions();
118 }
119 return "true";
120 }
121
122
123
124
125 public String getJ2seVersion()
126 {
127 if ( jnlp.getJ2seVersion() != null )
128 {
129 return jnlp.getJ2seVersion();
130 }
131 return "1.5+";
132 }
133
134
135
136
137 public String getJnlpCodeBase()
138 {
139 return codebase;
140 }
141
142
143
144
145 public Map<String, String> getProperties()
146 {
147 return jnlp.getProperties();
148 }
149 }