use of info.ata4.junity.bundle.BundleExternalEntry in project disunity by ata4.
the class BundleProps method read.
static void read(Path propsFile, Bundle bundle) throws IOException {
BundleProps props;
try (Reader reader = Files.newBufferedReader(propsFile, CHARSET)) {
props = new Gson().fromJson(reader, BundleProps.class);
}
BundleHeader header = bundle.header();
header.compressed(props.compressed);
header.streamVersion(props.streamVersion);
header.unityVersion(new UnityVersion(props.unityVersion));
header.unityRevision(new UnityVersion(props.unityRevision));
String bundleName = PathUtils.getBaseName(propsFile);
Path bundleDir = propsFile.resolveSibling(bundleName);
props.files.stream().map(bundleDir::resolve).forEach(file -> {
bundle.entries().add(new BundleExternalEntry(file));
});
}
Aggregations