Skip to content

Commit

Permalink
Merge pull request #239 from pdowler/master
Browse files Browse the repository at this point in the history
cadc-util: add ctor to read from arbitrary specified File
  • Loading branch information
pdowler authored Jan 12, 2024
2 parents 3724d2c + bde57f0 commit bebd939
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cadc-util/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ sourceCompatibility = 1.8

group = 'org.opencadc'

version = '1.10.4'
version = '1.10.5'

description = 'OpenCADC core utility library'
def git_url = 'https://github.com/opencadc/core'
Expand Down
14 changes: 14 additions & 0 deletions cadc-util/src/main/java/ca/nrc/cadc/util/PropertiesReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,20 @@ public PropertiesReader(String filename) throws InvalidConfigException {
cachedPropsKey = propertiesFile.getAbsolutePath();
log.debug("properties file: " + propertiesFile);
}

/**
* Read the specified file (no search in usual locations).
*
* @param src
*/
public PropertiesReader(File src) {
if (src == null) {
throw new IllegalArgumentException("src cannot be null.");
}
this.propertiesFile = src;
cachedPropsKey = propertiesFile.getAbsolutePath();
log.debug("properties file: " + propertiesFile);
}

/**
* Obtain whether the file associated with this Properties Reader can be accessed and read from.
Expand Down

0 comments on commit bebd939

Please sign in to comment.