This is an automated email from the git hooks/post-receive script. New commit to branch feature/7389_controle_existence_fichier_d_import in repository tutti. See https://gitlab.nuiton.org/codelutin/tutti.git commit c7a41258fa2f61d771e455774f20229c7b57838e Author: Samuel Maisonneuve <maisonneuve@codelutin.com> Date: Thu Jul 21 18:43:04 2016 +0200 Add a validation control on dump file to import refs #8379 --- .../java/fr/ird/observe/ui/storage/StorageUIModel.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/observe-application-swing/src/main/java/fr/ird/observe/ui/storage/StorageUIModel.java b/observe-application-swing/src/main/java/fr/ird/observe/ui/storage/StorageUIModel.java index 391b4a0..55979ac 100644 --- a/observe-application-swing/src/main/java/fr/ird/observe/ui/storage/StorageUIModel.java +++ b/observe-application-swing/src/main/java/fr/ird/observe/ui/storage/StorageUIModel.java @@ -929,6 +929,12 @@ public class StorageUIModel extends WizardModel<StorageStep> { setSteps(universe.toArray(new StorageStep[universe.size()])); } + private boolean isValidDumpFile(File dumpFile) { + return dumpFile != null && + dumpFile.exists() && + dumpFile.getName().endsWith(".sql.gz"); + } + @Override public boolean validate(StorageStep s) { boolean validate = super.validate(s); @@ -973,6 +979,8 @@ public class StorageUIModel extends WizardModel<StorageStep> { // dataSourceInformation.canReadData(); // } // } + } else if (DbMode.CREATE_LOCAL.equals(dbMode) && CreationMode.IMPORT_EXTERNAL_DUMP.equals(creationMode)) { + validate = isValidDumpFile(dumpFile); } break; case CONFIG_REFERENTIEL: @@ -988,10 +996,7 @@ public class StorageUIModel extends WizardModel<StorageStep> { break; case IMPORT_EXTERNAL_DUMP: // external dumb must be filled - File dumpFile = centralSourceModel.getDumpFile(); - validate = dumpFile != null && - dumpFile.exists() && - dumpFile.getName().endsWith(".sql.gz"); + validate = isValidDumpFile(centralSourceModel.getDumpFile()); break; case IMPORT_REMOTE_STORAGE: case IMPORT_SERVER_STORAGE: @@ -1026,10 +1031,7 @@ public class StorageUIModel extends WizardModel<StorageStep> { break; case IMPORT_EXTERNAL_DUMP: // external dumb must be filled - File dumpFile = dataSourceModel.getDumpFile(); - validate = dumpFile != null && - dumpFile.exists() && - dumpFile.getName().endsWith(".sql.gz"); + validate = isValidDumpFile(dataSourceModel.getDumpFile()); break; case IMPORT_REMOTE_STORAGE: // remote db connexion must be valid -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.