com.joanju.cgs
Class RootDirs

java.lang.Object
  extended by com.joanju.cgs.RootDirs

public class RootDirs
extends java.lang.Object


Constructor Summary
RootDirs()
           
 
Method Summary
 java.io.File findInProject(java.lang.String filename)
          Find a file in a project.
 java.io.File findRootRelative(java.lang.String relativeName)
          Try to find a File relative to any of the rootDir entries.
 java.lang.String propath2rootRelative(java.lang.String filename)
          Find a file on the PROPATH, return the result of rootRelative().
 java.lang.String rootRelative(java.lang.String canonicalName)
          Return the filename with the root path stripped off the front.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RootDirs

public RootDirs()
Method Detail

findInProject

public java.io.File findInProject(java.lang.String filename)
Find a file in a project. IMPORTANT: Filename must be found on the OS; i.e., is case sensitive on unix. Uses the PROPATH to find the file. Tests that the file is in the configuration rootdirs, to avoid letting arbitrary files be viewed.


findRootRelative

public java.io.File findRootRelative(java.lang.String relativeName)
Try to find a File relative to any of the rootDir entries. Needed if a "project relative" file name is submitted for browsing, but the project root is not actually in the PROPATH. (Possible, for example, from the Eclipse client where project relative path is submitted.)

Returns:
null if not found.

propath2rootRelative

public java.lang.String propath2rootRelative(java.lang.String filename)
Find a file on the PROPATH, return the result of rootRelative(). Useful for finding the root relative filename if we've been given the string used for an include reference or external procedure call.

Returns:
null if not found.

rootRelative

public java.lang.String rootRelative(java.lang.String canonicalName)
Return the filename with the root path stripped off the front. Returns the full string if no root path matches the start of the filename.



Copyright © 2008 Joanju Software. All Rights Reserved.