X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=org.argeo.util%2Fsrc%2Forg%2Fargeo%2Futil%2FCsvParser.java;h=1f52e986e880f112ef0f463ff7a9ef6c1753cf7a;hb=71196c25959b53964edf87aeb4387ed8b11b4868;hp=7680b3267c7d0739be7ca34a99fefac93118f3e5;hpb=eebaa683a3c470ad22a5eaa5c32f816a2ea2cbbb;p=lgpl%2Fargeo-commons.git diff --git a/org.argeo.util/src/org/argeo/util/CsvParser.java b/org.argeo.util/src/org/argeo/util/CsvParser.java index 7680b3267..1f52e986e 100644 --- a/org.argeo.util/src/org/argeo/util/CsvParser.java +++ b/org.argeo.util/src/org/argeo/util/CsvParser.java @@ -1,18 +1,3 @@ -/* - * Copyright (C) 2007-2012 Argeo GmbH - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ package org.argeo.util; import java.io.BufferedReader; @@ -23,9 +8,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 +96,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 +105,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);