File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
src/main/java/org/scijava/util Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 3131
3232package org .scijava .util ;
3333
34+ import java .io .File ;
35+ import java .io .FileNotFoundException ;
3436import java .io .IOException ;
3537import java .net .JarURLConnection ;
3638import java .net .URL ;
@@ -134,13 +136,16 @@ public Map<Object, Object> getAll() {
134136 /** Gets the JAR manifest associated with the given class. */
135137 public static Manifest getManifest (final Class <?> c ) {
136138 try {
137- // try to grab manifest from the JAR
138- final URL location = new URL ("jar:" + ClassUtils .getLocation (c ) + "!/" );
139- return new Manifest (((JarURLConnection )location .openConnection ()).getManifest ());
139+ return getManifest (new URL ("jar:" + ClassUtils .getLocation (c ) + "!/" ));
140140 }
141141 catch (final IOException e ) {
142142 return null ;
143143 }
144144 }
145145
146+ private static Manifest getManifest (final URL jarURL ) throws IOException {
147+ final JarURLConnection conn = (JarURLConnection ) jarURL .openConnection ();
148+ return new Manifest (conn .getManifest ());
149+ }
150+
146151}
You can’t perform that action at this time.
0 commit comments