on 03-23-2012 8:15 AM
Hello experts 😉
I'm trying to parse a html file which was uploaded by the user via UploadUi. This works fine.
Now I have the file in a context node (type. Resource). I need all characters from the html file in a string to parse the string and to build a new html file for download.
I need some help to reading out the resource to a string.
kind regards
Michael
Hi Michael,
You can use something like this:
IWDResource resource = wdContext.currentContextElement().getYourResource();
InputStream fileInputStream = resource.read(false);
int size = fileInputStream.available();
byte[] byteArray = new byte[size];
fileInputStream.read(byteArray, 0, size);
String yourHTML = new String(byteArray);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.