More beacon additions and small fixes

This commit is contained in:
Christopher Schnick committed 2022-05-28 23:52:08 +02:00
1 parent 628e322ca3
commit 948dcf33ef
25 files changed
+449 -74

No files matched your search

@@ -107,13 +107,13 @@ public class DataSourceProviders {
.anyMatch(s -> s.equalsIgnoreCase(name))).findAny();
}
public static Optional<DataSourceProvider<?>> byStore(DataStore store) {
public static Optional<DataSourceProvider<?>> byPreferredStore(DataStore store) {
if (ALL == null) {
throw new IllegalStateException("Not initialized");
}
return ALL.stream().filter(d -> d.getFileProvider() != null)
.filter(d -> d.couldSupportStore(store)).findAny();
.filter(d -> d.prefersStore(store)).findAny();
}
public static Set<DataSourceProvider<?>> getAll() {
@@ -18,8 +18,14 @@ public interface SimpleFileDataSourceProvider<T extends DataSource<?>> extends D
continue;
}
if (store instanceof FileDataStore l) {
return l.getFileName().matches("\\." + e.getValue() + "$");
for (var ext : e.getValue()) {
if (ext == null) {
continue;
}
if (store instanceof FileDataStore l) {
return l.getFileName().endsWith("." + ext);
}
}
}
return false;