use of org.eclipse.ceylon.langtools.tools.javac.file.RelativePath.RelativeFile in project ceylon by eclipse.
the class JavacFileManager method getFileForInput.
public FileObject getFileForInput(Location location, String packageName, String relativeName) throws IOException {
nullCheck(location);
// validatePackageName(packageName);
nullCheck(packageName);
if (!isRelativeUri(relativeName))
throw new IllegalArgumentException("Invalid relative name: " + relativeName);
RelativeFile name = packageName.length() == 0 ? new RelativeFile(relativeName) : new RelativeFile(RelativeDirectory.forPackage(packageName), relativeName);
return getFileForInput(location, name);
}
use of org.eclipse.ceylon.langtools.tools.javac.file.RelativePath.RelativeFile in project ceylon by eclipse.
the class JavacFileManager method getFileForOutput.
public FileObject getFileForOutput(Location location, String packageName, String relativeName, FileObject sibling) throws IOException {
nullCheck(location);
// validatePackageName(packageName);
nullCheck(packageName);
if (!isRelativeUri(relativeName))
throw new IllegalArgumentException("Invalid relative name: " + relativeName);
RelativeFile name = packageName.length() == 0 ? new RelativeFile(relativeName) : new RelativeFile(RelativeDirectory.forPackage(packageName), relativeName);
return getFileForOutput(location, name, sibling);
}
use of org.eclipse.ceylon.langtools.tools.javac.file.RelativePath.RelativeFile in project ceylon by eclipse.
the class ZipFileIndexArchive method getFileObject.
public JavaFileObject getFileObject(RelativeDirectory subdirectory, String file) {
RelativeFile fullZipFileName = new RelativeFile(subdirectory, file);
ZipFileIndex.Entry entry = zfIndex.getZipIndexEntry(fullZipFileName);
JavaFileObject ret = new ZipFileIndexFileObject(fileManager, zfIndex, entry, zfIndex.getZipFile());
return ret;
}
use of org.eclipse.ceylon.langtools.tools.javac.file.RelativePath.RelativeFile in project ceylon by eclipse.
the class JavacFileManager method getFileForOutput.
protected JavaFileObject getFileForOutput(Location location, RelativeFile fileName, FileObject sibling) throws IOException {
File dir;
if (location == CLASS_OUTPUT) {
if (getClassOutDir() != null) {
dir = getClassOutDir();
} else {
File siblingDir = null;
if (sibling != null && sibling instanceof RegularFileObject) {
siblingDir = ((RegularFileObject) sibling).file.getParentFile();
}
return new RegularFileObject(this, new File(siblingDir, fileName.basename()));
}
} else if (location == SOURCE_OUTPUT) {
dir = (getSourceOutDir() != null ? getSourceOutDir() : getClassOutDir());
} else {
Iterable<? extends File> path = locations.getLocation(location);
dir = null;
for (File f : path) {
dir = f;
break;
}
}
// null-safe
File file = fileName.getFile(dir);
return new RegularFileObject(this, file);
}
use of org.eclipse.ceylon.langtools.tools.javac.file.RelativePath.RelativeFile in project ceylon by eclipse.
the class SymbolArchive method getFileObject.
@Override
public JavaFileObject getFileObject(RelativeDirectory subdirectory, String file) {
RelativeDirectory prefix_subdir = new RelativeDirectory(prefix, subdirectory.path);
ZipEntry ze = new RelativeFile(prefix_subdir, file).getZipEntry(zfile);
return new SymbolFileObject(this, file, ze);
}
Aggregations