public class DefaultStateSave implements ImportWorker.StateSaver {
private DefaultStateSave() {
}
public synchronized void setValue(String key, Serializable value) {
PersistentProperties values = PersistentProperties.loadOrCreate("importerWorkerState");
ByteArrayOutputStream buf = new ByteArrayOutputStream();
try {
ObjectOutputStream oos = new ObjectOutputStream(buf);
oos.writeObject(value);
oos.flush();
values.setProperty(key, Base64.encode(buf.toByteArray()));
} catch (IOException e) {
logger.error("Internal error, this cannot happen?!", e);
}
}