Skip to content

Commit

Permalink
Also look for example properties from root of dans-core-systems
Browse files Browse the repository at this point in the history
  • Loading branch information
janvanmansum committed Nov 19, 2024
1 parent 024c053 commit 5629052
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@

import java.net.URI;
import java.net.URISyntaxException;
import java.nio.file.Files;
import java.nio.file.Path;

public abstract class ExampleBase {

Expand All @@ -30,7 +32,9 @@ public abstract class ExampleBase {

static {
try {
PropertiesConfiguration props = new PropertiesConfiguration("examples/dataverse.properties");
String propsFiles = Files.exists(Path.of("examples/dataverse.properties")) ?
"examples/dataverse.properties" : "modules/dans-dataverse-client-lib/examples/dataverse.properties";
PropertiesConfiguration props = new PropertiesConfiguration(propsFiles);
DataverseClientConfig config = new DataverseClientConfig(new URI(props.getString("baseUrl")), props.getString("apiToken"), props.getString("unblockKey", null));
client = new DataverseClient(config);
}
Expand Down

0 comments on commit 5629052

Please sign in to comment.