]> git.argeo.org Git - lgpl/argeo-commons.git/blobdiff - org.argeo.util/src/org/argeo/util/CsvParser.java
Introduce OS utility.
[lgpl/argeo-commons.git] / org.argeo.util / src / org / argeo / util / CsvParser.java
index 7680b3267c7d0739be7ca34a99fefac93118f3e5..d133afdbc41f1d6d35fed0d1019aae5e9a31c289 100644 (file)
@@ -23,9 +23,6 @@ import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 
-import org.argeo.ArgeoException;
-import org.argeo.StreamUtils;
-
 /**
  * Parses a CSV file interpreting the first line as a header. The
  * {@link #parse(InputStream)} method and the setters are synchronized so that
@@ -114,7 +111,7 @@ public abstract class CsvParser {
                                        if (tokenSize == 1 && line.trim().equals(""))
                                                continue lines;// empty line
                                        if (headerSize != tokenSize) {
-                                               throw new ArgeoException("Token size " + tokenSize
+                                               throw new UtilsException("Token size " + tokenSize
                                                                + " is different from header size "
                                                                + headerSize + " at line " + lineCount
                                                                + ", line: " + line + ", header: " + header
@@ -123,10 +120,10 @@ public abstract class CsvParser {
                                }
                                processLine(lineCount, header, tokens);
                        }
-               } catch (ArgeoException e) {
+               } catch (UtilsException e) {
                        throw e;
                } catch (IOException e) {
-                       throw new ArgeoException("Cannot parse CSV file (line: "
+                       throw new UtilsException("Cannot parse CSV file (line: "
                                        + lineCount + ")", e);
                } finally {
                        StreamUtils.closeQuietly(reader);