org.ops4j.pax.url.war.internal
Class WarReferenceConnection

java.lang.Object
  extended by java.net.URLConnection
      extended by org.ops4j.pax.url.war.internal.WarReferenceConnection

public class WarReferenceConnection
extends java.net.URLConnection

Url connection for war-file protocol handler.

Since:
0.1.0, January 14, 2008
Author:
Alin Dreghiciu

Field Summary
 
Fields inherited from class java.net.URLConnection
allowUserInteraction, connected, doInput, doOutput, ifModifiedSince, url, useCaches
 
Constructor Summary
WarReferenceConnection(java.net.URL url, Configuration config)
           
 
Method Summary
 void connect()
          Does nothing.
protected  Configuration getConfiguration()
          Getter.
 java.io.InputStream getInputStream()
          Returns the input stream denoted by the url.
protected  java.util.Properties getInstructions()
          Url must be a reference to an instructions file.
protected static java.lang.String join(java.util.Collection<java.lang.String> strings, java.lang.String delimiter)
          Joins elements from a collection into a delimiter separated string.
protected static java.util.List<java.lang.String> toList(java.lang.String separatedString, java.lang.String delimiter)
          Splits a delimiter separated string into a list.
 
Methods inherited from class java.net.URLConnection
addRequestProperty, getAllowUserInteraction, getConnectTimeout, getContent, getContent, getContentEncoding, getContentLength, getContentType, getDate, getDefaultAllowUserInteraction, getDefaultRequestProperty, getDefaultUseCaches, getDoInput, getDoOutput, getExpiration, getFileNameMap, getHeaderField, getHeaderField, getHeaderFieldDate, getHeaderFieldInt, getHeaderFieldKey, getHeaderFields, getIfModifiedSince, getLastModified, getOutputStream, getPermission, getReadTimeout, getRequestProperties, getRequestProperty, getURL, getUseCaches, guessContentTypeFromName, guessContentTypeFromStream, setAllowUserInteraction, setConnectTimeout, setContentHandlerFactory, setDefaultAllowUserInteraction, setDefaultRequestProperty, setDefaultUseCaches, setDoInput, setDoOutput, setFileNameMap, setIfModifiedSince, setReadTimeout, setRequestProperty, setUseCaches, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WarReferenceConnection

public WarReferenceConnection(java.net.URL url,
                              Configuration config)
                       throws java.net.MalformedURLException
Throws:
java.net.MalformedURLException
See Also:
AbstractConnection.AbstractConnection(URL, Configuration)
Method Detail

getInstructions

protected java.util.Properties getInstructions()
                                        throws java.io.IOException
Url must be a reference to an instructions file.

Returns:
processing instructions
Throws:
java.io.IOException - if instructions file can not be returned
See Also:
AbstractConnection.getInstructions()

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Returns the input stream denoted by the url.

Overrides:
getInputStream in class java.net.URLConnection
Returns:
the input stream for the resource denoted by url
Throws:
java.io.IOException - in case of an exception during accessing the resource
See Also:
URLConnection.getInputStream()

getConfiguration

protected Configuration getConfiguration()
Getter.

Returns:
configuration

connect

public void connect()
Does nothing.

Specified by:
connect in class java.net.URLConnection

toList

protected static java.util.List<java.lang.String> toList(java.lang.String separatedString,
                                                         java.lang.String delimiter)
Splits a delimiter separated string into a list.

Parameters:
separatedString - string to be split
delimiter - delimiter
Returns:
list composed out of the string segments

join

protected static java.lang.String join(java.util.Collection<java.lang.String> strings,
                                       java.lang.String delimiter)
Joins elements from a collection into a delimiter separated string.

Parameters:
strings - collection of ellements
delimiter - delimiter
Returns:
string composed from the collection elements delimited by the delimiter


Copyright © 2006-2011 OPS4J - Open Participation Software for Java. All Rights Reserved.