net.sf.xsltmp.util
Class FileResolver

java.lang.Object
  extended by net.sf.xsltmp.util.FileResolver
Direct Known Subclasses:
DefaultURIResolver

public class FileResolver
extends Object

Resolves a File corresponding to a given path either as absolute path, from project basedir or from classpath.

First tries to resolve the path as absolute path.

Then tries to relate the path to project basedir.

Then iterates over all compile classpath elements and tries to relate the path to each one of them. If the classpath element is not a directory, but an archive file, tries to extract the requested file from the archive. See UnArchiverHelper for details on how extract is performed.


Constructor Summary
FileResolver(org.apache.maven.plugin.logging.Log log, org.apache.maven.project.MavenProject project, UnArchiverHelper helper)
          Constructor.
 
Method Summary
protected  boolean exists(File file)
          Check existence of a file.
 UnArchiverHelper getHelper()
           
 org.apache.maven.plugin.logging.Log getLog()
           
 org.apache.maven.project.MavenProject getProject()
           
 File resolve(String filePath)
          Get a file path as a File.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileResolver

public FileResolver(org.apache.maven.plugin.logging.Log log,
                    org.apache.maven.project.MavenProject project,
                    UnArchiverHelper helper)
Constructor.

Parameters:
log - Maven log
project - Maven project
helper - UnArchiver helper
Method Detail

getLog

public org.apache.maven.plugin.logging.Log getLog()

getProject

public org.apache.maven.project.MavenProject getProject()

getHelper

public UnArchiverHelper getHelper()

resolve

public File resolve(String filePath)
Get a file path as a File.

Parameters:
filePath - The relative path of the file
Returns:
File The File corresponding to the path

exists

protected boolean exists(File file)
Check existence of a file. Returns true iff the file exists.

Parameters:
file - The File to check
Returns:
boolean


Copyright © 2008-2010 SEAF. All Rights Reserved.