Author: chatellier Date: 2010-11-25 09:26:21 +0000 (Thu, 25 Nov 2010) New Revision: 271 Log: Selection file is now named <selectionname>.selection Modified: trunk/coser-business/src/main/java/fr/ifremer/coser/services/ProjectService.java Modified: trunk/coser-business/src/main/java/fr/ifremer/coser/services/ProjectService.java =================================================================== --- trunk/coser-business/src/main/java/fr/ifremer/coser/services/ProjectService.java 2010-11-24 15:33:29 UTC (rev 270) +++ trunk/coser-business/src/main/java/fr/ifremer/coser/services/ProjectService.java 2010-11-25 09:26:21 UTC (rev 271) @@ -309,11 +309,12 @@ File[] selectionDirectories = selectionsDirectory.listFiles(); for (File selectionDirectory : selectionDirectories) { if (selectionDirectory.isDirectory()) { + String selectionName = selectionDirectory.getName(); Selection selection = new Selection(); - selection.setName(selectionDirectory.getName()); + selection.setName(selectionName); // relecture des informations de la selection (properties) - File selectionPropertiesFile = new File(selectionDirectory, "selection.properties"); + File selectionPropertiesFile = new File(selectionDirectory, selectionName + ".selection"); InputStream inputStream = null; try { Properties props = new Properties(); @@ -536,8 +537,9 @@ project.clearData(); // try to load validated data first + String selectionName = selection.getName(); File selectionsDirectory = new File(projectDirectory, CoserConstants.STORAGE_SELECTION_DIRECTORY); - File selectionDirectory = new File(selectionsDirectory, selection.getName()); + File selectionDirectory = new File(selectionsDirectory, selectionName); int fileLoaded = 0; for (Category category : Category.values()) { @@ -558,7 +560,7 @@ } // relecture des commandes de la selection (properties) - File selectionPropertiesFile = new File(selectionDirectory, "selection.properties"); + File selectionPropertiesFile = new File(selectionDirectory, selectionName + ".selection"); InputStream inputStream = null; try { Properties props = new Properties(); @@ -734,7 +736,8 @@ File selectionsDirectory = new File(projectDirectory, CoserConstants.STORAGE_SELECTION_DIRECTORY); // creation du dossier de la selection courante - File selectionDirectory = new File(selectionsDirectory, selection.getName()); + String selectionName = selection.getName(); + File selectionDirectory = new File(selectionsDirectory, selectionName); for (Category category : Category.values()) { if (category.isDataCategory()) { @@ -755,7 +758,7 @@ } // sauvegarde des informations de la selection (properties) - File propertiesFile = new File(selectionDirectory, "selection.properties"); + File propertiesFile = new File(selectionDirectory, selectionName + ".selection"); Properties props = selection.toProperties(); addHistoryCommandsToProperties(props, selection.getHistoryCommand(), "selection.commands"); OutputStream outputStream = null; @@ -1793,7 +1796,7 @@ matrix.setValue(dynMatrixEntry.getKey(), haulCountForYearEntry.getKey(), occurence); } } - + return matrix; }