File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
opengrok-indexer/src/main/java/org/opengrok/indexer/index Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 24
24
*/
25
25
package org .opengrok .indexer .index ;
26
26
27
+ import java .io .BufferedReader ;
27
28
import java .io .File ;
29
+ import java .io .FileInputStream ;
28
30
import java .io .IOException ;
31
+ import java .io .InputStreamReader ;
29
32
import java .io .PrintStream ;
30
33
import java .io .UncheckedIOException ;
31
34
import java .lang .reflect .Field ;
32
35
import java .lang .reflect .InvocationTargetException ;
33
36
import java .net .URI ;
34
37
import java .net .URISyntaxException ;
38
+ import java .nio .charset .StandardCharsets ;
35
39
import java .nio .file .Files ;
36
40
import java .nio .file .Path ;
37
41
import java .nio .file .Paths ;
@@ -767,8 +771,9 @@ public static String[] parseOptions(String[] argv) throws ParseException {
767
771
execute (optarg -> {
768
772
String value = ((String ) optarg ).trim ();
769
773
if (value .startsWith ("@" )) {
770
- try {
771
- String token = new String (Files .readAllBytes (Path .of (value ))).trim ();
774
+ try (BufferedReader in = new BufferedReader (new InputStreamReader (
775
+ new FileInputStream (Path .of (value ).toString ().substring (1 ))))) {
776
+ String token = in .readLine ().trim ();
772
777
cfg .setIndexerAuthenticationToken (token );
773
778
} catch (IOException e ) {
774
779
die ("Failed to read from " + value );
You can’t perform that action at this time.
0 commit comments