Skip to content

Commit

Permalink
Bug fix: When looking for boundaries, all files inside the boundary l…
Browse files Browse the repository at this point in the history
…ocation directory are considered

Signed-off-by: VEDELAGO MIORA <miora.ralambotiana@rte-france.com>
  • Loading branch information
miovd committed Mar 29, 2022
1 parent 6aec4e1 commit 894b9da
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
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

0 comments on commit 894b9da

Please sign in to comment.