bugfix for extension checking

This commit is contained in:
Jonathan Shook 2024-07-10 14:46:47 -05:00
parent 9b5fea7131
commit 9fd72cd967
2 changed files with 4 additions and 5 deletions

View File

@ -72,7 +72,7 @@ public class QdrantSpace implements AutoCloseable {
boolean useTls = cfg.getOptional("use_tls").map(Boolean::parseBoolean).orElse(true);
var builder = QdrantGrpcClient.newBuilder(uri, grpcPort, useTls);
var Optional<requiredToken> = cfg.getOptional("token_file")
String requiredToken = cfg.getOptional("token_file")
.map(Paths::get)
.map(
tokenFilePath -> {

View File

@ -119,12 +119,11 @@ public class NBAtFile {
String formatSpec = matcher.group("formatter");
String[] datapath = (dataPathSpec!=null && !dataPathSpec.isBlank()) ? dataPathSpec.split("(/|\\.)") : new String[] {};
String[] parts = filepathSpec.split("\\.",2);
if (parts.length==2 && !parts[1].toLowerCase().matches("yaml")) {
String filename = Path.of(filepathSpec).getFileName().toString();
if (filename.contains(".") && !(filename.toLowerCase().endsWith("yaml"))) {
throw new RuntimeException("Only the yaml format and extension is supported for at-files." +
" You specified " + parts[1]);
" You specified " + filepathSpec);
}
filepathSpec=(filepathSpec.endsWith(".yaml") ? filepathSpec : filepathSpec+".yaml");
Path atPath = Path.of(filepathSpec);