uPortal 2.4.1
API Documentation

org.jasig.portal.car
Class CarResources

java.lang.Object
  extended byorg.jasig.portal.car.CarResources

public class CarResources
extends java.lang.Object

Provides access to resources stored in channel archive files or CARs for short.

Version:
$Revision: 1.12 $
Author:
Mark Boyd

Field Summary
static java.lang.String CAR_RESOURCE_PARM
           
static java.lang.String CAR_WORKER_ID
           
static java.lang.String RCS_ID
           
 
Method Summary
 boolean containsResource(java.lang.String resource)
          Returns true if the indicated resource is available, false otherwise.
 java.net.URL findResource(java.lang.String entry)
          Returns a URL to the requested entry if found in one of the installed CARs or null if not found.
 java.lang.ClassLoader getClassLoader()
          Return the single instance of CarClassLoader.
 java.lang.String getContainingCarPath(java.lang.String entry)
          Returns the path of the CAR containing the indicated resource.
static CarResources getInstance()
          Return the single instance of CarResources.
 java.io.InputStream getResourceAsStream(java.lang.String resource)
          Return an input stream for reading the raw bytes making up the resource contained in one of the installed CARs.
 long getResourceSize(java.lang.String resource)
          Return the size of the indicated resource or -1 if the resource is not found or its size is unknown.
 void getServices(org.xml.sax.ContentHandler contentHandler)
          Push into the passed in content handler events for any services declared in any component archive's deployment descriptor.
 void getWorkers(java.util.Properties workers)
          Push into the passed in properties object workers defined in any component archive's deployment descriptor.
 boolean hasDescriptors()
          Returns true if any archive included a deployment descriptor.
 java.lang.String[] listAllResources()
          Returns an enumeration of String objects each containing the path of a resource available from the installed CARs.
 java.lang.String[] listCarResources(java.lang.String carPath)
          Returns a list of resources available in the car identified by the passed in relative car file path name.
 java.lang.String[] listCars()
          Returns a String array of car file paths relative to the car directory specified via the property in portal.properties.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RCS_ID

public static final java.lang.String RCS_ID
See Also:
Constant Field Values

CAR_WORKER_ID

public static final java.lang.String CAR_WORKER_ID
See Also:
Constant Field Values

CAR_RESOURCE_PARM

public static final java.lang.String CAR_RESOURCE_PARM
See Also:
Constant Field Values
Method Detail

getInstance

public static CarResources getInstance()
Return the single instance of CarResources.


getClassLoader

public java.lang.ClassLoader getClassLoader()
Return the single instance of CarClassLoader.


getWorkers

public void getWorkers(java.util.Properties workers)
Push into the passed in properties object workers defined in any component archive's deployment descriptor.


hasDescriptors

public boolean hasDescriptors()
Returns true if any archive included a deployment descriptor.


getServices

public void getServices(org.xml.sax.ContentHandler contentHandler)
                 throws org.xml.sax.SAXException
Push into the passed in content handler events for any services declared in any component archive's deployment descriptor.

Throws:
org.xml.sax.SAXException

getResourceAsStream

public java.io.InputStream getResourceAsStream(java.lang.String resource)
                                        throws PortalException
Return an input stream for reading the raw bytes making up the resource contained in one of the installed CARs. Returns null if the resource is not found.

Throws:
PortalException

getResourceSize

public long getResourceSize(java.lang.String resource)
Return the size of the indicated resource or -1 if the resource is not found or its size is unknown.


findResource

public java.net.URL findResource(java.lang.String entry)
Returns a URL to the requested entry if found in one of the installed CARs or null if not found.


getContainingCarPath

public java.lang.String getContainingCarPath(java.lang.String entry)
Returns the path of the CAR containing the indicated resource. This path is relative to the CAR directory configured via the property in portal.properties. If a CAR for that entry is not found it returns null.


containsResource

public boolean containsResource(java.lang.String resource)
Returns true if the indicated resource is available, false otherwise. The resource is identified by its complete path within the CAR file.


listCars

public java.lang.String[] listCars()
Returns a String array of car file paths relative to the car directory specified via the property in portal.properties.


listCarResources

public java.lang.String[] listCarResources(java.lang.String carPath)
Returns a list of resources available in the car identified by the passed in relative car file path name. This name is the path to the car file relative to the car directory. If no car file is found for the passed-in path then null is returned.


listAllResources

public java.lang.String[] listAllResources()
Returns an enumeration of String objects each containing the path of a resource available from the installed CARs.


uPortal 2.4.1
API Documentation