org.jboss.shrinkwrap.api.asset
Class StringAsset

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

public class StringAsset
extends Object
implements Asset

Implementation of an Asset backed by a String

Version:
$Revision: $
Author:
Dan Allen

Constructor Summary
StringAsset(String content)
          Creates a new Asset instance backed by the specified String
 
Method Summary
 InputStream openStream()
          Get a input stream for the resource content.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StringAsset

public StringAsset(String content)
Creates a new Asset instance backed by the specified String

Parameters:
content - The content represented as a String
Throws:
IllegalArgumentException - If the contents were not specified
Method Detail

openStream

public InputStream openStream()
Description copied from interface: Asset
Get a input stream for the resource content. The caller is responsible for closing the stream. If this returns null, this denotes that the Asset is to be viewed as a logical path (placeholder/directory) only with no backing content.

Specified by:
openStream in interface Asset
Returns:
A new open InputStream for each call, or null if this type simply represents a logical path within an Archive
See Also:
Asset.openStream()

toString

public String toString()

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


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