Package com.sun.ts.lib.util.sec.misc

# Class Resource

java.lang.Object
com.sun.ts.lib.util.sec.misc.Resource

public abstract class Resource extends Object
This class is used to represent a Resource that has been loaded from the class path.

Since:
  1.2
Author:
  David Connelly

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Resource()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `ByteBuffer`
  `getByteBuffer()`
  Returns the Resource data as a ByteBuffer, but only if the input stream was implemented on top of a ByteBuffer.
  `byte[]`
  `getBytes()`
  Returns the Resource data as an array of bytes.
  `Certificate[]`
  `getCertificates()`
  Returns theCertificates for the Resource, or null if none.
  `CodeSigner[]`
  `getCodeSigners()`
  Returns the code signers for the Resource, or null if none.
  `abstract URL`
  `getCodeSourceURL()`
  Returns the CodeSource URL for the Resource.
  `abstract int`
  `getContentLength()`
  Returns the length of the Resource data, or -1 if unknown.
  `abstract InputStream`
  `getInputStream()`
  Returns an InputStream for reading the Resource data.
  `Manifest`
  `getManifest()`
  Returns the Manifest for the Resource, or null if none.
  `abstract String`
  `getName()`
  Returns the name of the Resource.
  `abstract URL`
  `getURL()`
  Returns the URL of the Resource.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### Resource

    public Resource()

- ## Method Details

  - ### getName

    public abstract String getName()
    Returns the name of the Resource.

  - ### getURL

    public abstract URL getURL()
    Returns the URL of the Resource.

  - ### getCodeSourceURL

    public abstract URL getCodeSourceURL()
    Returns the CodeSource URL for the Resource.

  - ### getInputStream

    public abstract InputStream getInputStream() throws IOException
    Returns an InputStream for reading the Resource data.
    Throws:
      `IOException`

  - ### getContentLength

    public abstract int getContentLength() throws IOException
    Returns the length of the Resource data, or -1 if unknown.
    Throws:
      `IOException`

  - ### getBytes

    public byte[] getBytes() throws IOException
    Returns the Resource data as an array of bytes.
    Throws:
      `IOException`

  - ### getByteBuffer

    public ByteBuffer getByteBuffer() throws IOException
    Returns the Resource data as a ByteBuffer, but only if the input stream was implemented on top of a ByteBuffer. Return `null` otherwise.
    Throws:
      `IOException`

  - ### getManifest

    public Manifest getManifest() throws IOException
    Returns the Manifest for the Resource, or null if none.
    Throws:
      `IOException`

  - ### getCertificates

    public Certificate[] getCertificates()
    Returns theCertificates for the Resource, or null if none.

  - ### getCodeSigners

    public CodeSigner[] getCodeSigners()
    Returns the code signers for the Resource, or null if none.