@Override public javax.tools.FileObject getFileForOutput(Location l, String pkgName, String relativeName, javax.tools.FileObject sibling) throws IOException, UnsupportedOperationException, IllegalArgumentException { if (StandardLocation.SOURCE_OUTPUT != l) { throw new UnsupportedOperationException("Only apt output is supported."); // NOI18N } final FileObject aptRoot = getAptRoot(sibling); if (aptRoot == null) { throw new UnsupportedOperationException(noAptRootDebug(sibling)); } final String nameStr = pkgName.length() == 0 ? relativeName : pkgName.replace('.', File.separatorChar) + File.separatorChar + relativeName; //NOI18N //Always on master fs -> file is save. File rootFile = FileUtil.toFile(aptRoot); return fileTx.createFileObject(l, new File(rootFile,nameStr), rootFile, null, null); }
@Override public JavaFileObject getJavaFileForOutput (Location l, String className, JavaFileObject.Kind kind, javax.tools.FileObject sibling) throws IOException, UnsupportedOperationException, IllegalArgumentException { if (StandardLocation.SOURCE_OUTPUT != l) { throw new UnsupportedOperationException("Only apt output is supported."); // NOI18N } final FileObject aptRoot = getAptRoot(sibling); if (aptRoot == null) { throw new UnsupportedOperationException(noAptRootDebug(sibling)); } final String nameStr = className.replace('.', File.separatorChar) + kind.extension; //NOI18N //Always on master fs -> file is save. File rootFile = FileUtil.toFile(aptRoot); final JavaFileObject result = fileTx.createFileObject(l, new File(rootFile,nameStr), rootFile, null, null); return result; }