Compare commits

...

2 Commits

Author SHA1 Message Date
Terekhin Alexander 9f94469ff1 Rewrite from functional style to simplify code 5 years ago
Terekhin Alexander e7dd1a131e Files in archive order finished 5 years ago
  1. 24
      src/main/java/me/bearns/fias/helpers/UpdaterImpl.java

@ -135,19 +135,37 @@ public class UpdaterImpl implements UpdateHelper {
}
}
map.forEach((config, entry) -> {
/* map.forEach(ThrowingBiConsumer.unchecked((config, entry) -> {
try (InputStream is = zipFile.getInputStream(entry)) {
log.debug("Process '{}' in zip", entry.getName());
unmarshaller.process(is, config, filter);
}
});
}));*/
for (Map.Entry<UnmarshallerParameters, ZipArchiveEntry> next : map.entrySet()) {
final UnmarshallerParameters config = next.getKey();
final ZipArchiveEntry entry = next.getValue();
try (InputStream is = zipFile.getInputStream(entry)) {
log.debug("Process '{}' in zip", entry.getName());
unmarshaller.process(is, config, filter);
}
}
log.debug("Completed Zip file");
} catch (IOException e) {
log.error("IO Unzip Exception");
throw new UnzipException(e);
}
} /*catch (RuntimeException e) {
final Throwable cause = e.getCause();
if(cause instanceof CommonException) {
log.error("Probably unmarshalling exception");
throw (CommonException) cause;
} else {
log.error("Unknown exception occured");
}
}*/
}
}

Loading…
Cancel
Save