Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-08-2008, 03:19 PM
Member
 
Join Date: Apr 2008
Posts: 3
radhika123 is on a distinguished road
code to create a folder in java
Hi friends
I want to know how to create a folder in java using files concept.
Can any one send me the code to create a folder in our system using files concept.
Thanks in advance
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-08-2008, 03:45 PM
Member
 
Join Date: Jul 2008
Posts: 6
sdileepk is on a distinguished road
Send a message via Skype™ to sdileepk
In the Java.io.file package you have a mkdir method which is used to create a directory. I dont remember how this is exactly used but iam sure that it can be created with this method.
__________________
S.Dileep Kumar,
Student.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 07-08-2008, 03:55 PM
Member
 
Join Date: Jul 2008
Posts: 6
sdileepk is on a distinguished road
Send a message via Skype™ to sdileepk
Hey radhika here is the sample code. i think this should work for you. Am not sure as i have not tested as te system from which am accessing the forum from the cyber cafe. please let me know if any chnages are made in this to compile.

File f = new File("C:\TEST");
try{
if(f.mkDir())
System.out.println("Directory Created");
else
System.out.println("Directory is not created");
}catch(Exception e){
e.printStacktrace();
}
__________________
S.Dileep Kumar,
Student.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
folder cloning jad Advanced Java 1 07-01-2008 01:28 AM
Creating a java gui to create xml code Jman New To Java 3 04-27-2008 07:56 PM
How to create directory through Java Code Java Tip java.io 0 04-04-2008 03:44 PM
add password to folder ismailsaleh AWT / Swing 1 01-08-2008 06:46 AM
creation of new folder in the mail an8086 Advanced Java 1 07-15-2007 06:10 PM


All times are GMT +3. The time now is 04:56 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org