Hello,
Is the text file that you want to read situated on the client side or
on the server side?
If on server-side :
/**
* read a text file
*
* @param path
* the path to the file to read
* @return a string representing the contents of the file
*/
public static String readFile(String path) {
if (path == null) {
return "";
}
String line = "";
String text = "";
try {
InputStream ips = new FileInputStream(path);
InputStreamReader ipsr = new InputStreamReader(ips);
BufferedReader br = new BufferedReader(ipsr);
while ((line = br.readLine()) != null) {
text += line + "\n";
}
br.close();
} catch (Exception e) {
text = "";
}
return text;
}
On 19 juin, 07:51, rohitgodkhindi <[email protected]> wrote:
> HEllo every body.
>
> I want to read a text file into gwt and display its contents in my
> browser .
>
> Plz help me. I am not getting how to do it.
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
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-web-toolkit?hl=en.