FileDocCategorySizeDatePackage
Resource.javaAPI DocGlassfish v2 API3856Fri May 04 22:33:00 BST 2007org.apache.naming.resources

Resource

public class Resource extends Object
Encapsultes the contents of a resource.
author
Remy Maucherat
version
$Revision: 1.4 $

Fields Summary
protected byte[]
binaryContent
Binary content.
protected InputStream
inputStream
Input stream.
Constructors Summary
public Resource()

    
public Resource(InputStream inputStream)

        setContent(inputStream);
    
public Resource(byte[] binaryContent)

        setContent(binaryContent);
    
Methods Summary
public byte[]getContent()
Content accessor.

return
binary content

        return binaryContent;
    
public voidsetContent(java.io.InputStream inputStream)
Content mutator.

param
inputStream New input stream

        this.inputStream = inputStream;
    
public voidsetContent(byte[] binaryContent)
Content mutator.

param
binaryContent New bin content

        this.binaryContent = binaryContent;
    
public java.io.InputStreamstreamContent()
Content accessor.

return
InputStream

    
    
    // ------------------------------------------------------------- Properties
    
    
              
      
          
        if (binaryContent != null) {
            return new ByteArrayInputStream(binaryContent);
        }
        return inputStream;