Skip to content
Snippets Groups Projects
Commit 752c6c71 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

when source file doesn't exist throw proper exception

parent 95e5faeb
No related branches found
No related tags found
1 merge request!836Resolve "Implement Spring Security"
......@@ -123,6 +123,9 @@ public class ProjectController extends BaseController {
public ResponseEntity<byte[]> getProjectSource(@PathVariable(value = "projectId") String projectId)
throws QueryException {
FileEntry file = projectController.getSource(projectId);
if (file == null) {
throw new ObjectNotFoundException("File doesn't exist");
}
MediaType type = MediaType.TEXT_PLAIN;
if (file.getOriginalFileName().endsWith("xml")) {
type = MediaType.APPLICATION_XML;
......
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