-
- private PropHolder(File dir, File file, File keyfile) throws IOException {
- this.dir = dir;
- this.file = file;
- this.keyfile = keyfile;
- symm = null;
- props = new TreeMap<>();
- }
-
- public String getPath() {
- return file.getAbsolutePath();
- }
-
- public File getDir() {
- return dir;
- }
-
- public String getKeyPath() {
- return keyfile.getAbsolutePath();
- }
-
- public String add(final String tag, final String value) {
- final String rv = value==null?"":value;
- props.put(tag, rv);
- return rv;
- }
-
- public String add(final String tag, Access orig, final String def) {
- return add(tag, orig.getProperty(tag, def));
- }
-
- public String addEnc(final String tag, final String value) throws IOException {
- String rv;
- if(value==null) {
- rv = "";
- } else {
- if(symm==null) { // Lazy Instantiations... on a few PropFiles have Security
- symm = ArtifactDir.getSymm(keyfile);
- }
- rv = "enc:"+symm.enpass(value);
- }
- props.put(tag, rv);
- return rv;
- }
-
- public void addEnc(final String tag, Access orig, final String def) throws IOException {
- String pwd = orig.getProperty(tag, def);
- if(pwd==null) {
- return;
- } else if(pwd.startsWith("enc:")) {
- pwd = orig.decrypt(pwd, true);
- }
- addEnc(tag,pwd);
- }
-
- public void write() throws IOException {
+
+ public String addEnc(final String tag, final String value) throws IOException {
+ String rv;
+ if(value==null) {
+ rv = "";
+ } else {
+ if(symm==null) { // Lazy Instantiations... on a few PropFiles have Security
+ symm = ArtifactDir.getSymm(keyfile);
+ }
+ rv = "enc:"+symm.enpass(value);
+ }
+ props.put(tag, rv);
+ return rv;
+ }
+
+ public void addEnc(final String tag, Access orig, final String def) throws IOException {
+ String pwd = orig.getProperty(tag, def);
+ if(pwd==null) {
+ return;
+ } else if(pwd.startsWith("enc:")) {
+ pwd = orig.decrypt(pwd, true);
+ }
+ addEnc(tag,pwd);
+ }
+
+ public void write() throws IOException {