• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 !!
 
Ranch Hand
Posts: 781
Netbeans IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Netbeans IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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() .
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic