org.clearsilver
Class CSUtil

java.lang.Object
  extended by org.clearsilver.CSUtil

public final class CSUtil
extends Object

Utility class containing helper methods


Field Summary
static String HDF_LOADPATHS
           
 
Method Summary
static List<String> getLoadPaths(HDF hdf)
          Helper function that returns a concatenation of the loadpaths in the provided HDF.
static List<String> getLoadPaths(HDF hdf, boolean allowEmpty)
          Helper function that returns a concatenation of the loadpaths in the provided HDF.
static File locateFile(List<String> loadpaths, String filename)
          Given an ordered list of directories to look in, locate the specified file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HDF_LOADPATHS

public static final String HDF_LOADPATHS
See Also:
Constant Field Values
Method Detail

getLoadPaths

public static List<String> getLoadPaths(HDF hdf)
Helper function that returns a concatenation of the loadpaths in the provided HDF.

Parameters:
hdf - an HDF structure containing load paths.
Returns:
A list of loadpaths in order in which to search.
Throws:
NullPointerException - if no loadpaths are found.

getLoadPaths

public static List<String> getLoadPaths(HDF hdf,
                                        boolean allowEmpty)
Helper function that returns a concatenation of the loadpaths in the provided HDF.

Parameters:
hdf - an HDF structure containing load paths.
allowEmpty - if true then this will return an empty list when no loadpaths are found in the HDF object, otherwise a NullPointerException is thrown. Loadpaths are not needed if no files are read in or are all specified by absolute paths.
Returns:
A list of loadpaths in order in which to search.
Throws:
NullPointerException - if no loadpaths are found and allowEmpty is false.

locateFile

public static File locateFile(List<String> loadpaths,
                              String filename)
Given an ordered list of directories to look in, locate the specified file. Returns null if file not found.

Parameters:
loadpaths - the ordered list of paths to search.
filename - the name of the file.
Returns:
a File object corresponding to the file. null if file not found.


Copyright © 2010-2012 Google. All Rights Reserved.