[Webfunds-commits] java/webfunds/ricardian IniFileReader.java

Ian Grigg iang@cypherpunks.ai
Wed, 16 Aug 2000 14:37:18 -0400 (AST)


iang        00/08/16 14:37:18

  Modified:    webfunds/ricardian IniFileReader.java
  Log:
  added type of ContractException as MULTILINE (now valuable info);
  removed old stuff;

Revision  Changes    Path
1.12      +5 -50     java/webfunds/ricardian/IniFileReader.java

Index: IniFileReader.java
===================================================================
RCS file: /home/webfunds/cvsroot/java/webfunds/ricardian/IniFileReader.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- IniFileReader.java	1999/12/29 03:56:49	1.11
+++ IniFileReader.java	2000/08/16 18:37:17	1.12
@@ -1,5 +1,5 @@
 /*
- * $Id: IniFileReader.java,v 1.11 1999/12/29 03:56:49 iang Exp $
+ * $Id: IniFileReader.java,v 1.12 2000/08/16 18:37:17 iang Exp $
  *
  * Copyright (c) Systemics Ltd 1995-1999 on behalf of
  * the WebFunds Development Team.  All Rights Reserved.
@@ -67,48 +67,6 @@
         add(data);
     }
 
-//    /**
-//     *  read a ini formated file and put in the class
-//     *  @param fileName the file name of the ini file
-//     */
-//    public IniFileReader(String fileName)
-//        throws IOException
-//    {
-//        FileInputStream fis = new FileInputStream(fileName);
-//        byte[] data = new byte[fis.available()];
-//        fis.read(data);
-//        fis.close();
-//
-//        startEmpty();
-//        add(data);
-//    }
-//   
-//    public IniFileReader(File file)
-//        throws IOException
-//    {
-//        FileInputStream fis = new FileInputStream(file);
-//        byte[] data = new byte[fis.available()];
-//        fis.read(data);
-//        fis.close();
-//
-//        startEmpty();
-//        add(data);
-//    }
-//
-//    public IniFileReader(URL url)
-//        throws IOException
-//    {
-//    
-//        // read the url in a byte array;
-//        InputStream is = url.openStream();
-//        byte[] data = new byte[is.available()];
-//        is.read(data);
-//        is.close();
-//
-//        startEmpty();
-//        add(data);
-//    }
-//
 
 
     final static int         TRIM_WHITE_SPACE = 3;
@@ -315,11 +273,6 @@
     {
         String[] lines = toLines(iniFileAsByteArray);
     
-//        //open the file
-//        BufferedReader bufr = new BufferedReader(
-//                              new InputStreamReader (
-//                              new ByteArrayInputStream(iniFileAsByteArray)));
-//        while (( line = bufr.readLine()) != null)
 
         //
         // Read the file line by line and put data in the right place
@@ -433,12 +386,14 @@
                 {
                     if (lineNum + 1 > numLines)
                         throw new ContractException(
-                                  "Too few lines for multiline" + lineNum);
+                                  ContractException.MULTILINE, lineNum,
+                                  "Too few lines for multiline");
 
                     String temp = lines[lineNum++];
                     if (!temp.equals("{"))
                         throw new ContractException(
-                                  "No { after * at line " + lineNum);
+                                  ContractException.MULTILINE, lineNum,
+                                  "No { after *");
         
                     value = "";
                     temp = null;