Java Code Examples for javax.tools.StandardLocation#isOutputLocation()

The following examples show how to use javax.tools.StandardLocation#isOutputLocation() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TestSearchPaths.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
void checkFile(StandardLocation l, String path) {
    if (!l.isOutputLocation()) {
        error("Not an output location: " + l);
        return;
    }

    List<File> files = getLocation(l);
    if (files == null) {
        error("location is unset: " + l);
        return;
    }

    if (files.size() != 1)
        error("unexpected number of entries on " + l + ": " + files.size());

    File f = new File(files.get(0), path);
    if (!f.exists())
        error("file not found: " + f);
}
 
Example 2
Source File: JavacFiler.java    From java-n-IDE-for-Android with Apache License 2.0 5 votes vote down vote up
private void locationCheck(Location location) {
    if (location instanceof StandardLocation) {
        StandardLocation stdLoc = (StandardLocation) location;
        if (!stdLoc.isOutputLocation())
            throw new IllegalArgumentException("Resource creation not supported in location " +
                                               stdLoc);
    }
}
 
Example 3
Source File: JavacFiler.java    From javaide with GNU General Public License v3.0 5 votes vote down vote up
private void locationCheck(Location location) {
    if (location instanceof StandardLocation) {
        StandardLocation stdLoc = (StandardLocation) location;
        if (!stdLoc.isOutputLocation())
            throw new IllegalArgumentException("Resource creation not supported in location " +
                                               stdLoc);
    }
}