Ableverse™
Platform 6.0

av.meta
Class ClassPathLoader

java.lang.Object
  extended by av.meta.ClassPathLoader
All Implemented Interfaces:
MetaLoader

public class ClassPathLoader
extends Object
implements MetaLoader

A MetaLoader implementation that loads resources from the java classpath.

Note: This loader don't search resources under a URL CodeBase (i.e. an applet's codebase) to improve loading performance.

Author:
Compl

Constructor Summary
ClassPathLoader()
          A ClassPathLoader without a specified ClassLoader will try the current thread's context class loader on each resource query.
ClassPathLoader(ClassLoader cl)
          Construct a ClassPathLoader with an explicit class loader specified.
 
Method Summary
 InputStream getMetaResourceAsStream(String id)
          This will try loading a resource named id from local java class path entries.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassPathLoader

public ClassPathLoader()
A ClassPathLoader without a specified ClassLoader will try the current thread's context class loader on each resource query.


ClassPathLoader

public ClassPathLoader(ClassLoader cl)
Construct a ClassPathLoader with an explicit class loader specified.

Parameters:
cl - a specific class loader used to load resources
Method Detail

getMetaResourceAsStream

public InputStream getMetaResourceAsStream(String id)
This will try loading a resource named id from local java class path entries.

Specified by:
getMetaResourceAsStream in interface MetaLoader
Parameters:
id - calculated as above
Returns:
the read stream for the resource exactly matches id, null otherwise.

Ableverse™
Platform 6.0

Copyright© 2006 Ableverse Platform. All rights reserved.