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.maven.artifact.Artifact;
23 import org.codehaus.mojo.webstart.JnlpExtension;
24 import org.codehaus.mojo.webstart.dependency.filenaming.DependencyFilenameStrategy;
25
26 import java.util.Collections;
27 import java.util.List;
28 import java.util.Map;
29
30
31
32
33
34
35
36 public class ExtensionGeneratorConfig
37 extends AbstractGeneratorExtraConfigWithDeps
38 {
39
40 private final Map<JnlpExtension, List<Artifact>> extensionsJnlpArtifacts;
41
42 private final JnlpExtension extension;
43
44 private final String codebase;
45
46 public ExtensionGeneratorConfig( String libPath, boolean pack200, boolean outputJarVersions,
47 boolean useUniqueVersions, Artifact artifactWithMainClass,
48 DependencyFilenameStrategy dependencyFilenameStrategy,
49 Map<JnlpExtension, List<Artifact>> extensionsJnlpArtifacts, String codebase,
50 JnlpExtension extension )
51 {
52 super( libPath, pack200, outputJarVersions, useUniqueVersions, artifactWithMainClass, dependencyFilenameStrategy );
53 this.extensionsJnlpArtifacts = extensionsJnlpArtifacts;
54 this.extension = extension;
55 this.codebase = codebase;
56 }
57
58 public JnlpExtension getExtension()
59 {
60 return extension;
61 }
62
63 public String getCodebase()
64 {
65 return codebase;
66 }
67
68 public List<Artifact> getExtensionJnlpArtifacts( JnlpExtension extension )
69 {
70 return extensionsJnlpArtifacts.get( extension );
71 }
72
73
74
75
76 public String getJnlpSpec()
77 {
78
79
80 if ( extension.getSpec() != null )
81 {
82 return extension.getSpec();
83 }
84 return "1.0+";
85 }
86
87
88
89
90 public String getOfflineAllowed()
91 {
92 if ( extension.getOfflineAllowed() != null )
93 {
94 return extension.getOfflineAllowed();
95 }
96 return "false";
97 }
98
99
100
101
102 public String getAllPermissions()
103 {
104 if ( extension.getAllPermissions() != null )
105 {
106 return extension.getAllPermissions();
107 }
108 return "true";
109 }
110
111
112
113
114 public String getJ2seVersion()
115 {
116 if ( extension.getJ2seVersion() != null )
117 {
118 return extension.getJ2seVersion();
119 }
120 return "1.5+";
121 }
122
123
124
125
126 public String getJnlpCodeBase()
127 {
128 return codebase;
129 }
130
131
132
133
134 public Map<String, String> getProperties()
135 {
136 return Collections.emptyMap();
137 }
138 }