.entrySet()) {
if (entry.getValue().isDone()) {
InputStream in = null;
OutputStream out = null;
try {
ProductImageAsset asset = entry.getKey();
in = entry.getValue().get();
String filename = asset.getLatestFileId() + "." + format;
out = Files.newOutputStream(Paths.get(args[3], filename), StandardOpenOption.CREATE);
int count = 0;
byte[] buff = new byte[8192];
while ((count = in.read(buff)) > 0) {
out.write(buff, 0, count);