mirror of
https://github.com/xpipe-io/xpipe.git
synced 2026-10-07 10:22:19 -04:00
More beacon additions and small fixes
This commit is contained in:
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;
|
||||
|
||||
Reference in new issue
Block a user