branch develop updated (6caafee -> b456d51)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository tutti. See http://git.codelutin.com/tutti.git from 6caafee fixes #6859 gérer les deux types de path dans l'archive new b456d51 ne pas exploser si fichier non trouvé dans l'archive The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit b456d516ba5415f1dda41b44ca0379f82cf38128 Author: Tony CHEMIT <chemit@codelutin.com> Date: Tue Mar 24 19:30:32 2015 +0100 ne pas exploser si fichier non trouvé dans l'archive Summary of changes: .../genericformat/GenericFormatArchive.java | 29 ++++++++++++++-------- 1 file changed, 19 insertions(+), 10 deletions(-) -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository tutti. See http://git.codelutin.com/tutti.git commit b456d516ba5415f1dda41b44ca0379f82cf38128 Author: Tony CHEMIT <chemit@codelutin.com> Date: Tue Mar 24 19:30:32 2015 +0100 ne pas exploser si fichier non trouvé dans l'archive --- .../genericformat/GenericFormatArchive.java | 29 ++++++++++++++-------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/GenericFormatArchive.java b/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/GenericFormatArchive.java index d3b553c..ec64277 100644 --- a/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/GenericFormatArchive.java +++ b/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/GenericFormatArchive.java @@ -486,20 +486,29 @@ public class GenericFormatArchive implements Serializable { Path path = getPath(archiveFilePath); - try (BufferedReader bufferedReader = Files.newBufferedReader(path, Charset.forName("UTF-8"))) { + if (path==null) { + + result=0; + countLines.put(archiveFilePath, 0); + + } else { + + //FIXME The LineNumberReader can in some case be wrong, improve it + try (BufferedReader bufferedReader = Files.newBufferedReader(path, Charset.forName("UTF-8"))) { + + try (LineNumberReader lineNumberReader = new LineNumberReader(bufferedReader)) { + lineNumberReader.skip(Long.MAX_VALUE); + result = lineNumberReader.getLineNumber() - 1; + if (result == -1) { + result = 0; + } + countLines.put(archiveFilePath, result); - try (LineNumberReader lineNumberReader = new LineNumberReader(bufferedReader)) { - lineNumberReader.skip(Long.MAX_VALUE); - result = lineNumberReader.getLineNumber() - 1; - if (result == -1) { - result = 0; } - countLines.put(archiveFilePath, result); + } catch (IOException e) { + throw new ApplicationTechnicalException("Could not read " + path.toFile().getName() + " file from archive " + archiveFile, e); } - - } catch (IOException e) { - throw new ApplicationTechnicalException("Could not read " + path.toFile().getName() + " file from archive " + archiveFile, e); } } -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
participants (1)
-
codelutin.com scm