org.jboss.shrinkwrap.api.asset
Class UrlAsset

java.lang.Object
  extended by org.jboss.shrinkwrap.api.asset.UrlAsset
All Implemented Interfaces:
Asset

public class UrlAsset
extends Object
implements Asset

Implementation of an Asset backed by a URL. The URL may be of any backing protocol supported by the runtime (ie. has a handler registered).

Author:
Aslak Knutsen

Constructor Summary
UrlAsset(URL url)
          Create a new resource with a URL source.
 
Method Summary
 InputStream openStream()
          Open the URL stream.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UrlAsset

public UrlAsset(URL url)
Create a new resource with a URL source.

Parameters:
url - A valid URL
Throws:
IllegalArgumentException - URL can not be null
Method Detail

openStream

public InputStream openStream()
Open the URL stream.

Specified by:
openStream in interface Asset
Returns:
A open stream with the content of the URL

toString

public String toString()

Overrides:
toString in class Object
See Also:
Object.toString()


Copyright © 2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.