com.asual.lesscss.loader
Class ClasspathResourceLoader

java.lang.Object
  extended by com.asual.lesscss.loader.StreamResourceLoader
      extended by com.asual.lesscss.loader.ClasspathResourceLoader
All Implemented Interfaces:
ResourceLoader

public class ClasspathResourceLoader
extends StreamResourceLoader

A ResourceLoader that loads resources from a ClassLoader.

Author:
RafaƂ Krzewski

Constructor Summary
ClasspathResourceLoader(ClassLoader classLoader)
          Creates a new ClasspathResourceLoader.
 
Method Summary
protected  String getSchema()
          Returns the schema name associated with the loader.
protected  InputStream openStream(String path)
          Please note that path should NOT have a leading slash.
 
Methods inherited from class com.asual.lesscss.loader.StreamResourceLoader
exists, load, readStream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClasspathResourceLoader

public ClasspathResourceLoader(ClassLoader classLoader)
Creates a new ClasspathResourceLoader.

Parameters:
classLoader - a ClassLoader to load resources from.
Method Detail

getSchema

protected String getSchema()
Description copied from class: StreamResourceLoader
Returns the schema name associated with the loader.

Specified by:
getSchema in class StreamResourceLoader
Returns:
schema name.

openStream

protected InputStream openStream(String path)
Please note that path should NOT have a leading slash.

Specified by:
openStream in class StreamResourceLoader
Parameters:
path - the path of the resource.
Returns:
an InputStream or null if the resource does not exist.


Copyright © 2013 Asual DZZD. All Rights Reserved.