Skip to content

Commit

Permalink
remove NOT NEEDED reference to solr.YaCySchema from ConfigurationSet …
Browse files Browse the repository at this point in the history
…to be able to use ConfigurationSet for other conf files (than solr.keys.default.list).
  • Loading branch information
reger committed Dec 7, 2012
1 parent a3cd385 commit e2d499b
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions source/net/yacy/cora/federate/yacy/ConfigurationSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@

import org.apache.log4j.Logger;

import net.yacy.cora.federate.solr.YaCySchema;
import net.yacy.cora.federate.yacy.ConfigurationSet.Entry;
import net.yacy.cora.storage.Files;

Expand Down Expand Up @@ -162,14 +161,9 @@ public boolean add(final String key, final String comment, final boolean enabled
try {
if (modified) {
commit();
try {
YaCySchema f = YaCySchema.valueOf(key);
f.setSolrFieldName(entry.getValue());
} catch (IllegalArgumentException e) {}
}

} catch (final IOException e) {
}
} catch (final IOException e) {}
return modified;
}

Expand Down Expand Up @@ -201,8 +195,11 @@ public void commit() throws IOException {
if (this.file == null) return;
// create a temporary bak file, use it as template to preserve user comments
File bakfile = new File (this.file.getAbsolutePath() + ".bak");
Files.copy (this.file, bakfile);

try {
Files.copy(this.file, bakfile);
} catch (final IOException e) {
this.file.createNewFile();
}
@SuppressWarnings("unchecked")
TreeMap<String,Entry> tclone = (TreeMap<String,Entry>) this.clone(); // clone to write appended entries

Expand Down Expand Up @@ -240,7 +237,7 @@ public void commit() throws IOException {
if (e != null) {
writer.write (e.toString());
tclone.remove(key); // remove written entries from clone
} else {writer.write(sorig); }
}
writer.write("\n");
} else {
writer.write(sorig+"\n");
Expand Down

0 comments on commit e2d499b

Please sign in to comment.