Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| xmlgraphics-commons 1.5
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.xmlgraphics.util
Class ClasspathResource

    java.lang.Object
      org.apache.xmlgraphics.util.ClasspathResource

    public final class ClasspathResource

extends Object

A class to find resources in the classpath by their mime-type specified in the MANIFEST.

This class searches for content entries in all META-INF/MANIFEST.MF files. It will find files with a given Content-Type: attribute. This allows to add arbitrary resources by content-type just by creating a JAR wrapper and adding them to the classpath.

Example:

     Name: test.txt
     Content-Type: text/plain

Method Summary
`static ClasspathResource` | `getInstance()` Retrieve the singleton instance of this class.
`List` | `listResourcesOfMimeType(String mimeType)` Retrieve a list of resources known to have the given mime-type.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### getInstance

    public static ClasspathResource getInstance()

  Retrieve the singleton instance of this class.

  Returns:
    the ClassPathResource instance.

### listResourcesOfMimeType

    public List listResourcesOfMimeType(String mimeType)

  Retrieve a list of resources known to have the given mime-type.

  Parameters:
    `mimeType` - the mime-type to search for.
  Returns:
    a List<URL>, guaranteed to be != null.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| xmlgraphics-commons 1.5
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright 1999-2012 The Apache Software Foundation. All Rights Reserved.