| | |
How do i creat folders using JAVA..
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: May 2007
Posts: 3
Reputation:
Solved Threads: 0
HI there,
The program which I am working on involves reading XML document and then depending on the input data save the output files(text) in different folders...can any body tell me where do i find tutorials which can help me in doing this....
I need help ..
waiting for response
shriyash.
The program which I am working on involves reading XML document and then depending on the input data save the output files(text) in different folders...can any body tell me where do i find tutorials which can help me in doing this....
I need help ..
waiting for response
shriyash.
Shriyash.
There are two commands available on a File object to create a directory. File.mkDir() will create just the directory specified by the File object. All parent directories must already exist. The second method, File.mkDirs() will create any necessary directories to create the entire path specified.
Java Syntax (Toggle Plain Text)
// if ParentDir exists, this invocation will work File targetDir = new File("c:/ParentDir/TargetDir"); if (!targetDir.exists()) targetDir.mkDir(); // if ParentDir may not exist yet, you can use // mkDirs() instead and all directories will be created File targetDir = new File("c:/ParentDir/TargetDir"); if (!targetDir.exists()) targetDir.mkDirs();
Last edited by Ezzaral; May 31st, 2007 at 12:26 pm. Reason: added a bit of example code
•
•
Join Date: May 2007
Posts: 3
Reputation:
Solved Threads: 0
hey Ezzaral.
thanx a lot....can u plz help me with the bold part which i have mentioned in my thread....i.e" reading XML document with a JAVA program and then depending on the input data save the output files(text) in different folders
I am new to java programming and wud be very gratefull if you can suggest me with some tutorial links with which i can do this task.
shriyash.
thanx a lot....can u plz help me with the bold part which i have mentioned in my thread....i.e" reading XML document with a JAVA program and then depending on the input data save the output files(text) in different folders
I am new to java programming and wud be very gratefull if you can suggest me with some tutorial links with which i can do this task.
shriyash.
Shriyash.
You will need to use an XML parser to read the files for processing. If you are using J2SE5.0 or above, JAXP provides built-in XML libraries. If you are using earlier versions of Java, you will need to download a parser such as JDOM or Xerces (easily found with Google). If you use JAXP, you can find many tutorials on processing XML in Java at http://java.sun.com/webservices/jaxp...ial/index.html
![]() |
Similar Threads
- Even harder than coding... designing code. UML diagrams (Computer Science)
- video & sound freezing up (Windows NT / 2000 / XP)
- uml diagram help (Database Design)
- System restore, search files& folders doesn't work. HiJackthis log is like reading gr (Viruses, Spyware and other Nasties)
- i NEED java help!!!!! (Java)
- files in C++ (C++)
Other Threads in the Java Forum
| Thread Tools | Search this Thread |
Tag cloud for Java
addressbook android api apple applet application arguments array arrays automation awt binary bluetooth button calculator chat class classes client code columns component converter database draw eclipse error errors event exception fractal ftp game givemetehcodez graphics gridlayout gui html ide image inetaddress input integer invokingapacheantprogrammatically j2me japplet java javaprojects jme jmf jni jpanel julia link linux list loop map method methods midlethttpconnection mobile netbeans newbie number objects openjavafx oracle php print problem program programming project projects recursion rim scanner screen server set signing size smart sms socket sort sql storm string support swing test threads time tree unlimited variablebinding webservices windows






