Questo sito utilizza cookies, anche di terze parti, per mostrare pubblicità e servizi in linea con il tuo account. Leggi l'informativa sui cookies.
Username: Password: oppure
JSiteMap - Java Site Map Generator - Util.java

Util.java

Caricato da: Teutoburgo
Scarica il programma completo

  1. /*
  2.     JSiteMap 0.9.0 - A Java Site Map Generator
  3.     Copyright (C) 2003 Pierre Blanc
  4.     Pierre Blanc: blanc_teutoburgo@yahoo.it
  5.     http://www.site-map.tk
  6.     http://it.geocities.com/teutoburgo
  7.  
  8.     This program is free software; you can redistribute it and/or modify
  9.     it under the terms of the GNU General Public License as published by
  10.     the Free Software Foundation; either version 2 of the License, or
  11.     (at your option) any later version.
  12.  
  13.     This program is distributed in the hope that it will be useful,
  14.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16.     GNU General Public License for more details.
  17.  
  18.     You should have received a copy of the GNU General Public License
  19.     along with this program; if not, write to the Free Software
  20.     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  21.     or go to      http://www.gnu.org/copyleft/gpl.html
  22. */
  23.  
  24. package tk.teutoburgo.jsitemap;
  25.  
  26. import java.util.*;
  27. import java.io.*;
  28.  
  29. public class Util
  30. {
  31.         public Vector readOptions(String fileName) throws Exception {
  32.                 Vector options=new Vector();
  33.                 FileInputStream fis2=new FileInputStream(fileName);
  34.                 Properties p=new Properties();
  35.                 p.load(fis2);
  36.                 Enumeration e=p.propertyNames();
  37.                 while(e.hasMoreElements()){
  38.                         String name=(String)e.nextElement(), type, value=p.getProperty(name);
  39.                         if(value.length()<1 || value.charAt(0)=='"'){
  40.                                 type=JSiteMapApplet.STRING;
  41.                                 if(value.length()>0)
  42.                                         value=value.substring(1,value.length()-1);
  43.                         } else if(value.charAt(0)=='t' || value.charAt(0)=='f')
  44.                                 type=JSiteMapApplet.BOOLEAN;
  45.                         else
  46.                                 type=JSiteMapApplet.NUMBER;
  47.                         String[] option={name, value, type};
  48.                         options.add(option);
  49. //                      System.out.println("addin.. "+name+" "+value+" "+type);
  50.                 }
  51.                 return options;
  52.         }
  53.  
  54. }