Package libcore.net.url
Class JarHandler
- java.lang.Object
-
- java.net.URLStreamHandler
-
- libcore.net.url.JarHandler
-
- Direct Known Subclasses:
ClassPathURLStreamHandler
public class JarHandler extends URLStreamHandler
-
-
Constructor Summary
Constructors Constructor Description JarHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods 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
-
-
-
-
Method Detail
-
openConnection
protected URLConnection openConnection(URL u) throws IOException
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
protected void parseURL(URL url, String spec, int start, int limit)
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
protected String toExternalForm(URL url)
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()
-
-