branch develop updated (d5f6b7c -> 6caafee)
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 d5f6b7c refs #6847 ajout de la nouvelle configuration par défaut new 6caafee fixes #6859 gérer les deux types de path 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 6caafeed07bf382d384f120bca631d8e8085f466 Author: Tony CHEMIT <chemit@codelutin.com> Date: Tue Mar 24 18:59:19 2015 +0100 fixes #6859 gérer les deux types de path dans l'archive Summary of changes: .../genericformat/GenericFormatArchive.java | 29 ++++++++++++++-------- 1 file changed, 18 insertions(+), 11 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 6caafeed07bf382d384f120bca631d8e8085f466 Author: Tony CHEMIT <chemit@codelutin.com> Date: Tue Mar 24 18:59:19 2015 +0100 fixes #6859 gérer les deux types de path dans l'archive --- .../genericformat/GenericFormatArchive.java | 29 ++++++++++++++-------- 1 file changed, 18 insertions(+), 11 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 31de088..d3b553c 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 @@ -63,12 +63,12 @@ public class GenericFormatArchive implements Serializable { /** Logger. */ private static final Log log = LogFactory.getLog(GenericFormatArchive.class); - private static enum ArchiveMode { + private enum ArchiveMode { IMPORT, EXPORT } - private static enum ArchiveFilePath { + private enum ArchiveFilePath { PROTOCOL(false, "protocol.tuttiProtocol"), REFERENTIAL_GEAR(false, "temporaryGears.csv"), @@ -377,7 +377,7 @@ public class GenericFormatArchive implements Serializable { fileObject = children[0]; - String prefix = fileObject.getName().getBaseName() + "/"; + String prefix = fileObject.getName().getBaseName(); return prefix; } @@ -394,8 +394,7 @@ public class GenericFormatArchive implements Serializable { try (ZipFile zipFile = new ZipFile(archiveFile)) { - String zipEntryPath = getZipEntryPath(archiveFilePath); - ZipEntry entry = zipFile.getEntry(zipEntryPath); + ZipEntry entry = getZipEntryPath(archiveFilePath, zipFile); Preconditions.checkState(!(archiveFilePath.isMandatory() && entry == null), "Must have entry " + filename); @@ -421,6 +420,16 @@ public class GenericFormatArchive implements Serializable { } + protected ZipEntry getZipEntryPath(ArchiveFilePath archiveFilePath, ZipFile zipFile ) { + String path = prefixPath + "/" + archiveFilePath.getFilename(); + ZipEntry entry = zipFile.getEntry(path); + if (entry==null) { + path = prefixPath + "\\" + archiveFilePath.getFilename(); + entry = zipFile.getEntry(path); + } + return entry; + } + protected String getZipEntryPath(ArchiveFilePath archiveFilePath) { String path = prefixPath + archiveFilePath.getFilename(); @@ -436,18 +445,16 @@ public class GenericFormatArchive implements Serializable { for (ArchiveFilePath archiveFilePath : ArchiveFilePath.values()) { - String zipEntryPath = getZipEntryPath(archiveFilePath); + ZipEntry zipEntry = getZipEntryPath(archiveFilePath, zipFile); if (log.isDebugEnabled()) { - log.debug("Check if entry " + zipEntryPath + " exists."); + log.debug("Check if entry " + archiveFilePath + " exists."); } - ZipEntry zipEntry = zipFile.getEntry(zipEntryPath); - if (zipEntry == null) { if (log.isInfoEnabled()) { - log.info("Entry " + zipEntryPath + " not found."); + log.info("Entry " + archiveFilePath + " not found."); } result.add(archiveFilePath); @@ -455,7 +462,7 @@ public class GenericFormatArchive implements Serializable { } else { if (log.isInfoEnabled()) { - log.info("Entry " + zipEntryPath + " found."); + log.info("Entry " + archiveFilePath + " found."); } } -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
participants (1)
-
codelutin.com scm