aboutsummaryrefslogtreecommitdiffstats
path: root/netx/net/sourceforge/jnlp/ResourcesDesc.java
diff options
context:
space:
mode:
authorJiri Vanek <[email protected]>2013-11-13 09:48:41 +0100
committerJiri Vanek <[email protected]>2013-11-13 09:48:41 +0100
commit1c0876d0d5afafdd6472fbb873a5472fb62adf0a (patch)
tree0892beb5c2ee2a377e65da4fb77f9bfa9bb0b3aa /netx/net/sourceforge/jnlp/ResourcesDesc.java
parent2a61c4b99672d8033b67ae8df8665c09e508941b (diff)
Enabled access to manifests' attributes from JNLPFile class, implemented http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/manifest.html#app_name
Diffstat (limited to 'netx/net/sourceforge/jnlp/ResourcesDesc.java')
-rw-r--r--netx/net/sourceforge/jnlp/ResourcesDesc.java29
1 files changed, 18 insertions, 11 deletions
diff --git a/netx/net/sourceforge/jnlp/ResourcesDesc.java b/netx/net/sourceforge/jnlp/ResourcesDesc.java
index 42eec01..988c55b 100644
--- a/netx/net/sourceforge/jnlp/ResourcesDesc.java
+++ b/netx/net/sourceforge/jnlp/ResourcesDesc.java
@@ -67,23 +67,30 @@ public class ResourcesDesc {
return resources.toArray(new JREDesc[resources.size()]);
}
- /**
- * Returns the main JAR for these resources. There first JAR
- * is returned if no JARs are specified as the main JAR, and if
- * there are no JARs defined then null is returned.
- */
- public JARDesc getMainJAR() {
- JARDesc jars[] = getJARs();
+ public static JARDesc getMainJAR(JARDesc jars[] ) {
+ return getMainJAR(Arrays.asList(jars));
+ }
+ public static JARDesc getMainJAR(List<JARDesc> jars) {
for (JARDesc jar : jars) {
- if (jar.isMain())
+ if (jar.isMain()) {
return jar;
+ }
}
- if (jars.length > 0)
- return jars[0];
- else
+ if (jars.size() > 0) {
+ return jars.get(0);
+ } else {
return null;
+ }
+ }
+ /**
+ * Returns the main JAR for these resources. There first JAR
+ * is returned if no JARs are specified as the main JAR, and if
+ * there are no JARs defined then null is returned.
+ */
+ public JARDesc getMainJAR() {
+ return getMainJAR(getJARs());
}
/**