Skip to content

Commit d9026a7

Browse files
committed
use File
1 parent 7932000 commit d9026a7

File tree

1 file changed

+5
-6
lines changed
  • opengrok-indexer/src/main/java/org/opengrok/indexer/util

1 file changed

+5
-6
lines changed

opengrok-indexer/src/main/java/org/opengrok/indexer/util/CtagsUtil.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,22 +62,21 @@ public static boolean validate(String ctagsBinary) {
6262
return false;
6363
}
6464

65-
return canProcessFiles(RuntimeEnvironment.getInstance().getSourceRootPath());
65+
return canProcessFiles(RuntimeEnvironment.getInstance().getSourceRootFile());
6666
}
6767

6868
/**
6969
* Run ctags program on a known temporary file to be created under given path and see if it was possible
7070
* to get some symbols.
71-
* @param basePath path to use for storing the temporary file
71+
* @param baseDir directory to use for storing the temporary file
7272
* @return true if at least one symbol was found, false otherwise
7373
*/
74-
private static boolean canProcessFiles(String basePath) {
74+
private static boolean canProcessFiles(File baseDir) {
7575
Path inputPath;
7676
try {
77-
inputPath = File.createTempFile("ctagsValidation", ".c",
78-
new File(basePath)).toPath();
77+
inputPath = File.createTempFile("ctagsValidation", ".c", baseDir).toPath();
7978
} catch (IOException e) {
80-
LOGGER.log(Level.WARNING, "cannot create temporary file in ''{0}''", basePath);
79+
LOGGER.log(Level.WARNING, "cannot create temporary file in ''{0}''", baseDir);
8180
return false;
8281
}
8382
final String resourceFileName = "sample.c";

0 commit comments

Comments
 (0)