org.eclipse.emf.common.archive
Class Handler

java.lang.Object
  extended byjava.net.URLStreamHandler
      extended byorg.eclipse.emf.common.archive.Handler

public class Handler
extends URLStreamHandler

A URL stream handler that can be registered to support archive access protocol. It uses ArchiveURLConnection to implement the connection.


Constructor Summary
Handler()
          Creates an instance.
 
Method Summary
static void main(String[] args)
          Registers this handler and interprets each argument as URL to be opened, read in, and written out to System.out.
protected  URLConnection openConnection(URL url)
          Returns a new ArchiveURLConnection.
protected  void parseURL(URL url, String specification, int start, int limit)
          Overrides parsing the URL to validate constraints on well formed archive syntax.
static void register()
          Registers this class.
 
Methods inherited from class java.net.URLStreamHandler
equals, getDefaultPort, getHostAddress, hashCode, hostsEqual, sameFile, setURL, setURL, toExternalForm
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Handler

public Handler()
Creates an instance.

Method Detail

register

public static void register()
Registers this class. A handler for protocol "xyz" is registered by providing a class named Handler implementing URLStreamHandler in a package called named xyz in a package of your choosing, and then registering that chosen prefix package name in the system property for "java.protocol.handler.pkgs", which is an "|" separated list of package prefixes to search for handlers.


main

public static void main(String[] args)
                 throws IOException
Registers this handler and interprets each argument as URL to be opened, read in, and written out to System.out.

Parameters:
args - URLs to open, read, and write to System.out
Throws:
IOException - if there are problems opening or reading from the URLs, or writing to System.out.

parseURL

protected void parseURL(URL url,
                        String specification,
                        int start,
                        int limit)
Overrides parsing the URL to validate constraints on well formed archive syntax.

See Also:
URLStreamHandler.parseURL(java.net.URL, java.lang.String, int, int)

openConnection

protected URLConnection openConnection(URL url)
                                throws IOException
Returns a new ArchiveURLConnection.

Throws:
IOException

Copyright 2001-2006 IBM Corporation and others.
All Rights Reserved.