Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.tripi.asp
Class AspFileFactory  view AspFileFactory download AspFileFactory.java

java.lang.Object
  extended bycom.tripi.asp.AspFileFactory
All Implemented Interfaces:
com.tripi.asp.parse.FileFactory

public class AspFileFactory
extends java.lang.Object
implements com.tripi.asp.parse.FileFactory

This class is a factory to handle finding files on the local file system. It is used by the other test routines.


Nested Class Summary
private static class AspFileFactory.FileInformation
          Class to contain cached file information.
 
Field Summary
(package private)  AspContext context
          Asp Content
private static org.apache.log4j.Category DBG
          Debugging class
(package private)  java.util.Map loadedFiles
          Map of files loaded using this file factory, used to determine if any of the files have changed.
 
Constructor Summary
AspFileFactory(AspContext context)
          Constructor, initialized with an AspContext.
 
Method Summary
 void clearLoadedFilesCache()
          Clear the loaded files cache.
private static java.lang.String concatPath(java.lang.String absPath, java.lang.String addPath)
          Internal utility function to concatenate two paths.
private  AspFileFactory.FileInformation getFileInformation(java.lang.String fileLocation)
          Get the cached file information for the file.
 java.io.InputStream getResource(java.lang.String filename)
          Get the file resource.
 boolean isModified()
          Check if any of the cached files have been modified on the disk.
private static boolean isSeparatorChar(char ch)
           
 java.lang.String resolveFile(java.lang.String baseFilename, java.lang.String relFile, boolean virtual)
          Resolve a relative file's location based on the given file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DBG

private static final org.apache.log4j.Category DBG
Debugging class


context

AspContext context
Asp Content


loadedFiles

java.util.Map loadedFiles
Map of files loaded using this file factory, used to determine if any of the files have changed.

Constructor Detail

AspFileFactory

public AspFileFactory(AspContext context)
Constructor, initialized with an AspContext.

Method Detail

resolveFile

public java.lang.String resolveFile(java.lang.String baseFilename,
                                    java.lang.String relFile,
                                    boolean virtual)
                             throws AspException
Resolve a relative file's location based on the given file.

Specified by:
resolveFile in interface com.tripi.asp.parse.FileFactory

isSeparatorChar

private static final boolean isSeparatorChar(char ch)

concatPath

private static java.lang.String concatPath(java.lang.String absPath,
                                           java.lang.String addPath)
                                    throws AspException
Internal utility function to concatenate two paths.


getResource

public java.io.InputStream getResource(java.lang.String filename)
                                throws AspException
Get the file resource.

Specified by:
getResource in interface com.tripi.asp.parse.FileFactory

clearLoadedFilesCache

public void clearLoadedFilesCache()
Clear the loaded files cache.


isModified

public boolean isModified()
Check if any of the cached files have been modified on the disk.


getFileInformation

private AspFileFactory.FileInformation getFileInformation(java.lang.String fileLocation)
Get the cached file information for the file.