net.sf.plb4jedit.plb
Class PathBroker

java.lang.Object
  extended bynet.sf.plb4jedit.plb.PathBroker

public class PathBroker
extends Object

Handles the PLB_PATH to search for includes.

Author:
Peter Schaefer

Constructor Summary
PathBroker(String plbpath, String program)
          Constructs a path broker for a path and a program
 
Method Summary
 String[] getPathElements()
          get elements of the PLB_PATH as String array.
static void main(String[] args)
          for testing: Gets a PLB_PATH and an include name as input and prints out where the include is found in the path
 File searchInclude(String include)
          search in path elements according to their order for the given include name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PathBroker

public PathBroker(String plbpath,
                  String program)
Constructs a path broker for a path and a program

Parameters:
plbpath - general plb path as defined in env PLB_PATH
program - absolute path of the actual program has priority over default path + programName itself, e.g. /opt/cvsroot/procars/utils/test.dbs
Method Detail

getPathElements

public String[] getPathElements()
get elements of the PLB_PATH as String array.

Returns:

searchInclude

public File searchInclude(String include)
                   throws FileNotFoundException
search in path elements according to their order for the given include name. The first path-element which matches is used to construct the file. Include name must not contain the file suffix .dbs

Parameters:
include - include name without file suffix (.dbs)-
Returns:
where this include is found in the PLB_PATH.
Throws:
FileNotFoundException - if include is not found in any place in the path

main

public static void main(String[] args)
                 throws FileNotFoundException
for testing: Gets a PLB_PATH and an include name as input and prints out where the include is found in the path

Parameters:
args - PLB_PATH, include name without file-extension, e.g. nadrcd3 (but not nadrcd3.dbs)
Throws:
FileNotFoundException - if include can not be found in path.


Copyright © 2003 Riege Software Internationl. All Rights Reserved.