com.sun.tools.javac.file
Class Paths

java.lang.Object
  extended by com.sun.tools.javac.file.Paths

public class Paths
extends java.lang.Object

This class converts command line arguments, environment variables and system properties (in File.pathSeparator-separated String form) into a boot class path, user class path, and source path (in Collection form).

This is NOT part of any API supported by Sun Microsystems. If you write code that depends on this, you do so at your own risk. This code and its internal interfaces are subject to change or deletion without notice.


Nested Class Summary
private  class Paths.Path
           
 
Field Summary
private  java.io.File bootClassPathRtJar
          rt.jar as found on the default bootclass path.
private  Paths.Path classSearchPath
          The actual effective locations searched for classes
private  FSInfo fsInfo
          Access to (possibly cached) file info
private  boolean inited
           
private  Lint lint
          Handler for -Xlint options
private  Log log
          The log to use for warning output
private  Options options
          Collection of command-line options
private  Paths.Path otherSearchPath
          The actual effective locations for non-source, non-class files
private  java.util.Map<JavaFileManager.Location,Paths.Path> pathsForLocation
           
protected static Context.Key<Paths> pathsKey
          The context key for the todo list
private  Paths.Path sourceSearchPath
          The actual effective locations searched for sources
private  boolean warn
          Whether to warn about non-existent path elements
 
Constructor Summary
protected Paths(Context context)
           
 
Method Summary
 java.util.Collection<java.io.File> bootClassPath()
           
 java.util.Collection<java.io.File> classSearchPath()
           
private  Paths.Path computeAnnotationProcessorPath()
           
private  Paths.Path computeBootClassPath()
           
private  Paths.Path computeSourcePath()
           
private  Paths.Path computeUserClassPath()
           
private static java.lang.Iterable<java.io.File> getPathEntries(java.lang.String path)
          Split a path into its elements.
private static java.lang.Iterable<java.io.File> getPathEntries(java.lang.String path, java.io.File emptyPathDefault)
          Split a path into its elements.
(package private)  Paths.Path getPathForLocation(JavaFileManager.Location location)
           
static Paths instance(Context context)
          Get the Paths instance for this context.
private  boolean isArchive(java.io.File file)
          Is this the name of an archive file?
(package private)  boolean isBootClassPathRtJar(java.io.File file)
           
protected  void lazy()
           
(package private)  java.util.Collection<java.io.File> otherSearchPath()
           
(package private)  void setContext(Context context)
           
(package private)  void setPathForLocation(JavaFileManager.Location location, java.lang.Iterable<? extends java.io.File> path)
           
 java.util.Collection<java.io.File> sourcePath()
           
 java.util.Collection<java.io.File> sourceSearchPath()
           
 java.util.Collection<java.io.File> userClassPath()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pathsKey

protected static final Context.Key<Paths> pathsKey
The context key for the todo list


log

private Log log
The log to use for warning output


options

private Options options
Collection of command-line options


lint

private Lint lint
Handler for -Xlint options


fsInfo

private FSInfo fsInfo
Access to (possibly cached) file info


warn

private boolean warn
Whether to warn about non-existent path elements


pathsForLocation

private java.util.Map<JavaFileManager.Location,Paths.Path> pathsForLocation

inited

private boolean inited

bootClassPathRtJar

private java.io.File bootClassPathRtJar
rt.jar as found on the default bootclass path. If the user specified a bootclasspath, null is used.


sourceSearchPath

private Paths.Path sourceSearchPath
The actual effective locations searched for sources


classSearchPath

private Paths.Path classSearchPath
The actual effective locations searched for classes


otherSearchPath

private Paths.Path otherSearchPath
The actual effective locations for non-source, non-class files

Constructor Detail

Paths

protected Paths(Context context)
Method Detail

instance

public static Paths instance(Context context)
Get the Paths instance for this context.

Parameters:
context - the context
Returns:
the Paths instance for this context

setContext

void setContext(Context context)

getPathForLocation

Paths.Path getPathForLocation(JavaFileManager.Location location)

setPathForLocation

void setPathForLocation(JavaFileManager.Location location,
                        java.lang.Iterable<? extends java.io.File> path)

lazy

protected void lazy()

bootClassPath

public java.util.Collection<java.io.File> bootClassPath()

userClassPath

public java.util.Collection<java.io.File> userClassPath()

sourcePath

public java.util.Collection<java.io.File> sourcePath()

isBootClassPathRtJar

boolean isBootClassPathRtJar(java.io.File file)

getPathEntries

private static java.lang.Iterable<java.io.File> getPathEntries(java.lang.String path)
Split a path into its elements. Empty path elements will be ignored.

Parameters:
path - The path to be split
Returns:
The elements of the path

getPathEntries

private static java.lang.Iterable<java.io.File> getPathEntries(java.lang.String path,
                                                               java.io.File emptyPathDefault)
Split a path into its elements. If emptyPathDefault is not null, all empty elements in the path, including empty elements at either end of the path, will be replaced with the value of emptyPathDefault.

Parameters:
path - The path to be split
emptyPathDefault - The value to substitute for empty path elements, or null, to ignore empty path elements
Returns:
The elements of the path

computeBootClassPath

private Paths.Path computeBootClassPath()

computeUserClassPath

private Paths.Path computeUserClassPath()

computeSourcePath

private Paths.Path computeSourcePath()

computeAnnotationProcessorPath

private Paths.Path computeAnnotationProcessorPath()

sourceSearchPath

public java.util.Collection<java.io.File> sourceSearchPath()

classSearchPath

public java.util.Collection<java.io.File> classSearchPath()

otherSearchPath

java.util.Collection<java.io.File> otherSearchPath()

isArchive

private boolean isArchive(java.io.File file)
Is this the name of an archive file?