This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes Creating XML from folder Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Creating XML from folder" Watch "Creating XML from folder" New topic
Author

Creating XML from folder

Suresh Appagundi
Ranch Hand

Joined: Sep 22, 2003
Posts: 44
Hi

I want to create a XML from the folder specified.
For example if i give c:\\ to my xml generator, the generator should generate an xml file containing all the folders and files recursively in the c:\\.

It will look some thing like this.


<?xml version="1.0" encoding="utf-8" ?>

<folder_root name="Passed folder name with complete path">

<folder name="A">

<folder name="B">

<folder name="C">

<file name="file2" />

</folder>

<file name="file3" />

</folder>

<file name="file1" />

<file name="file3" />

</folder>

</folder_root>
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12761
    
    5
The first thing you will have to master is the use of the java.io.File class. This class contains all the methods needed to locate the directories and files in your C:\\ root.
Bill
 
jQuery in Action, 2nd edition
 
subject: Creating XML from folder
 
Similar Threads
JBuilder 6 and custom tag-libraries
how to save collection object into database
Recreate XML file
JTree - Compare Nodes problem
problem with Simple captcha implementation for sub folders directory