18
18
*/
19
19
20
20
/*
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.
22
22
* Portions Copyright (c) 2020, Chris Fraire <[email protected] >.
23
23
*/
24
24
package org .opengrok .web .api .v1 .controller ;
@@ -83,10 +83,6 @@ public StreamingOutput getContentPlain(@Context HttpServletRequest request,
83
83
@ QueryParam ("path" ) final String path ) throws IOException , ParseException , NoPathParameterException {
84
84
85
85
File file = toFile (path );
86
- if (file == null ) {
87
- // error already set in the response
88
- return null ;
89
- }
90
86
91
87
Document doc ;
92
88
if ((doc = getDocument (file )) == null ) {
@@ -113,15 +109,6 @@ public StreamingOutput getContentOctets(@Context HttpServletRequest request,
113
109
@ QueryParam ("path" ) final String path ) throws IOException , ParseException , NoPathParameterException {
114
110
115
111
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
- }
125
112
126
113
try {
127
114
return transfer (file );
@@ -141,10 +128,6 @@ public String getGenre(@Context HttpServletRequest request,
141
128
@ QueryParam ("path" ) final String path ) throws IOException , ParseException , NoPathParameterException {
142
129
143
130
File file = toFile (path );
144
- if (file == null ) {
145
- // error already set in the response
146
- return null ;
147
- }
148
131
149
132
Document doc ;
150
133
if ((doc = getDocument (file )) == null ) {
0 commit comments