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.Kindkind, 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, toUripublic JavaInMemoryFileObject(URI uri, String pathInJar, JavaFileObject.Kind kind)
public InputStream openInputStream() throws IOException
IOExceptionpublic OutputStream openOutputStream() throws IOException
IOExceptionpublic Reader openReader(boolean ignoreEncodingErrors) throws IOException
IOExceptionpublic CharSequence getCharContent(boolean ignoreEncodingErrors) throws IOException
IOExceptionpublic Writer openWriter() throws IOException
IOExceptionpublic void writeToJar(JarBuilder jarBuilder, String owner)
writeToJar in class JarFileObject