import java.io.File;
import org.splat.kernel.Do;
-import org.splat.som.Database;
+import org.splat.service.technical.RepositoryService;
+import org.splat.dal.dao.som.Database;
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;
// -------------------------
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);
// ----------------------------------------------
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