List of usage examples for java.net JarURLConnection getMainAttributes
public Attributes getMainAttributes() throws IOException
From source file:Main.java
public static void main(String[] argv) throws Exception { URL url = new URL("jar:file:/c://my.jar!/"); JarURLConnection conn = (JarURLConnection) url.openConnection(); Attributes attrs = conn.getMainAttributes(); System.out.println(attrs.isEmpty()); }
From source file:JarClassLoader.java
public String getMainClassName() throws IOException { URL u = new URL("jar", "", url + "!/"); JarURLConnection uc = (JarURLConnection) u.openConnection(); Attributes attr = uc.getMainAttributes(); return attr != null ? attr.getValue(Attributes.Name.MAIN_CLASS) : null; }
From source file:org.hyperic.util.PluginLoader.java
public static String getPluginMainClass(URL url) throws Exception { JarURLConnection jarConn = (JarURLConnection) url.openConnection(); Attributes attrs = jarConn.getMainAttributes(); String pluginName = attrs.getValue(Attributes.Name.MAIN_CLASS); return pluginName; }