de.enough.polish.browser.protocols
Class ResourceConnection

java.lang.Object
  extended by de.enough.polish.browser.protocols.ResourceConnection
All Implemented Interfaces:
Connection, InputConnection, OutputConnection, StreamConnection

public class ResourceConnection
extends Object
implements StreamConnection

A StreamConnection for resources from inside the application jar. The urls of resources always start with resource://.


Constructor Summary
ResourceConnection(InputStream in)
          Creates a new resource connection for the specified input stream.
ResourceConnection(String url)
          Creates a new resource connection for the specified URL
 
Method Summary
 void close()
           
 DataInputStream openDataInputStream()
           
 DataOutputStream openDataOutputStream()
           
 InputStream openInputStream()
           
 OutputStream openOutputStream()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceConnection

public ResourceConnection(String url)
Creates a new resource connection for the specified URL

Parameters:
url - the URL, e.g. /image.png.

ResourceConnection

public ResourceConnection(InputStream in)
Creates a new resource connection for the specified input stream.

Parameters:
in - the input stream
Method Detail

close

public void close()
           throws IOException
Specified by:
close in interface Connection
Throws:
IOException

openDataInputStream

public DataInputStream openDataInputStream()
                                    throws IOException
Specified by:
openDataInputStream in interface InputConnection
Throws:
IOException

openDataOutputStream

public DataOutputStream openDataOutputStream()
                                      throws IOException
Specified by:
openDataOutputStream in interface OutputConnection
Throws:
IOException

openInputStream

public InputStream openInputStream()
                            throws IOException
Specified by:
openInputStream in interface InputConnection
Throws:
IOException

openOutputStream

public OutputStream openOutputStream()
                              throws IOException
Specified by:
openOutputStream in interface OutputConnection
Throws:
IOException