KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ashkelon > util > ApiXml


1 package org.ashkelon.util;
2
3 import java.io.BufferedReader JavaDoc;
4 import java.io.FileReader JavaDoc;
5 import java.io.IOException JavaDoc;
6
7 /**
8  * A utility to write xml skeleton file from package-list file
9  * to take away drudgery of creating xml files that are inputs
10  * into the repository manager
11  *
12  * @author Eitan Suez
13  */

14 public class ApiXml
15 {
16   public static void main(String JavaDoc args[]) throws IOException JavaDoc
17   {
18     if (args.length == 0 || args[0] == null)
19     {
20       System.out.println("Usage: java org.ashkelon.util.ApiXml <plist_filename>");
21       return;
22     }
23     System.out.println("<?xml version=\"1.0\" ?>");
24     System.out.println("<api>");
25     System.out.println("<name></name>");
26     System.out.println("<summarydescription></summarydescription>");
27     System.out.println("<description></description>");
28     System.out.println("<publisher></publisher>");
29     System.out.println("<download_url></download_url>");
30     System.out.println("<release_date>2001-07-03T08:00:00.000</release_date>");
31     System.out.println("<version></version>");
32     
33     BufferedReader JavaDoc br = new BufferedReader JavaDoc(new FileReader JavaDoc(args[0]));
34     String JavaDoc line = null;
35     while ( (line=br.readLine()) != null )
36     {
37       System.out.println("<package>"+line+"</package>");
38     }
39     br.close();
40     System.out.println("</api>");
41   }
42 }
43
44
Popular Tags