import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
+import java.util.Map.Entry;
import de.todesbaum.util.mime.DefaultMIMETypes;
* insert.
*/
public void onSuccessfulInsert() {
- for (FileOption fileOption : fileOptions.values()) {
- if ((fileOption.getCurrentHash() != null) && (fileOption.getCurrentHash().length() > 0) && !fileOption.getCurrentHash().equals(fileOption.getLastInsertHash())) {
+ for (Entry<String, FileOption> fileOptionEntry : fileOptions.entrySet()) {
+ FileOption fileOption = fileOptionEntry.getValue();
+ if ((fileOption.getCurrentHash() != null) && (fileOption.getCurrentHash().length() > 0) && (!fileOption.getCurrentHash().equals(fileOption.getLastInsertHash()) || fileOption.isForceInsert())) {
fileOption.setLastInsertEdition(edition);
fileOption.setLastInsertHash(fileOption.getCurrentHash());
+ fileOption.setLastInsertFilename(fileOption.hasChangedName() ? fileOption.getChangedName() : fileOptionEntry.getKey());
}
fileOption.setForceInsert(false);
}