Skip to content
Snippets Groups Projects
Commit 6aaf14d9 authored by srosse's avatar srosse
Browse files

Merge OpenOLAT 10.3 to OpenOLATpro default branch with 4bd21d8d690eecb44bcf2718dffcfff407abe15b

parents 994dbf5b bdac9cbd
No related branches found
No related tags found
No related merge requests found
...@@ -39,6 +39,7 @@ import org.olat.core.gui.control.WindowControl; ...@@ -39,6 +39,7 @@ import org.olat.core.gui.control.WindowControl;
import org.olat.core.util.StringHelper; import org.olat.core.util.StringHelper;
import org.olat.core.util.vfs.VFSContainer; import org.olat.core.util.vfs.VFSContainer;
import org.olat.core.util.vfs.VFSItem; import org.olat.core.util.vfs.VFSItem;
import org.olat.core.util.vfs.VFSManager;
import org.olat.course.nodes.gta.model.Solution; import org.olat.course.nodes.gta.model.Solution;
...@@ -60,12 +61,12 @@ public class EditSolutionController extends FormBasicController { ...@@ -60,12 +61,12 @@ public class EditSolutionController extends FormBasicController {
public EditSolutionController(UserRequest ureq, WindowControl wControl, public EditSolutionController(UserRequest ureq, WindowControl wControl,
File solutionDir, VFSContainer solutionContainer) { File solutionDir, VFSContainer solutionContainer) {
this(ureq, wControl, new Solution(), solutionDir, solutionContainer, true); this(ureq, wControl, new Solution(), solutionDir, solutionContainer, false);
} }
public EditSolutionController(UserRequest ureq, WindowControl wControl, Solution solution, public EditSolutionController(UserRequest ureq, WindowControl wControl, Solution solution,
File solutionDir, VFSContainer solutionContainer) { File solutionDir, VFSContainer solutionContainer) {
this(ureq, wControl, solution, solutionDir, solutionContainer, false); this(ureq, wControl, solution, solutionDir, solutionContainer, true);
} }
private EditSolutionController(UserRequest ureq, WindowControl wControl, private EditSolutionController(UserRequest ureq, WindowControl wControl,
...@@ -145,6 +146,13 @@ public class EditSolutionController extends FormBasicController { ...@@ -145,6 +146,13 @@ public class EditSolutionController extends FormBasicController {
} }
String filename = fileEl.getUploadFileName(); String filename = fileEl.getUploadFileName();
if(!replaceFile) {
File currentFile = new File(solutionDir, filename);
if(currentFile.exists()) {
filename = VFSManager.rename(solutionContainer, filename);
}
}
solution.setFilename(filename); solution.setFilename(filename);
try { try {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment