Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fix: When looking for boundaries, all files inside the boundary location directory are considered #2045

Merged
merged 3 commits into from
Mar 29, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import com.powsybl.cgmes.model.CgmesOnDataSource;
import com.powsybl.commons.config.PlatformConfig;
import com.powsybl.commons.datasource.DataSource;
import com.powsybl.commons.datasource.DataSourceUtil;
import com.powsybl.commons.datasource.GenericReadOnlyDataSource;
import com.powsybl.commons.datasource.ReadOnlyDataSource;
import com.powsybl.commons.util.ServiceLoaderCache;
Expand Down Expand Up @@ -129,7 +128,7 @@ private ReadOnlyDataSource boundary(Properties p) {
boundaryLocationParameter,
defaultValueConfig));
// Check that the Data Source has valid CGMES names
ReadOnlyDataSource ds = new GenericReadOnlyDataSource(loc, DataSourceUtil.getBaseName(loc));
ReadOnlyDataSource ds = new GenericReadOnlyDataSource(loc);
if ((new CgmesOnDataSource(ds)).names().isEmpty()) {
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ public GenericReadOnlyDataSource(Path directory, String baseName, DataSourceObse
};
}

/**
* The data source contains all files inside the given directory.
*/
public GenericReadOnlyDataSource(Path directory) {
this(directory, "");
}

public GenericReadOnlyDataSource(Path directory, String baseName) {
this(directory, baseName, null);
}
Expand Down