@@ -1196,31 +1196,31 @@ public static boolean dump(Writer out, File file, boolean compressed) {
1196
1196
* {@link IOException}s get caught and logged, but not re-thrown.
1197
1197
* @param out dump destination
1198
1198
* @param file file to dump
1199
- * @param compressed if {@code true} the denoted file is assumed to be
1200
- * gzipped
1199
+ * @param compressed if {@code true} the denoted file is assumed to be gzipped
1201
1200
* @param contextPath an optional override of "/source/" as the context path
1202
1201
* @return {@code true} on success (everything read and written)
1203
1202
* @throws NullPointerException if a parameter is {@code null}.
1204
1203
*/
1205
- public static boolean dumpXref (Writer out , File file , boolean compressed ,
1206
- String contextPath ) {
1204
+ public static boolean dumpXref (Writer out , File file , boolean compressed , String contextPath ) {
1205
+
1207
1206
if (!file .exists ()) {
1208
1207
return false ;
1209
1208
}
1210
- /**
1209
+
1210
+ /*
1211
1211
* For backward compatibility, read the OpenGrok-produced document
1212
1212
* using the system default charset.
1213
1213
*/
1214
- try (InputStream iss = new BufferedInputStream (
1215
- new FileInputStream ( file ))) {
1216
- Reader in = compressed ? new InputStreamReader (new GZIPInputStream (
1217
- iss )) : new InputStreamReader ( iss );
1218
- dumpXref ( out , in , contextPath ) ;
1219
- return true ;
1214
+ try (InputStream iss = new BufferedInputStream (new FileInputStream ( file ))) {
1215
+ try ( Reader in = compressed ? new InputStreamReader ( new GZIPInputStream ( iss )) :
1216
+ new InputStreamReader (iss )) {
1217
+ dumpXref ( out , in , contextPath );
1218
+ return true ;
1219
+ }
1220
1220
} catch (IOException e ) {
1221
- LOGGER .log (Level .WARNING , "An error occured while piping file " +
1222
- file , e );
1221
+ LOGGER .log (Level .WARNING , "An error occurred while piping file " + file , e );
1223
1222
}
1223
+
1224
1224
return false ;
1225
1225
}
1226
1226
0 commit comments