Package libcore.net.url
Class JarHandler
java.lang.Object
java.net.URLStreamHandler
libcore.net.url.JarHandler
public class JarHandler extends URLStreamHandler
-
Constructor Summary
Constructors Constructor Description JarHandler() -
Method Summary
Modifier and Type Method Description protected URLConnectionopenConnection(URL u)Returns a connection to the jar file pointed by thisURLin the file systemprotected voidparseURL(URL url, String spec, int start, int limit)Parses the clear text URL instrinto a URL object.protected StringtoExternalForm(URL url)Build and return the externalized string representation of url.Methods inherited from class java.net.URLStreamHandler
equals, getDefaultPort, getHostAddress, hashCode, hostsEqual, openConnection, sameFile, setURL, setURL
-
Constructor Details
-
JarHandler
public JarHandler()
-
-
Method Details
-
openConnection
Returns a connection to the jar file pointed by thisURLin the file system- Specified by:
openConnectionin classURLStreamHandler- Parameters:
u- java.net.URL The URL to which the connection is pointing to- Returns:
- java.net.URLConnection A connection to the resource pointed by this url.
- Throws:
IOException- thrown if an IO error occurs when this method tries to establish connection.
-
parseURL
Description copied from class:URLStreamHandlerParses the clear text URL instrinto a URL object. URL strings generally have the following format:http://www.company.com/java/file1.java#reference
The string is parsed in HTTP format. If the protocol has a different URL format this method must be overridden.
- Overrides:
parseURLin classURLStreamHandler- Parameters:
url- URL the context URLspec- java.lang.String the spec stringstart- int the location to start parsing fromlimit- int the location where parsing ends- See Also:
URLStreamHandler.toExternalForm(java.net.URL),URL
-
toExternalForm
Build and return the externalized string representation of url.- Overrides:
toExternalFormin classURLStreamHandler- Parameters:
url- a URL- Returns:
- String the externalized string representation of url
- See Also:
URLStreamHandler.parseURL(java.net.URL, java.lang.String, int, int),URL.toExternalForm()
-