public FileObject getResource(JavaFileManager.Location location, FileKey key) throws IOException { return getResource(location, key.packageFQN, key.name); }
public FileObject getResource(JavaFileManager.Location location, FileKey key) throws IOException { return getResource(location, key.packageFQN, key.name); }
public FileObject getResource(JavaFileManager.Location location, CharSequence pkg, CharSequence relativeName) { return getResource(location, Name.parse(pkg), relativeName); }
public FileObject getResource(JavaFileManager.Location location, CharSequence pkg, CharSequence relativeName) { return getResource(location, Name.parse(pkg), relativeName); }
public FileObject getResource(JavaFileManager.Location location, Path.Absolute path) throws IOException { return getResource(location, path.getDirs(), path.getSimpleName()); }
public FileObject getResource(JavaFileManager.Location location, Path.Absolute path) throws IOException { return getResource(location, path.getDirs(), path.getSimpleName()); }
InputStream in = null; try { FileObject file = context.getResource(StandardLocation.SOURCE_OUTPUT, "juzu", "processor.log"); in = file.openInputStream(); s = Tools.read(in, Tools.UTF_8);
InputStream in = null; try { FileObject file = context.getResource(StandardLocation.SOURCE_OUTPUT, "juzu", "processor.log"); in = file.openInputStream(); s = Tools.read(in, Tools.UTF_8);
InputStream in = null; try { FileObject file = getContext().getResource(StandardLocation.SOURCE_OUTPUT, "juzu", "metamodel.ser"); in = file.openInputStream(); ObjectInputStream ois = new ObjectInputStream(in);
InputStream in = null; try { FileObject file = getContext().getResource(StandardLocation.SOURCE_OUTPUT, "juzu", "metamodel.ser"); in = file.openInputStream(); ObjectInputStream ois = new ObjectInputStream(in);
private boolean _process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) throws IOException { if (roundEnv.processingOver()) { // Read an existing resource FileObject foo = processingContext.getResource(location, "", "foo.txt"); assertNotNull(foo); String s = Tools.read(foo.openInputStream()); assertEquals("foo_value", s); // Now we overwrite the resource foo = processingContext.createResource(location, "", "foo.txt"); OutputStream out = foo.openOutputStream(); out.write("new_foo_value".getBytes()); out.close(); // Read an non existing resource // JDK 6 strange behavior / bug happens here, we should get bar=null but we don't // JDK 7 should return null FileObject bar = processingContext.getResource(location, "", "bar.txt"); assertNull(bar); // Now create new resource foo = processingContext.createResource(location, "", "juu.txt"); out = foo.openOutputStream(); out.write("juu_value".getBytes()); out.close(); } return true; } }
private boolean _process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) throws IOException { if (roundEnv.processingOver()) { // Read an existing resource FileObject foo = processingContext.getResource(location, "", "foo.txt"); assertNotNull(foo); String s = Tools.read(foo.openInputStream()); assertEquals("foo_value", s); // Now we overwrite the resource foo = processingContext.createResource(location, "", "foo.txt"); OutputStream out = foo.openOutputStream(); out.write("new_foo_value".getBytes()); out.close(); // Read an non existing resource // JDK 6 strange behavior / bug happens here, we should get bar=null but we don't // JDK 7 should return null FileObject bar = processingContext.getResource(location, "", "bar.txt"); assertNull(bar); // Now create new resource foo = processingContext.createResource(location, "", "juu.txt"); out = foo.openOutputStream(); out.write("juu_value".getBytes()); out.close(); } return true; } }
URL src = entry.getValue(); URLConnection conn = src.openConnection(); FileObject dst = context.getResource(StandardLocation.CLASS_OUTPUT, qn, entry.getKey()); if (dst == null || dst.getLastModified() < conn.getLastModified()) { dst = context.createResource(StandardLocation.CLASS_OUTPUT, qn, entry.getKey(), context.get(metaModel.getHandle()));
URL src = entry.getValue(); URLConnection conn = src.openConnection(); FileObject dst = context.getResource(StandardLocation.CLASS_OUTPUT, qn, entry.getKey()); if (dst == null || dst.getLastModified() < conn.getLastModified()) { dst = context.createResource(StandardLocation.CLASS_OUTPUT, qn, entry.getKey(), context.get(metaModel.getHandle()));