mirror of
https://github.com/correl/mage.git
synced 2024-12-27 03:00:13 +00:00
apply try-with for MtgJson
This commit is contained in:
parent
e7c729f11c
commit
5b38f4168f
1 changed files with 1 additions and 7 deletions
|
@ -2,7 +2,6 @@ package mage.verify;
|
||||||
|
|
||||||
import com.fasterxml.jackson.core.type.TypeReference;
|
import com.fasterxml.jackson.core.type.TypeReference;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import mage.util.StreamUtils;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
|
@ -133,14 +132,9 @@ public final class MtgJson {
|
||||||
}
|
}
|
||||||
stream = new FileInputStream(file);
|
stream = new FileInputStream(file);
|
||||||
}
|
}
|
||||||
ZipInputStream zipInputStream = null;
|
try (ZipInputStream zipInputStream = new ZipInputStream(stream)) {
|
||||||
try {
|
|
||||||
zipInputStream = new ZipInputStream(stream);
|
|
||||||
zipInputStream.getNextEntry();
|
zipInputStream.getNextEntry();
|
||||||
return new ObjectMapper().readValue(zipInputStream, ref);
|
return new ObjectMapper().readValue(zipInputStream, ref);
|
||||||
} finally {
|
|
||||||
StreamUtils.closeQuietly(zipInputStream);
|
|
||||||
StreamUtils.closeQuietly(stream);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue