Ableverse™
Platform 6.0

av.meta
Class FileSystemLoader

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

public class FileSystemLoader
extends Object
implements MetaLoader

A MetaLoader implementation that loads resources from the file system.

Author:
Compl

Constructor Summary
FileSystemLoader(File dir)
          Construct a file system loader.
 
Method Summary
 InputStream getMetaResourceAsStream(String id)
          This will replace dot(.) characters in id to the path separator character of the host system of current JVM and then append the file extension name, finally use the calculated string as a path name under the specified dir at construction to try loading a file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileSystemLoader

public FileSystemLoader(File dir)
Construct a file system loader. The constructed loader will try to load files under the specified dir.

Parameters:
dir - under which to find resource files
Method Detail

getMetaResourceAsStream

public InputStream getMetaResourceAsStream(String id)
This will replace dot(.) characters in id to the path separator character of the host system of current JVM and then append the file extension name, finally use the calculated string as a path name under the specified dir at construction to try loading a file.

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.