public class JavaInMemoryFileObject extends JarFileObject
SimpleJavaFileObject
implementation that forwards the content of the file to a Jar
output stream instead of writing it to disk. Since the Jar can be shared between multiple
threads, a semaphore is used to ensure exclusive access to the output stream.JavaFileObject.Kind
kind, pathInJar, uri
Constructor and Description |
---|
JavaInMemoryFileObject(URI uri,
String pathInJar,
JavaFileObject.Kind kind) |
Modifier and Type | Method and Description |
---|---|
CharSequence |
getCharContent(boolean ignoreEncodingErrors) |
InputStream |
openInputStream() |
OutputStream |
openOutputStream() |
Reader |
openReader(boolean ignoreEncodingErrors) |
Writer |
openWriter() |
void |
writeToJar(JarBuilder jarBuilder,
String owner) |
delete, getAccessLevel, getKind, getLastModified, getName, getNestingKind, isNameCompatible, toString, toUri
public JavaInMemoryFileObject(URI uri, String pathInJar, JavaFileObject.Kind kind)
public InputStream openInputStream() throws IOException
IOException
public OutputStream openOutputStream() throws IOException
IOException
public Reader openReader(boolean ignoreEncodingErrors) throws IOException
IOException
public CharSequence getCharContent(boolean ignoreEncodingErrors) throws IOException
IOException
public Writer openWriter() throws IOException
IOException
public void writeToJar(JarBuilder jarBuilder, String owner)
writeToJar
in class JarFileObject