JarURLConnection

In this chapter you will learn:

  1. Get the entry name

Get the entry name

import java.net.JarURLConnection;
import java.net.URL;
// ja v  a 2 s.co  m
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();
  }
}

Next chapter...

What you will learn in the next chapter:

  1. How to encode space for URL
  2. Encode % percentage for URL
  3. Encode plus sign for URL
  4. URLEncoder: slashes
  5. Encode symbols for URL
Home » Java Tutorial » URL URI
URL
URL Creation
URL for jar file
URL Components
Convert file path to URL
URL Relative
URL Protocol
Read from URL
Compare URL
URLConnection
HTTP Header
URLConnection Post
Cookie
URLConnection Read
HttpURLConnection
HttpURLConnection Properties
HttpURLConnection proxy
HttpURLConnection Authenticator
HTTPS
JarURLConnection
Encode a URL
Decode a URL
URI
URI Normalization
URI Resolution
URI Relativization
Convert URI to URL
IP Address
IP Ping
NetworkInterface