Get the entry name; it should be the same as specified on URL : JarURLConnection « Network « Java Tutorial






import java.net.JarURLConnection;
import java.net.URL;

public class Main {
  public static void main(String[] argv) throws Exception {
    URL url = new URL("jar:file:/c://my.jar!/");
    JarURLConnection conn = (JarURLConnection) url.openConnection();

    String entryName = conn.getEntryName();
  }
}








19.27.JarURLConnection
19.27.1.Get the entry name; it should be the same as specified on URL
19.27.2.When no entry is specified on the URL, the entry name is null