Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

java code to create a folder and save a text file in it..!!  RSS feed

 
varun nurav
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Suppose i have a form in which there is a button "Save" and has two text fields "name" and "message".
when i click on the save button, it creates a new folder with name as the value entered in name textfield and inside it a text file contaning body as the value entered in message textfield.

please help !!
 
James Sabre
Ranch Hand
Posts: 781
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
varun nurav wrote:
please help !!


With what? You have posted this in the JDBC forum but I see nothing to do with databases. You have given an outline of a system but don't say what you are having trouble with. It seems to me you would benefit from going through the Java tutorial - http://download.oracle.com/javase/tutorial/ . Start at the "Getting Started" section and progress from there.
 
varun nurav
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i want the code for both doing functions one by one means first the folder is created and then a text file is saved in that.
i know how to create a text file but i dont know for making a folder and then saving the text file in that folder.

it has nothing to relate with database, just a I/O Stream query.!!
 
James Sabre
Ranch Hand
Posts: 781
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to study http://download.oracle.com/javase/tutorial/essential/io/ and to look at the Javadoc for class java.io.File method mkdirs() .
 
Rob Spoor
Sheriff
Posts: 20893
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
varun nurav wrote:i want the code

We are NotACodeMill. With James' hints you should be able to do it yourself.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!