@Override public javax.tools.FileObject getFileForInput( Location l, String pkgName, String relativeName ) { return findFile(pkgName, relativeName); }
@Override public JavaFileObject getJavaFileForInput(Location l, String className, Kind kind) { if (kind == JavaFileObject.Kind.CLASS) { int dot = className.lastIndexOf('.'); String dir = dot == -1 ? "" : FileObjects.convertPackage2Folder(className.substring(0, dot)); javax.tools.FileObject fo = tx.readFileObject(l, dir, className.substring(dot + 1)); if (fo != null) { return (JavaFileObject)fo; } } return super.getJavaFileForInput(l, className, kind); }
@Override public Iterable<JavaFileObject> list(Location l, String packageName, Set<Kind> kinds, boolean recursive) { final Iterable<JavaFileObject> sr = super.list(l, packageName, kinds, recursive); return tx.filter(l, packageName, sr); }
new CachingFileManager (this.archiveProvider, this.cachedBootClassPath, true, true), new CachingFileManager (this.archiveProvider, this.cachedCompileClassPath, false, true), hasSources ? (!useModifiedFiles ? new CachingFileManager (this.archiveProvider, this.cachedSrcClassPath, filter, false, ignoreExcludes) : new SourceFileManager (this.cachedSrcClassPath, ignoreExcludes)) : null, cachedAptSrcClassPath != null ?
@Override public javax.tools.FileObject getFileForInput(Location l, String pkgName, String relativeName) { final String[] names = FileObjects.getFolderAndBaseName( FileObjects.resolveRelativePath(pkgName, relativeName), FileObjects.NBFS_SEPARATOR_CHAR); javax.tools.FileObject fo = tx.readFileObject(l, names[0], names[1]); if (fo != null) { return fo; } return super.getFileForInput(l, pkgName, relativeName); }
OutputFileManager( @NonNull final CachingArchiveProvider cap, @NonNull final ClassPath srcPath) { final ClassPathImplementation srcNoApt = AptSourcePath.sources(srcPath); final ClassPath out = CacheClassPath.forSourcePath ( ClassPathFactory.createClassPath(srcNoApt), true); readDelegate = new CachingFileManager(cap, out, false, true); }
@Override public javax.tools.FileObject getFileForOutput( Location l, String pkgName, String relativeName, javax.tools.FileObject sibling ) throws IOException, UnsupportedOperationException, IllegalArgumentException { if (!allowOutput) { throw new UnsupportedOperationException("Output is unsupported."); //NOI18N } javax.tools.JavaFileObject file = findFile (pkgName, relativeName); if (file == null) { final List<ClassPath.Entry> entries = this.cp.entries(); if (!entries.isEmpty()) { final String resourceName = FileObjects.resolveRelativePath(pkgName, relativeName); file = provider.getArchive(entries.get(0).getURL(), cacheFile).create(resourceName, filter); } } return file; //todo: wrap to make read only }