Salome HOME
Refactoring of Database, replacing SQL by DAOs calls. Methods for search by criteria...
[tools/siman.git] / Workspace / Siman / src / org / splat / simer / UploadAction.java
index 923a120f78010035f0c9366c3d00eb27f69f4665..ad513195f7bb45f8eb49288f071b6a8c17cd29ad 100644 (file)
@@ -3,6 +3,7 @@ package org.splat.simer;
 import java.io.File;
 
 import org.splat.kernel.Do;
+import org.splat.service.technical.RepositoryService;
 import org.splat.dal.dao.som.Database;
 
 
@@ -15,6 +16,10 @@ public class UploadAction extends Action {
     private ToDo    action;                  // Action to do
     private String  next           = null;   // Action to which the uploaded file is passed
        private String  index          = null;   // Depending on the next action, document index to which the action applies
+       /**
+        * Injected repository service.
+        */
+       private RepositoryService _repositoryService;
 
        private static final long serialVersionUID = 6003880772275115923L;
 
@@ -33,7 +38,7 @@ public class UploadAction extends Action {
 //  -------------------------
       if (action == ToDo.cancel) return "cancel";
       try {
-       File    udir = Database.getDownloadDirectory(getConnectedUser());
+       File    udir = getRepositoryService().getDownloadDirectory(getConnectedUser());
        String  path = udir.getPath() + "/" + uploadFileName;
        File    file = new File(path);
 
@@ -96,4 +101,20 @@ public class UploadAction extends Action {
 //  ----------------------------------------------
       this.uploadMimeType = mime;
     }
+
+       /**
+        * Get the repositoryService.
+        * @return the repositoryService
+        */
+       public RepositoryService getRepositoryService() {
+               return _repositoryService;
+       }
+
+       /**
+        * Set the repositoryService.
+        * @param repositoryService the repositoryService to set
+        */
+       public void setRepositoryService(RepositoryService repositoryService) {
+               _repositoryService = repositoryService;
+       }
 }
\ No newline at end of file