parent
8f52745cdd
commit
b81b7d27f8
|
@ -9,6 +9,6 @@ loader_version=0.9.0+build.204
|
||||||
fabric_version=0.15.0+build.379-1.16.1
|
fabric_version=0.15.0+build.379-1.16.1
|
||||||
|
|
||||||
# Mod Properties
|
# Mod Properties
|
||||||
mod_version = 1.3.2
|
mod_version = 1.4.0
|
||||||
maven_group = net.szum123321
|
maven_group = net.szum123321
|
||||||
archives_base_name = textile_backup
|
archives_base_name = textile_backup
|
|
@ -29,26 +29,26 @@ public class ParallelGzipCompressor {
|
||||||
|
|
||||||
File input = in.getCanonicalFile();
|
File input = in.getCanonicalFile();
|
||||||
|
|
||||||
Files.walk(input.toPath()
|
Files.walk(input.toPath())
|
||||||
).filter(path -> !path.equals(input.toPath()) &&
|
.filter(path -> !path.equals(input.toPath()))
|
||||||
path.toFile().isFile() &&
|
.filter(path -> path.toFile().isFile())
|
||||||
!Utilities.isBlacklisted(input.toPath().relativize(path))
|
.filter(path -> !Utilities.isBlacklisted(input.toPath().relativize(path)))
|
||||||
).forEach(path -> {
|
.forEach(path -> {
|
||||||
File file = path.toAbsolutePath().toFile();
|
File file = path.toAbsolutePath().toFile();
|
||||||
|
|
||||||
try (FileInputStream fin = new FileInputStream(file);
|
try (FileInputStream fin = new FileInputStream(file);
|
||||||
BufferedInputStream bfin = new BufferedInputStream(fin)) {
|
BufferedInputStream bfin = new BufferedInputStream(fin)) {
|
||||||
ArchiveEntry entry = arc.createArchiveEntry(file, input.toPath().relativize(path).toString());
|
ArchiveEntry entry = arc.createArchiveEntry(file, input.toPath().relativize(path).toString());
|
||||||
|
|
||||||
arc.putArchiveEntry(entry);
|
arc.putArchiveEntry(entry);
|
||||||
IOUtils.copy(bfin, arc);
|
IOUtils.copy(bfin, arc);
|
||||||
|
|
||||||
arc.closeArchiveEntry();
|
arc.closeArchiveEntry();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
TextileBackup.LOGGER.error("An exception occurred while trying to compress file: " + path, e);
|
TextileBackup.LOGGER.error("An exception occurred while trying to compress file: " + path, e);
|
||||||
Utilities.sendError("Something went wrong while compressing files!", ctx);
|
Utilities.sendError("Something went wrong while compressing files!", ctx);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
arc.finish();
|
arc.finish();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
|
Loading…
Reference in New Issue