public interface PathFileManager extends JavaFileManager
Path
.
Eventually, this should be moved to javax.tools.
Also, JavaCompiler might reasonably provide a method getPathFileManager,
similar to getStandardFileManager
. However, would need to be handled carefully
as another forward reference from langtools to jdk.
This is NOT part of any supported API. 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.
JavaFileManager.Location
Modifier and Type | Method and Description |
---|---|
FileSystem |
getDefaultFileSystem()
Get the default file system used to create paths.
|
Iterable<? extends JavaFileObject> |
getJavaFileObjects(Path... paths)
Get file objects representing the given paths.
|
Iterable<? extends JavaFileObject> |
getJavaFileObjectsFromPaths(Iterable<? extends Path> paths)
Get file objects representing the given files.
|
Iterable<? extends Path> |
getLocation(JavaFileManager.Location location)
Get the search path associated with the given location.
|
Path |
getPath(FileObject fo)
Return the Path for a file object that has been obtained from this
file manager.
|
void |
setDefaultFileSystem(FileSystem fs)
Set the default file system used to create paths.
|
void |
setLocation(JavaFileManager.Location location,
Iterable<? extends Path> searchPath)
Associate the given search path with the given location.
|
close, flush, getClassLoader, getFileForInput, getFileForOutput, getJavaFileForInput, getJavaFileForOutput, handleOption, hasLocation, inferBinaryName, isSameFile, list
isSupportedOption
FileSystem getDefaultFileSystem()
FileSystems.getDefault()
.void setDefaultFileSystem(FileSystem fs)
fs
- the default file system used to create any new paths.Iterable<? extends JavaFileObject> getJavaFileObjectsFromPaths(Iterable<? extends Path> paths)
paths
- a list of pathsIllegalArgumentException
- if the list of paths includes
a directoryIterable<? extends JavaFileObject> getJavaFileObjects(Path... paths)
getJavaFileObjectsFromPaths(Arrays.asList(paths))
paths
- an array of pathsIllegalArgumentException
- if the array of files includes
a directoryNullPointerException
- if the given array contains null
elementsPath getPath(FileObject fo)
fo
- A file object that has been obtained from this file manager.IllegalArgumentException
- is the file object was not obtained from
from this file manager.Iterable<? extends Path> getLocation(JavaFileManager.Location location)
location
- a locationnull
if this location has no
associated search pathsetLocation(javax.tools.JavaFileManager.Location, java.lang.Iterable<? extends java.nio.file.Path>)
void setLocation(JavaFileManager.Location location, Iterable<? extends Path> searchPath) throws IOException
location
- a locationsearchPath
- a list of files, if null
use the default
search path for this locationIllegalArgumentException
- if location is an output
location and searchpath does not contain exactly one elementIOException
- if location is an output location and searchpath
does not represent an existing directorygetLocation(javax.tools.JavaFileManager.Location)
Copyright © 2015. All rights reserved.