@Override JavaFileObject createFileObject(Location location, File file, File root, JavaFileFilterImplementation filter, Charset encoding) { return getDelegate().createFileObject(location, file, root, filter, encoding); }
@Override public FileObject getFileForOutput(Location location, String packageName, String relativeName, FileObject sibling) throws IOException { if (!hasLocation(location)) { throw new IllegalArgumentException(String.valueOf(location)); } final File root = new File(outputRoot); final File file = FileUtil.normalizeFile(new File ( root, FileObjects.resolveRelativePath(packageName, relativeName).replace(FileObjects.NBFS_SEPARATOR_CHAR, File.separatorChar))); //NOI18N return tx.createFileObject(location, file, root,null,null); }
@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; }
@Override public JavaFileObject getJavaFileForOutput(Location location, String className, JavaFileObject.Kind kind, FileObject sibling) throws IOException { if (!hasLocation(location)) { throw new IllegalArgumentException(String.valueOf(location)); } final File root = new File (outputRoot); final String nameStr = FileObjects.convertPackage2Folder(className, File.separatorChar) + '.' + FileObjects.SIG; final File file = new File (root, nameStr); if (FileObjects.isValidFileName(className)) { return tx.createFileObject(location, file, root, null, null); } else { LOG.log( Level.WARNING, "Invalid class name: {0} sibling: {1}", //NOI18N new Object[]{ className, sibling }); return FileObjects.nullWriteFileObject(FileObjects.fileFileObject(file, root, null, null)); } }
public @Override javax.tools.FileObject getFileForOutput( Location l, String pkgName, String relativeName, javax.tools.FileObject sibling ) throws IOException, UnsupportedOperationException, IllegalArgumentException { assert pkgName != null; assert relativeName != null; URL siblingURL = siblings.hasSibling() ? siblings.getSibling() : sibling == null ? null : sibling.toUri().toURL(); if (siblingURL == null) { throw new IllegalArgumentException ("sibling == null"); } File activeRoot = getClassFolderForSourceImpl (siblingURL); if (activeRoot == null) { activeRoot = getClassFolderForApt(siblingURL); if (activeRoot == null) { //Deleted project throw new InvalidSourcePath (); } } final String path = FileObjects.resolveRelativePath(pkgName, relativeName); final File file = FileUtil.normalizeFile(new File (activeRoot,path.replace(FileObjects.NBFS_SEPARATOR_CHAR, File.separatorChar))); return tx.createFileObject(l, file, activeRoot,null,null); }
final File f = new File (activeRoot, nameStr); if (FileObjects.isValidFileName(className)) { return tx.createFileObject(l, f, activeRoot, null, null); } else { LOG.log(