Skip to content

Commit 27eed78

Browse files
Vladimir Kotalahornace
authored andcommitted
cleanup
1 parent c5c07d2 commit 27eed78

File tree

1 file changed

+1
-18
lines changed

1 file changed

+1
-18
lines changed

opengrok-web/src/main/java/org/opengrok/web/api/v1/controller/FileController.java

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919

2020
/*
21-
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
21+
* Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
2222
* Portions Copyright (c) 2020, Chris Fraire <[email protected]>.
2323
*/
2424
package org.opengrok.web.api.v1.controller;
@@ -83,10 +83,6 @@ public StreamingOutput getContentPlain(@Context HttpServletRequest request,
8383
@QueryParam("path") final String path) throws IOException, ParseException, NoPathParameterException {
8484

8585
File file = toFile(path);
86-
if (file == null) {
87-
// error already set in the response
88-
return null;
89-
}
9086

9187
Document doc;
9288
if ((doc = getDocument(file)) == null) {
@@ -113,15 +109,6 @@ public StreamingOutput getContentOctets(@Context HttpServletRequest request,
113109
@QueryParam("path") final String path) throws IOException, ParseException, NoPathParameterException {
114110

115111
File file = toFile(path);
116-
if (file == null) {
117-
return null;
118-
}
119-
120-
Document doc;
121-
if ((doc = getDocument(file)) == null) {
122-
response.sendError(HttpServletResponse.SC_NOT_FOUND, "Cannot get document for file");
123-
return null;
124-
}
125112

126113
try {
127114
return transfer(file);
@@ -141,10 +128,6 @@ public String getGenre(@Context HttpServletRequest request,
141128
@QueryParam("path") final String path) throws IOException, ParseException, NoPathParameterException {
142129

143130
File file = toFile(path);
144-
if (file == null) {
145-
// error already set in the response
146-
return null;
147-
}
148131

149132
Document doc;
150133
if ((doc = getDocument(file)) == null) {

0 commit comments

Comments
 (0)