The classes of the packe java.io are used to read/write files.
Try sth. like:
String s = "bla bla bla";
try {
// write file
FileWriter writer = new FileWriter("filename.txt");
writer.write(s, 0, s.length());
writer.flush();
writer.close();
StringBuffer sb = new StringBuffer();
// read file
FileReader reader = new FileReader("filename.txt");
char[] buf = new char[128];
int i = 0;
while ((i = reader.read(buf,0,buf.length)) !=
-1) sb.append(buf);
reader.close();
String filecontent = sb.toString();
} catch (IOExceptoin e) {}
(Get further information in the Java Tutorial available at javasoft.com as
this is a quite basic question with no relation to servlets.)
-mw
At 15:55 23.05.2001 -0500, you wrote:
>Hi List:
>
>I have other question... still wait for the respond of my before request.
>
>The question is:
>I have a variable of type String...> String nota = "This is Johan";
>How can I do for to write the value of my variable "nota" in a File(Notepad
>for example) , then save it in a directory and open it in other time for
>several times. All that process in code pure of Java.
>
>Please, this is a important question, help me...
>
>Good Luck!!!
>
>Bach. Johan A. Talla Anampa
>----------------------------
>Consultor IT
>Lima - Per�
>----------------------------
>
>___________________________________________________________________________
>To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
>of the message "signoff SERVLET-INTEREST".
>
>Archives: http://archives.java.sun.com/archives/servlet-interest.html
>Resources: http://java.sun.com/products/servlet/external-resources.html
>LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html