We use the following code snippet, for a static file stored in
/war/data/rules.xml
...
File file = new File("data/content.xml");
FileInputStream istream = new FileInputStream(file);
int ret = 0, count = 0;
byte[] buff = new byte[2048];
StringBuffer xmlString = new StringBuffer();
while( (ret = istream.read(buff)) > 0 ){
ByteBuffer bb = ByteBuffer.wrap(buff, 0, ret);
Charset csets = Charset.forName("US-ASCII");
CharBuffer encoded = csets.decode(bb);
xmlString.append(encoded.toString());
count += ret;
}
istream.close();
...
doXmlWorker(xmlString.toString());
...
In appengine-web-app.xml add
<resource-files>
<include path="/data/**.*" />
....
</resource-files>
--
You received this message because you are subscribed to the Google Groups
"Google App Engine for Java" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-appengine-java/-/1ktYrx_9M-sJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-appengine-java?hl=en.