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

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

public class WebBundleConnection
extends WarConnection

Url connection for webbundle protocol handler.

Author:
Guillaume Nodet

Field Summary
 
Fields inherited from class java.net.URLConnection
allowUserInteraction, connected, doInput, doOutput, ifModifiedSince, url, useCaches
 
Constructor Summary
WebBundleConnection(URL url, Configuration config)
           
 
Method Summary
protected static boolean checkJarIsLegal(String name)
          verifies that the given jar name is not contained in the blacklist.
 void connect()
          Does nothing.
protected  InputStream createBundle(InputStream inputStream, Properties instructions, String warUri)
          Actually create the bundle based on the parsed instructions and the given stream
protected  InputStream createBundle(InputStream inputStream, Properties instructions, String warUri, org.ops4j.pax.swissbox.bnd.OverwriteMode overwriteMode)
          Actually create the bundle based on the parsed instructions and the given stream
protected  Configuration getConfiguration()
          Getter.
 InputStream getInputStream()
          Returns the input stream denoted by the url.
protected static String join(Collection<String> strings, String delimiter)
          Joins elements from a collection into a delimiter separated string.
protected static List<String> toList(String separatedString, String delimiter)
          Splits a delimiter separated string into a list.
 
Methods inherited from class org.ops4j.pax.url.war.internal.WarConnection
getInstructions
 
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

WebBundleConnection

public WebBundleConnection(URL url,
                           Configuration config)
                    throws MalformedURLException
Throws:
MalformedURLException
Method Detail

createBundle

protected InputStream createBundle(InputStream inputStream,
                                   Properties instructions,
                                   String warUri)
                            throws IOException
Actually create the bundle based on the parsed instructions and the given stream

Returns:
Throws:
IOException

getInputStream

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

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

createBundle

protected InputStream createBundle(InputStream inputStream,
                                   Properties instructions,
                                   String warUri,
                                   org.ops4j.pax.swissbox.bnd.OverwriteMode overwriteMode)
                            throws IOException
Actually create the bundle based on the parsed instructions and the given stream

Parameters:
inputStream -
instructions -
warUri -
overwriteMode -
Returns:
an input stream for the generated bundle
Throws:
IOException
See Also:
BndUtils.createBundle

getConfiguration

protected Configuration getConfiguration()
Getter.

Returns:
configuration

connect

public void connect()
Does nothing.

Specified by:
connect in class URLConnection

checkJarIsLegal

protected static boolean checkJarIsLegal(String name)
verifies that the given jar name is not contained in the blacklist.

Parameters:
name - of the jar which needs verification
Returns:
true - if the jar is a legal jar
false - if the jar is not supposed to be in a war archive like servlet.jar

toList

protected static List<String> toList(String separatedString,
                                     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 String join(Collection<String> strings,
                             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-2012 OPS4J - Open Participation Software for Java. All Rights Reserved.