diff --git a/.editorconfig b/.editorconfig index f82d4e34c..a3eebc537 100644 --- a/.editorconfig +++ b/.editorconfig @@ -4,9 +4,22 @@ end_of_line = lf indent_size = 4 indent_style = space insert_final_newline = true -max_line_length = 150 +max_line_length = 120 tab_width = 4 trim_trailing_whitespace = true # noinspection EditorConfigKeyCorrectness continuation_indent_size = 8 + +[{*.raml,*.yaml,*.yml}] +indent_size = 2 + +[{*.markdown,*.md}] +indent_size = 2 +tab_width = 2 +ij_continuation_indent_size = 4 + +[*.java] +ij_java_imports_layout = ru.olegcherednik.zip4jvm.**,|,*,|,java.**,javax.**,|,$* + + diff --git a/NOTICE b/NOTICE index 95e810cbe..e6ddd9979 100644 --- a/NOTICE +++ b/NOTICE @@ -1,4 +1,4 @@ -gson-utils +zip4jvm Copyright 2021 Oleg Cherednik (oleg.cherednik@gmail.com) This product includes software developed by diff --git a/_config.yml b/_config.yml deleted file mode 100644 index 3397c9a49..000000000 --- a/_config.yml +++ /dev/null @@ -1 +0,0 @@ -theme: jekyll-theme-architect \ No newline at end of file diff --git a/build.gradle b/build.gradle index 2e8dc5b79..d5adba4d3 100644 --- a/build.gradle +++ b/build.gradle @@ -1,3 +1,6 @@ +import com.github.jk1.license.filter.LicenseBundleNormalizer +import com.github.jk1.license.render.InventoryHtmlReportRenderer + buildscript { repositories { mavenLocal() @@ -8,8 +11,10 @@ buildscript { plugins { id 'jacoco' id 'java-library' + id 'io.freefair.lombok' version '8.4' + id 'org.cadixdev.licenser' version '0.6.1' - id 'io.franzbecker.gradle-lombok' version '5.0.0' + id 'com.github.jk1.dependency-license-report' version '2.5' id 'com.github.ben-manes.versions' version '0.51.0' id 'signing' @@ -25,13 +30,21 @@ repositories { group 'ru.oleg-cherednik.zip4jvm' version '1.11' -sourceCompatibility = '1.8' -targetCompatibility = '1.8' +sourceCompatibility = JavaVersion.VERSION_1_8 +targetCompatibility = JavaVersion.VERSION_1_8 tasks.withType(JavaCompile).configureEach { options.encoding = 'UTF-8' + options.compilerArgs += ['-Xlint:unchecked'] } +configurations { + jar.archiveFileName = "${rootProject.name}-${version}.jar" +} + +apply from: "${projectDir}/gradle/checkstyle.gradle" +apply from: "${projectDir}/gradle/pmd.gradle" + dependencies { annotationProcessor "org.projectlombok:lombok:${property('lombok.version')}" @@ -64,9 +77,16 @@ jacocoTestReport { } } -check.dependsOn jacocoTestReport +javadoc { + options.addBooleanOption('Xdoclint:-missing', true) +} + +check.finalizedBy(checkLicense) +check.finalizedBy(generateLicenseReport) +check.finalizedBy(jacocoTestReport) test { + dependsOn('jar') useTestNG() } @@ -76,6 +96,13 @@ license { newLine false } +licenseReport { + configurations = ['compileClasspath', 'runtimeClasspath', 'testCompileClasspath', 'testRuntimeClasspath'] + renderers = [new InventoryHtmlReportRenderer()] + allowedLicensesFile = new File("$projectDir/misc/license/allowed-licenses.json") + filters = [new LicenseBundleNormalizer(bundlePath: "$projectDir/misc/license/license-normalizer-bundle.json")] +} + signing { sign publishing.publications } diff --git a/codecov.yml b/codecov.yml deleted file mode 100644 index 01bf6177a..000000000 --- a/codecov.yml +++ /dev/null @@ -1,4 +0,0 @@ -coverage: - range: 70..90 - round: down - precision: 2 diff --git a/gradle/checkstyle.gradle b/gradle/checkstyle.gradle new file mode 100644 index 000000000..38e70f1d0 --- /dev/null +++ b/gradle/checkstyle.gradle @@ -0,0 +1,24 @@ +apply plugin: 'checkstyle' + +checkstyle { + toolVersion = '10.10.0' + configFile = file("${projectDir}/misc/checkstyle/checkstyle.xml") + ignoreFailures = false + maxWarnings = 0 + maxErrors = 0 +} + +checkstyleMain { + enabled = true + source = 'src/main/java' + group = 'static analysis' + exclude 'ru/olegcherednik/zip4jvm/io/bzip2/**' + exclude 'ru/olegcherednik/zip4jvm/io/ed/**' + exclude 'ru/olegcherednik/zip4jvm/io/lzma/**' +} + +checkstyleTest { + enabled = true + source = 'src/test/java' + group = 'static analysis' +} diff --git a/gradle/pmd.gradle b/gradle/pmd.gradle new file mode 100644 index 000000000..841d062d1 --- /dev/null +++ b/gradle/pmd.gradle @@ -0,0 +1,30 @@ +apply plugin: 'pmd' + +pmd { + toolVersion = '6.21.0' + consoleOutput = false + rulesMinimumPriority = 5 + ignoreFailures = false + ruleSets = [ + "${projectDir}/misc/pmd/bestpractices.xml", + "${projectDir}/misc/pmd/codestyle.xml", + "${projectDir}/misc/pmd/design.xml", + "${projectDir}/misc/pmd/errorprone.xml", + "${projectDir}/misc/pmd/multithreading.xml", + "${projectDir}/misc/pmd/performance.xml", + "${projectDir}/misc/pmd/security.xml" + ] +} + +pmdMain { + enabled = true + source = 'src/main/java' + group = 'static analysis' +} + +pmdTest { + dependsOn('jar') + enabled = true + source = 'src/test/java' + group = 'static analysis' +} diff --git a/java.png b/java.png deleted file mode 100644 index 1068d5ec8..000000000 Binary files a/java.png and /dev/null differ diff --git a/lombok.config b/lombok.config new file mode 100644 index 000000000..890f812f1 --- /dev/null +++ b/lombok.config @@ -0,0 +1,10 @@ +# https://projectlombok.org/features/configuration + +# configuration file is in the root of the workspace directory only +config.stopBubbling = true +# If true, lombok will generate a @java.beans.ConstructorProperties annotation when generating constructors. +lombok.anyConstructor.addConstructorProperties=true +# Do not use experimental annotations +lombok.experimental.flagUsage=ERROR +# Lombok marks generated code with @lombok.Generated, so JaCoCo can understand it +lombok.addLombokGeneratedAnnotation = true diff --git a/misc/checkstyle/checkstyle.xml b/misc/checkstyle/checkstyle.xml new file mode 100644 index 000000000..e742e19fd --- /dev/null +++ b/misc/checkstyle/checkstyle.xml @@ -0,0 +1,522 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/misc/license/allowed-licenses.json b/misc/license/allowed-licenses.json new file mode 100644 index 000000000..dd621207a --- /dev/null +++ b/misc/license/allowed-licenses.json @@ -0,0 +1,10 @@ +{ + "allowedLicenses": [ + { + "moduleLicense": "Apache License, Version 2.0" + }, + { + "moduleLicense": "The MIT License" + } + ] +} diff --git a/misc/license/license-normalizer-bundle.json b/misc/license/license-normalizer-bundle.json new file mode 100644 index 000000000..316fe533d --- /dev/null +++ b/misc/license/license-normalizer-bundle.json @@ -0,0 +1,363 @@ +{ + "bundles": [ + { + "bundleName": "Apache-1.1", + "licenseName": "Apache Software License, Version 1.1", + "licenseUrl": "https://www.apache.org/licenses/LICENSE-1.1" + }, + { + "bundleName": "Apache-2.0", + "licenseName": "Apache License, Version 2.0", + "licenseUrl": "https://www.apache.org/licenses/LICENSE-2.0" + }, + { + "bundleName": "0BSD", + "licenseName": "BSD Zero Clause License", + "licenseUrl": "https://opensource.org/licenses/0BSD" + }, + { + "bundleName": "BSD-2-Clause", + "licenseName": "The 2-Clause BSD License", + "licenseUrl": "https://opensource.org/licenses/BSD-2-Clause" + }, + { + "bundleName": "BSD-3-Clause", + "licenseName": "The 3-Clause BSD License", + "licenseUrl": "https://opensource.org/licenses/BSD-3-Clause" + }, + { + "bundleName": "CC0-1.0", + "licenseName": "Creative Commons Legal Code", + "licenseUrl": "https://creativecommons.org/publicdomain/zero/1.0/legalcode" + }, + { + "bundleName": "CDDL-1.0", + "licenseName": "COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0", + "licenseUrl": "https://oss.oracle.com/licenses/CDDL" + }, + { + "bundleName": "CDDL-1.1", + "licenseName": "COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.1", + "licenseUrl": "https://oss.oracle.com/licenses/CDDL-1.1" + }, + { + "bundleName": "CPL-1.0", + "licenseName": "Common Public License - v 1.0", + "licenseUrl": "https://www.eclipse.org/legal/cpl-v10.html" + }, + { + "bundleName": "EPL-1.0", + "licenseName": "Eclipse Public License - v 1.0", + "licenseUrl": "http://www.eclipse.org/legal/epl-v10.html" + }, + { + "bundleName": "EPL-2.0", + "licenseName": "Eclipse Public License - v 2.0", + "licenseUrl": "https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt" + }, + { + "bundleName": "EDL-1.0", + "licenseName": "Eclipse Distribution License - v 1.0", + "licenseUrl": "https://www.eclipse.org/org/documents/edl-v10.html" + }, + { + "bundleName": "GPL-1.0", + "licenseName": "GNU GENERAL PUBLIC LICENSE, Version 1", + "licenseUrl": "https://www.gnu.org/licenses/gpl-1.0" + }, + { + "bundleName": "GPL-2.0-only", + "licenseName": "GNU GENERAL PUBLIC LICENSE, Version 2", + "licenseUrl": "https://www.gnu.org/licenses/gpl-2.0" + }, + { + "bundleName": "GPL-3.0-only", + "licenseName": "GNU GENERAL PUBLIC LICENSE, Version 3", + "licenseUrl": "https://www.gnu.org/licenses/gpl-3.0" + }, + { + "bundleName": "GPL-2.0 WITH Classpath-exception-2.0", + "licenseName": "GNU GENERAL PUBLIC LICENSE, Version 2 + Classpath Exception", + "licenseUrl": "https://openjdk.java.net/legal/gplv2+ce.html" + }, + { + "bundleName": "LGPL-2.1-only", + "licenseName": "GNU LESSER GENERAL PUBLIC LICENSE, Version 2.1", + "licenseUrl": "https://www.gnu.org/licenses/lgpl-2.1" + }, + { + "bundleName": "LGPL-3.0-only", + "licenseName": "GNU LESSER GENERAL PUBLIC LICENSE, Version 3", + "licenseUrl": "https://www.gnu.org/licenses/lgpl-3.0" + }, + { + "bundleName": "MIT", + "licenseName": "The MIT License", + "licenseUrl": "https://opensource.org/licenses/MIT" + }, + { + "bundleName": "MPL-1.1", + "licenseName": "Mozilla Public License Version 1.1", + "licenseUrl": "https://www.mozilla.org/en-US/MPL/1.1" + }, + { + "bundleName": "MPL-2.0", + "licenseName": "Mozilla Public License, Version 2.0", + "licenseUrl": "https://www.mozilla.org/en-US/MPL/2.0" + }, + { + "bundleName": "Public-Domain", + "licenseName": "PUBLIC DOMAIN", + "licenseUrl": "" + } + ], + "transformationRules": [ + { + "bundleName": "0BSD", + "licenseNamePattern": "BSD Zero Clause License" + }, + { + "bundleName": "0BSD", + "licenseNamePattern": "BSD$" + }, + { + "bundleName": "0BSD", + "licenseNamePattern": "BSD( |-)clause.*" + }, + { + "bundleName": "0BSD", + "licenseNamePattern": "BSD( |-)license.*" + }, + { + "bundleName": "Apache-2.0", + "licenseNamePattern": ".*The Apache Software License, Version 2\\.0.*" + }, + { + "bundleName": "Apache-2.0", + "licenseNamePattern": ".*?Apache( |-|_)2.*" + }, + { + "bundleName": "Apache-2.0", + "licenseNamePattern": "ASL 2\\.0" + }, + { + "bundleName": "Apache-2.0", + "licenseNamePattern": ".*Apache License,?( Version)? 2.*" + }, + { + "bundleName": "Apache-2.0", + "licenseUrlPattern": ".*(www\\.)?opensource\\.org/licenses/Apache-2\\.0.*" + }, + { + "bundleName": "Apache-2.0", + "licenseUrlPattern": ".*www\\.apache\\.org/licenses/LICENSE-2\\.0.*" + }, + { + "bundleName": "LGPL-2.1-only", + "licenseUrlPattern": ".*www\\.gnu\\.org/licenses/old-licenses/lgpl-2\\.1\\.html" + }, + { + "bundleName": "Apache-2.0", + "licenseFileContentPattern": ".*Apache License,?( Version)? 2.*" + }, + { + "bundleName": "Apache-1.1", + "licenseFileContentPattern": ".*Apache Software License, Version 1\\.1.*" + }, + { + "bundleName": "CC0-1.0", + "licenseNamePattern": "CC0(( |-)1(\\.0)?)?" + }, + { + "bundleName": "CC0-1.0", + "licenseUrlPattern": ".*(www\\.)?creativecommons\\.org/publicdomain/zero/1\\.0/" + }, + { + "bundleName": "CDDL-1.0", + "licenseFileContentPattern": ".*CDDL.*1\\.0" + }, + { + "bundleName": "CDDL-1.0", + "licenseUrlPattern": ".*CDDL.*.?1\\.0" + }, + { + "bundleName": "CDDL-1.1", + "licenseUrlPattern": ".*CDDL.*.?1\\.1" + }, + { + "bundleName": "CDDL-1.0", + "licenseNamePattern": "Common Development and Distribution License( \\(CDDL\\),?)? (version )?(.?\\s?)?1\\.0" + }, + { + "bundleName": "CDDL-1.1", + "licenseNamePattern": "Common Development and Distribution License( \\(CDDL\\),?)? (version )?(.?\\s?)?1\\.1" + }, + { + "bundleName": "BSD-3-Clause", + "licenseNamePattern": ".*BSD( |-)3-clause.*" + }, + { + "bundleName": "BSD-3-Clause", + "licenseUrlPattern": ".*(www\\.)?opensource\\.org/licenses/BSD-3-Clause" + }, + { + "bundleName": "BSD-3-Clause", + "licenseNamePattern": ".*?(The )New BSD License.*" + }, + { + "bundleName": "BSD-3-Clause", + "licenseNamePattern": ".*?Modified BSD License.*" + }, + { + "bundleName": "BSD-2-Clause", + "licenseNamePattern": "BSD( |-)2-clause.*" + }, + { + "bundleName": "BSD-2-Clause", + "licenseUrlPattern": ".*(www\\.)?opensource\\.org/licenses/BSD-2-Clause" + }, + { + "bundleName": "BSD-2-Clause", + "licenseUrlPattern": ".*(www\\.)?opensource\\.org/licenses/bsd-license(\\.php)?" + }, + { + "bundleName": "CDDL-1.0", + "licenseNamePattern": "Common Development and Distribution( License)?" + }, + { + "bundleName": "CDDL-1.0", + "licenseNamePattern": "CDDL 1(\\.0)" + }, + { + "bundleName": "CDDL-1.1", + "licenseNamePattern": "CDDL 1\\.1" + }, + { + "bundleName": "CDDL-1.1", + "licenseUrlPattern": ".*(www\\.).opensource\\.org/licenses/CDDL-1\\.0" + }, + { + "bundleName": "EPL-1.0", + "licenseNamePattern": "Eclipse Publish License.*(v|version)\\.?\\s?1(\\.?0)?" + }, + { + "bundleName": "EPL-1.0", + "licenseNamePattern": "Eclipse Public License.*(v|version)\\.?\\s?1(\\.?0)?" + }, + { + "bundleName": "EPL-2.0", + "licenseNamePattern": "Eclipse Public License.*(v|version)\\.?\\s?2(\\.?0)?" + }, + { + "bundleName": "EPL-2.0", + "licenseUrlPattern": ".*(www\\.).opensource\\.org/licenses/EPL-2\\.0" + }, + { + "bundleName": "EPL-2.0", + "licenseUrlPattern": ".*http.?://www\\.eclipse\\.org/legal/epl-.?2\\.?0.*" + }, + { + "bundleName": "EPL-2.0", + "licenseUrlPattern": ".*http.?://www\\.eclipse\\.org/org.*/epl-.?2\\.?0.*" + }, + { + "bundleName": "EPL-2.0", + "licenseUrlPattern": ".*http.?://projects\\.eclipse\\.org/.*/epl-.?2\\.?0.*" + }, + { + "bundleName": "EDL-1.0", + "licenseNamePattern": "Eclipse Distribution License.*(v|version)\\.?\\s?1(\\.0)?" + }, + { + "bundleName": "EDL-1.0", + "licenseUrlPattern": ".*http.?://(www\\.)?eclipse\\.org/org.*/edl-.?1\\.?0.*" + }, + { + "bundleName": "GPL-2.0-only", + "licenseUrlPattern": ".*(www\\.)?opensource\\.org/licenses/GPL-2\\.0" + }, + { + "bundleName": "GPL-2.0 WITH Classpath-exception-2.0", + "licenseNamePattern": "GNU General Public License, version 2.*classpath exception" + }, + { + "bundleName": "GPL-2.0 WITH Classpath-exception-2.0", + "licenseNamePattern": "GNU General Public License, version 2.*cp?e" + }, + { + "bundleName": "GPL-2.0 WITH Classpath-exception-2.0", + "licenseNamePattern": "GNU General Public License, version 2.*, with the classpath exception" + }, + { + "bundleName": "GPL-2.0 WITH Classpath-exception-2.0", + "licenseNamePattern": "GPL2 w/ CPE" + }, + { + "bundleName": "GPL-3.0-only", + "licenseUrlPattern": ".*(www\\.)?opensource\\.org/licenses/GPL-3\\.0" + }, + { + "bundleName": "LGPL-2.1-only", + "licenseUrlPattern": ".*(www\\.)?opensource\\.org/licenses/LGPL-2\\.1" + }, + { + "bundleName": "LGPL-2.1-only", + "licenseUrlPattern": ".*(www\\.)?gnu\\.org/licenses(/old-licenses)?/lgpl-2\\.1(\\.(html|txt))?" + }, + { + "bundleName": "LGPL-2.1-only", + "licenseNamePattern": "LGPL 2\\.1" + }, + { + "bundleName": "LGPL-2.1-only", + "licenseNamePattern": "LGPL.*(v|version)\\.?\\s?2\\.1" + }, + { + "bundleName": "LGPL-2.1-only", + "licenseUrlPattern": ".*(www\\.)?repository.jboss.org/licenses/lgpl-2.1\\.txt" + }, + { + "bundleName": "LGPL-3.0-only", + "licenseUrlPattern": ".*(www\\.).opensource\\.org/licenses/LGPL-3\\.0" + }, + { + "bundleName": "LGPL-3.0-only", + "licenseNamePattern": "lgplv?3" + }, + { + "bundleName": "LGPL-3.0-only", + "licenseUrlPattern": ".*(www\\.)?gnu\\.org/licenses(/old-licenses)?/lgpl(-3)?(\\.(html|txt))?" + }, + { + "bundleName": "MIT", + "licenseNamePattern": "(The\\s)?MIT(\\slicen(c|s)e)?(\\s\\(MIT\\))?" + }, + { + "bundleName": "MIT", + "licenseUrlPattern": ".*(www\\.)?opensource\\.org/licenses/MIT(\\.php)?" + }, + { + "bundleName": "MPL-1.1", + "licenseNamePattern": "MPL 1\\.1" + }, + { + "bundleName": "MPL-2.0", + "licenseUrlPattern": ".*(www\\.).opensource\\.org/licenses/MPL-2\\.0" + }, + { + "bundleName": "Public-Domain", + "licenseNamePattern": "((public)\\s(domain)).*", + "transformUrl": false + }, + { + "bundleName": "Public-Domain", + "licenseFileContentPattern": ".*(Creative)\\s(Commons).*", + "transformUrl": false + }, + { + "bundleName": "Public-Domain", + "licenseFileContentPattern": ".*((Public)\\s(Domain)).*", + "transformUrl": false + } + ] +} diff --git a/misc/pmd/bestpractices.xml b/misc/pmd/bestpractices.xml new file mode 100644 index 000000000..019d445cc --- /dev/null +++ b/misc/pmd/bestpractices.xml @@ -0,0 +1,17 @@ + + + + + https://docs.pmd-code.org/latest/pmd_rules_java_bestpractices.html + + + + + + + + + + diff --git a/misc/pmd/codestyle.xml b/misc/pmd/codestyle.xml new file mode 100644 index 000000000..3c2b27ea8 --- /dev/null +++ b/misc/pmd/codestyle.xml @@ -0,0 +1,62 @@ + + + + + https://docs.pmd-code.org/latest/pmd_rules_java_codestyle.html + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/misc/pmd/design.xml b/misc/pmd/design.xml new file mode 100644 index 000000000..0d721d3bd --- /dev/null +++ b/misc/pmd/design.xml @@ -0,0 +1,44 @@ + + + + + https://docs.pmd-code.org/latest/pmd_rules_java_design.html + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/misc/pmd/errorprone.xml b/misc/pmd/errorprone.xml new file mode 100644 index 000000000..5e068dd36 --- /dev/null +++ b/misc/pmd/errorprone.xml @@ -0,0 +1,21 @@ + + + + + https://docs.pmd-code.org/latest/pmd_rules_java_errorprone.html + + + + + + + + + + + + + + diff --git a/misc/pmd/multithreading.xml b/misc/pmd/multithreading.xml new file mode 100644 index 000000000..a09f8be8d --- /dev/null +++ b/misc/pmd/multithreading.xml @@ -0,0 +1,15 @@ + + + + + https://docs.pmd-code.org/latest/pmd_rules_java_multithreading.html + + + + + + + + diff --git a/misc/pmd/performance.xml b/misc/pmd/performance.xml new file mode 100644 index 000000000..fa1c41349 --- /dev/null +++ b/misc/pmd/performance.xml @@ -0,0 +1,13 @@ + + + + + https://docs.pmd-code.org/latest/pmd_rules_java_performance.html + + + + + + diff --git a/misc/pmd/security.xml b/misc/pmd/security.xml new file mode 100644 index 000000000..5adf90112 --- /dev/null +++ b/misc/pmd/security.xml @@ -0,0 +1,11 @@ + + + + + https://docs.pmd-code.org/latest/pmd_rules_java_security.html + + + + diff --git a/src/main/java/ru/olegcherednik/zip4jvm/UnzipIt.java b/src/main/java/ru/olegcherednik/zip4jvm/UnzipIt.java index 3ad6361c6..5b48260bc 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/UnzipIt.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/UnzipIt.java @@ -18,13 +18,14 @@ */ package ru.olegcherednik.zip4jvm; -import lombok.AccessLevel; -import lombok.RequiredArgsConstructor; import ru.olegcherednik.zip4jvm.engine.UnzipEngine; import ru.olegcherednik.zip4jvm.exception.IncorrectPasswordException; import ru.olegcherednik.zip4jvm.model.settings.UnzipSettings; import ru.olegcherednik.zip4jvm.model.src.SrcZip; +import lombok.AccessLevel; +import lombok.RequiredArgsConstructor; + import java.io.IOException; import java.io.InputStream; import java.nio.file.Path; @@ -48,7 +49,9 @@ public final class UnzipIt { /** path to the zip file (new or existed) */ private final SrcZip srcZip; - /** destination directory for extracted files; by default it's directory where {@link #zip} archive is located */ + /** + * Destination directory for extracted files; by default its directory where {@link #zip} archive is located + */ private Path destDir; /** setting for unzip files */ private UnzipSettings settings = UnzipSettings.DEFAULT; @@ -65,7 +68,8 @@ public static UnzipIt zip(Path zip) { } /** - * Set destination directory for extracted files. By default all files are extracted into {@link #zip} archive located directory.
+ * Set destination directory for extracted files. By default, all files are extracted into {@link #zip} archive + * located directory.
* If given directory is not exists, then it will be created. * * @param destDir not {@literal null} destination directory @@ -115,8 +119,10 @@ public void extract() throws IOException, IncorrectPasswordException { /** * Extract entry with {@code fileName} into {@link #destDir} using {@link #settings}.
- * If {@code fileName} is a regular file entry, then only single regular file will be extracted into the root of {@link #destDir}.
- * If {@code fileName} is a directory, then entire directory will be extracted into the root of {@link #destDir} keeping the initial structure. + * If {@code fileName} is a regular file entry, then only single regular file will be extracted into the root of + * {@link #destDir}.
+ * If {@code fileName} is a directory, then entire directory will be extracted into the root of {@link #destDir} + * keeping the initial structure. * * @param fileName not blank file name * @throws IOException in case of any problem with file access @@ -129,9 +135,12 @@ public void extract(String fileName) throws IOException, IncorrectPasswordExcept } /** - * Extract entries with {@code fileNames} into {@link #destDir} using {@link #settings}. Each entry is extracted separately.
- * If {@code fileName} is a regular file entry, then only single regular file will be extracted into the root of {@link #destDir}.
- * If {@code fileName} is a directory, then entire directory will be extracted into the root of {@link #destDir} keeping the initial structure. + * Extract entries with {@code fileNames} into {@link #destDir} using {@link #settings}. Each entry is extracted + * separately.
+ * If {@code fileName} is a regular file entry, then only single regular file will be extracted into the root of + * {@link #destDir}.
+ * If {@code fileName} is a directory, then entire directory will be extracted into the root of {@link #destDir} + * keeping the initial structure. * * @param fileNames not {@literal null} file names * @throws IOException in case of any problem with file access @@ -147,7 +156,8 @@ public void extract(Collection fileNames) throws IOException { } /** - * Retrieve entry with given {@code fileName} as {@link InputStream}. If given {@code fileName} is directory entry, then empty {@link InputStream} + * Retrieve entry with given {@code fileName} as {@link InputStream}. If given {@code fileName} is directory entry, + * then empty {@link InputStream} * will be retrieved. * * @param fileName not blank file name @@ -160,7 +170,8 @@ public InputStream stream(String fileName) { } /** - * Retrieves not {@literal null} instance of {@link ZipFile.Reader}. It provides all available methods to unzip an archive. + * Retrieves not {@literal null} instance of {@link ZipFile.Reader}. It provides all available methods to unzip an + * archive. * * @return not {@literal null} instance of {@link ZipFile.Reader} * @throws IOException in case of any problem with file access diff --git a/src/main/java/ru/olegcherednik/zip4jvm/ZipFile.java b/src/main/java/ru/olegcherednik/zip4jvm/ZipFile.java index ef173fbaa..2997cce22 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/ZipFile.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/ZipFile.java @@ -18,10 +18,6 @@ */ package ru.olegcherednik.zip4jvm; -import lombok.AccessLevel; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.RequiredArgsConstructor; import ru.olegcherednik.zip4jvm.engine.InfoEngine; import ru.olegcherednik.zip4jvm.engine.UnzipEngine; import ru.olegcherednik.zip4jvm.engine.ZipEngine; @@ -37,6 +33,11 @@ import ru.olegcherednik.zip4jvm.utils.quitely.Quietly; import ru.olegcherednik.zip4jvm.utils.quitely.functions.InputStreamSupplier; +import lombok.AccessLevel; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.RequiredArgsConstructor; + import java.io.Closeable; import java.io.IOException; import java.io.InputStream; @@ -75,7 +76,9 @@ public static final class Entry { @Getter(AccessLevel.NONE) private final InputStreamSupplier inputStreamSupplier; - /** Normalized file name without directory marker {@literal /} */ + /** + * Normalized file name without directory marker {@literal /} + */ private final String name; private final long lastModifiedTime; private final long uncompressedSize; diff --git a/src/main/java/ru/olegcherednik/zip4jvm/ZipInfo.java b/src/main/java/ru/olegcherednik/zip4jvm/ZipInfo.java index b6a4b8a28..e6715b7d4 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/ZipInfo.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/ZipInfo.java @@ -18,12 +18,12 @@ */ package ru.olegcherednik.zip4jvm; -import lombok.AccessLevel; -import lombok.RequiredArgsConstructor; -import ru.olegcherednik.zip4jvm.model.settings.UnzipSettings; -import ru.olegcherednik.zip4jvm.model.src.SrcZip; import ru.olegcherednik.zip4jvm.model.CentralDirectory; import ru.olegcherednik.zip4jvm.model.settings.ZipInfoSettings; +import ru.olegcherednik.zip4jvm.model.src.SrcZip; + +import lombok.AccessLevel; +import lombok.RequiredArgsConstructor; import java.io.IOException; import java.io.PrintStream; diff --git a/src/main/java/ru/olegcherednik/zip4jvm/ZipIt.java b/src/main/java/ru/olegcherednik/zip4jvm/ZipIt.java index 243db7f44..46c4473f2 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/ZipIt.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/ZipIt.java @@ -18,14 +18,15 @@ */ package ru.olegcherednik.zip4jvm; -import lombok.AccessLevel; -import lombok.RequiredArgsConstructor; -import org.apache.commons.collections4.CollectionUtils; import ru.olegcherednik.zip4jvm.exception.PathNotExistsException; import ru.olegcherednik.zip4jvm.model.settings.ZipEntrySettings; import ru.olegcherednik.zip4jvm.model.settings.ZipSettings; import ru.olegcherednik.zip4jvm.utils.ValidationUtils; +import lombok.AccessLevel; +import lombok.RequiredArgsConstructor; +import org.apache.commons.collections4.CollectionUtils; + import java.io.IOException; import java.nio.file.Path; import java.util.Collection; @@ -76,18 +77,21 @@ public ZipIt settings(ZipSettings settings) { } /** - * Set same {@link ZipEntrySettings} for all new entries in the zip archive. If {@literal null}, then {@link ZipEntrySettings#DEFAULT} will be + * Set same {@link ZipEntrySettings} for all new entries in the zip archive. If {@literal null}, then + * {@link ZipEntrySettings#DEFAULT} will be * used. * * @param entrySettings entry settings * @return not {@literal null} {@link ZipIt} instance */ public ZipIt entrySettings(ZipEntrySettings entrySettings) { - return entrySettings == null ? entrySettings(ZipEntrySettings.DEFAULT_PROVIDER) : entrySettings(fileName -> entrySettings); + return entrySettings == null ? entrySettings(ZipEntrySettings.DEFAULT_PROVIDER) + : entrySettings(fileName -> entrySettings); } /** - * Set provider of {@link ZipEntrySettings} for the given file name. Each entry could have separate settings. If {@literal null}, then {@link + * Set provider of {@link ZipEntrySettings} for the given file name. Each entry could have separate settings. If + * {@literal null}, then {@link * ZipEntrySettings#DEFAULT_PROVIDER} will be used. * * @param entrySettingsProvider entry settings provider with fileName as a key diff --git a/src/main/java/ru/olegcherednik/zip4jvm/ZipMisc.java b/src/main/java/ru/olegcherednik/zip4jvm/ZipMisc.java index 7e14a3163..a5d2f9f3a 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/ZipMisc.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/ZipMisc.java @@ -18,11 +18,12 @@ */ package ru.olegcherednik.zip4jvm; -import lombok.AccessLevel; -import lombok.RequiredArgsConstructor; import ru.olegcherednik.zip4jvm.exception.EntryNotFoundException; import ru.olegcherednik.zip4jvm.model.settings.ZipSettings; +import lombok.AccessLevel; +import lombok.RequiredArgsConstructor; + import java.io.IOException; import java.nio.file.Path; import java.util.Collection; @@ -93,8 +94,9 @@ public Stream getEntries() throws IOException { } /** - * Remove entry with given {@code entryName}. Exact match of the entry name is required; i.e. in case of given entry name represents a directory - * and zip archive has sub entries of this entry, then only the root entry will be removed (if it's exist); all sub entries will not be removed. + * Remove entry with given {@code entryName}. Exact match of the entry name is required; i.e. in case of given entry + * name represents a directory and zip archive has sub entries of this entry, then only the root entry will be + * removed (if it's exist); all sub entries will not be removed. * * @param entryName not blank entry name * @throws IOException in case of any problem with file access @@ -106,9 +108,10 @@ public void removeEntryByName(String entryName) throws IOException, EntryNotFoun } /** - * Remove all entries with given {@code entryNames}. Exact match of the entry name is required; i.e. in case of given entry name represents a - * directory and zip archive sub entries of this entry, then only the root entry will removed (if it's exist); all sub entries will not be - * removed. + * Remove all entries with given {@code entryNames}. Exact match of the entry name is required; i.e. in case of + * given entry name represents a + * directory and zip archive sub entries of this entry, then only the root entry will be removed (if it's exist); + * all sub entries will not be removed. * * @param entryNames not empty entry names * @throws IOException in case of any problem with file access @@ -138,7 +141,8 @@ public void removeEntryByNamePrefix(String entryNamePrefix) throws IOException, * @throws IOException in case of any problem with file access * @throws EntryNotFoundException in case of no entries with given {@code entryNamePrefix} were not found */ - public void removeEntryByNamePrefix(Collection entryNamePrefixes) throws IOException, EntryNotFoundException { + public void removeEntryByNamePrefix(Collection entryNamePrefixes) + throws IOException, EntryNotFoundException { requireNotEmpty(entryNamePrefixes, "ZipMisc.entryName"); removeEntry(entryNamePrefixes, ZipFile.Writer::removeEntryByNamePrefix); } diff --git a/src/main/java/ru/olegcherednik/zip4jvm/crypto/aes/AesDecoder.java b/src/main/java/ru/olegcherednik/zip4jvm/crypto/aes/AesDecoder.java index 387cab4dd..438dccfe6 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/crypto/aes/AesDecoder.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/crypto/aes/AesDecoder.java @@ -18,10 +18,6 @@ */ package ru.olegcherednik.zip4jvm.crypto.aes; -import lombok.AccessLevel; -import lombok.Getter; -import lombok.RequiredArgsConstructor; -import org.apache.commons.lang3.ArrayUtils; import ru.olegcherednik.zip4jvm.crypto.Decoder; import ru.olegcherednik.zip4jvm.exception.IncorrectZipEntryPasswordException; import ru.olegcherednik.zip4jvm.exception.Zip4jvmException; @@ -29,10 +25,15 @@ import ru.olegcherednik.zip4jvm.model.entry.ZipEntry; import ru.olegcherednik.zip4jvm.utils.quitely.Quietly; -import javax.crypto.Cipher; -import javax.crypto.Mac; +import lombok.AccessLevel; +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import org.apache.commons.lang3.ArrayUtils; + import java.io.IOException; import java.util.Objects; +import javax.crypto.Cipher; +import javax.crypto.Mac; import static ru.olegcherednik.zip4jvm.crypto.aes.AesEngine.MAC_SIZE; import static ru.olegcherednik.zip4jvm.crypto.aes.AesEngine.PASSWORD_CHECKSUM_SIZE; diff --git a/src/main/java/ru/olegcherednik/zip4jvm/crypto/aes/AesEncoder.java b/src/main/java/ru/olegcherednik/zip4jvm/crypto/aes/AesEncoder.java index 2aa58311e..d27fb6f5d 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/crypto/aes/AesEncoder.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/crypto/aes/AesEncoder.java @@ -19,14 +19,13 @@ package ru.olegcherednik.zip4jvm.crypto.aes; import ru.olegcherednik.zip4jvm.crypto.Encoder; -import ru.olegcherednik.zip4jvm.exception.Zip4jvmException; import ru.olegcherednik.zip4jvm.io.out.data.DataOutput; import ru.olegcherednik.zip4jvm.model.entry.ZipEntry; import ru.olegcherednik.zip4jvm.utils.quitely.Quietly; +import java.io.IOException; import javax.crypto.Cipher; import javax.crypto.Mac; -import java.io.IOException; import static ru.olegcherednik.zip4jvm.crypto.aes.AesEngine.MAC_SIZE; diff --git a/src/main/java/ru/olegcherednik/zip4jvm/crypto/aes/AesEngine.java b/src/main/java/ru/olegcherednik/zip4jvm/crypto/aes/AesEngine.java index 1833b8ee1..2bd02c3e5 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/crypto/aes/AesEngine.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/crypto/aes/AesEngine.java @@ -18,12 +18,17 @@ */ package ru.olegcherednik.zip4jvm.crypto.aes; -import lombok.AccessLevel; -import lombok.RequiredArgsConstructor; import ru.olegcherednik.zip4jvm.crypto.Engine; import ru.olegcherednik.zip4jvm.model.EncryptionMethod; import ru.olegcherednik.zip4jvm.utils.quitely.Quietly; +import lombok.AccessLevel; +import lombok.RequiredArgsConstructor; + +import java.security.InvalidKeyException; +import java.security.NoSuchAlgorithmException; +import java.security.spec.InvalidKeySpecException; +import java.security.spec.KeySpec; import javax.crypto.Cipher; import javax.crypto.Mac; import javax.crypto.NoSuchPaddingException; @@ -31,10 +36,6 @@ import javax.crypto.ShortBufferException; import javax.crypto.spec.PBEKeySpec; import javax.crypto.spec.SecretKeySpec; -import java.security.InvalidKeyException; -import java.security.NoSuchAlgorithmException; -import java.security.spec.InvalidKeySpecException; -import java.security.spec.KeySpec; /** * @author Oleg Cherednik diff --git a/src/main/java/ru/olegcherednik/zip4jvm/crypto/aes/AesStrength.java b/src/main/java/ru/olegcherednik/zip4jvm/crypto/aes/AesStrength.java index d4c40e7d5..71b2c9ba7 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/crypto/aes/AesStrength.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/crypto/aes/AesStrength.java @@ -22,8 +22,8 @@ import lombok.Getter; import lombok.RequiredArgsConstructor; -import javax.crypto.spec.SecretKeySpec; import java.security.SecureRandom; +import javax.crypto.spec.SecretKeySpec; /** * @author Oleg Cherednik diff --git a/src/main/java/ru/olegcherednik/zip4jvm/crypto/aes/AesStrongDecoder.java b/src/main/java/ru/olegcherednik/zip4jvm/crypto/aes/AesStrongDecoder.java index a99adaa3b..27d7f664e 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/crypto/aes/AesStrongDecoder.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/crypto/aes/AesStrongDecoder.java @@ -18,11 +18,9 @@ */ package ru.olegcherednik.zip4jvm.crypto.aes; -import lombok.Getter; -import lombok.RequiredArgsConstructor; import ru.olegcherednik.zip4jvm.crypto.Decoder; -import ru.olegcherednik.zip4jvm.crypto.strong.DecryptionHeader; import ru.olegcherednik.zip4jvm.crypto.strong.AesCentralDirectoryCipherCreator; +import ru.olegcherednik.zip4jvm.crypto.strong.DecryptionHeader; import ru.olegcherednik.zip4jvm.exception.IncorrectPasswordException; import ru.olegcherednik.zip4jvm.exception.IncorrectZipEntryPasswordException; import ru.olegcherednik.zip4jvm.io.in.data.DataInput; @@ -30,6 +28,9 @@ import ru.olegcherednik.zip4jvm.model.entry.ZipEntry; import ru.olegcherednik.zip4jvm.utils.quitely.Quietly; +import lombok.Getter; +import lombok.RequiredArgsConstructor; + import javax.crypto.Cipher; /** diff --git a/src/main/java/ru/olegcherednik/zip4jvm/crypto/pkware/PkwareDecoder.java b/src/main/java/ru/olegcherednik/zip4jvm/crypto/pkware/PkwareDecoder.java index 33ac34b1b..b17eb27d3 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/crypto/pkware/PkwareDecoder.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/crypto/pkware/PkwareDecoder.java @@ -18,12 +18,13 @@ */ package ru.olegcherednik.zip4jvm.crypto.pkware; -import lombok.Getter; -import lombok.RequiredArgsConstructor; import ru.olegcherednik.zip4jvm.crypto.Decoder; import ru.olegcherednik.zip4jvm.io.in.data.DataInput; import ru.olegcherednik.zip4jvm.model.entry.ZipEntry; +import lombok.Getter; +import lombok.RequiredArgsConstructor; + import static ru.olegcherednik.zip4jvm.utils.ValidationUtils.requireNotEmpty; /** diff --git a/src/main/java/ru/olegcherednik/zip4jvm/crypto/pkware/PkwareEncoder.java b/src/main/java/ru/olegcherednik/zip4jvm/crypto/pkware/PkwareEncoder.java index 0eacf349b..086a7fdcd 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/crypto/pkware/PkwareEncoder.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/crypto/pkware/PkwareEncoder.java @@ -18,11 +18,12 @@ */ package ru.olegcherednik.zip4jvm.crypto.pkware; -import lombok.RequiredArgsConstructor; import ru.olegcherednik.zip4jvm.crypto.Encoder; import ru.olegcherednik.zip4jvm.io.out.data.DataOutput; import ru.olegcherednik.zip4jvm.model.entry.ZipEntry; +import lombok.RequiredArgsConstructor; + import java.io.IOException; import static ru.olegcherednik.zip4jvm.utils.ValidationUtils.requireNotEmpty; diff --git a/src/main/java/ru/olegcherednik/zip4jvm/crypto/pkware/PkwareEngine.java b/src/main/java/ru/olegcherednik/zip4jvm/crypto/pkware/PkwareEngine.java index b203aa457..d4b343e2c 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/crypto/pkware/PkwareEngine.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/crypto/pkware/PkwareEngine.java @@ -60,19 +60,19 @@ public int decrypt(byte[] buf, int offs, int len) { // ---------- private byte encrypt(byte b) { - byte cipher = (byte)(stream() ^ b); + byte cipher = (byte) (stream() ^ b); updateKeys(keys, b); return cipher; } private byte decrypt() { int tmp = keys[2] | 2; - return (byte)((tmp * (tmp ^ 1)) >>> 8); + return (byte) ((tmp * (tmp ^ 1)) >>> 8); } private byte stream() { int tmp = keys[2] | 3; - return (byte)((tmp * (tmp ^ 1)) >>> 8); + return (byte) ((tmp * (tmp ^ 1)) >>> 8); } private static int[] createCrcTable() { @@ -95,7 +95,7 @@ private static int[] createKeys(char[] password) { int[] keys = { 0x12345678, 0x23456789, 0x34567890 }; for (int i = 0; i < password.length; i++) - updateKeys(keys, (byte)password[i]); + updateKeys(keys, (byte) password[i]); return keys; } @@ -103,7 +103,7 @@ private static int[] createKeys(char[] password) { private static void updateKeys(int[] keys, byte b) { keys[0] = crc32(keys[0], b); keys[1] = (keys[1] + (keys[0] & 0xFF)) * 0x8088405 + 1; - keys[2] = crc32(keys[2], (byte)(keys[1] >> 24)); + keys[2] = crc32(keys[2], (byte) (keys[1] >> 24)); } private static int crc32(int crc, byte b) { diff --git a/src/main/java/ru/olegcherednik/zip4jvm/crypto/pkware/PkwareHeader.java b/src/main/java/ru/olegcherednik/zip4jvm/crypto/pkware/PkwareHeader.java index a32e89f8f..1d472d4a1 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/crypto/pkware/PkwareHeader.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/crypto/pkware/PkwareHeader.java @@ -18,13 +18,14 @@ */ package ru.olegcherednik.zip4jvm.crypto.pkware; -import lombok.AccessLevel; -import lombok.RequiredArgsConstructor; import ru.olegcherednik.zip4jvm.exception.IncorrectZipEntryPasswordException; import ru.olegcherednik.zip4jvm.io.in.data.DataInput; import ru.olegcherednik.zip4jvm.io.out.data.DataOutput; import ru.olegcherednik.zip4jvm.model.entry.ZipEntry; +import lombok.AccessLevel; +import lombok.RequiredArgsConstructor; + import java.io.IOException; import java.security.SecureRandom; diff --git a/src/main/java/ru/olegcherednik/zip4jvm/crypto/strong/AesCentralDirectoryCipherCreator.java b/src/main/java/ru/olegcherednik/zip4jvm/crypto/strong/AesCentralDirectoryCipherCreator.java index ead00830a..25c759bce 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/crypto/strong/AesCentralDirectoryCipherCreator.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/crypto/strong/AesCentralDirectoryCipherCreator.java @@ -18,8 +18,6 @@ */ package ru.olegcherednik.zip4jvm.crypto.strong; -import lombok.RequiredArgsConstructor; -import org.apache.commons.codec.digest.DigestUtils; import ru.olegcherednik.zip4jvm.crypto.aes.AesEngine; import ru.olegcherednik.zip4jvm.crypto.aes.AesStrength; import ru.olegcherednik.zip4jvm.crypto.strong.cd.CentralDirectoryCipherCreator; @@ -28,12 +26,15 @@ import ru.olegcherednik.zip4jvm.io.Endianness; import ru.olegcherednik.zip4jvm.utils.quitely.Quietly; -import javax.crypto.BadPaddingException; -import javax.crypto.Cipher; -import javax.crypto.spec.IvParameterSpec; +import lombok.RequiredArgsConstructor; +import org.apache.commons.codec.digest.DigestUtils; + import java.security.Key; import java.security.MessageDigest; import java.util.Arrays; +import javax.crypto.BadPaddingException; +import javax.crypto.Cipher; +import javax.crypto.spec.IvParameterSpec; /** * @author Oleg Cherednik diff --git a/src/main/java/ru/olegcherednik/zip4jvm/crypto/strong/DecryptionHeader.java b/src/main/java/ru/olegcherednik/zip4jvm/crypto/strong/DecryptionHeader.java index 7f14bd763..838100c0b 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/crypto/strong/DecryptionHeader.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/crypto/strong/DecryptionHeader.java @@ -18,9 +18,10 @@ */ package ru.olegcherednik.zip4jvm.crypto.strong; +import ru.olegcherednik.zip4jvm.io.Endianness; + import lombok.Getter; import lombok.Setter; -import ru.olegcherednik.zip4jvm.io.Endianness; import java.util.Collections; import java.util.List; diff --git a/src/main/java/ru/olegcherednik/zip4jvm/crypto/strong/EncryptionAlgorithm.java b/src/main/java/ru/olegcherednik/zip4jvm/crypto/strong/EncryptionAlgorithm.java index 31b1e8aef..1c3eb79ea 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/crypto/strong/EncryptionAlgorithm.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/crypto/strong/EncryptionAlgorithm.java @@ -18,13 +18,14 @@ */ package ru.olegcherednik.zip4jvm.crypto.strong; -import lombok.AccessLevel; -import lombok.Getter; -import lombok.RequiredArgsConstructor; import ru.olegcherednik.zip4jvm.crypto.strong.cd.CentralDirectoryCipherCreator; import ru.olegcherednik.zip4jvm.exception.EncryptionNotSupportedException; import ru.olegcherednik.zip4jvm.model.EncryptionMethod; +import lombok.AccessLevel; +import lombok.Getter; +import lombok.RequiredArgsConstructor; + import java.util.Optional; /** diff --git a/src/main/java/ru/olegcherednik/zip4jvm/crypto/tripledes/TripleDesDecoder.java b/src/main/java/ru/olegcherednik/zip4jvm/crypto/tripledes/TripleDesDecoder.java deleted file mode 100644 index 857be818f..000000000 --- a/src/main/java/ru/olegcherednik/zip4jvm/crypto/tripledes/TripleDesDecoder.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package ru.olegcherednik.zip4jvm.crypto.tripledes; - -import lombok.Getter; -import ru.olegcherednik.zip4jvm.crypto.Decoder; -import ru.olegcherednik.zip4jvm.crypto.strong.DecryptionHeader; -import ru.olegcherednik.zip4jvm.io.in.data.DataInput; -import ru.olegcherednik.zip4jvm.io.readers.crypto.strong.DecryptionHeaderReader; -import ru.olegcherednik.zip4jvm.model.Charsets; -import ru.olegcherednik.zip4jvm.model.entry.ZipEntry; -import ru.olegcherednik.zip4jvm.utils.quitely.Quietly; - -import javax.crypto.Cipher; -import javax.crypto.SecretKeyFactory; -import javax.crypto.spec.IvParameterSpec; -import javax.crypto.spec.PBEKeySpec; -import javax.crypto.spec.SecretKeySpec; -import java.security.spec.KeySpec; -import java.util.Arrays; -import java.util.zip.CRC32; -import java.util.zip.Checksum; - -/** - * @author Oleg Cherednik - * @since 16.02.2020 - */ -public final class TripleDesDecoder implements Decoder { - - private final TripleDesEngine engine; - private final long decryptionHeaderSize; - @Getter - private final long compressedSize = 0; - - public static TripleDesDecoder create(DataInput in, ZipEntry zipEntry) { - return Quietly.doQuietly(() -> { - in.mark("bb"); - DecryptionHeader decryptionHeader = new DecryptionHeaderReader().read(in); - byte[] iv = decryptionHeader.getIv(); - byte[] ivOne = Arrays.copyOfRange(iv, 0, 8); - byte[] ivTwo = Arrays.copyOfRange(iv, 8, 16); - //168 - int bitLength = decryptionHeader.getBitLength(); - byte[] salt = decryptionHeader.getEncryptedRandomData(); - String psw = "ThisIsSecretEncryptionKey"; -// byte[] sha1 = DigestUtils.sha1(psw); - - byte[] pvd = decryptionHeader.getPasswordValidationData(); - byte[] pvd_salt = Arrays.copyOfRange(pvd, 0, 4); - byte[] pvd_crc32 = Arrays.copyOfRange(pvd, pvd.length - 4, pvd.length); - - Checksum checksum = new CRC32(); - checksum.update(pvd, 0, 4); -// long crc32 = checksum.getValue(); - - - KeySpec keySpec = new PBEKeySpec(psw.toCharArray(), salt, 100, bitLength); - byte[] key = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA1").generateSecret(keySpec).getEncoded(); - SecretKeySpec secretKeySpec = new SecretKeySpec(key, 0, bitLength / 8, "DESede"); - Cipher cipher = Cipher.getInstance("DESede/CBC/PKCS5Padding"); - cipher.init(Cipher.ENCRYPT_MODE, secretKeySpec); - - - IvParameterSpec ivParameterSpec = new IvParameterSpec(ivOne); - // byte[] password = DigestUtils.sha1("".getBytes(Charsets.UTF_8)); - byte[] password = psw.getBytes(Charsets.UTF_8); - - return new TripleDesDecoder(cipher, in.getAbsoluteOffs() - in.getMark("bb")); - }); - } - - private TripleDesDecoder(Cipher cipher, long decryptionHeaderSize) { - engine = new TripleDesEngine(cipher); - this.decryptionHeaderSize = decryptionHeaderSize; - } - - /* - public String encryptText(String plainText) throws Exception { - // ---- Use specified 3DES key and IV from other source -------------- - byte[] plaintext = plainText.getBytes(); - byte[] tdesKeyData = Config.key.getBytes(); - // byte[] myIV = initializationVector.getBytes(); - Cipher c3des = Cipher.getInstance("DESede/CBC/PKCS5Padding"); - SecretKeySpec myKey = new SecretKeySpec(tdesKeyData, "DESede"); - IvParameterSpec ivspec = new IvParameterSpec(Config.initializationVector.getBytes()); - c3des.init(Cipher.ENCRYPT_MODE, myKey, ivspec); - byte[] cipherText = c3des.doFinal(plaintext); - return new BASE64Encoder().encode(cipherText); -} - -public static String decryptText(String cipherText) throws Exception { - byte[] encData = new BASE64Decoder().decodeBuffer(cipherText); - Cipher decipher = Cipher.getInstance("DESede/CBC/PKCS5Padding"); - byte[] tdesKeyData = Config.key.getBytes(); - SecretKeySpec myKey = new SecretKeySpec(tdesKeyData, "DESede"); - IvParameterSpec ivspec = new IvParameterSpec(Config.initializationVector.getBytes()); - decipher.init(Cipher.DECRYPT_MODE, myKey, ivspec); - byte[] plainText = decipher.doFinal(encData); - return new String(plainText); -} - */ - - // ---------- Decrypt ---------- - - @Override - public int decrypt(byte[] buf, int offs, int len) { - assert len > 0; - - return Quietly.doQuietly(() -> { - byte[] plain = engine.cipher.doFinal(buf, offs, len); - String str = new String(plain, Charsets.UTF_8); - System.out.println(str); - int a = 0; - a++; - return len; - }); - -// engine.cypherUpdate(buf, offs, len); - } -} diff --git a/src/main/java/ru/olegcherednik/zip4jvm/crypto/tripledes/TripleDesEngine.java b/src/main/java/ru/olegcherednik/zip4jvm/crypto/tripledes/TripleDesEngine.java deleted file mode 100644 index 3d11d1da8..000000000 --- a/src/main/java/ru/olegcherednik/zip4jvm/crypto/tripledes/TripleDesEngine.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package ru.olegcherednik.zip4jvm.crypto.tripledes; - -import lombok.RequiredArgsConstructor; -import ru.olegcherednik.zip4jvm.model.EncryptionMethod; - -import javax.crypto.Cipher; - -/** - * @author Oleg Cherednik - * @since 16.02.2020 - */ -@RequiredArgsConstructor -public final class TripleDesEngine { - - public final Cipher cipher; - - public void cypherUpdate(byte[] buf, int offs, int len) { - cipher.update(buf, offs, len); - } - - public static TripleDesStrength getStrength(EncryptionMethod encryptionMethod) { - if (encryptionMethod == EncryptionMethod.TRIPLE_DES_168) - return TripleDesStrength.S168; - if (encryptionMethod == EncryptionMethod.TRIPLE_DES_192) - return TripleDesStrength.S192; - return TripleDesStrength.NULL; - } -} diff --git a/src/main/java/ru/olegcherednik/zip4jvm/crypto/tripledes/TripleDesStrength.java b/src/main/java/ru/olegcherednik/zip4jvm/crypto/tripledes/TripleDesStrength.java deleted file mode 100644 index 2a5c1736c..000000000 --- a/src/main/java/ru/olegcherednik/zip4jvm/crypto/tripledes/TripleDesStrength.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package ru.olegcherednik.zip4jvm.crypto.tripledes; - -import lombok.AccessLevel; -import lombok.Getter; -import lombok.RequiredArgsConstructor; - -import javax.crypto.spec.SecretKeySpec; -import java.security.SecureRandom; - -/** - * @author Oleg Cherednik - * @since 16.02.2020 - */ -@Getter -@SuppressWarnings("MethodCanBeVariableArityMethod") -@RequiredArgsConstructor(access = AccessLevel.PACKAGE) -public enum TripleDesStrength { - NULL(0, 0), - S168(1, 128), - S192(2, 192); - - private final int code; - private final int size; - - public final int saltLength() { - return size / 16; - } - - private int macLength() { - return size / 8; - } - - private int keyLength() { - return size / 8; - } - - public SecretKeySpec createSecretKeyForCipher(byte[] key) { - return new SecretKeySpec(key, 0, keyLength(), "AES"); - } - - public SecretKeySpec createSecretKeyForMac(byte[] key) { - return new SecretKeySpec(key, keyLength(), macLength(), "HmacSHA1"); - } - - public byte[] createPasswordChecksum(byte[] key) { - final int offs = keyLength() + macLength(); - return new byte[] { key[offs], key[offs + 1] }; - } - - public byte[] generateSalt() { - SecureRandom random = new SecureRandom(); - byte[] buf = new byte[saltLength()]; - random.nextBytes(buf); - return buf; - } - - public static TripleDesStrength parseValue(int code) { - for (TripleDesStrength aesKeyStrength : values()) - if (aesKeyStrength.getCode() == code) - return aesKeyStrength; - - throw new EnumConstantNotPresentException(TripleDesStrength.class, "code=" + code); - } - -} diff --git a/src/main/java/ru/olegcherednik/zip4jvm/decompose/Decompose.java b/src/main/java/ru/olegcherednik/zip4jvm/decompose/Decompose.java index 39fa6d67f..92d441752 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/decompose/Decompose.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/decompose/Decompose.java @@ -21,7 +21,6 @@ import ru.olegcherednik.zip4jvm.view.PrintTextInfo; import java.io.IOException; -import java.io.PrintStream; import java.nio.file.Path; /** diff --git a/src/main/java/ru/olegcherednik/zip4jvm/decompose/EncryptedCentralDirectoryDecompose.java b/src/main/java/ru/olegcherednik/zip4jvm/decompose/EncryptedCentralDirectoryDecompose.java index ceb21ad8b..8b7f1e683 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/decompose/EncryptedCentralDirectoryDecompose.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/decompose/EncryptedCentralDirectoryDecompose.java @@ -28,7 +28,6 @@ import java.io.IOException; import java.nio.file.Path; -import java.util.Optional; /** * @author Oleg Cherednik diff --git a/src/main/java/ru/olegcherednik/zip4jvm/decompose/EncryptedFileHeaderDecompose.java b/src/main/java/ru/olegcherednik/zip4jvm/decompose/EncryptedFileHeaderDecompose.java index 77906b3a1..de820be19 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/decompose/EncryptedFileHeaderDecompose.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/decompose/EncryptedFileHeaderDecompose.java @@ -54,7 +54,9 @@ public Path decompose(Path dir) throws IOException { } @Override - protected FileHeaderView fileHeaderView(CentralDirectory.FileHeader fileHeader, CentralDirectoryBlock.FileHeaderBlock block, long pos) { + protected FileHeaderView fileHeaderView(CentralDirectory.FileHeader fileHeader, + CentralDirectoryBlock.FileHeaderBlock block, + long pos) { return new EncryptedFileHeaderView(fileHeader, block, pos, diff --git a/src/main/java/ru/olegcherednik/zip4jvm/decompose/EncryptionHeaderDecompose.java b/src/main/java/ru/olegcherednik/zip4jvm/decompose/EncryptionHeaderDecompose.java index 356fabb97..be726df89 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/decompose/EncryptionHeaderDecompose.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/decompose/EncryptionHeaderDecompose.java @@ -18,17 +18,18 @@ */ package ru.olegcherednik.zip4jvm.decompose; -import lombok.RequiredArgsConstructor; import ru.olegcherednik.zip4jvm.crypto.strong.DecryptionHeader; import ru.olegcherednik.zip4jvm.model.EncryptionMethod; import ru.olegcherednik.zip4jvm.model.ZipModel; import ru.olegcherednik.zip4jvm.model.block.crypto.AesEncryptionHeaderBlock; -import ru.olegcherednik.zip4jvm.model.block.crypto.strong.DecryptionHeaderBlock; import ru.olegcherednik.zip4jvm.model.block.crypto.EncryptionHeaderBlock; import ru.olegcherednik.zip4jvm.model.block.crypto.PkwareEncryptionHeaderBlock; +import ru.olegcherednik.zip4jvm.model.block.crypto.strong.DecryptionHeaderBlock; import ru.olegcherednik.zip4jvm.model.settings.ZipInfoSettings; import ru.olegcherednik.zip4jvm.view.crypto.EncryptionHeaderView; +import lombok.RequiredArgsConstructor; + import java.io.IOException; import java.io.PrintStream; import java.nio.file.Files; @@ -64,19 +65,19 @@ public Path decompose(Path dir) throws IOException { dir = Files.createDirectories(dir.resolve("encryption")); if (encryptionMethod.isStrong()) { - DecryptionHeaderBlock block = (DecryptionHeaderBlock)encryptionHeaderBlock; + DecryptionHeaderBlock block = (DecryptionHeaderBlock) encryptionHeaderBlock; Utils.print(dir.resolve("decryption_header.txt"), out -> encryptionHeaderView().printTextInfo(out)); Utils.copyLarge(zipModel, dir.resolve("decryption_header.data"), block); } else if (encryptionMethod.isAes()) { // TODO probably same with block reader - AesEncryptionHeaderBlock block = (AesEncryptionHeaderBlock)encryptionHeaderBlock; + AesEncryptionHeaderBlock block = (AesEncryptionHeaderBlock) encryptionHeaderBlock; Utils.print(dir.resolve("aes_encryption_header.txt"), out -> encryptionHeaderView().printTextInfo(out)); Utils.copyLarge(zipModel, dir.resolve("aes_salt.data"), block.getSalt()); Utils.copyLarge(zipModel, dir.resolve("aes_password_checksum.data"), block.getPasswordChecksum()); Utils.copyLarge(zipModel, dir.resolve("aes_mac.data"), block.getMac()); } else if (encryptionMethod == EncryptionMethod.PKWARE) { - PkwareEncryptionHeaderBlock block = (PkwareEncryptionHeaderBlock)encryptionHeaderBlock; + PkwareEncryptionHeaderBlock block = (PkwareEncryptionHeaderBlock) encryptionHeaderBlock; Utils.print(dir.resolve("pkware_encryption_header.txt"), out -> encryptionHeaderView().printTextInfo(out)); Utils.copyLarge(zipModel, dir.resolve("pkware_encryption_header.data"), block); } else { diff --git a/src/main/java/ru/olegcherednik/zip4jvm/decompose/FileHeaderDecompose.java b/src/main/java/ru/olegcherednik/zip4jvm/decompose/FileHeaderDecompose.java index e544b3558..8a713984c 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/decompose/FileHeaderDecompose.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/decompose/FileHeaderDecompose.java @@ -18,17 +18,18 @@ */ package ru.olegcherednik.zip4jvm.decompose; -import lombok.RequiredArgsConstructor; import ru.olegcherednik.zip4jvm.model.CentralDirectory; -import ru.olegcherednik.zip4jvm.model.extrafield.PkwareExtraField; import ru.olegcherednik.zip4jvm.model.GeneralPurposeFlag; import ru.olegcherednik.zip4jvm.model.ZipModel; import ru.olegcherednik.zip4jvm.model.block.BaseCentralDirectoryBlock; import ru.olegcherednik.zip4jvm.model.block.CentralDirectoryBlock; import ru.olegcherednik.zip4jvm.model.block.ExtraFieldBlock; +import ru.olegcherednik.zip4jvm.model.extrafield.PkwareExtraField; import ru.olegcherednik.zip4jvm.model.settings.ZipInfoSettings; import ru.olegcherednik.zip4jvm.view.centraldirectory.FileHeaderView; +import lombok.RequiredArgsConstructor; + import java.io.IOException; import java.io.PrintStream; import java.nio.file.Path; @@ -46,6 +47,7 @@ public class FileHeaderDecompose implements Decompose { private final BaseCentralDirectoryBlock block; @Override + @SuppressWarnings("NonShortCircuitBooleanExpression") public boolean printTextInfo(PrintStream out, boolean emptyLine) { long pos = 0; @@ -53,7 +55,9 @@ public boolean printTextInfo(PrintStream out, boolean emptyLine) { CentralDirectoryBlock.FileHeaderBlock fileHeaderBlock = block.getFileHeader(fileHeader.getFileName()); emptyLine |= fileHeaderView(fileHeader, fileHeaderBlock, pos).printTextInfo(out, pos != 0 || emptyLine); - emptyLine |= extraFields(fileHeader, fileHeaderBlock.getExtraFieldBlock(), settings.getOffs()).printTextInfo(out, false); + emptyLine |= extraFields(fileHeader, + fileHeaderBlock.getExtraFieldBlock(), + settings.getOffs()).printTextInfo(out, false); pos++; } @@ -106,7 +110,12 @@ private PkwareExtraFieldDecompose extraFields(CentralDirectory.FileHeader fileHe int offs) { PkwareExtraField extraField = fileHeader.getExtraField(); GeneralPurposeFlag generalPurposeFlag = fileHeader.getGeneralPurposeFlag(); - return new PkwareExtraFieldDecompose(zipModel, extraField, block, generalPurposeFlag, offs, settings.getColumnWidth()); + return new PkwareExtraFieldDecompose(zipModel, + extraField, + block, + generalPurposeFlag, + offs, + settings.getColumnWidth()); } } diff --git a/src/main/java/ru/olegcherednik/zip4jvm/decompose/LocalFileHeaderDecompose.java b/src/main/java/ru/olegcherednik/zip4jvm/decompose/LocalFileHeaderDecompose.java index 7b61f9931..fcd9198eb 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/decompose/LocalFileHeaderDecompose.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/decompose/LocalFileHeaderDecompose.java @@ -25,15 +25,14 @@ import ru.olegcherednik.zip4jvm.model.ZipModel; import ru.olegcherednik.zip4jvm.model.block.Block; import ru.olegcherednik.zip4jvm.model.block.BlockModel; -import ru.olegcherednik.zip4jvm.model.block.ExtraFieldBlock; import ru.olegcherednik.zip4jvm.model.block.ZipEntryBlock; import ru.olegcherednik.zip4jvm.model.block.crypto.AesEncryptionHeaderBlock; import ru.olegcherednik.zip4jvm.model.block.crypto.EncryptionHeaderBlock; import ru.olegcherednik.zip4jvm.model.block.crypto.PkwareEncryptionHeaderBlock; import ru.olegcherednik.zip4jvm.model.entry.ZipEntry; import ru.olegcherednik.zip4jvm.model.extrafield.AlignmentExtraField; -import ru.olegcherednik.zip4jvm.model.extrafield.PkwareExtraField; import ru.olegcherednik.zip4jvm.model.extrafield.ExtraField; +import ru.olegcherednik.zip4jvm.model.extrafield.PkwareExtraField; import ru.olegcherednik.zip4jvm.model.settings.ZipInfoSettings; import ru.olegcherednik.zip4jvm.view.entry.DataDescriptorView; import ru.olegcherednik.zip4jvm.view.entry.LocalFileHeaderView; @@ -63,6 +62,7 @@ public LocalFileHeaderDecompose(BlockModel blockModel, ZipInfoSettings settings) } @Override + @SuppressWarnings("NonShortCircuitBooleanExpression") public boolean printTextInfo(PrintStream out, boolean emptyLine) { long pos = 0; @@ -71,10 +71,15 @@ public boolean printTextInfo(PrintStream out, boolean emptyLine) { EncryptionMethod encryptionMethod = zipModel.getZipEntryByFileName(fileName).getEncryptionMethod(); - emptyLine |= localFileHeaderView(zipEntryBlock.getLocalFileHeader(), fileName, pos).printTextInfo(out, pos != 0 || emptyLine); + emptyLine |= localFileHeaderView(zipEntryBlock.getLocalFileHeader(), fileName, pos) + .printTextInfo(out, pos != 0 || emptyLine); emptyLine |= extraFieldDecompose(zipEntryBlock, settings.getOffs()).printTextInfo(out, false); emptyLine |= encryptionHeader(encryptionMethod, zipEntryBlock, pos).printTextInfo(out, emptyLine); - emptyLine |= dataDescriptor(zipEntryBlock.getDataDescriptor(), zipEntryBlock.getDataDescriptorBlock(), pos, out, emptyLine); + emptyLine |= dataDescriptor(zipEntryBlock.getDataDescriptor(), + zipEntryBlock.getDataDescriptorBlock(), + pos, + out, + emptyLine); pos++; } @@ -107,7 +112,8 @@ public Path decompose(Path dir) throws IOException { return dir; } - private void localFileHeader(Path dir, LocalFileHeader localFileHeader, String fileName, long pos) throws IOException { + private void localFileHeader(Path dir, LocalFileHeader localFileHeader, String fileName, long pos) + throws IOException { ZipEntryBlock.LocalFileHeaderBlock block = blockModel.getZipEntryBlock(fileName).getLocalFileHeaderBlock(); Utils.print(dir.resolve(LOCAL_FILE_HEADER + ".txt"), @@ -127,7 +133,7 @@ private void copyPayload(Path dir, ZipEntry zipEntry, ZipEntryBlock.LocalFileHea EncryptionMethod encryptionMethod = zipEntry.getEncryptionMethod(); if (encryptionMethod.isAes()) { - AesEncryptionHeaderBlock block = (AesEncryptionHeaderBlock)encryptionHeaderBlock; + AesEncryptionHeaderBlock block = (AesEncryptionHeaderBlock) encryptionHeaderBlock; offs += block.getSalt().getSize(); offs += block.getPasswordChecksum().getSize(); @@ -136,7 +142,7 @@ private void copyPayload(Path dir, ZipEntry zipEntry, ZipEntryBlock.LocalFileHea size -= block.getPasswordChecksum().getSize(); size -= block.getMac().getSize(); } else if (encryptionMethod == EncryptionMethod.PKWARE) { - PkwareEncryptionHeaderBlock block = (PkwareEncryptionHeaderBlock)encryptionHeaderBlock; + PkwareEncryptionHeaderBlock block = (PkwareEncryptionHeaderBlock) encryptionHeaderBlock; offs += block.getSize(); size -= block.getSize(); } @@ -181,11 +187,17 @@ private LocalFileHeaderView localFileHeaderView(LocalFileHeader localFileHeader, .pos(pos) .charset(settings.getCharset()) .centralDirectoryEncrypted(zipModel.isCentralDirectoryEncrypted()) - .position(settings.getOffs(), settings.getColumnWidth(), zipModel.getTotalDisks()).build(); + .position(settings.getOffs(), settings.getColumnWidth(), zipModel.getTotalDisks()) + .build(); } private DataDescriptorView dataDescriptorView(DataDescriptor dataDescriptor, Block block, long pos) { - return new DataDescriptorView(dataDescriptor, block, pos, settings.getOffs(), settings.getColumnWidth(), zipModel.getTotalDisks()); + return new DataDescriptorView(dataDescriptor, + block, + pos, + settings.getOffs(), + settings.getColumnWidth(), + zipModel.getTotalDisks()); } private Decompose extraFieldDecompose(ZipEntryBlock zipEntryBlock, int offs) { @@ -196,7 +208,7 @@ private Decompose extraFieldDecompose(ZipEntryBlock zipEntryBlock, int offs) { GeneralPurposeFlag generalPurposeFlag = zipEntryBlock.getLocalFileHeader().getGeneralPurposeFlag(); return new PkwareExtraFieldDecompose(zipModel, - (PkwareExtraField)extraField, + (PkwareExtraField) extraField, zipEntryBlock.getLocalFileHeaderBlock().getExtraFieldBlock(), generalPurposeFlag, offs, diff --git a/src/main/java/ru/olegcherednik/zip4jvm/decompose/PkwareExtraFieldDecompose.java b/src/main/java/ru/olegcherednik/zip4jvm/decompose/PkwareExtraFieldDecompose.java index a27602301..639010fab 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/decompose/PkwareExtraFieldDecompose.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/decompose/PkwareExtraFieldDecompose.java @@ -18,10 +18,10 @@ */ package ru.olegcherednik.zip4jvm.decompose; -import ru.olegcherednik.zip4jvm.model.extrafield.PkwareExtraField; import ru.olegcherednik.zip4jvm.model.GeneralPurposeFlag; import ru.olegcherednik.zip4jvm.model.ZipModel; import ru.olegcherednik.zip4jvm.model.block.ExtraFieldBlock; +import ru.olegcherednik.zip4jvm.model.extrafield.PkwareExtraField; import ru.olegcherednik.zip4jvm.view.extrafield.ExtraFieldRecordView; import ru.olegcherednik.zip4jvm.view.extrafield.ExtraFieldView; diff --git a/src/main/java/ru/olegcherednik/zip4jvm/decompose/Utils.java b/src/main/java/ru/olegcherednik/zip4jvm/decompose/Utils.java index 1363e8f18..ce7f94dce 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/decompose/Utils.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/decompose/Utils.java @@ -18,14 +18,15 @@ */ package ru.olegcherednik.zip4jvm.decompose; -import lombok.AccessLevel; -import lombok.NoArgsConstructor; -import org.apache.commons.io.IOUtils; import ru.olegcherednik.zip4jvm.model.ZipModel; import ru.olegcherednik.zip4jvm.model.block.Block; import ru.olegcherednik.zip4jvm.model.entry.ZipEntry; import ru.olegcherednik.zip4jvm.utils.ValidationUtils; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; +import org.apache.commons.io.IOUtils; + import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; @@ -55,7 +56,8 @@ public static void copyLarge(ZipModel zipModel, Path out, Block block) throws IO public static void copyLarge(ZipModel zipModel, Path out, long offs, long size) throws IOException { Path file = zipModel.getSrcZip().getPath(); - try (FileInputStream fis = new FileInputStream(file.toFile()); FileOutputStream fos = new FileOutputStream(out.toFile())) { + try (FileInputStream fis = new FileInputStream(file.toFile()); + FileOutputStream fos = new FileOutputStream(out.toFile())) { fis.skip(offs); IOUtils.copyLarge(fis, fos, 0, size); } diff --git a/src/main/java/ru/olegcherednik/zip4jvm/decompose/Zip64Decompose.java b/src/main/java/ru/olegcherednik/zip4jvm/decompose/Zip64Decompose.java index 89d8f7e21..33abeb005 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/decompose/Zip64Decompose.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/decompose/Zip64Decompose.java @@ -77,19 +77,26 @@ public Path decompose(Path dir) throws IOException { } private void endOfCentralDirectoryLocator(Path dir) throws IOException { - Utils.print(dir.resolve("zip64_end_central_directory_locator.txt"), out -> endCentralDirectorLocatorView().printTextInfo(out)); - Utils.copyLarge(zipModel, dir.resolve("zip64_end_central_directory_locator.data"), block.getEndCentralDirectoryLocatorBlock()); + Utils.print(dir.resolve("zip64_end_central_directory_locator.txt"), + out -> endCentralDirectorLocatorView().printTextInfo(out)); + Utils.copyLarge(zipModel, + dir.resolve("zip64_end_central_directory_locator.data"), + block.getEndCentralDirectoryLocatorBlock()); } private void endOfCentralDirectory(Path dir) throws IOException { - Utils.print(dir.resolve("zip64_end_central_directory.txt"), out -> endCentralDirectoryView().printTextInfo(out)); + Utils.print(dir.resolve("zip64_end_central_directory.txt"), + out -> endCentralDirectoryView().printTextInfo(out)); Utils.copyLarge(zipModel, dir.resolve("zip64_end_central_directory.data"), block.getEndCentralDirectoryBlock()); } private void extensibleDataSector(Path dir) throws IOException { if (zip64.isCentralDirectoryEncrypted()) { - Utils.print(dir.resolve("zip64_extensible_data_sector.txt"), out -> extensibleDataSectorView().printTextInfo(out)); - Utils.copyLarge(zipModel, dir.resolve("zip64_extensible_data_sector.data"), block.getExtensibleDataSectorBlock()); + Utils.print(dir.resolve("zip64_extensible_data_sector.txt"), + out -> extensibleDataSectorView().printTextInfo(out)); + Utils.copyLarge(zipModel, + dir.resolve("zip64_extensible_data_sector.data"), + block.getExtensibleDataSectorBlock()); } } diff --git a/src/main/java/ru/olegcherednik/zip4jvm/engine/InfoEngine.java b/src/main/java/ru/olegcherednik/zip4jvm/engine/InfoEngine.java index cc0ab86ea..fd2b692f2 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/engine/InfoEngine.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/engine/InfoEngine.java @@ -18,8 +18,13 @@ */ package ru.olegcherednik.zip4jvm.engine; -import lombok.RequiredArgsConstructor; import ru.olegcherednik.zip4jvm.ZipFile; +import ru.olegcherednik.zip4jvm.decompose.CentralDirectoryDecompose; +import ru.olegcherednik.zip4jvm.decompose.Decompose; +import ru.olegcherednik.zip4jvm.decompose.EncryptedCentralDirectoryDecompose; +import ru.olegcherednik.zip4jvm.decompose.EndCentralDirectoryDecompose; +import ru.olegcherednik.zip4jvm.decompose.Zip64Decompose; +import ru.olegcherednik.zip4jvm.decompose.ZipEntriesDecompose; import ru.olegcherednik.zip4jvm.exception.EntryNotFoundException; import ru.olegcherednik.zip4jvm.io.readers.ZipModelReader; import ru.olegcherednik.zip4jvm.io.readers.block.BlockZipModelReader; @@ -27,12 +32,8 @@ import ru.olegcherednik.zip4jvm.model.block.BlockModel; import ru.olegcherednik.zip4jvm.model.settings.ZipInfoSettings; import ru.olegcherednik.zip4jvm.model.src.SrcZip; -import ru.olegcherednik.zip4jvm.decompose.CentralDirectoryDecompose; -import ru.olegcherednik.zip4jvm.decompose.Decompose; -import ru.olegcherednik.zip4jvm.decompose.EncryptedCentralDirectoryDecompose; -import ru.olegcherednik.zip4jvm.decompose.EndCentralDirectoryDecompose; -import ru.olegcherednik.zip4jvm.decompose.Zip64Decompose; -import ru.olegcherednik.zip4jvm.decompose.ZipEntriesDecompose; + +import lombok.RequiredArgsConstructor; import java.io.IOException; import java.io.PrintStream; @@ -80,7 +81,9 @@ private Decompose getCentralDirectoryDecompose(BlockModel blockModel) { @Override public CentralDirectory.FileHeader getFileHeader(String entryName) throws IOException { - ZipModelReader reader = new ZipModelReader(srcZip, settings.getCustomizeCharset(), settings.getPasswordProvider()); + ZipModelReader reader = new ZipModelReader(srcZip, + settings.getCustomizeCharset(), + settings.getPasswordProvider()); reader.readCentralData(); return reader.getCentralDirectory().getFileHeaders().stream() .filter(fh -> fh.getFileName().equalsIgnoreCase(entryName)) diff --git a/src/main/java/ru/olegcherednik/zip4jvm/engine/UnzipEngine.java b/src/main/java/ru/olegcherednik/zip4jvm/engine/UnzipEngine.java index ec3a1cdc4..286e43ebb 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/engine/UnzipEngine.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/engine/UnzipEngine.java @@ -18,8 +18,6 @@ */ package ru.olegcherednik.zip4jvm.engine; -import org.apache.commons.io.FilenameUtils; -import org.apache.commons.io.IOUtils; import ru.olegcherednik.zip4jvm.ZipFile; import ru.olegcherednik.zip4jvm.exception.Zip4jvmException; import ru.olegcherednik.zip4jvm.model.Charsets; @@ -33,6 +31,9 @@ import ru.olegcherednik.zip4jvm.utils.quitely.Quietly; import ru.olegcherednik.zip4jvm.utils.time.DosTimestampConverterUtils; +import org.apache.commons.io.FilenameUtils; +import org.apache.commons.io.IOUtils; + import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; @@ -71,7 +72,9 @@ public void extract(Path destDir, String fileName) throws IOException { fileName = ZipUtils.getFileNameNoDirectoryMarker(fileName); if (zipModel.hasEntry(fileName)) - extractEntry(destDir, zipModel.getZipEntryByFileName(fileName), e -> FilenameUtils.getName(e.getFileName())); + extractEntry(destDir, + zipModel.getZipEntryByFileName(fileName), + e -> FilenameUtils.getName(e.getFileName())); else { List subEntries = getEntriesWithFileNamePrefix(fileName + '/'); diff --git a/src/main/java/ru/olegcherednik/zip4jvm/engine/ZipEngine.java b/src/main/java/ru/olegcherednik/zip4jvm/engine/ZipEngine.java index 84982c94d..739ad2096 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/engine/ZipEngine.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/engine/ZipEngine.java @@ -18,7 +18,6 @@ */ package ru.olegcherednik.zip4jvm.engine; -import lombok.extern.slf4j.Slf4j; import ru.olegcherednik.zip4jvm.ZipFile; import ru.olegcherednik.zip4jvm.engine.np.NamedPath; import ru.olegcherednik.zip4jvm.exception.EntryDuplicationException; @@ -39,6 +38,8 @@ import ru.olegcherednik.zip4jvm.utils.ZipUtils; import ru.olegcherednik.zip4jvm.utils.function.Writer; +import lombok.extern.slf4j.Slf4j; + import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; @@ -206,7 +207,8 @@ private void moveTempZipFiles() throws IOException { Files.deleteIfExists(tempZipModel.getSrcZip().getPath().getParent()); } - private static ZipModel createTempZipModel(Path zip, ZipSettings settings, Map fileNameWriter) throws IOException { + private static ZipModel createTempZipModel(Path zip, ZipSettings settings, Map fileNameWriter) + throws IOException { Path tempZip = createTempZip(zip); ZipModel tempZipModel = ZipModelBuilder.build(tempZip, settings); diff --git a/src/main/java/ru/olegcherednik/zip4jvm/engine/ZipSymlinkEngine.java b/src/main/java/ru/olegcherednik/zip4jvm/engine/ZipSymlinkEngine.java index 03c11b19a..b017d82e8 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/engine/ZipSymlinkEngine.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/engine/ZipSymlinkEngine.java @@ -18,15 +18,15 @@ */ package ru.olegcherednik.zip4jvm.engine; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; import ru.olegcherednik.zip4jvm.engine.np.NamedPath; -import ru.olegcherednik.zip4jvm.exception.Zip4jvmException; import ru.olegcherednik.zip4jvm.model.ZipSymlink; import ru.olegcherednik.zip4jvm.utils.PathUtils; import ru.olegcherednik.zip4jvm.utils.ZipUtils; import ru.olegcherednik.zip4jvm.utils.quitely.Quietly; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; + import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; diff --git a/src/main/java/ru/olegcherednik/zip4jvm/engine/np/Directory.java b/src/main/java/ru/olegcherednik/zip4jvm/engine/np/Directory.java index d17c4204b..c47b6fd55 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/engine/np/Directory.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/engine/np/Directory.java @@ -32,7 +32,7 @@ final class Directory extends NamedPath { private final Path dir; - public Directory(Path dir, String dirName) { + Directory(Path dir, String dirName) { super(dirName); this.dir = dir; diff --git a/src/main/java/ru/olegcherednik/zip4jvm/engine/np/NamedPath.java b/src/main/java/ru/olegcherednik/zip4jvm/engine/np/NamedPath.java index 81973dbe8..e16cc2290 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/engine/np/NamedPath.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/engine/np/NamedPath.java @@ -18,13 +18,14 @@ */ package ru.olegcherednik.zip4jvm.engine.np; -import lombok.Getter; import ru.olegcherednik.zip4jvm.exception.Zip4jvmException; import ru.olegcherednik.zip4jvm.model.entry.ZipEntry; import ru.olegcherednik.zip4jvm.model.settings.ZipEntrySettings; import ru.olegcherednik.zip4jvm.utils.PathUtils; import ru.olegcherednik.zip4jvm.utils.ZipUtils; +import lombok.Getter; + import java.nio.file.Files; import java.nio.file.Path; import java.util.Comparator; @@ -55,7 +56,9 @@ public abstract class NamedPath { return 0; }; - /** Normalized file name without directory marker {@literal /} */ + /** + * Normalized file name without directory marker {@literal /} + */ protected final String name; public static NamedPath create(Path path) { diff --git a/src/main/java/ru/olegcherednik/zip4jvm/engine/np/RegularFile.java b/src/main/java/ru/olegcherednik/zip4jvm/engine/np/RegularFile.java index 86eeddec5..4f607cb3c 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/engine/np/RegularFile.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/engine/np/RegularFile.java @@ -32,7 +32,7 @@ final class RegularFile extends NamedPath { private final Path file; - public RegularFile(Path file, String fileName) { + RegularFile(Path file, String fileName) { super(fileName); this.file = file; } diff --git a/src/main/java/ru/olegcherednik/zip4jvm/engine/np/Symlink.java b/src/main/java/ru/olegcherednik/zip4jvm/engine/np/Symlink.java index 6610dd27b..820733c23 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/engine/np/Symlink.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/engine/np/Symlink.java @@ -18,7 +18,6 @@ */ package ru.olegcherednik.zip4jvm.engine.np; -import ru.olegcherednik.zip4jvm.ZipFile; import ru.olegcherednik.zip4jvm.model.entry.ZipEntry; import ru.olegcherednik.zip4jvm.model.entry.ZipEntryBuilder; import ru.olegcherednik.zip4jvm.model.settings.ZipEntrySettings; @@ -34,11 +33,11 @@ final class Symlink extends NamedPath { private final Path symlinkTarget; private final String symlinkTargetRelativePath; - public Symlink(Path symlinkTarget, String symlinkName) { + Symlink(Path symlinkTarget, String symlinkName) { this(symlinkTarget, null, symlinkName); } - public Symlink(Path symlinkTarget, String symlinkTargetRelativePath, String symlinkName) { + Symlink(Path symlinkTarget, String symlinkTargetRelativePath, String symlinkName) { super(symlinkName); this.symlinkTarget = symlinkTarget; this.symlinkTargetRelativePath = symlinkTargetRelativePath; diff --git a/src/main/java/ru/olegcherednik/zip4jvm/exception/SignatureWasNotFoundException.java b/src/main/java/ru/olegcherednik/zip4jvm/exception/SignatureWasNotFoundException.java index 8b5ba277f..425806cec 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/exception/SignatureWasNotFoundException.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/exception/SignatureWasNotFoundException.java @@ -18,9 +18,10 @@ */ package ru.olegcherednik.zip4jvm.exception; -import lombok.Getter; import ru.olegcherednik.zip4jvm.view.BaseView; +import lombok.Getter; + /** * @author Oleg Cherednik * @since 04.12.2019 diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/bzip2/Bzip2OutputStream.java b/src/main/java/ru/olegcherednik/zip4jvm/io/bzip2/Bzip2OutputStream.java index 4cd6fd025..08ce0528e 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/bzip2/Bzip2OutputStream.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/bzip2/Bzip2OutputStream.java @@ -28,6 +28,7 @@ * @author Oleg Cherednik * @since 12.04.2020 */ +@SuppressWarnings("all") public class Bzip2OutputStream extends OutputStream { private static final int GREATER_ICOST = 15; @@ -64,8 +65,8 @@ public class Bzip2OutputStream extends OutputStream { private boolean init = true; private static void hbMakeCodeLengths(final byte[] len, final int[] freq, - final Data dat, final int alphaSize, - final int maxLen) { + final Data dat, final int alphaSize, + final int maxLen) { /* * Nodes and heap entries run from 1. Entry 0 for both the heap and * nodes is a sentinel. @@ -198,7 +199,7 @@ private static void hbMakeCodeLengths(final byte[] len, final int[] freq, j++; } - len[i - 1] = (byte)j; + len[i - 1] = (byte) j; if (j > maxLen) { tooLong = true; } @@ -251,7 +252,7 @@ private void writeRun() throws IOException { final int currentCharShadow = currentChar; final Data dataShadow = data; dataShadow.inUse[currentCharShadow] = true; - final byte ch = (byte)currentCharShadow; + final byte ch = (byte) currentCharShadow; int runLengthShadow = runLength; crc32.update(currentCharShadow, runLengthShadow); @@ -285,7 +286,7 @@ private void writeRun() throws IOException { block[lastShadow + 3] = ch; block[lastShadow + 4] = ch; block[lastShadow + 5] = ch; - block[lastShadow + 6] = (byte)runLengthShadow; + block[lastShadow + 6] = (byte) runLengthShadow; last = lastShadow + 5; } break; @@ -478,8 +479,8 @@ private void write0(int b) throws IOException { } private static void hbAssignCodes(final int[] code, final byte[] length, - final int minLen, final int maxLen, - final int alphaSize) { + final int minLen, final int maxLen, + final int alphaSize) { int vec = 0; for (int n = minLen; n <= maxLen; n++) { for (int i = 0; i < alphaSize; i++) { @@ -697,7 +698,7 @@ private int sendMTFValues1(final int nGroups, final int alphaSize) { } fave[bt]++; - selector[nSelectors] = (byte)bt; + selector[nSelectors] = (byte) bt; nSelectors++; /* @@ -729,7 +730,7 @@ private void sendMTFValues2(final int nGroups, final int nSelectors) { final byte[] pos = dataShadow.sendMTFValues2_pos; for (int i = nGroups; --i >= 0; ) { - pos[i] = (byte)i; + pos[i] = (byte) i; } for (int i = 0; i < nSelectors; i++) { @@ -745,7 +746,7 @@ private void sendMTFValues2(final int nGroups, final int nSelectors) { } pos[0] = tmp; - dataShadow.selectorMtf[i] = (byte)j; + dataShadow.selectorMtf[i] = (byte) j; } } @@ -994,7 +995,7 @@ private void generateMTFValues() { int nInUseShadow = 0; for (int i = 0; i < 256; i++) { if (inUse[i]) { - unseqToSeq[i] = (byte)nInUseShadow; + unseqToSeq[i] = (byte) nInUseShadow; nInUseShadow++; } } @@ -1007,7 +1008,7 @@ private void generateMTFValues() { } for (int i = nInUseShadow; --i >= 0; ) { - yy[i] = (byte)i; + yy[i] = (byte) i; } int wr = 0; @@ -1050,7 +1051,7 @@ private void generateMTFValues() { } zPend = 0; } - sfmap[wr] = (char)(j + 1); + sfmap[wr] = (char) (j + 1); wr++; mtfFreq[j + 1]++; } @@ -1077,7 +1078,7 @@ private void generateMTFValues() { } } - sfmap[wr] = (char)eob; + sfmap[wr] = (char) eob; mtfFreq[eob]++; this.nMTF = wr + 1; } diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/in/BitInputStream.java b/src/main/java/ru/olegcherednik/zip4jvm/io/in/BitInputStream.java index 088428325..3d91526eb 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/in/BitInputStream.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/in/BitInputStream.java @@ -18,9 +18,10 @@ */ package ru.olegcherednik.zip4jvm.io.in; +import ru.olegcherednik.zip4jvm.io.in.data.DataInput; + import lombok.RequiredArgsConstructor; import org.apache.commons.io.IOUtils; -import ru.olegcherednik.zip4jvm.io.in.data.DataInput; import java.io.IOException; import java.nio.ByteOrder; diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/in/RandomAccess.java b/src/main/java/ru/olegcherednik/zip4jvm/io/in/RandomAccess.java index bb03c45b2..dc07c7be4 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/in/RandomAccess.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/in/RandomAccess.java @@ -24,7 +24,8 @@ */ public interface RandomAccess { - // TODO looks like when delegate is encryption (e.g. AES), then it's mandatory not skip, but read bytes to keep counters up to date + // TODO looks like when delegate is encryption (e.g. AES), then it's mandatory not skip, + // but read bytes to keep counters up to date /** * Skip given {@code bytes} diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/in/buf/DiskByteArrayDataInput.java b/src/main/java/ru/olegcherednik/zip4jvm/io/in/buf/DiskByteArrayDataInput.java index ae6c79df5..d7228222c 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/in/buf/DiskByteArrayDataInput.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/in/buf/DiskByteArrayDataInput.java @@ -18,16 +18,18 @@ */ package ru.olegcherednik.zip4jvm.io.in.buf; -import lombok.Getter; import ru.olegcherednik.zip4jvm.io.Endianness; import ru.olegcherednik.zip4jvm.model.src.SrcZip; +import lombok.Getter; + /** * This class was designed only to cover one decompose test split+ecd. * It should be removed and real problem should be fixed. * * @author Oleg Cherednik * @since 08.01.2023 + * @deprecated this is a temporary fix */ @Deprecated public final class DiskByteArrayDataInput extends ByteArrayDataInput { diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/in/buf/InflateDataInput.java b/src/main/java/ru/olegcherednik/zip4jvm/io/in/buf/InflateDataInput.java index 3db3fe382..9ca735577 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/in/buf/InflateDataInput.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/in/buf/InflateDataInput.java @@ -18,12 +18,10 @@ */ package ru.olegcherednik.zip4jvm.io.in.buf; -import ru.olegcherednik.zip4jvm.exception.Zip4jvmException; import ru.olegcherednik.zip4jvm.io.in.data.DataInput; import ru.olegcherednik.zip4jvm.io.in.data.DataInputLocation; import ru.olegcherednik.zip4jvm.utils.quitely.Quietly; -import java.util.zip.DataFormatException; import java.util.zip.Inflater; /** @@ -39,7 +37,7 @@ public InflateDataInput(DataInput in, int uncompressedSize, DataInputLocation da private static byte[] read(DataInput in, int uncompressedSize) { return Quietly.doQuietly(() -> { Inflater inflater = new Inflater(true); - inflater.setInput(in.readBytes((int)in.size())); + inflater.setInput(in.readBytes((int) in.size())); byte[] buf = new byte[uncompressedSize]; inflater.inflate(buf, 0, buf.length); diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/in/buf/MetadataByteArrayDataInput.java b/src/main/java/ru/olegcherednik/zip4jvm/io/in/buf/MetadataByteArrayDataInput.java index 12d41ec36..08b79f7ca 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/in/buf/MetadataByteArrayDataInput.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/in/buf/MetadataByteArrayDataInput.java @@ -18,12 +18,13 @@ */ package ru.olegcherednik.zip4jvm.io.in.buf; -import lombok.Getter; import ru.olegcherednik.zip4jvm.io.Endianness; import ru.olegcherednik.zip4jvm.io.in.data.DataInput; import ru.olegcherednik.zip4jvm.io.in.data.DataInputLocation; import ru.olegcherednik.zip4jvm.model.src.SrcZip; +import lombok.Getter; + /** * Represents {@link DataInput} based on the array with additional metadata {@link DataInputLocation} * diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/in/buf/SimpleDataInputLocation.java b/src/main/java/ru/olegcherednik/zip4jvm/io/in/buf/SimpleDataInputLocation.java index 698ac9cc4..9f5a67ea5 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/in/buf/SimpleDataInputLocation.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/in/buf/SimpleDataInputLocation.java @@ -18,11 +18,12 @@ */ package ru.olegcherednik.zip4jvm.io.in.buf; -import lombok.Getter; -import ru.olegcherednik.zip4jvm.io.in.file.DataInputFile; import ru.olegcherednik.zip4jvm.io.in.data.DataInputLocation; +import ru.olegcherednik.zip4jvm.io.in.file.DataInputFile; import ru.olegcherednik.zip4jvm.model.src.SrcZip; +import lombok.Getter; + /** * @author Oleg Cherednik * @since 24.12.2022 @@ -41,4 +42,5 @@ public SimpleDataInputLocation(DataInputFile in) { srcZip = in.getSrcZip(); disk = in.getDisk(); } + } diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/in/data/BaseDataInput.java b/src/main/java/ru/olegcherednik/zip4jvm/io/in/data/BaseDataInput.java index 4cefb26e6..4128786c8 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/in/data/BaseDataInput.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/in/data/BaseDataInput.java @@ -18,13 +18,14 @@ */ package ru.olegcherednik.zip4jvm.io.in.data; +import ru.olegcherednik.zip4jvm.exception.Zip4jvmException; +import ru.olegcherednik.zip4jvm.io.Endianness; + import lombok.AccessLevel; import lombok.Getter; import lombok.RequiredArgsConstructor; import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.ArrayUtils; -import ru.olegcherednik.zip4jvm.exception.Zip4jvmException; -import ru.olegcherednik.zip4jvm.io.Endianness; import java.io.IOException; import java.math.BigInteger; diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/in/data/DataInput.java b/src/main/java/ru/olegcherednik/zip4jvm/io/in/data/DataInput.java index 5280c5fdf..e67247d09 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/in/data/DataInput.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/in/data/DataInput.java @@ -77,7 +77,7 @@ default int readWordSignature() { } default int readDwordSignature() { - return (int)readDword(); + return (int) readDword(); } // ---------- RandomAccess ---------- diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/in/data/DecoderDataInput.java b/src/main/java/ru/olegcherednik/zip4jvm/io/in/data/DecoderDataInput.java index 9508545b0..8f318c01d 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/in/data/DecoderDataInput.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/in/data/DecoderDataInput.java @@ -18,11 +18,12 @@ */ package ru.olegcherednik.zip4jvm.io.in.data; -import org.apache.commons.io.IOUtils; -import org.apache.commons.lang3.ArrayUtils; import ru.olegcherednik.zip4jvm.crypto.Decoder; import ru.olegcherednik.zip4jvm.utils.ValidationUtils; +import org.apache.commons.io.IOUtils; +import org.apache.commons.lang3.ArrayUtils; + import java.io.IOException; /** diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/in/entry/Bzip2EntryInputStream.java b/src/main/java/ru/olegcherednik/zip4jvm/io/in/entry/Bzip2EntryInputStream.java index f04ae3ee5..374af3caf 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/in/entry/Bzip2EntryInputStream.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/in/entry/Bzip2EntryInputStream.java @@ -18,11 +18,12 @@ */ package ru.olegcherednik.zip4jvm.io.in.entry; -import org.apache.commons.io.IOUtils; import ru.olegcherednik.zip4jvm.io.bzip2.Bzip2InputStream; import ru.olegcherednik.zip4jvm.io.in.data.DataInput; import ru.olegcherednik.zip4jvm.model.entry.ZipEntry; +import org.apache.commons.io.IOUtils; + import java.io.IOException; /** diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/in/entry/EnhancedDeflateEntryInputStream.java b/src/main/java/ru/olegcherednik/zip4jvm/io/in/entry/EnhancedDeflateEntryInputStream.java index 990ebc6e3..daf9cd2fd 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/in/entry/EnhancedDeflateEntryInputStream.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/in/entry/EnhancedDeflateEntryInputStream.java @@ -18,11 +18,12 @@ */ package ru.olegcherednik.zip4jvm.io.in.entry; -import org.apache.commons.io.IOUtils; import ru.olegcherednik.zip4jvm.io.ed.EnhancedDeflateInputStream; import ru.olegcherednik.zip4jvm.io.in.data.DataInput; import ru.olegcherednik.zip4jvm.model.entry.ZipEntry; +import org.apache.commons.io.IOUtils; + import java.io.IOException; /** diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/in/entry/EntryInputStream.java b/src/main/java/ru/olegcherednik/zip4jvm/io/in/entry/EntryInputStream.java index 3ffac3420..5d516398f 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/in/entry/EntryInputStream.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/in/entry/EntryInputStream.java @@ -18,23 +18,25 @@ */ package ru.olegcherednik.zip4jvm.io.in.entry; -import org.apache.commons.io.IOUtils; import ru.olegcherednik.zip4jvm.crypto.Decoder; import ru.olegcherednik.zip4jvm.io.in.data.DataInput; -import ru.olegcherednik.zip4jvm.io.in.file.DataInputFile; import ru.olegcherednik.zip4jvm.io.in.data.DecoderDataInput; +import ru.olegcherednik.zip4jvm.io.in.file.DataInputFile; import ru.olegcherednik.zip4jvm.io.readers.LocalFileHeaderReader; import ru.olegcherednik.zip4jvm.model.Compression; import ru.olegcherednik.zip4jvm.model.CompressionMethod; import ru.olegcherednik.zip4jvm.model.LocalFileHeader; import ru.olegcherednik.zip4jvm.model.entry.ZipEntry; +import org.apache.commons.io.IOUtils; + import java.io.IOException; import java.nio.charset.Charset; import java.util.function.Function; /** - * This stream is responsible to read {@link ZipEntry} data. It could be encrypted; therefore all read data should be go throw given {@link Decoder}. + * This stream is responsible to read {@link ZipEntry} data. It could be encrypted; therefore all read data should be go + * throw given {@link Decoder}. * * @author Oleg Cherednik * @since 04.08.2019 @@ -45,7 +47,9 @@ public abstract class EntryInputStream extends EntryMetadataInputStream { private final byte[] buf = new byte[1]; - public static EntryInputStream create(ZipEntry zipEntry, Function charsetCustomizer, DataInputFile in) { + public static EntryInputStream create(ZipEntry zipEntry, + Function charsetCustomizer, + DataInputFile in) { long absoluteOffs = in.convertToAbsoluteOffs(zipEntry.getDiskNo(), zipEntry.getLocalFileHeaderRelativeOffs()); LocalFileHeader localFileHeader = new LocalFileHeaderReader(absoluteOffs, charsetCustomizer).read(in); diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/in/entry/EntryMetadataInputStream.java b/src/main/java/ru/olegcherednik/zip4jvm/io/in/entry/EntryMetadataInputStream.java index d17a13b6b..2fc14e349 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/in/entry/EntryMetadataInputStream.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/in/entry/EntryMetadataInputStream.java @@ -31,8 +31,8 @@ import java.util.zip.Checksum; /** - * This stream reads all {@link ZipEntry} related metadata like {@link DataDescriptor}. These data are not encrypted; therefore this stream cannot - * be used to read {@link ZipEntry} payload (that could be encrypted). + * This stream reads all {@link ZipEntry} related metadata like {@link DataDescriptor}. These data are not encrypted; + * therefore this stream cannot be used to read {@link ZipEntry} payload (that could be encrypted). * * @author Oleg Cherednik * @since 08.02.2020 @@ -60,7 +60,7 @@ protected final void updateChecksum(byte[] buf, int offs, int len) { @Override public int available() { - return (int)Math.max(0, uncompressedSize - writtenUncompressedBytes); + return (int) Math.max(0, uncompressedSize - writtenUncompressedBytes); } @Override @@ -71,11 +71,14 @@ public void close() throws IOException { checkUncompressedSize(); } finally { if (in instanceof Closeable) - ((Closeable)in).close(); + ((Closeable) in).close(); } } - /** Just read {@link DataDescriptor} and ignore it's value. We got it from {@link ru.olegcherednik.zip4jvm.model.CentralDirectory.FileHeader} */ + /** + * Just read {@link DataDescriptor} and ignore its value. We got it from + * {@link ru.olegcherednik.zip4jvm.model.CentralDirectory.FileHeader} + */ @SuppressWarnings("UnnecessaryFullyQualifiedName") private void readDataDescriptor() throws IOException { if (zipEntry.isDataDescriptorAvailable()) diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/in/entry/InflateEntryInputStream.java b/src/main/java/ru/olegcherednik/zip4jvm/io/in/entry/InflateEntryInputStream.java index 94530df39..fa91bb0cb 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/in/entry/InflateEntryInputStream.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/in/entry/InflateEntryInputStream.java @@ -18,10 +18,11 @@ */ package ru.olegcherednik.zip4jvm.io.in.entry; -import org.apache.commons.io.IOUtils; import ru.olegcherednik.zip4jvm.io.in.data.DataInput; import ru.olegcherednik.zip4jvm.model.entry.ZipEntry; +import org.apache.commons.io.IOUtils; + import java.io.IOException; import java.util.zip.DataFormatException; import java.util.zip.Inflater; @@ -66,7 +67,7 @@ public int read(byte[] buf, int offs, int len) throws IOException { updateChecksum(buf, offs, bytes); writtenUncompressedBytes += bytes; return bytes; - } catch(DataFormatException e) { + } catch (DataFormatException e) { throw new IOException(e); } } diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/in/entry/LzmaEntryInputStream.java b/src/main/java/ru/olegcherednik/zip4jvm/io/in/entry/LzmaEntryInputStream.java index c93f8e16a..bb614e7d1 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/in/entry/LzmaEntryInputStream.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/in/entry/LzmaEntryInputStream.java @@ -18,13 +18,14 @@ */ package ru.olegcherednik.zip4jvm.io.in.entry; -import org.apache.commons.io.IOUtils; import ru.olegcherednik.zip4jvm.exception.Zip4jvmException; import ru.olegcherednik.zip4jvm.io.in.data.DataInput; import ru.olegcherednik.zip4jvm.io.lzma.LzmaInputStream; import ru.olegcherednik.zip4jvm.model.entry.ZipEntry; import ru.olegcherednik.zip4jvm.utils.quitely.Quietly; +import org.apache.commons.io.IOUtils; + import java.io.IOException; /** @@ -50,7 +51,8 @@ private LzmaInputStream createInputStream() { int headerSize = in.readWord(); if (headerSize != 5) - throw new Zip4jvmException(String.format("LZMA header size expected 5 bytes: actual is %d bytes", headerSize)); + throw new Zip4jvmException(String.format("LZMA header size expected 5 bytes: actual is %d bytes", + headerSize)); long uncompressedSize = zipEntry.isLzmaEosMarker() ? -1 : zipEntry.getUncompressedSize(); return new LzmaInputStream(in, uncompressedSize); diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/in/entry/StoreEntryInputStream.java b/src/main/java/ru/olegcherednik/zip4jvm/io/in/entry/StoreEntryInputStream.java index 37b992f5d..7f0e6c3e3 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/in/entry/StoreEntryInputStream.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/in/entry/StoreEntryInputStream.java @@ -18,10 +18,11 @@ */ package ru.olegcherednik.zip4jvm.io.in.entry; -import org.apache.commons.io.IOUtils; import ru.olegcherednik.zip4jvm.io.in.data.DataInput; import ru.olegcherednik.zip4jvm.model.entry.ZipEntry; +import org.apache.commons.io.IOUtils; + import java.io.IOException; /** diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/in/entry/ZstdEntryInputStream.java b/src/main/java/ru/olegcherednik/zip4jvm/io/in/entry/ZstdEntryInputStream.java index 69970aa0c..921fc1670 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/in/entry/ZstdEntryInputStream.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/in/entry/ZstdEntryInputStream.java @@ -18,11 +18,12 @@ */ package ru.olegcherednik.zip4jvm.io.in.entry; -import org.apache.commons.io.IOUtils; import ru.olegcherednik.zip4jvm.io.in.data.DataInput; import ru.olegcherednik.zip4jvm.io.zstd.ZstdInputStream; import ru.olegcherednik.zip4jvm.model.entry.ZipEntry; +import org.apache.commons.io.IOUtils; + import java.io.IOException; /** diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/in/file/LittleEndianDataInputFile.java b/src/main/java/ru/olegcherednik/zip4jvm/io/in/file/LittleEndianDataInputFile.java index df4fcdfe9..1d58928c4 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/in/file/LittleEndianDataInputFile.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/in/file/LittleEndianDataInputFile.java @@ -18,14 +18,15 @@ */ package ru.olegcherednik.zip4jvm.io.in.file; -import lombok.Getter; -import org.apache.commons.io.IOUtils; import ru.olegcherednik.zip4jvm.exception.Zip4jvmException; import ru.olegcherednik.zip4jvm.io.in.data.BaseDataInput; import ru.olegcherednik.zip4jvm.model.src.SrcZip; import ru.olegcherednik.zip4jvm.utils.ValidationUtils; import ru.olegcherednik.zip4jvm.utils.quitely.Quietly; +import lombok.Getter; +import org.apache.commons.io.IOUtils; + import java.io.IOException; import java.io.RandomAccessFile; @@ -177,8 +178,11 @@ public void seek(int diskNo, long relativeOffs) { @Override public String toString() { - return in == null ? "" : - "offs: " + getAbsoluteOffs() + " (0x" + Long.toHexString(getAbsoluteOffs()) + ')'; + if (in == null) + return ""; + + long offs = getAbsoluteOffs(); + return String.format("offs: %s (0x%s)", offs, Long.toHexString(offs)); } } diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/out/data/DataOutput.java b/src/main/java/ru/olegcherednik/zip4jvm/io/out/data/DataOutput.java index 435b7764c..d8d947858 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/out/data/DataOutput.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/out/data/DataOutput.java @@ -18,9 +18,10 @@ */ package ru.olegcherednik.zip4jvm.io.out.data; -import org.apache.commons.lang3.ArrayUtils; import ru.olegcherednik.zip4jvm.io.Marker; +import org.apache.commons.lang3.ArrayUtils; + import java.io.Closeable; import java.io.IOException; diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/out/data/DecoderDataOutputDecorator.java b/src/main/java/ru/olegcherednik/zip4jvm/io/out/data/DecoderDataOutputDecorator.java index 7c50f3798..54a6a2df1 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/out/data/DecoderDataOutputDecorator.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/out/data/DecoderDataOutputDecorator.java @@ -18,9 +18,10 @@ */ package ru.olegcherednik.zip4jvm.io.out.data; -import lombok.RequiredArgsConstructor; import ru.olegcherednik.zip4jvm.crypto.Encoder; +import lombok.RequiredArgsConstructor; + import java.io.IOException; /** diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/out/data/SplitZipOutputStream.java b/src/main/java/ru/olegcherednik/zip4jvm/io/out/data/SplitZipOutputStream.java index a99dcd81a..077e633e9 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/out/data/SplitZipOutputStream.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/out/data/SplitZipOutputStream.java @@ -18,13 +18,14 @@ */ package ru.olegcherednik.zip4jvm.io.out.data; -import lombok.Getter; import ru.olegcherednik.zip4jvm.io.writers.ZipModelWriter; import ru.olegcherednik.zip4jvm.model.DataDescriptor; import ru.olegcherednik.zip4jvm.model.ZipModel; import ru.olegcherednik.zip4jvm.model.src.SrcZip; import ru.olegcherednik.zip4jvm.utils.ValidationUtils; +import lombok.Getter; + import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; @@ -79,7 +80,7 @@ public void write(byte[] buf, int offs, int len) throws IOException { available = zipModel.getSplitSize() - getRelativeOffs(); - int writeBytes = Math.min(len, (int)available); + int writeBytes = Math.min(len, (int) available); super.write(buf, offs, writeBytes); offs += writeBytes; @@ -96,7 +97,8 @@ private void openNextDisk() throws IOException { // TODO #34 - Validate all new create split disks are not exist if (Files.exists(diskPath)) - throw new IOException("split file: " + diskPath.getFileName() + " already exists in the current directory, cannot rename this file"); + throw new IOException("split file: " + diskPath.getFileName() + + " already exists in the current directory, cannot rename this file"); if (!path.toFile().renameTo(diskPath.toFile())) throw new IOException("cannot rename newly created split file"); diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/out/entry/Bzip2EntryOutputStream.java b/src/main/java/ru/olegcherednik/zip4jvm/io/out/entry/Bzip2EntryOutputStream.java index 589cf5424..ef504d0aa 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/out/entry/Bzip2EntryOutputStream.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/out/entry/Bzip2EntryOutputStream.java @@ -32,7 +32,7 @@ final class Bzip2EntryOutputStream extends EntryOutputStream { private final Bzip2OutputStream bzip2; - public Bzip2EntryOutputStream(ZipEntry zipEntry, DataOutput out) throws IOException { + Bzip2EntryOutputStream(ZipEntry zipEntry, DataOutput out) throws IOException { super(zipEntry, out); bzip2 = createEncoder(); } diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/out/entry/DeflateEntryOutputStream.java b/src/main/java/ru/olegcherednik/zip4jvm/io/out/entry/DeflateEntryOutputStream.java index 28008b2fb..dbb7a563d 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/out/entry/DeflateEntryOutputStream.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/out/entry/DeflateEntryOutputStream.java @@ -35,7 +35,7 @@ final class DeflateEntryOutputStream extends EntryOutputStream { public boolean firstBytesRead; - public DeflateEntryOutputStream(ZipEntry zipEntry, DataOutput out) { + DeflateEntryOutputStream(ZipEntry zipEntry, DataOutput out) { super(zipEntry, out); deflater.setLevel(zipEntry.getCompressionLevel().getCode()); } diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/out/entry/EntryMetadataOutputStream.java b/src/main/java/ru/olegcherednik/zip4jvm/io/out/entry/EntryMetadataOutputStream.java index 1eacbc73a..25b11d24e 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/out/entry/EntryMetadataOutputStream.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/out/entry/EntryMetadataOutputStream.java @@ -36,15 +36,16 @@ import static ru.olegcherednik.zip4jvm.model.ZipModel.MAX_TOTAL_DISKS; /** - * This stream writes all {@link ZipEntry} related metadata like {@link DataDescriptor}. These data are not encrypted; therefore this stream cannot - * be used to write {@link ZipEntry} payload (that could be encrypted). + * This stream writes all {@link ZipEntry} related metadata like {@link DataDescriptor}. These data are not encrypted; + * therefore this stream cannot be used to write {@link ZipEntry} payload (that could be encrypted). * * @author Oleg Cherednik * @since 26.07.2019 */ abstract class EntryMetadataOutputStream extends OutputStream { - private static final String COMPRESSED_DATA = EntryMetadataOutputStream.class.getSimpleName() + ".entryCompressedDataOffs"; + private static final String COMPRESSED_DATA = + EntryMetadataOutputStream.class.getSimpleName() + ".entryCompressedDataOffs"; protected final ZipEntry zipEntry; private final Checksum checksum = new CRC32(); @@ -66,7 +67,7 @@ protected void writeLocalFileHeader() throws IOException { @Override public final void write(int b) throws IOException { - write(new byte[] { (byte)b }, 0, 1); + write(new byte[] { (byte) b }, 0, 1); } @Override @@ -99,11 +100,9 @@ private void writeDataDescriptor() throws IOException { if (!zipEntry.isDataDescriptorAvailable()) return; - long crc32 = checksum.getValue(); - long compressedSize = zipEntry.getCompressedSize(); - long uncompressedSize = zipEntry.getUncompressedSize(); - - DataDescriptor dataDescriptor = new DataDescriptor(crc32, compressedSize, uncompressedSize); + DataDescriptor dataDescriptor = new DataDescriptor(checksum.getValue(), + zipEntry.getCompressedSize(), + zipEntry.getUncompressedSize()); DataDescriptorWriter.get(zipEntry.isZip64(), dataDescriptor).write(out); } diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/out/entry/LzmaEntryOutputStream.java b/src/main/java/ru/olegcherednik/zip4jvm/io/out/entry/LzmaEntryOutputStream.java index 3011be6cc..a16131463 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/out/entry/LzmaEntryOutputStream.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/out/entry/LzmaEntryOutputStream.java @@ -35,7 +35,7 @@ final class LzmaEntryOutputStream extends EntryOutputStream { private final LzmaOutputStream lzma; private boolean writeHeader = true; - public LzmaEntryOutputStream(ZipEntry zipEntry, DataOutput out) throws IOException { + LzmaEntryOutputStream(ZipEntry zipEntry, DataOutput out) throws IOException { super(zipEntry, out); lzma = createOutputStream(); } @@ -51,8 +51,8 @@ public void write(byte[] buf, int offs, int len) throws IOException { super.write(buf, offs, len); if (writeHeader) { - out.writeByte((byte)19); // major version - out.writeByte((byte)0); // minor version + out.writeByte((byte) 19); // major version + out.writeByte((byte) 0); // minor version out.writeWord(5); // header size lzma.writeHeader(); writeHeader = false; diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/out/entry/StoreEntryOutputStream.java b/src/main/java/ru/olegcherednik/zip4jvm/io/out/entry/StoreEntryOutputStream.java index 0ea3c9b4c..ca018365c 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/out/entry/StoreEntryOutputStream.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/out/entry/StoreEntryOutputStream.java @@ -29,7 +29,7 @@ */ final class StoreEntryOutputStream extends EntryOutputStream { - public StoreEntryOutputStream(ZipEntry zipEntry, DataOutput out) { + StoreEntryOutputStream(ZipEntry zipEntry, DataOutput out) { super(zipEntry, out); } @@ -38,4 +38,5 @@ public void write(byte[] buf, int offs, int len) throws IOException { super.write(buf, offs, len); out.write(buf, offs, len); } + } diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/out/entry/ZstdEntryOutputStream.java b/src/main/java/ru/olegcherednik/zip4jvm/io/out/entry/ZstdEntryOutputStream.java index d7fca5e07..8d7200633 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/out/entry/ZstdEntryOutputStream.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/out/entry/ZstdEntryOutputStream.java @@ -32,7 +32,7 @@ final class ZstdEntryOutputStream extends EntryOutputStream { private final ZstdOutputStream zstd; - public ZstdEntryOutputStream(ZipEntry zipEntry, DataOutput out) throws IOException { + ZstdEntryOutputStream(ZipEntry zipEntry, DataOutput out) throws IOException { super(zipEntry, out); zstd = createEncoder(); } diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/out/file/LittleEndianWriteFile.java b/src/main/java/ru/olegcherednik/zip4jvm/io/out/file/LittleEndianWriteFile.java index a801618bb..dde5ca84e 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/out/file/LittleEndianWriteFile.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/out/file/LittleEndianWriteFile.java @@ -42,7 +42,7 @@ public LittleEndianWriteFile(Path file) throws IOException { @Override public void fromLong(long val, byte[] buf, int offs, int len) { for (int i = 0; i < len; i++) { - buf[offs + i] = (byte)val; + buf[offs + i] = (byte) val; val >>= 8; } } diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/BaseZipModelReader.java b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/BaseZipModelReader.java index 10c08aea5..b33acc159 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/BaseZipModelReader.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/BaseZipModelReader.java @@ -18,9 +18,6 @@ */ package ru.olegcherednik.zip4jvm.io.readers; -import lombok.AccessLevel; -import lombok.Getter; -import lombok.RequiredArgsConstructor; import ru.olegcherednik.zip4jvm.exception.SignatureWasNotFoundException; import ru.olegcherednik.zip4jvm.exception.Zip4jvmException; import ru.olegcherednik.zip4jvm.io.in.file.DataInputFile; @@ -33,6 +30,10 @@ import ru.olegcherednik.zip4jvm.model.password.PasswordProvider; import ru.olegcherednik.zip4jvm.model.src.SrcZip; +import lombok.AccessLevel; +import lombok.Getter; +import lombok.RequiredArgsConstructor; + import java.io.IOException; import java.nio.charset.Charset; import java.util.function.Function; diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/ByteArrayReader.java b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/ByteArrayReader.java index 0b0acfbdd..c25952492 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/ByteArrayReader.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/ByteArrayReader.java @@ -18,10 +18,11 @@ */ package ru.olegcherednik.zip4jvm.io.readers; -import lombok.RequiredArgsConstructor; import ru.olegcherednik.zip4jvm.io.in.data.DataInput; import ru.olegcherednik.zip4jvm.utils.function.Reader; +import lombok.RequiredArgsConstructor; + /** * @author Oleg Cherednik * @since 30.12.2022 diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/CentralDirectoryReader.java b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/CentralDirectoryReader.java index 2d6172f2c..13071f356 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/CentralDirectoryReader.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/CentralDirectoryReader.java @@ -18,11 +18,12 @@ */ package ru.olegcherednik.zip4jvm.io.readers; -import lombok.RequiredArgsConstructor; import ru.olegcherednik.zip4jvm.io.in.data.DataInput; import ru.olegcherednik.zip4jvm.model.CentralDirectory; import ru.olegcherednik.zip4jvm.utils.function.Reader; +import lombok.RequiredArgsConstructor; + import java.nio.charset.Charset; import java.util.function.Function; diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/DataDescriptorReader.java b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/DataDescriptorReader.java index 795cca8be..3ea7ae267 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/DataDescriptorReader.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/DataDescriptorReader.java @@ -18,13 +18,14 @@ */ package ru.olegcherednik.zip4jvm.io.readers; -import lombok.AccessLevel; -import lombok.NoArgsConstructor; import ru.olegcherednik.zip4jvm.exception.Zip4jvmException; import ru.olegcherednik.zip4jvm.io.in.data.DataInput; import ru.olegcherednik.zip4jvm.model.DataDescriptor; import ru.olegcherednik.zip4jvm.utils.function.Reader; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; + /** * @author Oleg Cherednik * @since 25.07.2019 diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/EncryptedCentralDirectoryReader.java b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/EncryptedCentralDirectoryReader.java index 1f3d2a7f7..f8702f23b 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/EncryptedCentralDirectoryReader.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/EncryptedCentralDirectoryReader.java @@ -38,10 +38,10 @@ import ru.olegcherednik.zip4jvm.utils.ValidationUtils; import ru.olegcherednik.zip4jvm.utils.function.Reader; -import javax.crypto.Cipher; import java.nio.charset.Charset; import java.util.Objects; import java.util.function.Function; +import javax.crypto.Cipher; /** * see 7.3.4 diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/EndCentralDirectoryReader.java b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/EndCentralDirectoryReader.java index a30a64e95..cbcababb9 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/EndCentralDirectoryReader.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/EndCentralDirectoryReader.java @@ -18,13 +18,13 @@ */ package ru.olegcherednik.zip4jvm.io.readers; -import lombok.RequiredArgsConstructor; -import ru.olegcherednik.zip4jvm.exception.SignatureWasNotFoundException; import ru.olegcherednik.zip4jvm.io.in.data.DataInput; import ru.olegcherednik.zip4jvm.model.Charsets; import ru.olegcherednik.zip4jvm.model.EndCentralDirectory; import ru.olegcherednik.zip4jvm.utils.function.Reader; +import lombok.RequiredArgsConstructor; + import java.nio.charset.Charset; import java.util.function.Function; diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/ExtraFieldRecordReader.java b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/ExtraFieldRecordReader.java index 3b296fb49..931742dc1 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/ExtraFieldRecordReader.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/ExtraFieldRecordReader.java @@ -18,13 +18,13 @@ */ package ru.olegcherednik.zip4jvm.io.readers; -import lombok.RequiredArgsConstructor; -import org.apache.commons.lang3.ArrayUtils; import ru.olegcherednik.zip4jvm.io.in.data.DataInput; import ru.olegcherednik.zip4jvm.model.extrafield.PkwareExtraField; import ru.olegcherednik.zip4jvm.model.extrafield.records.UnknownExtraFieldRecord; import ru.olegcherednik.zip4jvm.utils.function.Reader; +import lombok.RequiredArgsConstructor; + import java.util.Map; import java.util.function.Function; diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/FileHeaderReader.java b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/FileHeaderReader.java index 0a824f548..10471ec95 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/FileHeaderReader.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/FileHeaderReader.java @@ -18,7 +18,6 @@ */ package ru.olegcherednik.zip4jvm.io.readers; -import lombok.RequiredArgsConstructor; import ru.olegcherednik.zip4jvm.exception.SignatureWasNotFoundException; import ru.olegcherednik.zip4jvm.io.in.data.DataInput; import ru.olegcherednik.zip4jvm.io.readers.extrafiled.ExtraFieldReader; @@ -30,6 +29,8 @@ import ru.olegcherednik.zip4jvm.model.extrafield.PkwareExtraField; import ru.olegcherednik.zip4jvm.utils.function.Reader; +import lombok.RequiredArgsConstructor; + import java.nio.charset.Charset; import java.util.LinkedList; import java.util.List; @@ -75,7 +76,7 @@ protected CentralDirectory.FileHeader readFileHeader(DataInput in) { fileHeader.setVersionToExtract(Version.of(in.readWord())); fileHeader.setGeneralPurposeFlagData(in.readWord()); fileHeader.setCompressionMethod(CompressionMethod.parseCode(in.readWord())); - fileHeader.setLastModifiedTime((int)in.readDword()); + fileHeader.setLastModifiedTime((int) in.readDword()); fileHeader.setCrc32(in.readDword()); fileHeader.setCompressedSize(in.readDword()); fileHeader.setUncompressedSize(in.readDword()); @@ -90,7 +91,7 @@ protected CentralDirectory.FileHeader readFileHeader(DataInput in) { fileHeader.setExternalFileAttributes(getExternalFileAttribute(in.readBytes(ExternalFileAttributes.SIZE))); fileHeader.setLocalFileHeaderRelativeOffs(in.readDword()); fileHeader.setFileName(in.readString(fileNameLength, charset)); - fileHeader.setExtraField((PkwareExtraField)getExtraFiledReader(extraFieldLength, fileHeader).read(in)); + fileHeader.setExtraField((PkwareExtraField) getExtraFiledReader(extraFieldLength, fileHeader).read(in)); fileHeader.setComment(in.readString(fileCommentLength, charset)); return fileHeader; diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/LocalFileHeaderReader.java b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/LocalFileHeaderReader.java index 287cdf0dd..3afee54c1 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/LocalFileHeaderReader.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/LocalFileHeaderReader.java @@ -18,7 +18,6 @@ */ package ru.olegcherednik.zip4jvm.io.readers; -import lombok.RequiredArgsConstructor; import ru.olegcherednik.zip4jvm.exception.Zip4jvmException; import ru.olegcherednik.zip4jvm.io.in.data.DataInput; import ru.olegcherednik.zip4jvm.io.readers.extrafiled.ExtraFieldReader; @@ -29,6 +28,8 @@ import ru.olegcherednik.zip4jvm.model.extrafield.ExtraField; import ru.olegcherednik.zip4jvm.utils.function.Reader; +import lombok.RequiredArgsConstructor; + import java.nio.charset.Charset; import java.util.function.Function; @@ -56,7 +57,7 @@ protected LocalFileHeader readLocalFileHeader(DataInput in) { localFileHeader.setVersionToExtract(Version.of(in.readWord())); localFileHeader.setGeneralPurposeFlag(new GeneralPurposeFlag(in.readWord())); localFileHeader.setCompressionMethod(CompressionMethod.parseCode(in.readWord())); - localFileHeader.setLastModifiedTime((int)in.readDword()); + localFileHeader.setLastModifiedTime((int) in.readDword()); localFileHeader.setCrc32(in.readDword()); localFileHeader.setCompressedSize(in.readDword()); localFileHeader.setUncompressedSize(in.readDword()); diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/ZipModelReader.java b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/ZipModelReader.java index 023ac2eb2..089e6e598 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/ZipModelReader.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/ZipModelReader.java @@ -75,8 +75,8 @@ public static int getTotalDisks(SrcZip srcZip) { long totalDisks = reader.zip64.getEndCentralDirectoryLocator().getTotalDisks(); ValidationUtils.requireLessOrEqual(totalDisks, Integer.MAX_VALUE, "zip64.totalDisks"); - return (int)totalDisks; - } catch(Exception e) { + return (int) totalDisks; + } catch (Exception e) { return 1; } } diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/block/BlockCentralDirectoryReader.java b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/block/BlockCentralDirectoryReader.java index 8bfec00fa..64a603c07 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/block/BlockCentralDirectoryReader.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/block/BlockCentralDirectoryReader.java @@ -24,9 +24,7 @@ import ru.olegcherednik.zip4jvm.io.readers.FileHeaderReader; import ru.olegcherednik.zip4jvm.model.CentralDirectory; import ru.olegcherednik.zip4jvm.model.block.BaseCentralDirectoryBlock; -import ru.olegcherednik.zip4jvm.model.block.CentralDirectoryBlock; -import java.io.IOException; import java.nio.charset.Charset; import java.util.function.Function; @@ -59,4 +57,5 @@ protected FileHeaderReader getFileHeaderReader() { protected DigitalSignatureReader getDigitalSignatureReader() { return new BlockDigitalSignatureReader(block); } + } diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/block/BlockDataDescriptorReader.java b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/block/BlockDataDescriptorReader.java index c0452c054..a419f0c8f 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/block/BlockDataDescriptorReader.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/block/BlockDataDescriptorReader.java @@ -18,14 +18,15 @@ */ package ru.olegcherednik.zip4jvm.io.readers.block; -import lombok.Getter; import ru.olegcherednik.zip4jvm.io.in.data.DataInput; +import ru.olegcherednik.zip4jvm.io.in.data.DataInputLocation; import ru.olegcherednik.zip4jvm.io.readers.DataDescriptorReader; import ru.olegcherednik.zip4jvm.model.DataDescriptor; import ru.olegcherednik.zip4jvm.model.block.Block; -import ru.olegcherednik.zip4jvm.io.in.data.DataInputLocation; import ru.olegcherednik.zip4jvm.utils.function.Reader; +import lombok.Getter; + /** * @author Oleg Cherednik * @since 26.10.2019 @@ -42,7 +43,7 @@ public BlockDataDescriptorReader(boolean zip64) { @Override public DataDescriptor read(DataInput in) { - return block.calcSize((DataInputLocation)in, () -> reader.read(in)); + return block.calcSize((DataInputLocation) in, () -> reader.read(in)); } } diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/block/BlockDigitalSignatureReader.java b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/block/BlockDigitalSignatureReader.java index 1303694d8..f24730b9f 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/block/BlockDigitalSignatureReader.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/block/BlockDigitalSignatureReader.java @@ -18,13 +18,13 @@ */ package ru.olegcherednik.zip4jvm.io.readers.block; -import lombok.RequiredArgsConstructor; import ru.olegcherednik.zip4jvm.io.in.data.DataInput; import ru.olegcherednik.zip4jvm.io.readers.DigitalSignatureReader; import ru.olegcherednik.zip4jvm.model.CentralDirectory; import ru.olegcherednik.zip4jvm.model.block.BaseCentralDirectoryBlock; import ru.olegcherednik.zip4jvm.model.block.Block; -import ru.olegcherednik.zip4jvm.model.block.CentralDirectoryBlock; + +import lombok.RequiredArgsConstructor; /** * @author Oleg Cherednik @@ -42,4 +42,5 @@ protected CentralDirectory.DigitalSignature readDigitalSignature(DataInput in) { centralDirectoryBlock.setDigitalSignature(block); return digitalSignature; } + } diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/block/BlockEncryptedCentralDirectoryReader.java b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/block/BlockEncryptedCentralDirectoryReader.java index ed2076971..ae69e11b9 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/block/BlockEncryptedCentralDirectoryReader.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/block/BlockEncryptedCentralDirectoryReader.java @@ -20,22 +20,22 @@ import ru.olegcherednik.zip4jvm.crypto.strong.cd.CentralDirectoryDecoder; import ru.olegcherednik.zip4jvm.io.in.data.DataInput; -import ru.olegcherednik.zip4jvm.io.readers.block.crypto.strong.BlockCentralDirectoryDecoder; -import ru.olegcherednik.zip4jvm.io.readers.crypto.strong.DecryptionHeaderReader; import ru.olegcherednik.zip4jvm.io.readers.DigitalSignatureReader; import ru.olegcherednik.zip4jvm.io.readers.EncryptedCentralDirectoryReader; import ru.olegcherednik.zip4jvm.io.readers.FileHeaderReader; +import ru.olegcherednik.zip4jvm.io.readers.block.crypto.strong.BlockCentralDirectoryDecoder; import ru.olegcherednik.zip4jvm.io.readers.block.crypto.strong.BlockDecryptionHeaderReader; +import ru.olegcherednik.zip4jvm.io.readers.crypto.strong.DecryptionHeaderReader; import ru.olegcherednik.zip4jvm.model.CentralDirectory; import ru.olegcherednik.zip4jvm.model.Zip64; import ru.olegcherednik.zip4jvm.model.block.crypto.EncryptedCentralDirectoryBlock; import ru.olegcherednik.zip4jvm.model.password.PasswordProvider; import ru.olegcherednik.zip4jvm.utils.function.Reader; -import javax.crypto.Cipher; import java.nio.charset.Charset; import java.util.Arrays; import java.util.function.Function; +import javax.crypto.Cipher; /** * @author Oleg Cherednik diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/block/BlockExtraFieldReader.java b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/block/BlockExtraFieldReader.java index c8ddb19b0..f9a870688 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/block/BlockExtraFieldReader.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/block/BlockExtraFieldReader.java @@ -21,9 +21,9 @@ import ru.olegcherednik.zip4jvm.io.in.data.DataInput; import ru.olegcherednik.zip4jvm.io.readers.ExtraFieldRecordReader; import ru.olegcherednik.zip4jvm.io.readers.extrafiled.ExtraFieldReader; -import ru.olegcherednik.zip4jvm.model.extrafield.PkwareExtraField; import ru.olegcherednik.zip4jvm.model.block.ExtraFieldBlock; import ru.olegcherednik.zip4jvm.model.extrafield.ExtraField; +import ru.olegcherednik.zip4jvm.model.extrafield.PkwareExtraField; import ru.olegcherednik.zip4jvm.utils.function.Reader; import java.util.Map; diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/block/BlockExtraFieldRecordReader.java b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/block/BlockExtraFieldRecordReader.java index b9b204b41..9de6a7689 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/block/BlockExtraFieldRecordReader.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/block/BlockExtraFieldRecordReader.java @@ -20,9 +20,9 @@ import ru.olegcherednik.zip4jvm.io.in.data.DataInput; import ru.olegcherednik.zip4jvm.io.readers.ExtraFieldRecordReader; -import ru.olegcherednik.zip4jvm.model.extrafield.PkwareExtraField; import ru.olegcherednik.zip4jvm.model.block.Block; import ru.olegcherednik.zip4jvm.model.block.ExtraFieldBlock; +import ru.olegcherednik.zip4jvm.model.extrafield.PkwareExtraField; import ru.olegcherednik.zip4jvm.utils.function.Reader; import java.util.Map; @@ -36,8 +36,9 @@ public class BlockExtraFieldRecordReader extends ExtraFieldRecordReader { private final ExtraFieldBlock extraFieldBlock; - public BlockExtraFieldRecordReader(Map>> readers, - ExtraFieldBlock extraFieldBlock) { + public BlockExtraFieldRecordReader( + Map>> readers, + ExtraFieldBlock extraFieldBlock) { super(readers); this.extraFieldBlock = extraFieldBlock; } @@ -49,4 +50,5 @@ public PkwareExtraField.Record read(DataInput in) { extraFieldBlock.addRecord(record.getSignature(), recordBlock); return record; } + } diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/block/BlockLocalFileHeaderReader.java b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/block/BlockLocalFileHeaderReader.java index c9b0435fe..3d2900e1a 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/block/BlockLocalFileHeaderReader.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/block/BlockLocalFileHeaderReader.java @@ -18,7 +18,6 @@ */ package ru.olegcherednik.zip4jvm.io.readers.block; -import lombok.Getter; import ru.olegcherednik.zip4jvm.io.in.data.DataInput; import ru.olegcherednik.zip4jvm.io.readers.LocalFileHeaderReader; import ru.olegcherednik.zip4jvm.io.readers.extrafiled.ExtraFieldReader; @@ -26,6 +25,8 @@ import ru.olegcherednik.zip4jvm.model.block.ZipEntryBlock; import ru.olegcherednik.zip4jvm.model.extrafield.ExtraField; +import lombok.Getter; + import java.nio.charset.Charset; import java.util.function.Function; @@ -50,7 +51,9 @@ protected LocalFileHeader readLocalFileHeader(DataInput in) { @Override protected ExtraField readExtraFiled(int size, LocalFileHeader localFileHeader, DataInput in) { block.getContent().calcSize(in); - return new BlockExtraFieldReader(size, ExtraFieldReader.getReaders(localFileHeader), block.getExtraFieldBlock()).read(in); + return new BlockExtraFieldReader(size, + ExtraFieldReader.getReaders(localFileHeader), + block.getExtraFieldBlock()).read(in); } } diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/block/BlockZipEntryReader.java b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/block/BlockZipEntryReader.java index 5d3a861ca..4953c553f 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/block/BlockZipEntryReader.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/block/BlockZipEntryReader.java @@ -18,15 +18,14 @@ */ package ru.olegcherednik.zip4jvm.io.readers.block; -import lombok.RequiredArgsConstructor; import ru.olegcherednik.zip4jvm.crypto.aes.AesEngine; import ru.olegcherednik.zip4jvm.crypto.strong.DecryptionHeader; import ru.olegcherednik.zip4jvm.io.in.data.DataInput; import ru.olegcherednik.zip4jvm.io.in.file.DataInputFile; import ru.olegcherednik.zip4jvm.io.in.file.LittleEndianDataInputFile; import ru.olegcherednik.zip4jvm.io.readers.block.crypto.BlockAesHeaderReader; -import ru.olegcherednik.zip4jvm.io.readers.block.crypto.strong.BlockDecryptionHeaderReader; import ru.olegcherednik.zip4jvm.io.readers.block.crypto.BlockPkwareHeaderReader; +import ru.olegcherednik.zip4jvm.io.readers.block.crypto.strong.BlockDecryptionHeaderReader; import ru.olegcherednik.zip4jvm.model.DataDescriptor; import ru.olegcherednik.zip4jvm.model.EncryptionMethod; import ru.olegcherednik.zip4jvm.model.LocalFileHeader; @@ -36,6 +35,8 @@ import ru.olegcherednik.zip4jvm.model.block.crypto.EncryptionHeaderBlock; import ru.olegcherednik.zip4jvm.model.entry.ZipEntry; +import lombok.RequiredArgsConstructor; + import java.io.IOException; import java.nio.charset.Charset; import java.util.Collections; @@ -63,7 +64,8 @@ public Map read() throws IOException { } } - return fileNameZipEntryBlock.isEmpty() ? Collections.emptyMap() : Collections.unmodifiableMap(fileNameZipEntryBlock); + return fileNameZipEntryBlock.isEmpty() ? Collections.emptyMap() + : Collections.unmodifiableMap(fileNameZipEntryBlock); } private void readLocalFileHeader(ZipEntry zipEntry, DataInputFile in) throws IOException { @@ -99,7 +101,8 @@ private void readStrongEncryptionHeader(ZipEntry zipEntry, DataInput in) { private void readAesEncryptionHeader(ZipEntry zipEntry, DataInput in) { String fileName = zipEntry.getFileName(); EncryptionMethod encryptionMethod = zipEntry.getEncryptionMethod(); - EncryptionHeaderBlock block = new BlockAesHeaderReader(AesEngine.getStrength(encryptionMethod), zipEntry.getCompressedSize()).read(in); + EncryptionHeaderBlock block = new BlockAesHeaderReader(AesEngine.getStrength(encryptionMethod), + zipEntry.getCompressedSize()).read(in); requireBlockExists(fileName); fileNameZipEntryBlock.get(fileName).setEncryptionHeaderBlock(block); } @@ -107,7 +110,7 @@ private void readAesEncryptionHeader(ZipEntry zipEntry, DataInput in) { private void readPkwareEncryptionHeader(ZipEntry zipEntry, DataInput in) { String fileName = zipEntry.getFileName(); EncryptionHeaderBlock block = new BlockPkwareHeaderReader().read(in); - in.skip(zipEntry.getCompressedSize() - ((Block)block).getSize()); + in.skip(zipEntry.getCompressedSize() - ((Block) block).getSize()); requireBlockExists(fileName); fileNameZipEntryBlock.get(fileName).setEncryptionHeaderBlock(block); } diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/block/crypto/BlockAesHeaderReader.java b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/block/crypto/BlockAesHeaderReader.java index 310797b21..401afe73c 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/block/crypto/BlockAesHeaderReader.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/block/crypto/BlockAesHeaderReader.java @@ -18,13 +18,14 @@ */ package ru.olegcherednik.zip4jvm.io.readers.block.crypto; -import lombok.RequiredArgsConstructor; import ru.olegcherednik.zip4jvm.crypto.aes.AesEngine; import ru.olegcherednik.zip4jvm.crypto.aes.AesStrength; import ru.olegcherednik.zip4jvm.io.in.data.DataInput; import ru.olegcherednik.zip4jvm.model.block.crypto.AesEncryptionHeaderBlock; import ru.olegcherednik.zip4jvm.utils.function.Reader; +import lombok.RequiredArgsConstructor; + import static ru.olegcherednik.zip4jvm.crypto.aes.AesEngine.MAC_SIZE; import static ru.olegcherednik.zip4jvm.crypto.aes.AesEngine.PASSWORD_CHECKSUM_SIZE; diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/block/crypto/strong/BlockCentralDirectoryDecoder.java b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/block/crypto/strong/BlockCentralDirectoryDecoder.java index aff720300..3c3be0380 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/block/crypto/strong/BlockCentralDirectoryDecoder.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/block/crypto/strong/BlockCentralDirectoryDecoder.java @@ -21,8 +21,8 @@ import ru.olegcherednik.zip4jvm.crypto.strong.cd.CentralDirectoryDecoder; import ru.olegcherednik.zip4jvm.model.block.crypto.EncryptedCentralDirectoryBlock; -import javax.crypto.Cipher; import java.util.Arrays; +import javax.crypto.Cipher; /** * @author Oleg Cherednik diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/block/crypto/strong/BlockDecryptionHeaderReader.java b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/block/crypto/strong/BlockDecryptionHeaderReader.java index 6da385684..4f00490b8 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/block/crypto/strong/BlockDecryptionHeaderReader.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/block/crypto/strong/BlockDecryptionHeaderReader.java @@ -18,14 +18,15 @@ */ package ru.olegcherednik.zip4jvm.io.readers.block.crypto.strong; -import lombok.Getter; -import lombok.RequiredArgsConstructor; import ru.olegcherednik.zip4jvm.crypto.strong.DecryptionHeader; import ru.olegcherednik.zip4jvm.crypto.strong.Recipient; import ru.olegcherednik.zip4jvm.io.in.data.DataInput; import ru.olegcherednik.zip4jvm.io.readers.crypto.strong.DecryptionHeaderReader; import ru.olegcherednik.zip4jvm.model.block.crypto.strong.DecryptionHeaderBlock; +import lombok.Getter; +import lombok.RequiredArgsConstructor; + import java.util.List; /** diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/block/zip64/BlockEndCentralDirectoryLocatorReader.java b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/block/zip64/BlockEndCentralDirectoryLocatorReader.java index 87c54261c..7ec26cb1a 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/block/zip64/BlockEndCentralDirectoryLocatorReader.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/block/zip64/BlockEndCentralDirectoryLocatorReader.java @@ -18,12 +18,13 @@ */ package ru.olegcherednik.zip4jvm.io.readers.block.zip64; -import lombok.RequiredArgsConstructor; import ru.olegcherednik.zip4jvm.io.in.data.DataInput; import ru.olegcherednik.zip4jvm.io.readers.zip64.EndCentralDirectoryLocatorReader; import ru.olegcherednik.zip4jvm.model.Zip64; import ru.olegcherednik.zip4jvm.model.block.Block; +import lombok.RequiredArgsConstructor; + /** * @author Oleg Cherednik * @since 29.12.2022 diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/block/zip64/BlockEndCentralDirectoryReader.java b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/block/zip64/BlockEndCentralDirectoryReader.java index 9b1ff708d..73c66ee93 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/block/zip64/BlockEndCentralDirectoryReader.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/block/zip64/BlockEndCentralDirectoryReader.java @@ -18,12 +18,13 @@ */ package ru.olegcherednik.zip4jvm.io.readers.block.zip64; -import lombok.RequiredArgsConstructor; import ru.olegcherednik.zip4jvm.io.in.data.DataInput; import ru.olegcherednik.zip4jvm.io.readers.zip64.EndCentralDirectoryReader; import ru.olegcherednik.zip4jvm.model.Zip64; import ru.olegcherednik.zip4jvm.model.block.Block; +import lombok.RequiredArgsConstructor; + /** * @author Oleg Cherednik * @since 29.12.2022 diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/block/zip64/BlockExtensibleDataSectorReader.java b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/block/zip64/BlockExtensibleDataSectorReader.java index f087300e0..64edcdfa4 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/block/zip64/BlockExtensibleDataSectorReader.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/block/zip64/BlockExtensibleDataSectorReader.java @@ -18,12 +18,13 @@ */ package ru.olegcherednik.zip4jvm.io.readers.block.zip64; -import lombok.RequiredArgsConstructor; import ru.olegcherednik.zip4jvm.io.in.data.DataInput; import ru.olegcherednik.zip4jvm.io.readers.zip64.ExtensibleDataSectorReader; import ru.olegcherednik.zip4jvm.model.Zip64; import ru.olegcherednik.zip4jvm.model.block.Block; +import lombok.RequiredArgsConstructor; + /** * @author Oleg Cherednik * @since 29.12.2022 diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/block/zip64/BlockZip64Reader.java b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/block/zip64/BlockZip64Reader.java index db4d8af3d..e110956b4 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/block/zip64/BlockZip64Reader.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/block/zip64/BlockZip64Reader.java @@ -18,15 +18,14 @@ */ package ru.olegcherednik.zip4jvm.io.readers.block.zip64; -import lombok.RequiredArgsConstructor; -import ru.olegcherednik.zip4jvm.io.in.data.DataInput; import ru.olegcherednik.zip4jvm.io.readers.zip64.EndCentralDirectoryLocatorReader; import ru.olegcherednik.zip4jvm.io.readers.zip64.EndCentralDirectoryReader; import ru.olegcherednik.zip4jvm.io.readers.zip64.ExtensibleDataSectorReader; import ru.olegcherednik.zip4jvm.io.readers.zip64.Zip64Reader; -import ru.olegcherednik.zip4jvm.model.Zip64; import ru.olegcherednik.zip4jvm.model.block.Zip64Block; +import lombok.RequiredArgsConstructor; + /** * @author Oleg Cherednik * @since 20.10.2019 diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/crypto/strong/DecryptionHeaderReader.java b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/crypto/strong/DecryptionHeaderReader.java index e5a17f67e..0571909b7 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/crypto/strong/DecryptionHeaderReader.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/crypto/strong/DecryptionHeaderReader.java @@ -18,7 +18,6 @@ */ package ru.olegcherednik.zip4jvm.io.readers.crypto.strong; -import lombok.RequiredArgsConstructor; import ru.olegcherednik.zip4jvm.crypto.strong.DecryptionHeader; import ru.olegcherednik.zip4jvm.crypto.strong.Flags; import ru.olegcherednik.zip4jvm.crypto.strong.Recipient; @@ -26,6 +25,8 @@ import ru.olegcherednik.zip4jvm.io.in.data.DataInput; import ru.olegcherednik.zip4jvm.utils.function.Reader; +import lombok.RequiredArgsConstructor; + import java.util.LinkedList; import java.util.List; @@ -40,6 +41,7 @@ public class DecryptionHeaderReader implements Reader { private static final String MARKER_VERSION = "DecryptionHeaderReader.MARKER_VERSION"; @Override + @SuppressWarnings("VariableDeclarationUsageDistance") public DecryptionHeader read(DataInput in) { DecryptionHeader decryptionHeader = new DecryptionHeader(); @@ -56,7 +58,7 @@ public DecryptionHeader read(DataInput in) { boolean passwordKey = decryptionHeader.getFlags() == Flags.PASSWORD_KEY; int encryptedRandomDataSize = in.readWord(); decryptionHeader.setEncryptedRandomData(in.readBytes(encryptedRandomDataSize)); - int recipientCount = (int)in.readDword(); + int recipientCount = (int) in.readDword(); realBigZip64(recipientCount, "zip64.decryptionHeader.recipientCount"); diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/extrafiled/AesExtraFieldRecordReader.java b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/extrafiled/AesExtraFieldRecordReader.java index 92aeead9e..18ae3339e 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/extrafiled/AesExtraFieldRecordReader.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/extrafiled/AesExtraFieldRecordReader.java @@ -18,14 +18,15 @@ */ package ru.olegcherednik.zip4jvm.io.readers.extrafiled; -import lombok.RequiredArgsConstructor; import ru.olegcherednik.zip4jvm.crypto.aes.AesStrength; import ru.olegcherednik.zip4jvm.io.in.data.DataInput; -import ru.olegcherednik.zip4jvm.model.extrafield.records.AesExtraFieldRecord; import ru.olegcherednik.zip4jvm.model.Charsets; import ru.olegcherednik.zip4jvm.model.CompressionMethod; +import ru.olegcherednik.zip4jvm.model.extrafield.records.AesExtraFieldRecord; import ru.olegcherednik.zip4jvm.utils.function.Reader; +import lombok.RequiredArgsConstructor; + /** * @author Oleg Cherednik * @since 14.04.2019 diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/extrafiled/AlignmentExtraFieldRecordReader.java b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/extrafiled/AlignmentExtraFieldRecordReader.java index d5f492b9c..2e916eb46 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/extrafiled/AlignmentExtraFieldRecordReader.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/extrafiled/AlignmentExtraFieldRecordReader.java @@ -18,13 +18,12 @@ */ package ru.olegcherednik.zip4jvm.io.readers.extrafiled; -import lombok.RequiredArgsConstructor; import ru.olegcherednik.zip4jvm.io.in.data.DataInput; import ru.olegcherednik.zip4jvm.model.extrafield.records.AlignmentExtraFieldRecord; -import ru.olegcherednik.zip4jvm.model.extrafield.records.ExecutableJarMarkerExtraFieldRecord; -import ru.olegcherednik.zip4jvm.model.extrafield.records.UnknownExtraFieldRecord; import ru.olegcherednik.zip4jvm.utils.function.Reader; +import lombok.RequiredArgsConstructor; + /** * @author Oleg Cherednik * @since 05.01.2023 diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/extrafiled/ExecutableJarMarkerExtraFieldRecordReader.java b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/extrafiled/ExecutableJarMarkerExtraFieldRecordReader.java index 6cdb61735..e71eb6284 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/extrafiled/ExecutableJarMarkerExtraFieldRecordReader.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/extrafiled/ExecutableJarMarkerExtraFieldRecordReader.java @@ -18,11 +18,12 @@ */ package ru.olegcherednik.zip4jvm.io.readers.extrafiled; -import lombok.RequiredArgsConstructor; import ru.olegcherednik.zip4jvm.io.in.data.DataInput; import ru.olegcherednik.zip4jvm.model.extrafield.records.ExecutableJarMarkerExtraFieldRecord; import ru.olegcherednik.zip4jvm.utils.function.Reader; +import lombok.RequiredArgsConstructor; + /** * @author Oleg Cherednik * @since 11.04.2020 diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/extrafiled/ExtendedTimestampExtraFieldRecordReader.java b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/extrafiled/ExtendedTimestampExtraFieldRecordReader.java index c618089fb..b983afdad 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/extrafiled/ExtendedTimestampExtraFieldRecordReader.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/extrafiled/ExtendedTimestampExtraFieldRecordReader.java @@ -18,12 +18,13 @@ */ package ru.olegcherednik.zip4jvm.io.readers.extrafiled; -import lombok.RequiredArgsConstructor; import ru.olegcherednik.zip4jvm.io.in.data.DataInput; import ru.olegcherednik.zip4jvm.model.extrafield.records.ExtendedTimestampExtraFieldRecord; import ru.olegcherednik.zip4jvm.utils.function.Reader; import ru.olegcherednik.zip4jvm.utils.time.UnixTimestampConverterUtils; +import lombok.RequiredArgsConstructor; + /** * @author Oleg Cherednik * @since 25.10.2019 diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/extrafiled/ExtraFieldReader.java b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/extrafiled/ExtraFieldReader.java index 0c37e1a85..987fc251c 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/extrafiled/ExtraFieldReader.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/extrafiled/ExtraFieldReader.java @@ -18,31 +18,31 @@ */ package ru.olegcherednik.zip4jvm.io.readers.extrafiled; -import lombok.RequiredArgsConstructor; import ru.olegcherednik.zip4jvm.io.in.data.DataInput; import ru.olegcherednik.zip4jvm.io.readers.ExtraFieldRecordReader; import ru.olegcherednik.zip4jvm.io.readers.zip64.ExtendedInfoReader; -import ru.olegcherednik.zip4jvm.model.extrafield.AlignmentExtraField; import ru.olegcherednik.zip4jvm.model.CentralDirectory; -import ru.olegcherednik.zip4jvm.model.extrafield.PkwareExtraField; import ru.olegcherednik.zip4jvm.model.LocalFileHeader; import ru.olegcherednik.zip4jvm.model.Zip64; +import ru.olegcherednik.zip4jvm.model.extrafield.AlignmentExtraField; import ru.olegcherednik.zip4jvm.model.extrafield.ExtraField; +import ru.olegcherednik.zip4jvm.model.extrafield.PkwareExtraField; import ru.olegcherednik.zip4jvm.model.extrafield.records.AesExtraFieldRecord; import ru.olegcherednik.zip4jvm.model.extrafield.records.AlignmentExtraFieldRecord; -import ru.olegcherednik.zip4jvm.model.extrafield.records.StrongEncryptionHeaderExtraFieldRecord; import ru.olegcherednik.zip4jvm.model.extrafield.records.ExecutableJarMarkerExtraFieldRecord; import ru.olegcherednik.zip4jvm.model.extrafield.records.ExtendedTimestampExtraFieldRecord; import ru.olegcherednik.zip4jvm.model.extrafield.records.InfoZipNewUnixExtraFieldRecord; import ru.olegcherednik.zip4jvm.model.extrafield.records.InfoZipOldUnixExtraFieldRecord; import ru.olegcherednik.zip4jvm.model.extrafield.records.NtfsTimestampExtraFieldRecord; +import ru.olegcherednik.zip4jvm.model.extrafield.records.StrongEncryptionHeaderExtraFieldRecord; import ru.olegcherednik.zip4jvm.utils.function.Reader; +import lombok.RequiredArgsConstructor; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.TreeMap; import java.util.function.Function; import static ru.olegcherednik.zip4jvm.model.ZipModel.MAX_ENTRY_SIZE; @@ -59,7 +59,8 @@ public class ExtraFieldReader implements Reader { private final int size; protected final Map>> readers; - public static Map>> getReaders(CentralDirectory.FileHeader fileHeader) { + public static Map>> getReaders( + CentralDirectory.FileHeader fileHeader) { boolean uncompressedSize = fileHeader.getUncompressedSize() == MAX_ENTRY_SIZE; boolean compressedSize = fileHeader.getCompressedSize() == MAX_ENTRY_SIZE; boolean offs = fileHeader.getLocalFileHeaderRelativeOffs() == MAX_LOCAL_FILE_HEADER_OFFS; @@ -67,19 +68,22 @@ public static Map>> getReaders(LocalFileHeader localFileHeader) { + public static Map>> getReaders( + LocalFileHeader localFileHeader) { boolean uncompressedSize = localFileHeader.getUncompressedSize() == MAX_ENTRY_SIZE; boolean compressedSize = localFileHeader.getCompressedSize() == MAX_ENTRY_SIZE; return getReaders(uncompressedSize, compressedSize, false, false); } - private static Map>> getReaders(boolean uncompressedSize, - boolean compressedSize, - boolean offs, - boolean disk) { + private static Map>> getReaders( + boolean uncompressedSize, + boolean compressedSize, + boolean offs, + boolean disk) { Map>> map = new HashMap<>(); - map.put(Zip64.ExtendedInfo.SIGNATURE, size -> new ExtendedInfoReader(size, uncompressedSize, compressedSize, offs, disk)); + map.put(Zip64.ExtendedInfo.SIGNATURE, + size -> new ExtendedInfoReader(size, uncompressedSize, compressedSize, offs, disk)); map.put(AesExtraFieldRecord.SIGNATURE, AesExtraFieldRecordReader::new); map.put(NtfsTimestampExtraFieldRecord.SIGNATURE, NtfsTimestampExtraFieldRecordReader::new); map.put(InfoZipOldUnixExtraFieldRecord.SIGNATURE, InfoZipOldUnixExtraFieldRecordReader::new); diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/extrafiled/InfoZipNewUnixExtraFieldRecordReader.java b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/extrafiled/InfoZipNewUnixExtraFieldRecordReader.java index e038f5906..628fec930 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/extrafiled/InfoZipNewUnixExtraFieldRecordReader.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/extrafiled/InfoZipNewUnixExtraFieldRecordReader.java @@ -18,11 +18,12 @@ */ package ru.olegcherednik.zip4jvm.io.readers.extrafiled; -import lombok.RequiredArgsConstructor; import ru.olegcherednik.zip4jvm.io.in.data.DataInput; import ru.olegcherednik.zip4jvm.model.extrafield.records.InfoZipNewUnixExtraFieldRecord; import ru.olegcherednik.zip4jvm.utils.function.Reader; +import lombok.RequiredArgsConstructor; + /** * @author Oleg Cherednik * @since 25.10.2019 @@ -36,7 +37,8 @@ public final class InfoZipNewUnixExtraFieldRecordReader implements Reader readTags(long offs, DataInput in private static NtfsTimestampExtraFieldRecord.OneTag readOneTag(DataInput in) { int size = in.readWord(); - // TODO size should be equal to 8 * 3 + assert size == 8 * 3; long lastModificationTime = NtfsTimestampConverterUtils.ntfsToJavaTime(in.readQword()); long lastAccessTime = NtfsTimestampConverterUtils.ntfsToJavaTime(in.readQword()); diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/extrafiled/StrongEncryptionHeaderExtraFieldRecordReader.java b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/extrafiled/StrongEncryptionHeaderExtraFieldRecordReader.java index 4fe4d7a49..d24f8524f 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/extrafiled/StrongEncryptionHeaderExtraFieldRecordReader.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/extrafiled/StrongEncryptionHeaderExtraFieldRecordReader.java @@ -18,19 +18,21 @@ */ package ru.olegcherednik.zip4jvm.io.readers.extrafiled; -import lombok.RequiredArgsConstructor; import ru.olegcherednik.zip4jvm.crypto.strong.EncryptionAlgorithm; import ru.olegcherednik.zip4jvm.crypto.strong.Flags; import ru.olegcherednik.zip4jvm.io.in.data.DataInput; import ru.olegcherednik.zip4jvm.model.extrafield.records.StrongEncryptionHeaderExtraFieldRecord; import ru.olegcherednik.zip4jvm.utils.function.Reader; +import lombok.RequiredArgsConstructor; + /** * @author Oleg Cherednik * @since 15.02.2020 */ @RequiredArgsConstructor -public final class StrongEncryptionHeaderExtraFieldRecordReader implements Reader { +public final class StrongEncryptionHeaderExtraFieldRecordReader + implements Reader { private final int size; diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/zip64/ExtendedInfoReader.java b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/zip64/ExtendedInfoReader.java index 1e2b508ef..3507d31a7 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/zip64/ExtendedInfoReader.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/zip64/ExtendedInfoReader.java @@ -18,12 +18,13 @@ */ package ru.olegcherednik.zip4jvm.io.readers.zip64; -import lombok.AllArgsConstructor; import ru.olegcherednik.zip4jvm.io.in.data.DataInput; -import ru.olegcherednik.zip4jvm.model.extrafield.PkwareExtraField; import ru.olegcherednik.zip4jvm.model.Zip64; +import ru.olegcherednik.zip4jvm.model.extrafield.PkwareExtraField; import ru.olegcherednik.zip4jvm.utils.function.Reader; +import lombok.AllArgsConstructor; + import static ru.olegcherednik.zip4jvm.utils.ValidationUtils.realBigZip64; /** @@ -72,7 +73,8 @@ private Zip64.ExtendedInfo readExtendedInfo(DataInput in) { return Zip64.ExtendedInfo.builder() .uncompressedSize(uncompressedSizeExists ? in.readQword() : PkwareExtraField.NO_DATA) .compressedSize(compressedSizeExists ? in.readQword() : PkwareExtraField.NO_DATA) - .localFileHeaderRelativeOffs(offsLocalHeaderRelativeExists ? in.readQword() : PkwareExtraField.NO_DATA) + .localFileHeaderRelativeOffs(offsLocalHeaderRelativeExists ? in.readQword() + : PkwareExtraField.NO_DATA) .diskNo(diskExists ? in.readDword() : PkwareExtraField.NO_DATA) .build(); } diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/zip64/Zip64Reader.java b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/zip64/Zip64Reader.java index 5f0d0574e..0c2472eeb 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/readers/zip64/Zip64Reader.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/readers/zip64/Zip64Reader.java @@ -60,7 +60,8 @@ private Zip64 read(DataInputFile in, boolean locatorOnly) throws IOException { return Zip64.NULL; } - private Zip64.ExtensibleDataSector readExtensibleDataSector(Zip64.EndCentralDirectory endCentralDirectory, DataInputFile in) { + private Zip64.ExtensibleDataSector readExtensibleDataSector(Zip64.EndCentralDirectory endCentralDirectory, + DataInputFile in) { long size = endCentralDirectory.getEndCentralDirectorySize() - Zip64.EndCentralDirectory.SIZE; if (size == 0) @@ -76,8 +77,9 @@ private Zip64.ExtensibleDataSector readExtensibleDataSector(Zip64.EndCentralDire return extensibleDataSector; } - private static void findEndCentralDirectorySignature(Zip64.EndCentralDirectoryLocator locator, DataInputFile in) throws IOException { - in.seek((int)locator.getMainDiskNo(), locator.getEndCentralDirectoryRelativeOffs()); + private static void findEndCentralDirectorySignature(Zip64.EndCentralDirectoryLocator locator, DataInputFile in) + throws IOException { + in.seek((int) locator.getMainDiskNo(), locator.getEndCentralDirectoryRelativeOffs()); if (in.readDwordSignature() != Zip64.EndCentralDirectory.SIGNATURE) throw new Zip4jvmException("invalid zip64 end of central directory"); diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/writers/AesExtraDataRecordWriter.java b/src/main/java/ru/olegcherednik/zip4jvm/io/writers/AesExtraDataRecordWriter.java index f8c7c15d5..debc26c26 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/writers/AesExtraDataRecordWriter.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/writers/AesExtraDataRecordWriter.java @@ -18,12 +18,13 @@ */ package ru.olegcherednik.zip4jvm.io.writers; -import lombok.RequiredArgsConstructor; import ru.olegcherednik.zip4jvm.io.out.data.DataOutput; -import ru.olegcherednik.zip4jvm.model.extrafield.records.AesExtraFieldRecord; import ru.olegcherednik.zip4jvm.model.Charsets; +import ru.olegcherednik.zip4jvm.model.extrafield.records.AesExtraFieldRecord; import ru.olegcherednik.zip4jvm.utils.function.Writer; +import lombok.RequiredArgsConstructor; + import java.io.IOException; /** @@ -44,7 +45,7 @@ public void write(DataOutput out) throws IOException { out.writeWord(record.getDataSize()); out.writeWord(record.getVersionNumber()); out.writeBytes(record.getVendor(Charsets.UTF_8)); - out.writeBytes((byte)record.getStrength().getCode()); + out.writeBytes((byte) record.getStrength().getCode()); out.writeWord(record.getCompressionMethod().getCode()); } diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/writers/CentralDirectoryWriter.java b/src/main/java/ru/olegcherednik/zip4jvm/io/writers/CentralDirectoryWriter.java index 91ad0844e..c6909a762 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/writers/CentralDirectoryWriter.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/writers/CentralDirectoryWriter.java @@ -18,11 +18,12 @@ */ package ru.olegcherednik.zip4jvm.io.writers; -import lombok.RequiredArgsConstructor; import ru.olegcherednik.zip4jvm.io.out.data.DataOutput; import ru.olegcherednik.zip4jvm.model.CentralDirectory; import ru.olegcherednik.zip4jvm.utils.function.Writer; +import lombok.RequiredArgsConstructor; + import java.io.IOException; /** diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/writers/DataDescriptorWriter.java b/src/main/java/ru/olegcherednik/zip4jvm/io/writers/DataDescriptorWriter.java index 0df35ec77..0081d547d 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/writers/DataDescriptorWriter.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/writers/DataDescriptorWriter.java @@ -18,13 +18,14 @@ */ package ru.olegcherednik.zip4jvm.io.writers; -import lombok.AccessLevel; -import lombok.NoArgsConstructor; -import lombok.RequiredArgsConstructor; import ru.olegcherednik.zip4jvm.io.out.data.DataOutput; import ru.olegcherednik.zip4jvm.model.DataDescriptor; import ru.olegcherednik.zip4jvm.utils.function.Writer; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; +import lombok.RequiredArgsConstructor; + import java.io.IOException; /** diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/writers/DigitalSignatureWriter.java b/src/main/java/ru/olegcherednik/zip4jvm/io/writers/DigitalSignatureWriter.java index 2003bb81f..01be27b4b 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/writers/DigitalSignatureWriter.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/writers/DigitalSignatureWriter.java @@ -18,12 +18,13 @@ */ package ru.olegcherednik.zip4jvm.io.writers; -import lombok.RequiredArgsConstructor; -import org.apache.commons.lang3.ArrayUtils; import ru.olegcherednik.zip4jvm.io.out.data.DataOutput; import ru.olegcherednik.zip4jvm.model.CentralDirectory; import ru.olegcherednik.zip4jvm.utils.function.Writer; +import lombok.RequiredArgsConstructor; +import org.apache.commons.lang3.ArrayUtils; + import java.io.IOException; /** diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/writers/EndCentralDirectoryWriter.java b/src/main/java/ru/olegcherednik/zip4jvm/io/writers/EndCentralDirectoryWriter.java index 71c6d6aaf..00809ecb4 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/writers/EndCentralDirectoryWriter.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/writers/EndCentralDirectoryWriter.java @@ -18,12 +18,13 @@ */ package ru.olegcherednik.zip4jvm.io.writers; -import lombok.RequiredArgsConstructor; import ru.olegcherednik.zip4jvm.io.out.data.DataOutput; import ru.olegcherednik.zip4jvm.model.Charsets; import ru.olegcherednik.zip4jvm.model.EndCentralDirectory; import ru.olegcherednik.zip4jvm.utils.function.Writer; +import lombok.RequiredArgsConstructor; + import java.io.IOException; /** diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/writers/ExistedEntryWriter.java b/src/main/java/ru/olegcherednik/zip4jvm/io/writers/ExistedEntryWriter.java index 95863135c..17e8cafe1 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/writers/ExistedEntryWriter.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/writers/ExistedEntryWriter.java @@ -18,8 +18,6 @@ */ package ru.olegcherednik.zip4jvm.io.writers; -import lombok.RequiredArgsConstructor; -import org.apache.commons.io.IOUtils; import ru.olegcherednik.zip4jvm.exception.Zip4jvmException; import ru.olegcherednik.zip4jvm.io.in.file.DataInputFile; import ru.olegcherednik.zip4jvm.io.in.file.LittleEndianDataInputFile; @@ -34,10 +32,14 @@ import ru.olegcherednik.zip4jvm.utils.ZipUtils; import ru.olegcherednik.zip4jvm.utils.function.Writer; +import lombok.RequiredArgsConstructor; +import org.apache.commons.io.IOUtils; + import java.io.IOException; /** - * This writer copy existed {@link ZipEntry} block from one zip file to another as is. This block is not modified during the copy. + * This writer copy existed {@link ZipEntry} block from one zip file to another as is. This block is not modified during + * the copy. * * @author Oleg Cherednik * @since 12.09.2019 @@ -87,9 +89,11 @@ private static final class CopyEntryInputStream { private final DataInputFile in; public void copyLocalFileHeader(DataOutput out) throws IOException { - long absoluteOffs = in.convertToAbsoluteOffs(zipEntry.getDiskNo(), zipEntry.getLocalFileHeaderRelativeOffs()); + long absoluteOffs = in.convertToAbsoluteOffs(zipEntry.getDiskNo(), + zipEntry.getLocalFileHeaderRelativeOffs()); LocalFileHeader localFileHeader = new LocalFileHeaderReader(absoluteOffs, Charsets.UNMODIFIED).read(in); - zipEntry.setDataDescriptorAvailable(() -> localFileHeader.getGeneralPurposeFlag().isDataDescriptorAvailable()); + zipEntry.setDataDescriptorAvailable(() -> localFileHeader.getGeneralPurposeFlag() + .isDataDescriptorAvailable()); new LocalFileHeaderWriter(localFileHeader).write(out); } @@ -98,7 +102,7 @@ public void copyEncryptionHeaderAndData(DataOutput out) throws IOException { byte[] buf = new byte[1024 * 4]; while (size > 0) { - int n = in.read(buf, 0, (int)Math.min(buf.length, size)); + int n = in.read(buf, 0, (int) Math.min(buf.length, size)); if (n == IOUtils.EOF) throw new Zip4jvmException("Unexpected end of file"); diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/writers/ExtraFieldWriter.java b/src/main/java/ru/olegcherednik/zip4jvm/io/writers/ExtraFieldWriter.java index 1ecb21b1f..09694c203 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/writers/ExtraFieldWriter.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/writers/ExtraFieldWriter.java @@ -18,12 +18,13 @@ */ package ru.olegcherednik.zip4jvm.io.writers; -import lombok.RequiredArgsConstructor; import ru.olegcherednik.zip4jvm.exception.Zip4jvmException; import ru.olegcherednik.zip4jvm.io.out.data.DataOutput; import ru.olegcherednik.zip4jvm.model.extrafield.PkwareExtraField; import ru.olegcherednik.zip4jvm.utils.function.Writer; +import lombok.RequiredArgsConstructor; + import java.io.IOException; /** diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/writers/FileHeaderWriter.java b/src/main/java/ru/olegcherednik/zip4jvm/io/writers/FileHeaderWriter.java index 4d8abb89a..d3be49b84 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/writers/FileHeaderWriter.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/writers/FileHeaderWriter.java @@ -18,11 +18,12 @@ */ package ru.olegcherednik.zip4jvm.io.writers; -import lombok.RequiredArgsConstructor; import ru.olegcherednik.zip4jvm.io.out.data.DataOutput; import ru.olegcherednik.zip4jvm.model.CentralDirectory; import ru.olegcherednik.zip4jvm.utils.function.Writer; +import lombok.RequiredArgsConstructor; + import java.io.IOException; import java.nio.charset.Charset; import java.util.List; diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/writers/LocalFileHeaderWriter.java b/src/main/java/ru/olegcherednik/zip4jvm/io/writers/LocalFileHeaderWriter.java index ed7997eaf..8c84304bf 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/writers/LocalFileHeaderWriter.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/writers/LocalFileHeaderWriter.java @@ -18,13 +18,14 @@ */ package ru.olegcherednik.zip4jvm.io.writers; -import lombok.RequiredArgsConstructor; import ru.olegcherednik.zip4jvm.io.out.data.DataOutput; import ru.olegcherednik.zip4jvm.model.LocalFileHeader; -import ru.olegcherednik.zip4jvm.model.extrafield.PkwareExtraField; import ru.olegcherednik.zip4jvm.model.extrafield.ExtraField; +import ru.olegcherednik.zip4jvm.model.extrafield.PkwareExtraField; import ru.olegcherednik.zip4jvm.utils.function.Writer; +import lombok.RequiredArgsConstructor; + import java.io.IOException; import java.nio.charset.Charset; @@ -57,7 +58,7 @@ public void write(DataOutput out) throws IOException { ExtraField extraField = localFileHeader.getExtraField(); if (extraField instanceof PkwareExtraField) - new ExtraFieldWriter((PkwareExtraField)extraField).write(out); + new ExtraFieldWriter((PkwareExtraField) extraField).write(out); } } diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/writers/Zip64Writer.java b/src/main/java/ru/olegcherednik/zip4jvm/io/writers/Zip64Writer.java index 8315909dd..43335a38f 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/writers/Zip64Writer.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/writers/Zip64Writer.java @@ -18,12 +18,13 @@ */ package ru.olegcherednik.zip4jvm.io.writers; -import lombok.RequiredArgsConstructor; import ru.olegcherednik.zip4jvm.io.out.data.DataOutput; -import ru.olegcherednik.zip4jvm.model.extrafield.PkwareExtraField; import ru.olegcherednik.zip4jvm.model.Zip64; +import ru.olegcherednik.zip4jvm.model.extrafield.PkwareExtraField; import ru.olegcherednik.zip4jvm.utils.function.Writer; +import lombok.RequiredArgsConstructor; + import java.io.IOException; /** diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/writers/ZipEntryWriter.java b/src/main/java/ru/olegcherednik/zip4jvm/io/writers/ZipEntryWriter.java index fdf071cfb..183b19178 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/writers/ZipEntryWriter.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/writers/ZipEntryWriter.java @@ -18,7 +18,6 @@ */ package ru.olegcherednik.zip4jvm.io.writers; -import lombok.RequiredArgsConstructor; import ru.olegcherednik.zip4jvm.io.out.data.DataOutput; import ru.olegcherednik.zip4jvm.io.out.entry.EntryOutputStream; import ru.olegcherednik.zip4jvm.model.ZipModel; @@ -26,6 +25,8 @@ import ru.olegcherednik.zip4jvm.utils.ZipUtils; import ru.olegcherednik.zip4jvm.utils.function.Writer; +import lombok.RequiredArgsConstructor; + import java.io.IOException; /** diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/writers/ZipModelWriter.java b/src/main/java/ru/olegcherednik/zip4jvm/io/writers/ZipModelWriter.java index fea3419ed..85af3d52a 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/writers/ZipModelWriter.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/writers/ZipModelWriter.java @@ -18,7 +18,6 @@ */ package ru.olegcherednik.zip4jvm.io.writers; -import lombok.RequiredArgsConstructor; import ru.olegcherednik.zip4jvm.io.out.data.DataOutput; import ru.olegcherednik.zip4jvm.model.CentralDirectory; import ru.olegcherednik.zip4jvm.model.EndCentralDirectory; @@ -29,6 +28,8 @@ import ru.olegcherednik.zip4jvm.model.builders.Zip64Builder; import ru.olegcherednik.zip4jvm.utils.function.Writer; +import lombok.RequiredArgsConstructor; + import java.io.IOException; @RequiredArgsConstructor diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/zstd/ZstdInputStream.java b/src/main/java/ru/olegcherednik/zip4jvm/io/zstd/ZstdInputStream.java index 38c00a8ed..6a21fbb0b 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/zstd/ZstdInputStream.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/zstd/ZstdInputStream.java @@ -18,11 +18,12 @@ */ package ru.olegcherednik.zip4jvm.io.zstd; -import lombok.RequiredArgsConstructor; -import org.apache.commons.io.IOUtils; import ru.olegcherednik.zip4jvm.exception.Zip4jvmException; import ru.olegcherednik.zip4jvm.io.in.data.DataInput; +import lombok.RequiredArgsConstructor; +import org.apache.commons.io.IOUtils; + import java.io.Closeable; import java.io.IOException; import java.io.InputStream; @@ -47,7 +48,7 @@ public ZstdInputStream(DataInput in, long uncompressedSize, long compressedSize) zstd = new com.github.luben.zstd.ZstdInputStream(new Decorator(in)); finalAbsoluteOffs = in.getAbsoluteOffs() + compressedSize; bytesToRead = uncompressedSize; - } catch(IOException e) { + } catch (IOException e) { throw new Zip4jvmException(e); } } @@ -87,7 +88,7 @@ public int read(byte[] buf, int offs, int len) throws IOException { @Override public void close() throws IOException { if (in instanceof Closeable) - ((Closeable)in).close(); + ((Closeable) in).close(); } } diff --git a/src/main/java/ru/olegcherednik/zip4jvm/io/zstd/ZstdOutputStream.java b/src/main/java/ru/olegcherednik/zip4jvm/io/zstd/ZstdOutputStream.java index 5b528629e..20a01b114 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/io/zstd/ZstdOutputStream.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/io/zstd/ZstdOutputStream.java @@ -18,10 +18,11 @@ */ package ru.olegcherednik.zip4jvm.io.zstd; -import lombok.RequiredArgsConstructor; import ru.olegcherednik.zip4jvm.io.out.data.DataOutput; import ru.olegcherednik.zip4jvm.model.CompressionLevel; +import lombok.RequiredArgsConstructor; + import java.io.IOException; import java.io.OutputStream; diff --git a/src/main/java/ru/olegcherednik/zip4jvm/model/CentralDirectory.java b/src/main/java/ru/olegcherednik/zip4jvm/model/CentralDirectory.java index 22ef1824d..3f27d1731 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/model/CentralDirectory.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/model/CentralDirectory.java @@ -18,11 +18,12 @@ */ package ru.olegcherednik.zip4jvm.model; +import ru.olegcherednik.zip4jvm.crypto.strong.DecryptionHeader; +import ru.olegcherednik.zip4jvm.model.extrafield.PkwareExtraField; + import lombok.Getter; import lombok.Setter; import org.apache.commons.lang3.ArrayUtils; -import ru.olegcherednik.zip4jvm.crypto.strong.DecryptionHeader; -import ru.olegcherednik.zip4jvm.model.extrafield.PkwareExtraField; import java.nio.charset.Charset; import java.util.Collections; @@ -95,7 +96,8 @@ public byte[] getComment(Charset charset) { } public CompressionMethod getOriginalCompressionMethod() { - return compressionMethod == CompressionMethod.AES ? extraField.getAesRecord().getCompressionMethod() : compressionMethod; + return compressionMethod == CompressionMethod.AES ? extraField.getAesRecord().getCompressionMethod() + : compressionMethod; } public boolean isZip64() { diff --git a/src/main/java/ru/olegcherednik/zip4jvm/model/Compression.java b/src/main/java/ru/olegcherednik/zip4jvm/model/Compression.java index 9e904d51f..6f4cb3fd7 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/model/Compression.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/model/Compression.java @@ -18,8 +18,6 @@ */ package ru.olegcherednik.zip4jvm.model; -import lombok.Getter; -import lombok.RequiredArgsConstructor; import ru.olegcherednik.zip4jvm.exception.CompressionNotSupportedException; import ru.olegcherednik.zip4jvm.io.in.buf.Bzip2DataInput; import ru.olegcherednik.zip4jvm.io.in.buf.EnhancedDeflateDataInput; @@ -36,6 +34,9 @@ import ru.olegcherednik.zip4jvm.io.in.entry.ZstdEntryInputStream; import ru.olegcherednik.zip4jvm.model.entry.ZipEntry; +import lombok.Getter; +import lombok.RequiredArgsConstructor; + import java.util.Optional; /** diff --git a/src/main/java/ru/olegcherednik/zip4jvm/model/CompressionMethod.java b/src/main/java/ru/olegcherednik/zip4jvm/model/CompressionMethod.java index 30d2bd341..88756708d 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/model/CompressionMethod.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/model/CompressionMethod.java @@ -18,10 +18,11 @@ */ package ru.olegcherednik.zip4jvm.model; +import ru.olegcherednik.zip4jvm.exception.UnknownCompressionMethodException; + import lombok.AccessLevel; import lombok.Getter; import lombok.RequiredArgsConstructor; -import ru.olegcherednik.zip4jvm.exception.UnknownCompressionMethodException; /** * see 4.4.5 diff --git a/src/main/java/ru/olegcherednik/zip4jvm/model/EncryptionMethod.java b/src/main/java/ru/olegcherednik/zip4jvm/model/EncryptionMethod.java index d6177ee90..74e5de2c5 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/model/EncryptionMethod.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/model/EncryptionMethod.java @@ -18,8 +18,6 @@ */ package ru.olegcherednik.zip4jvm.model; -import lombok.AccessLevel; -import lombok.RequiredArgsConstructor; import ru.olegcherednik.zip4jvm.crypto.Decoder; import ru.olegcherednik.zip4jvm.crypto.Encoder; import ru.olegcherednik.zip4jvm.crypto.aes.AesDecoder; @@ -28,13 +26,15 @@ import ru.olegcherednik.zip4jvm.crypto.aes.AesStrongDecoder; import ru.olegcherednik.zip4jvm.crypto.pkware.PkwareDecoder; import ru.olegcherednik.zip4jvm.crypto.pkware.PkwareEncoder; -import ru.olegcherednik.zip4jvm.crypto.tripledes.TripleDesDecoder; import ru.olegcherednik.zip4jvm.exception.EncryptionNotSupportedException; import ru.olegcherednik.zip4jvm.io.in.data.DataInput; import ru.olegcherednik.zip4jvm.model.entry.ZipEntry; import ru.olegcherednik.zip4jvm.model.extrafield.PkwareExtraField; import ru.olegcherednik.zip4jvm.model.extrafield.records.AesExtraFieldRecord; +import lombok.AccessLevel; +import lombok.RequiredArgsConstructor; + import java.util.Optional; import java.util.function.Function; @@ -55,8 +55,8 @@ public enum EncryptionMethod { AES_STRONG_256(null, AesStrongDecoder::create, entry -> 0L), DES(null, null, ZipEntry::getChecksum), RC2_PRE_52(null, null, ZipEntry::getChecksum), - TRIPLE_DES_168(null, TripleDesDecoder::create, ZipEntry::getChecksum), - TRIPLE_DES_192(null, TripleDesDecoder::create, ZipEntry::getChecksum), + TRIPLE_DES_168(null, null, ZipEntry::getChecksum), + TRIPLE_DES_192(null, null, ZipEntry::getChecksum), RC2(null, null, ZipEntry::getChecksum), RC4(null, null, ZipEntry::getChecksum), BLOW_FISH(null, null, ZipEntry::getChecksum), @@ -73,8 +73,9 @@ public final Encoder createEncoder(ZipEntry zipEntry) { } public final Decoder createDecoder(DataInput in, ZipEntry zipEntry) { - return Optional.ofNullable(createDecoder).orElseThrow(() -> new EncryptionNotSupportedException(this)).apply(in, - zipEntry); + return Optional.ofNullable(createDecoder) + .orElseThrow(() -> new EncryptionNotSupportedException(this)) + .apply(in, zipEntry); } public final long getChecksum(ZipEntry zipEntry) { diff --git a/src/main/java/ru/olegcherednik/zip4jvm/model/ExternalFileAttributes.java b/src/main/java/ru/olegcherednik/zip4jvm/model/ExternalFileAttributes.java index 7b510cb3e..4e4e7d1dc 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/model/ExternalFileAttributes.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/model/ExternalFileAttributes.java @@ -18,13 +18,12 @@ */ package ru.olegcherednik.zip4jvm.model; -import lombok.Getter; -import lombok.NoArgsConstructor; -import org.apache.commons.lang3.ArrayUtils; import ru.olegcherednik.zip4jvm.utils.BitUtils; -import ru.olegcherednik.zip4jvm.utils.ZipUtils; import ru.olegcherednik.zip4jvm.utils.quitely.Quietly; +import lombok.Getter; +import org.apache.commons.lang3.ArrayUtils; + import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; @@ -118,7 +117,7 @@ public boolean isSymlink() { public ExternalFileAttributes readFrom(Path path) { // clear, because use local file system - Arrays.fill(data, (byte)0x0); + Arrays.fill(data, (byte) 0x0); posix.readFrom(path); windows.readFrom(path); @@ -164,10 +163,10 @@ else if (osName.contains(MAC) || osName.contains(UNIX)) } public byte[] getData() { - byte[] data = ArrayUtils.clone(this.data); - windows.fillData(data); - posix.fillData(data); - return data; + byte[] buf = ArrayUtils.clone(data); + windows.fillData(buf); + posix.fillData(buf); + return buf; } public String getDetailsWin() { @@ -247,7 +246,7 @@ public void apply(Path path, boolean posixReadOnly, boolean createdUnderPosix) t } public void fillData(byte[] data) { - data[0] = BitUtils.updateBits((byte)0x0, BIT0, readOnly); + data[0] = BitUtils.updateBits((byte) 0x0, BIT0, readOnly); data[0] = BitUtils.updateBits(data[0], BIT1, hidden); data[0] = BitUtils.updateBits(data[0], BIT2, system); data[0] = BitUtils.updateBits(data[0], BIT3, laboratory); @@ -371,7 +370,9 @@ public void apply(Path path, boolean winReadOnly, boolean createdUnderPosix) thr Files.setPosixFilePermissions(path, permissions); } - protected static void addIfSet(boolean exists, Set permissions, PosixFilePermission permission) { + protected static void addIfSet(boolean exists, + Set permissions, + PosixFilePermission permission) { if (exists) permissions.add(permission); } diff --git a/src/main/java/ru/olegcherednik/zip4jvm/model/GeneralPurposeFlag.java b/src/main/java/ru/olegcherednik/zip4jvm/model/GeneralPurposeFlag.java index 8c0485152..49c876806 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/model/GeneralPurposeFlag.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/model/GeneralPurposeFlag.java @@ -18,10 +18,11 @@ */ package ru.olegcherednik.zip4jvm.model; +import ru.olegcherednik.zip4jvm.utils.BitUtils; + import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; -import ru.olegcherednik.zip4jvm.utils.BitUtils; import java.nio.charset.Charset; @@ -48,7 +49,9 @@ public class GeneralPurposeFlag { private SlidingDictionarySize slidingDictionarySize = SlidingDictionarySize.SD_4K; private ShannonFanoTreesNumber shannonFanoTreesNumber = ShannonFanoTreesNumber.TWO; private boolean lzmaEosMarker; - /** {@link DataDescriptor} */ + /** + * {@link DataDescriptor} + */ private boolean dataDescriptorAvailable; private boolean strongEncryption; private boolean utf8; diff --git a/src/main/java/ru/olegcherednik/zip4jvm/model/InternalFileAttributes.java b/src/main/java/ru/olegcherednik/zip4jvm/model/InternalFileAttributes.java index 95793cb4c..d725feed6 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/model/InternalFileAttributes.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/model/InternalFileAttributes.java @@ -18,10 +18,11 @@ */ package ru.olegcherednik.zip4jvm.model; +import ru.olegcherednik.zip4jvm.utils.BitUtils; + import lombok.Getter; import lombok.NoArgsConstructor; import org.apache.commons.lang3.ArrayUtils; -import ru.olegcherednik.zip4jvm.utils.BitUtils; import static ru.olegcherednik.zip4jvm.utils.BitUtils.BIT0; @@ -55,9 +56,9 @@ private InternalFileAttributes readFrom(byte[] data) { } public byte[] getData() { - byte[] data = ArrayUtils.clone(this.data); - data[0] = BitUtils.updateBits((byte)0x0, BIT0, apparentFileType == ApparentFileType.TEXT); - return data; + byte[] buf = ArrayUtils.clone(data); + buf[0] = BitUtils.updateBits((byte) 0x0, BIT0, apparentFileType == ApparentFileType.TEXT); + return buf; } @Override diff --git a/src/main/java/ru/olegcherednik/zip4jvm/model/LocalFileHeader.java b/src/main/java/ru/olegcherednik/zip4jvm/model/LocalFileHeader.java index 0d609652f..eeea959c2 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/model/LocalFileHeader.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/model/LocalFileHeader.java @@ -18,11 +18,12 @@ */ package ru.olegcherednik.zip4jvm.model; +import ru.olegcherednik.zip4jvm.model.extrafield.ExtraField; +import ru.olegcherednik.zip4jvm.model.extrafield.PkwareExtraField; + import lombok.Getter; import lombok.Setter; import org.apache.commons.lang3.ArrayUtils; -import ru.olegcherednik.zip4jvm.model.extrafield.PkwareExtraField; -import ru.olegcherednik.zip4jvm.model.extrafield.ExtraField; import java.nio.charset.Charset; @@ -67,7 +68,7 @@ public byte[] getFileName(Charset charset) { public CompressionMethod getOriginalCompressionMethod() { if (compressionMethod == CompressionMethod.AES) - return ((PkwareExtraField)extraField).getAesRecord().getCompressionMethod(); + return ((PkwareExtraField) extraField).getAesRecord().getCompressionMethod(); return compressionMethod; } diff --git a/src/main/java/ru/olegcherednik/zip4jvm/model/Zip64.java b/src/main/java/ru/olegcherednik/zip4jvm/model/Zip64.java index 2be92c02e..16a160fd2 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/model/Zip64.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/model/Zip64.java @@ -18,17 +18,18 @@ */ package ru.olegcherednik.zip4jvm.model; +import ru.olegcherednik.zip4jvm.crypto.strong.EncryptionAlgorithm; +import ru.olegcherednik.zip4jvm.crypto.strong.Flags; +import ru.olegcherednik.zip4jvm.crypto.strong.HashAlgorithm; +import ru.olegcherednik.zip4jvm.io.out.data.DataOutput; +import ru.olegcherednik.zip4jvm.model.extrafield.PkwareExtraField; + import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.RequiredArgsConstructor; import lombok.Setter; import org.apache.commons.lang3.ArrayUtils; -import ru.olegcherednik.zip4jvm.crypto.strong.EncryptionAlgorithm; -import ru.olegcherednik.zip4jvm.crypto.strong.Flags; -import ru.olegcherednik.zip4jvm.crypto.strong.HashAlgorithm; -import ru.olegcherednik.zip4jvm.io.out.data.DataOutput; -import ru.olegcherednik.zip4jvm.model.extrafield.PkwareExtraField; import java.io.IOException; @@ -215,8 +216,10 @@ public static final class Builder { private long diskNo = PkwareExtraField.NO_DATA; public ExtendedInfo build() { - if (uncompressedSize == PkwareExtraField.NO_DATA && compressedSize == PkwareExtraField.NO_DATA - && localFileHeaderRelativeOffs == PkwareExtraField.NO_DATA && diskNo == PkwareExtraField.NO_DATA) + if (uncompressedSize == PkwareExtraField.NO_DATA + && compressedSize == PkwareExtraField.NO_DATA + && localFileHeaderRelativeOffs == PkwareExtraField.NO_DATA + && diskNo == PkwareExtraField.NO_DATA) return NULL; return new ExtendedInfo(this); } diff --git a/src/main/java/ru/olegcherednik/zip4jvm/model/ZipModel.java b/src/main/java/ru/olegcherednik/zip4jvm/model/ZipModel.java index 160d1ca00..390308f3e 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/model/ZipModel.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/model/ZipModel.java @@ -18,14 +18,15 @@ */ package ru.olegcherednik.zip4jvm.model; +import ru.olegcherednik.zip4jvm.exception.EntryNotFoundException; +import ru.olegcherednik.zip4jvm.model.entry.ZipEntry; +import ru.olegcherednik.zip4jvm.model.src.SrcZip; + import lombok.AccessLevel; import lombok.Getter; import lombok.RequiredArgsConstructor; import lombok.Setter; import org.apache.commons.lang3.StringUtils; -import ru.olegcherednik.zip4jvm.exception.EntryNotFoundException; -import ru.olegcherednik.zip4jvm.model.entry.ZipEntry; -import ru.olegcherednik.zip4jvm.model.src.SrcZip; import java.nio.file.Path; import java.util.Collection; @@ -66,7 +67,8 @@ public final class ZipModel { private long centralDirectorySize; /** - * {@literal true} only if section {@link Zip64} exists. In other words, do set this to {@code true}, to write zip archive + * {@literal true} only if section {@link Zip64} exists. In other words, do set this to {@code true}, to write zip + * archive * in ZIP64 format. */ private boolean zip64; diff --git a/src/main/java/ru/olegcherednik/zip4jvm/model/ZipSymlink.java b/src/main/java/ru/olegcherednik/zip4jvm/model/ZipSymlink.java index 6d7d4b237..69f4b58b4 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/model/ZipSymlink.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/model/ZipSymlink.java @@ -36,6 +36,6 @@ public enum ZipSymlink { * In case of duplicate content, there will only one target with multiple relative symlinks.
* Duplicate is the content with similar source path. */ - REPLACE_SYMLINK_WITH_UNIQUE_TARGET, + REPLACE_SYMLINK_WITH_UNIQUE_TARGET } diff --git a/src/main/java/ru/olegcherednik/zip4jvm/model/block/Block.java b/src/main/java/ru/olegcherednik/zip4jvm/model/block/Block.java index 1130f20fe..ac47a657f 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/model/block/Block.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/model/block/Block.java @@ -18,18 +18,19 @@ */ package ru.olegcherednik.zip4jvm.model.block; -import lombok.Getter; -import org.apache.commons.lang3.ArrayUtils; import ru.olegcherednik.zip4jvm.decompose.Utils; import ru.olegcherednik.zip4jvm.io.in.buf.DiskByteArrayDataInput; import ru.olegcherednik.zip4jvm.io.in.data.DataInput; -import ru.olegcherednik.zip4jvm.io.in.file.DataInputFile; import ru.olegcherednik.zip4jvm.io.in.data.DataInputLocation; +import ru.olegcherednik.zip4jvm.io.in.file.DataInputFile; import ru.olegcherednik.zip4jvm.io.in.file.LittleEndianDataInputFile; import ru.olegcherednik.zip4jvm.model.ZipModel; import ru.olegcherednik.zip4jvm.model.src.SrcZip; import ru.olegcherednik.zip4jvm.utils.function.LocalSupplier; +import lombok.Getter; +import org.apache.commons.lang3.ArrayUtils; + import java.io.IOException; import java.nio.file.Path; @@ -51,13 +52,13 @@ public class Block { public T calcSize(DataInput in, LocalSupplier task) { if (in instanceof DataInputLocation) - return calcSize((DataInputLocation)in, task); + return calcSize((DataInputLocation) in, task); absoluteOffs = in.getAbsoluteOffs(); relativeOffs = in.getAbsoluteOffs(); if (in instanceof DiskByteArrayDataInput) { - SrcZip.Disk disk = ((DiskByteArrayDataInput)in).getDisk(); + SrcZip.Disk disk = ((DiskByteArrayDataInput) in).getDisk(); diskNo = disk.getNo(); fileName = disk.getFileName(); } @@ -71,7 +72,7 @@ public T calcSize(DataInput in, LocalSupplier task) { } public T calcSize(DataInputFile in, LocalSupplier task) { - return calcSize((DataInputLocation)in, task); + return calcSize((DataInputLocation) in, task); } public T calcSize(DataInputLocation dataInputLocation, LocalSupplier task) { @@ -102,8 +103,8 @@ public byte[] getData() { try (DataInputFile in = new LittleEndianDataInputFile(srcZip)) { in.seek(diskNo, relativeOffs); - return in.readBytes((int)size); - } catch(Exception e) { + return in.readBytes((int) size); + } catch (Exception e) { e.printStackTrace(); return ArrayUtils.EMPTY_BYTE_ARRAY; } diff --git a/src/main/java/ru/olegcherednik/zip4jvm/model/block/BlockModel.java b/src/main/java/ru/olegcherednik/zip4jvm/model/block/BlockModel.java index 2eb64095f..b8bd2af07 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/model/block/BlockModel.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/model/block/BlockModel.java @@ -18,15 +18,16 @@ */ package ru.olegcherednik.zip4jvm.model.block; -import lombok.AccessLevel; -import lombok.Getter; -import lombok.NoArgsConstructor; -import org.apache.commons.collections4.MapUtils; import ru.olegcherednik.zip4jvm.model.CentralDirectory; import ru.olegcherednik.zip4jvm.model.EndCentralDirectory; import ru.olegcherednik.zip4jvm.model.Zip64; import ru.olegcherednik.zip4jvm.model.ZipModel; +import lombok.AccessLevel; +import lombok.Getter; +import lombok.NoArgsConstructor; +import org.apache.commons.collections4.MapUtils; + import java.util.Collections; import java.util.Map; import java.util.Optional; @@ -110,14 +111,16 @@ public Builder zip64(Zip64 zip64, Zip64Block block) { return this; } - public Builder centralDirectory(CentralDirectory centralDirectory, BaseCentralDirectoryBlock centralDirectoryBlock) { + public Builder centralDirectory(CentralDirectory centralDirectory, + BaseCentralDirectoryBlock centralDirectoryBlock) { this.centralDirectory = centralDirectory; this.centralDirectoryBlock = centralDirectoryBlock; return this; } public Builder zipEntries(Map zipEntries) { - this.zipEntries = MapUtils.isEmpty(zipEntries) ? Collections.emptyMap() : Collections.unmodifiableMap(zipEntries); + this.zipEntries = MapUtils.isEmpty(zipEntries) ? Collections.emptyMap() : Collections.unmodifiableMap( + zipEntries); return this; } } diff --git a/src/main/java/ru/olegcherednik/zip4jvm/model/block/EncryptedExtraFieldBlock.java b/src/main/java/ru/olegcherednik/zip4jvm/model/block/EncryptedExtraFieldBlock.java index 240efa03b..ea19697a8 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/model/block/EncryptedExtraFieldBlock.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/model/block/EncryptedExtraFieldBlock.java @@ -20,11 +20,6 @@ import lombok.Getter; import lombok.RequiredArgsConstructor; -import ru.olegcherednik.zip4jvm.decompose.Utils; -import ru.olegcherednik.zip4jvm.model.ZipModel; - -import java.io.IOException; -import java.nio.file.Path; /** * @author Oleg Cherednik @@ -36,14 +31,4 @@ public class EncryptedExtraFieldBlock extends ExtraFieldBlock { private final byte[] buf; -// @Override -// public Block createRecordBlock() { -// return new Block() { -// @Override -// public void copyLarge(ZipModel zipModel, Path out) throws IOException { -// Utils.copyByteArray(out, buf, this); -// } -// }; -// } - } diff --git a/src/main/java/ru/olegcherednik/zip4jvm/model/block/ZipEntryBlock.java b/src/main/java/ru/olegcherednik/zip4jvm/model/block/ZipEntryBlock.java index ab3dbf6cb..fe55a02c2 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/model/block/ZipEntryBlock.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/model/block/ZipEntryBlock.java @@ -18,14 +18,15 @@ */ package ru.olegcherednik.zip4jvm.model.block; -import lombok.Getter; -import lombok.RequiredArgsConstructor; -import lombok.Setter; import ru.olegcherednik.zip4jvm.crypto.strong.DecryptionHeader; import ru.olegcherednik.zip4jvm.model.DataDescriptor; import ru.olegcherednik.zip4jvm.model.LocalFileHeader; import ru.olegcherednik.zip4jvm.model.block.crypto.EncryptionHeaderBlock; +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import lombok.Setter; + /** * @author Oleg Cherednik * @since 12.12.2019 diff --git a/src/main/java/ru/olegcherednik/zip4jvm/model/block/crypto/AesEncryptionHeaderBlock.java b/src/main/java/ru/olegcherednik/zip4jvm/model/block/crypto/AesEncryptionHeaderBlock.java index 3f96cc889..775d50975 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/model/block/crypto/AesEncryptionHeaderBlock.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/model/block/crypto/AesEncryptionHeaderBlock.java @@ -18,9 +18,10 @@ */ package ru.olegcherednik.zip4jvm.model.block.crypto; -import lombok.Getter; import ru.olegcherednik.zip4jvm.model.block.Block; +import lombok.Getter; + /** * @author Oleg Cherednik * @since 23.10.2019 diff --git a/src/main/java/ru/olegcherednik/zip4jvm/model/block/crypto/EncryptedCentralDirectoryBlock.java b/src/main/java/ru/olegcherednik/zip4jvm/model/block/crypto/EncryptedCentralDirectoryBlock.java index cdf059a62..0970bd2f9 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/model/block/crypto/EncryptedCentralDirectoryBlock.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/model/block/crypto/EncryptedCentralDirectoryBlock.java @@ -18,8 +18,6 @@ */ package ru.olegcherednik.zip4jvm.model.block.crypto; -import lombok.Getter; -import lombok.Setter; import ru.olegcherednik.zip4jvm.decompose.Utils; import ru.olegcherednik.zip4jvm.model.ZipModel; import ru.olegcherednik.zip4jvm.model.block.Block; @@ -27,6 +25,9 @@ import ru.olegcherednik.zip4jvm.model.block.EncryptedExtraFieldBlock; import ru.olegcherednik.zip4jvm.model.block.crypto.strong.DecryptionHeaderBlock; +import lombok.Getter; +import lombok.Setter; + import java.io.IOException; import java.nio.file.Path; diff --git a/src/main/java/ru/olegcherednik/zip4jvm/model/block/crypto/PkwareEncryptionHeaderBlock.java b/src/main/java/ru/olegcherednik/zip4jvm/model/block/crypto/PkwareEncryptionHeaderBlock.java index 86993971a..5250652ee 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/model/block/crypto/PkwareEncryptionHeaderBlock.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/model/block/crypto/PkwareEncryptionHeaderBlock.java @@ -18,9 +18,10 @@ */ package ru.olegcherednik.zip4jvm.model.block.crypto; -import lombok.Getter; import ru.olegcherednik.zip4jvm.model.block.Block; +import lombok.Getter; + /** * @author Oleg Cherednik * @since 24.10.2019 diff --git a/src/main/java/ru/olegcherednik/zip4jvm/model/block/crypto/strong/DecryptionHeaderBlock.java b/src/main/java/ru/olegcherednik/zip4jvm/model/block/crypto/strong/DecryptionHeaderBlock.java index 9e1ae3783..8ee7e5328 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/model/block/crypto/strong/DecryptionHeaderBlock.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/model/block/crypto/strong/DecryptionHeaderBlock.java @@ -18,11 +18,12 @@ */ package ru.olegcherednik.zip4jvm.model.block.crypto.strong; -import lombok.Getter; import ru.olegcherednik.zip4jvm.model.block.Block; import ru.olegcherednik.zip4jvm.model.block.crypto.EncryptionHeaderBlock; import ru.olegcherednik.zip4jvm.model.block.crypto.RecipientsBlock; +import lombok.Getter; + /** * @author Oleg Cherednik * @since 30.03.2020 diff --git a/src/main/java/ru/olegcherednik/zip4jvm/model/builders/AesExtraDataRecordBuilder.java b/src/main/java/ru/olegcherednik/zip4jvm/model/builders/AesExtraDataRecordBuilder.java index 753654d22..2d00b70f0 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/model/builders/AesExtraDataRecordBuilder.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/model/builders/AesExtraDataRecordBuilder.java @@ -18,12 +18,13 @@ */ package ru.olegcherednik.zip4jvm.model.builders; -import lombok.RequiredArgsConstructor; import ru.olegcherednik.zip4jvm.crypto.aes.AesEngine; import ru.olegcherednik.zip4jvm.crypto.aes.AesStrength; import ru.olegcherednik.zip4jvm.model.entry.ZipEntry; import ru.olegcherednik.zip4jvm.model.extrafield.records.AesExtraFieldRecord; +import lombok.RequiredArgsConstructor; + /** * @author Oleg Cherednik * @since 30.08.2019 diff --git a/src/main/java/ru/olegcherednik/zip4jvm/model/builders/CentralDirectoryBuilder.java b/src/main/java/ru/olegcherednik/zip4jvm/model/builders/CentralDirectoryBuilder.java index e041918e7..5d7f2c369 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/model/builders/CentralDirectoryBuilder.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/model/builders/CentralDirectoryBuilder.java @@ -18,10 +18,11 @@ */ package ru.olegcherednik.zip4jvm.model.builders; -import lombok.RequiredArgsConstructor; import ru.olegcherednik.zip4jvm.model.CentralDirectory; import ru.olegcherednik.zip4jvm.model.entry.ZipEntry; +import lombok.RequiredArgsConstructor; + import java.io.IOException; import java.util.ArrayList; import java.util.Collection; diff --git a/src/main/java/ru/olegcherednik/zip4jvm/model/builders/EndCentralDirectoryBuilder.java b/src/main/java/ru/olegcherednik/zip4jvm/model/builders/EndCentralDirectoryBuilder.java index 6cd2679d8..c97506822 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/model/builders/EndCentralDirectoryBuilder.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/model/builders/EndCentralDirectoryBuilder.java @@ -18,11 +18,12 @@ */ package ru.olegcherednik.zip4jvm.model.builders; -import lombok.RequiredArgsConstructor; import ru.olegcherednik.zip4jvm.model.EndCentralDirectory; import ru.olegcherednik.zip4jvm.model.Zip64; import ru.olegcherednik.zip4jvm.model.ZipModel; +import lombok.RequiredArgsConstructor; + /** * @author Oleg Cherednik * @since 31.08.2019 diff --git a/src/main/java/ru/olegcherednik/zip4jvm/model/builders/FileHeaderBuilder.java b/src/main/java/ru/olegcherednik/zip4jvm/model/builders/FileHeaderBuilder.java index ef8a64ff5..461a5c6d3 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/model/builders/FileHeaderBuilder.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/model/builders/FileHeaderBuilder.java @@ -18,7 +18,6 @@ */ package ru.olegcherednik.zip4jvm.model.builders; -import lombok.RequiredArgsConstructor; import ru.olegcherednik.zip4jvm.model.CentralDirectory; import ru.olegcherednik.zip4jvm.model.GeneralPurposeFlag; import ru.olegcherednik.zip4jvm.model.Version; @@ -26,6 +25,8 @@ import ru.olegcherednik.zip4jvm.model.entry.ZipEntry; import ru.olegcherednik.zip4jvm.model.extrafield.PkwareExtraField; +import lombok.RequiredArgsConstructor; + import java.io.IOException; import static ru.olegcherednik.zip4jvm.model.ZipModel.MAX_LOCAL_FILE_HEADER_OFFS; diff --git a/src/main/java/ru/olegcherednik/zip4jvm/model/builders/LocalFileHeaderBuilder.java b/src/main/java/ru/olegcherednik/zip4jvm/model/builders/LocalFileHeaderBuilder.java index 7999c0fea..750a5c5bc 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/model/builders/LocalFileHeaderBuilder.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/model/builders/LocalFileHeaderBuilder.java @@ -18,7 +18,6 @@ */ package ru.olegcherednik.zip4jvm.model.builders; -import lombok.RequiredArgsConstructor; import ru.olegcherednik.zip4jvm.model.GeneralPurposeFlag; import ru.olegcherednik.zip4jvm.model.LocalFileHeader; import ru.olegcherednik.zip4jvm.model.Version; @@ -26,6 +25,8 @@ import ru.olegcherednik.zip4jvm.model.entry.ZipEntry; import ru.olegcherednik.zip4jvm.model.extrafield.PkwareExtraField; +import lombok.RequiredArgsConstructor; + /** * @author Oleg Cherednik * @since 27.08.2019 @@ -81,7 +82,8 @@ private Zip64.ExtendedInfo createExtendedInfo() { } private long getCrc32() { - return zipEntry.isDataDescriptorAvailable() ? LOOK_IN_DATA_DESCRIPTOR : zipEntry.getEncryptionMethod().getChecksum(zipEntry); + return zipEntry.isDataDescriptorAvailable() ? LOOK_IN_DATA_DESCRIPTOR + : zipEntry.getEncryptionMethod().getChecksum(zipEntry); } private long getSize(long size) { diff --git a/src/main/java/ru/olegcherednik/zip4jvm/model/builders/Zip64Builder.java b/src/main/java/ru/olegcherednik/zip4jvm/model/builders/Zip64Builder.java index 9bea7c9c5..8eba46fb5 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/model/builders/Zip64Builder.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/model/builders/Zip64Builder.java @@ -18,12 +18,13 @@ */ package ru.olegcherednik.zip4jvm.model.builders; -import lombok.RequiredArgsConstructor; -import org.apache.commons.lang3.ArrayUtils; import ru.olegcherednik.zip4jvm.model.Version; import ru.olegcherednik.zip4jvm.model.Zip64; import ru.olegcherednik.zip4jvm.model.ZipModel; +import lombok.RequiredArgsConstructor; +import org.apache.commons.lang3.ArrayUtils; + /** * @author Oleg Cherednik * @since 31.08.2019 @@ -40,7 +41,8 @@ public Zip64 build() { private Zip64.EndCentralDirectoryLocator createLocator() { Zip64.EndCentralDirectoryLocator locator = new Zip64.EndCentralDirectoryLocator(); - locator.setEndCentralDirectoryRelativeOffs(zipModel.getCentralDirectoryRelativeOffs() + zipModel.getCentralDirectorySize()); + locator.setEndCentralDirectoryRelativeOffs(zipModel.getCentralDirectoryRelativeOffs() + + zipModel.getCentralDirectorySize()); locator.setMainDiskNo(disk); locator.setTotalDisks(disk + 1); return locator; @@ -61,15 +63,15 @@ private Zip64.EndCentralDirectory createEndCentralDirectory() { endCentralDirectory.setTotalEntries(zipModel.getTotalEntries()); endCentralDirectory.setCentralDirectorySize(zipModel.getCentralDirectorySize()); endCentralDirectory.setCentralDirectoryRelativeOffs(zipModel.getCentralDirectoryRelativeOffs()); -// endCentralDirectory.setExtensibleDataSector(extensibleDataSector); + // endCentralDirectory.setExtensibleDataSector(extensibleDataSector); return endCentralDirectory; } private int countNumberOfFileHeaderEntriesOnDisk() { if (zipModel.isSplit()) - return (int)zipModel.getZipEntries().stream() - .filter(zipEntry -> zipEntry.getDiskNo() == zipModel.getTotalDisks()) - .count(); + return (int) zipModel.getZipEntries().stream() + .filter(zipEntry -> zipEntry.getDiskNo() == zipModel.getTotalDisks()) + .count(); return zipModel.getTotalEntries(); } diff --git a/src/main/java/ru/olegcherednik/zip4jvm/model/builders/ZipModelBuilder.java b/src/main/java/ru/olegcherednik/zip4jvm/model/builders/ZipModelBuilder.java index bf49f25ef..56a34d9ff 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/model/builders/ZipModelBuilder.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/model/builders/ZipModelBuilder.java @@ -18,10 +18,7 @@ */ package ru.olegcherednik.zip4jvm.model.builders; -import lombok.RequiredArgsConstructor; import ru.olegcherednik.zip4jvm.exception.Zip4jvmException; -import ru.olegcherednik.zip4jvm.model.password.PasswordProvider; -import ru.olegcherednik.zip4jvm.model.src.SrcZip; import ru.olegcherednik.zip4jvm.io.readers.ZipModelReader; import ru.olegcherednik.zip4jvm.model.CentralDirectory; import ru.olegcherednik.zip4jvm.model.Charsets; @@ -29,7 +26,11 @@ import ru.olegcherednik.zip4jvm.model.Zip64; import ru.olegcherednik.zip4jvm.model.ZipModel; import ru.olegcherednik.zip4jvm.model.entry.ZipEntryBuilder; +import ru.olegcherednik.zip4jvm.model.password.PasswordProvider; import ru.olegcherednik.zip4jvm.model.settings.ZipSettings; +import ru.olegcherednik.zip4jvm.model.src.SrcZip; + +import lombok.RequiredArgsConstructor; import java.io.IOException; import java.nio.charset.Charset; @@ -91,14 +92,16 @@ public ZipModel build() { private void createAndAddEntries(ZipModel zipModel) { if (centralDirectory != null) centralDirectory.getFileHeaders().stream() - .map(fileHeader -> ZipEntryBuilder.build(fileHeader, zipModel.getSrcZip(), charsetCustomizer)) + .map(fileHeader -> ZipEntryBuilder.build(fileHeader, + zipModel.getSrcZip(), + charsetCustomizer)) .forEach(zipModel::addEntry); } private int getTotalDisks() { if (zip64 == Zip64.NULL) return endCentralDirectory.getTotalDisks(); - return (int)zip64.getEndCentralDirectoryLocator().getTotalDisks(); + return (int) zip64.getEndCentralDirectoryLocator().getTotalDisks(); } private long getMainDiskNo() { @@ -112,7 +115,7 @@ public long getCentralDirectorySize() { public static int getMainDiskNo(EndCentralDirectory endCentralDirectory, Zip64 zip64) { if (zip64 == Zip64.NULL) return endCentralDirectory.getMainDiskNo(); - return (int)zip64.getEndCentralDirectory().getMainDiskNo(); + return (int) zip64.getEndCentralDirectory().getMainDiskNo(); } public static long getCentralDirectoryRelativeOffs(EndCentralDirectory endCentralDirectory, Zip64 zip64) { diff --git a/src/main/java/ru/olegcherednik/zip4jvm/model/entry/RegularFileZipEntry.java b/src/main/java/ru/olegcherednik/zip4jvm/model/entry/RegularFileZipEntry.java index 9f78be3f7..76c0e8bc0 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/model/entry/RegularFileZipEntry.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/model/entry/RegularFileZipEntry.java @@ -18,8 +18,6 @@ */ package ru.olegcherednik.zip4jvm.model.entry; -import lombok.Getter; -import lombok.Setter; import ru.olegcherednik.zip4jvm.crypto.Decoder; import ru.olegcherednik.zip4jvm.crypto.Encoder; import ru.olegcherednik.zip4jvm.io.in.data.DataInput; @@ -30,6 +28,9 @@ import ru.olegcherednik.zip4jvm.utils.ZipUtils; import ru.olegcherednik.zip4jvm.utils.function.ZipEntryInputStreamSupplier; +import lombok.Getter; +import lombok.Setter; + /** * @author Oleg Cherednik * @since 26.07.2019 diff --git a/src/main/java/ru/olegcherednik/zip4jvm/model/entry/ZipEntry.java b/src/main/java/ru/olegcherednik/zip4jvm/model/entry/ZipEntry.java index 0b372047a..b0d5908ca 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/model/entry/ZipEntry.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/model/entry/ZipEntry.java @@ -18,10 +18,6 @@ */ package ru.olegcherednik.zip4jvm.model.entry; -import lombok.AccessLevel; -import lombok.Getter; -import lombok.RequiredArgsConstructor; -import lombok.Setter; import ru.olegcherednik.zip4jvm.ZipFile; import ru.olegcherednik.zip4jvm.crypto.Decoder; import ru.olegcherednik.zip4jvm.crypto.Encoder; @@ -32,10 +28,14 @@ import ru.olegcherednik.zip4jvm.model.ExternalFileAttributes; import ru.olegcherednik.zip4jvm.model.InternalFileAttributes; import ru.olegcherednik.zip4jvm.model.LocalFileHeader; -import ru.olegcherednik.zip4jvm.utils.ZipUtils; import ru.olegcherednik.zip4jvm.utils.function.ZipEntryInputStreamSupplier; import ru.olegcherednik.zip4jvm.utils.quitely.Quietly; +import lombok.AccessLevel; +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import lombok.Setter; + import java.io.IOException; import java.io.InputStream; import java.util.Comparator; @@ -68,8 +68,10 @@ public abstract class ZipEntry { private final ZipEntryInputStreamSupplier inputStreamSup; /** - * {@literal true} only if section {@link ru.olegcherednik.zip4jvm.model.Zip64.ExtendedInfo} exists in {@link LocalFileHeader} and - * {@link ru.olegcherednik.zip4jvm.model.CentralDirectory.FileHeader}. In other words, do set this to {@code true}, to write given entry in + * {@literal true} only if section {@link ru.olegcherednik.zip4jvm.model.Zip64.ExtendedInfo} exists in + * {@link LocalFileHeader} and + * {@link ru.olegcherednik.zip4jvm.model.CentralDirectory.FileHeader}. In other words, do set this to {@code true}, + * to write given entry in * ZIP64 format. */ private boolean zip64; diff --git a/src/main/java/ru/olegcherednik/zip4jvm/model/entry/ZipEntryBuilder.java b/src/main/java/ru/olegcherednik/zip4jvm/model/entry/ZipEntryBuilder.java index 8ecff8472..e37f87906 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/model/entry/ZipEntryBuilder.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/model/entry/ZipEntryBuilder.java @@ -18,12 +18,9 @@ */ package ru.olegcherednik.zip4jvm.model.entry; -import lombok.AccessLevel; -import lombok.NoArgsConstructor; -import lombok.RequiredArgsConstructor; import ru.olegcherednik.zip4jvm.ZipFile; -import ru.olegcherednik.zip4jvm.io.in.file.LittleEndianDataInputFile; import ru.olegcherednik.zip4jvm.io.in.entry.EntryInputStream; +import ru.olegcherednik.zip4jvm.io.in.file.LittleEndianDataInputFile; import ru.olegcherednik.zip4jvm.model.CentralDirectory; import ru.olegcherednik.zip4jvm.model.Charsets; import ru.olegcherednik.zip4jvm.model.CompressionLevel; @@ -38,6 +35,10 @@ import ru.olegcherednik.zip4jvm.utils.quitely.Quietly; import ru.olegcherednik.zip4jvm.utils.time.DosTimestampConverterUtils; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; +import lombok.RequiredArgsConstructor; + import java.io.ByteArrayInputStream; import java.nio.charset.Charset; import java.nio.file.Files; @@ -97,7 +98,9 @@ public static ZipEntry emptyDirectory(Path dir, String dirName, ZipEntrySettings long lastModifiedTime = Files.getLastModifiedTime(dir).toMillis(); int dosLastModifiedTime = DosTimestampConverterUtils.javaToDosTime(lastModifiedTime); ExternalFileAttributes externalFileAttributes = ExternalFileAttributes.directory(dir); - EmptyDirectoryZipEntry zipEntry = new EmptyDirectoryZipEntry(dirName, dosLastModifiedTime, externalFileAttributes); + EmptyDirectoryZipEntry zipEntry = new EmptyDirectoryZipEntry(dirName, + dosLastModifiedTime, + externalFileAttributes); zipEntry.setComment(entrySettings.getComment()); zipEntry.setUtf8(entrySettings.isUtf8()); return zipEntry; @@ -192,7 +195,8 @@ private ZipEntry createRegularFileEntry() { ExternalFileAttributes externalFileAttributes = entry.getExternalFileAttributes(); CompressionMethod compressionMethod = entry.getUncompressedSize() == 0 ? CompressionMethod.STORE - : entrySettings.getCompression().getMethod(); + : + entrySettings.getCompression().getMethod(); CompressionLevel compressionLevel = entrySettings.getCompressionLevel(); EncryptionMethod encryptionMethod = entrySettings.getEncryption().getMethod(); ZipEntryInputStreamSupplier inputStreamSup = zipEntry -> entry.getInputStream(); @@ -247,8 +251,13 @@ private ZipEntry createRegularFileEntry() { ZipEntryInputStreamSupplier inputStreamSup = createInputStreamSupplier(); - RegularFileZipEntry zipEntry = new RegularFileZipEntry(fileName, lastModifiedTime, externalFileAttributes, compressionMethod, - compressionLevel, encryptionMethod, inputStreamSup); + RegularFileZipEntry zipEntry = new RegularFileZipEntry(fileName, + lastModifiedTime, + externalFileAttributes, + compressionMethod, + compressionLevel, + encryptionMethod, + inputStreamSup); zipEntry.setDataDescriptorAvailable(generalPurposeFlag::isDataDescriptorAvailable); zipEntry.setLzmaEosMarker(generalPurposeFlag.isLzmaEosMarker()); @@ -268,12 +277,14 @@ private ZipEntry createEmptyDirectoryEntry() { } private ZipEntryInputStreamSupplier createInputStreamSupplier() { - return zipEntry -> EntryInputStream.create(zipEntry, charsetCustomizer, new LittleEndianDataInputFile(srcZip)); + return zipEntry -> EntryInputStream.create(zipEntry, + charsetCustomizer, + new LittleEndianDataInputFile(srcZip)); } private int getDisk() { if (fileHeader.getDiskNo() == MAX_TOTAL_DISKS) - return (int)fileHeader.getExtraField().getExtendedInfo().getDiskNo(); + return (int) fileHeader.getExtraField().getExtendedInfo().getDiskNo(); return fileHeader.getDiskNo(); } diff --git a/src/main/java/ru/olegcherednik/zip4jvm/model/extrafield/AlignmentExtraField.java b/src/main/java/ru/olegcherednik/zip4jvm/model/extrafield/AlignmentExtraField.java index 0d82ad3e3..eeb036be0 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/model/extrafield/AlignmentExtraField.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/model/extrafield/AlignmentExtraField.java @@ -18,11 +18,12 @@ */ package ru.olegcherednik.zip4jvm.model.extrafield; -import lombok.Getter; -import lombok.RequiredArgsConstructor; import ru.olegcherednik.zip4jvm.io.in.data.DataInput; import ru.olegcherednik.zip4jvm.io.readers.ExtraFieldRecordReader; +import lombok.Getter; +import lombok.RequiredArgsConstructor; + /** * It was faced in apk file. This is not a PKWARE standard extra field. * Store it as simple byte array. It should not be greater than diff --git a/src/main/java/ru/olegcherednik/zip4jvm/model/extrafield/ExtraField.java b/src/main/java/ru/olegcherednik/zip4jvm/model/extrafield/ExtraField.java index 70dae7697..59a7f18fb 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/model/extrafield/ExtraField.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/model/extrafield/ExtraField.java @@ -25,4 +25,5 @@ public interface ExtraField { int getSize(); + } diff --git a/src/main/java/ru/olegcherednik/zip4jvm/model/extrafield/PkwareExtraField.java b/src/main/java/ru/olegcherednik/zip4jvm/model/extrafield/PkwareExtraField.java index 7bfe06c2d..42d2a7183 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/model/extrafield/PkwareExtraField.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/model/extrafield/PkwareExtraField.java @@ -18,18 +18,15 @@ */ package ru.olegcherednik.zip4jvm.model.extrafield; -import lombok.AccessLevel; -import lombok.Getter; -import lombok.NoArgsConstructor; -import org.apache.commons.lang3.ArrayUtils; import ru.olegcherednik.zip4jvm.exception.Zip4jvmException; -import ru.olegcherednik.zip4jvm.io.out.data.DataOutput; import ru.olegcherednik.zip4jvm.model.Zip64; import ru.olegcherednik.zip4jvm.model.extrafield.records.AesExtraFieldRecord; import ru.olegcherednik.zip4jvm.model.extrafield.records.StrongEncryptionHeaderExtraFieldRecord; import ru.olegcherednik.zip4jvm.utils.function.Writer; -import java.io.IOException; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; + import java.util.Collection; import java.util.Collections; import java.util.List; @@ -74,19 +71,19 @@ private PkwareExtraField(Builder builder) { public Zip64.ExtendedInfo getExtendedInfo() { PkwareExtraField.Record record = map.get(Zip64.ExtendedInfo.SIGNATURE); - return record instanceof Zip64.ExtendedInfo ? (Zip64.ExtendedInfo)record : Zip64.ExtendedInfo.NULL; + return record instanceof Zip64.ExtendedInfo ? (Zip64.ExtendedInfo) record : Zip64.ExtendedInfo.NULL; } public AesExtraFieldRecord getAesRecord() { PkwareExtraField.Record record = map.get(AesExtraFieldRecord.SIGNATURE); - return record instanceof AesExtraFieldRecord ? (AesExtraFieldRecord)record : AesExtraFieldRecord.NULL; + return record instanceof AesExtraFieldRecord ? (AesExtraFieldRecord) record : AesExtraFieldRecord.NULL; } public StrongEncryptionHeaderExtraFieldRecord getStrongEncryptionHeaderRecord() { PkwareExtraField.Record record = map.get(StrongEncryptionHeaderExtraFieldRecord.SIGNATURE); if (record instanceof StrongEncryptionHeaderExtraFieldRecord) - return (StrongEncryptionHeaderExtraFieldRecord)record; + return (StrongEncryptionHeaderExtraFieldRecord) record; return StrongEncryptionHeaderExtraFieldRecord.NULL; } @@ -104,9 +101,9 @@ public PkwareExtraField.Record getRecord(int signature) { } public int getTotalRecords() { - return (int)map.values().stream() - .filter(record -> !record.isNull()) - .count(); + return (int) map.values().stream() + .filter(record -> !record.isNull()) + .count(); } @Override diff --git a/src/main/java/ru/olegcherednik/zip4jvm/model/extrafield/records/AesExtraFieldRecord.java b/src/main/java/ru/olegcherednik/zip4jvm/model/extrafield/records/AesExtraFieldRecord.java index 02f7feed2..42f3b8d43 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/model/extrafield/records/AesExtraFieldRecord.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/model/extrafield/records/AesExtraFieldRecord.java @@ -18,10 +18,6 @@ */ package ru.olegcherednik.zip4jvm.model.extrafield.records; -import lombok.AccessLevel; -import lombok.Getter; -import lombok.NoArgsConstructor; -import org.apache.commons.lang3.StringUtils; import ru.olegcherednik.zip4jvm.crypto.aes.AesStrength; import ru.olegcherednik.zip4jvm.exception.Zip4jvmException; import ru.olegcherednik.zip4jvm.io.out.data.DataOutput; @@ -29,6 +25,11 @@ import ru.olegcherednik.zip4jvm.model.CompressionMethod; import ru.olegcherednik.zip4jvm.model.extrafield.PkwareExtraField; +import lombok.AccessLevel; +import lombok.Getter; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.StringUtils; + import java.io.IOException; import java.nio.charset.Charset; import java.util.Optional; @@ -103,7 +104,7 @@ public void write(DataOutput out) throws IOException { out.writeWord(dataSize); out.writeWord(versionNumber); out.writeBytes(getVendor(Charsets.UTF_8)); - out.writeBytes((byte)strength.getCode()); + out.writeBytes((byte) strength.getCode()); out.writeWord(compressionMethod.getCode()); } diff --git a/src/main/java/ru/olegcherednik/zip4jvm/model/extrafield/records/AlignmentExtraFieldRecord.java b/src/main/java/ru/olegcherednik/zip4jvm/model/extrafield/records/AlignmentExtraFieldRecord.java index 0b0f39df9..24d0cff1c 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/model/extrafield/records/AlignmentExtraFieldRecord.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/model/extrafield/records/AlignmentExtraFieldRecord.java @@ -18,11 +18,12 @@ */ package ru.olegcherednik.zip4jvm.model.extrafield.records; +import ru.olegcherednik.zip4jvm.io.out.data.DataOutput; +import ru.olegcherednik.zip4jvm.model.extrafield.PkwareExtraField; + import lombok.Builder; import lombok.Getter; import org.apache.commons.lang3.NotImplementedException; -import ru.olegcherednik.zip4jvm.io.out.data.DataOutput; -import ru.olegcherednik.zip4jvm.model.extrafield.PkwareExtraField; import java.io.IOException; diff --git a/src/main/java/ru/olegcherednik/zip4jvm/model/extrafield/records/ExecutableJarMarkerExtraFieldRecord.java b/src/main/java/ru/olegcherednik/zip4jvm/model/extrafield/records/ExecutableJarMarkerExtraFieldRecord.java index eaccf8442..7f24b9efb 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/model/extrafield/records/ExecutableJarMarkerExtraFieldRecord.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/model/extrafield/records/ExecutableJarMarkerExtraFieldRecord.java @@ -18,11 +18,12 @@ */ package ru.olegcherednik.zip4jvm.model.extrafield.records; +import ru.olegcherednik.zip4jvm.io.out.data.DataOutput; +import ru.olegcherednik.zip4jvm.model.extrafield.PkwareExtraField; + import lombok.Getter; import lombok.RequiredArgsConstructor; import org.apache.commons.lang3.NotImplementedException; -import ru.olegcherednik.zip4jvm.io.out.data.DataOutput; -import ru.olegcherednik.zip4jvm.model.extrafield.PkwareExtraField; import java.io.IOException; diff --git a/src/main/java/ru/olegcherednik/zip4jvm/model/extrafield/records/ExtendedTimestampExtraFieldRecord.java b/src/main/java/ru/olegcherednik/zip4jvm/model/extrafield/records/ExtendedTimestampExtraFieldRecord.java index 866dcf6ce..ad33768bd 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/model/extrafield/records/ExtendedTimestampExtraFieldRecord.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/model/extrafield/records/ExtendedTimestampExtraFieldRecord.java @@ -18,15 +18,16 @@ */ package ru.olegcherednik.zip4jvm.model.extrafield.records; +import ru.olegcherednik.zip4jvm.io.out.data.DataOutput; +import ru.olegcherednik.zip4jvm.model.extrafield.PkwareExtraField; +import ru.olegcherednik.zip4jvm.utils.BitUtils; + import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; import org.apache.commons.lang3.NotImplementedException; import org.apache.commons.lang3.StringUtils; -import ru.olegcherednik.zip4jvm.io.out.data.DataOutput; -import ru.olegcherednik.zip4jvm.model.extrafield.PkwareExtraField; -import ru.olegcherednik.zip4jvm.utils.BitUtils; import java.io.IOException; import java.util.function.IntSupplier; diff --git a/src/main/java/ru/olegcherednik/zip4jvm/model/extrafield/records/InfoZipNewUnixExtraFieldRecord.java b/src/main/java/ru/olegcherednik/zip4jvm/model/extrafield/records/InfoZipNewUnixExtraFieldRecord.java index 53f4dcc92..fbf8c8f32 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/model/extrafield/records/InfoZipNewUnixExtraFieldRecord.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/model/extrafield/records/InfoZipNewUnixExtraFieldRecord.java @@ -18,11 +18,12 @@ */ package ru.olegcherednik.zip4jvm.model.extrafield.records; +import ru.olegcherednik.zip4jvm.io.out.data.DataOutput; +import ru.olegcherednik.zip4jvm.model.extrafield.PkwareExtraField; + import lombok.Builder; import lombok.Getter; import org.apache.commons.lang3.NotImplementedException; -import ru.olegcherednik.zip4jvm.io.out.data.DataOutput; -import ru.olegcherednik.zip4jvm.model.extrafield.PkwareExtraField; import java.io.IOException; @@ -77,7 +78,7 @@ public String toString() { } public T getPayload() { - return (T)payload; + return (T) payload; } public interface Payload { diff --git a/src/main/java/ru/olegcherednik/zip4jvm/model/extrafield/records/InfoZipOldUnixExtraFieldRecord.java b/src/main/java/ru/olegcherednik/zip4jvm/model/extrafield/records/InfoZipOldUnixExtraFieldRecord.java index f7689d9d3..1be1c665a 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/model/extrafield/records/InfoZipOldUnixExtraFieldRecord.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/model/extrafield/records/InfoZipOldUnixExtraFieldRecord.java @@ -18,11 +18,12 @@ */ package ru.olegcherednik.zip4jvm.model.extrafield.records; +import ru.olegcherednik.zip4jvm.io.out.data.DataOutput; +import ru.olegcherednik.zip4jvm.model.extrafield.PkwareExtraField; + import lombok.Builder; import lombok.Getter; import org.apache.commons.lang3.NotImplementedException; -import ru.olegcherednik.zip4jvm.io.out.data.DataOutput; -import ru.olegcherednik.zip4jvm.model.extrafield.PkwareExtraField; import java.io.IOException; diff --git a/src/main/java/ru/olegcherednik/zip4jvm/model/extrafield/records/NtfsTimestampExtraFieldRecord.java b/src/main/java/ru/olegcherednik/zip4jvm/model/extrafield/records/NtfsTimestampExtraFieldRecord.java index 7f0e2c2a8..a193e6bef 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/model/extrafield/records/NtfsTimestampExtraFieldRecord.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/model/extrafield/records/NtfsTimestampExtraFieldRecord.java @@ -18,12 +18,13 @@ */ package ru.olegcherednik.zip4jvm.model.extrafield.records; +import ru.olegcherednik.zip4jvm.io.out.data.DataOutput; +import ru.olegcherednik.zip4jvm.model.extrafield.PkwareExtraField; + import lombok.Builder; import lombok.Getter; import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.NotImplementedException; -import ru.olegcherednik.zip4jvm.io.out.data.DataOutput; -import ru.olegcherednik.zip4jvm.model.extrafield.PkwareExtraField; import java.io.IOException; import java.util.List; diff --git a/src/main/java/ru/olegcherednik/zip4jvm/model/extrafield/records/StrongEncryptionHeaderExtraFieldRecord.java b/src/main/java/ru/olegcherednik/zip4jvm/model/extrafield/records/StrongEncryptionHeaderExtraFieldRecord.java index de27a77ef..92a19c4d5 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/model/extrafield/records/StrongEncryptionHeaderExtraFieldRecord.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/model/extrafield/records/StrongEncryptionHeaderExtraFieldRecord.java @@ -18,14 +18,15 @@ */ package ru.olegcherednik.zip4jvm.model.extrafield.records; -import lombok.Builder; -import lombok.Getter; -import org.apache.commons.lang3.NotImplementedException; import ru.olegcherednik.zip4jvm.crypto.strong.EncryptionAlgorithm; import ru.olegcherednik.zip4jvm.crypto.strong.Flags; import ru.olegcherednik.zip4jvm.io.out.data.DataOutput; import ru.olegcherednik.zip4jvm.model.extrafield.PkwareExtraField; +import lombok.Builder; +import lombok.Getter; +import org.apache.commons.lang3.NotImplementedException; + import java.io.IOException; /** @@ -38,7 +39,8 @@ @Builder public final class StrongEncryptionHeaderExtraFieldRecord implements PkwareExtraField.Record { - public static final StrongEncryptionHeaderExtraFieldRecord NULL = builder().encryptionAlgorithm(EncryptionAlgorithm.UNKNOWN).build(); + public static final StrongEncryptionHeaderExtraFieldRecord NULL = + builder().encryptionAlgorithm(EncryptionAlgorithm.UNKNOWN).build(); public static final int SIGNATURE = 0x0017; public static final int SIZE_FIELD = 2 + 2; // 4 bytes: signature + size diff --git a/src/main/java/ru/olegcherednik/zip4jvm/model/extrafield/records/UnknownExtraFieldRecord.java b/src/main/java/ru/olegcherednik/zip4jvm/model/extrafield/records/UnknownExtraFieldRecord.java index fdbcf9020..3abab43ac 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/model/extrafield/records/UnknownExtraFieldRecord.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/model/extrafield/records/UnknownExtraFieldRecord.java @@ -18,11 +18,12 @@ */ package ru.olegcherednik.zip4jvm.model.extrafield.records; +import ru.olegcherednik.zip4jvm.io.out.data.DataOutput; +import ru.olegcherednik.zip4jvm.model.extrafield.PkwareExtraField; + import lombok.Getter; import lombok.RequiredArgsConstructor; import org.apache.commons.lang3.ArrayUtils; -import ru.olegcherednik.zip4jvm.io.out.data.DataOutput; -import ru.olegcherednik.zip4jvm.model.extrafield.PkwareExtraField; import java.io.IOException; diff --git a/src/main/java/ru/olegcherednik/zip4jvm/model/settings/UnzipSettings.java b/src/main/java/ru/olegcherednik/zip4jvm/model/settings/UnzipSettings.java index 72c9018c9..80b9100e7 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/model/settings/UnzipSettings.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/model/settings/UnzipSettings.java @@ -18,15 +18,16 @@ */ package ru.olegcherednik.zip4jvm.model.settings; -import lombok.AccessLevel; -import lombok.Getter; -import lombok.NoArgsConstructor; -import org.apache.commons.lang3.ArrayUtils; import ru.olegcherednik.zip4jvm.model.Charsets; import ru.olegcherednik.zip4jvm.model.password.NoPasswordProvider; import ru.olegcherednik.zip4jvm.model.password.PasswordProvider; import ru.olegcherednik.zip4jvm.model.password.SinglePasswordProvider; +import lombok.AccessLevel; +import lombok.Getter; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.ArrayUtils; + import java.nio.charset.Charset; import java.util.Arrays; import java.util.Optional; diff --git a/src/main/java/ru/olegcherednik/zip4jvm/model/settings/ZipEntrySettings.java b/src/main/java/ru/olegcherednik/zip4jvm/model/settings/ZipEntrySettings.java index 85dd1d917..2dfd6d3d1 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/model/settings/ZipEntrySettings.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/model/settings/ZipEntrySettings.java @@ -18,17 +18,18 @@ */ package ru.olegcherednik.zip4jvm.model.settings; -import lombok.AccessLevel; -import lombok.Getter; -import lombok.NoArgsConstructor; -import org.apache.commons.lang3.ArrayUtils; -import org.apache.commons.lang3.StringUtils; import ru.olegcherednik.zip4jvm.exception.EmptyPasswordException; import ru.olegcherednik.zip4jvm.model.Compression; import ru.olegcherednik.zip4jvm.model.CompressionLevel; import ru.olegcherednik.zip4jvm.model.Encryption; import ru.olegcherednik.zip4jvm.model.ZipModel; +import lombok.AccessLevel; +import lombok.Getter; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.ArrayUtils; +import org.apache.commons.lang3.StringUtils; + import java.util.function.Function; /** @@ -122,7 +123,8 @@ public ZipEntrySettings.Builder password(char[] password) { public ZipEntrySettings.Builder comment(String comment) { if (StringUtils.length(comment) > ZipModel.MAX_COMMENT_SIZE) - throw new IllegalArgumentException("Entry comment should not exceed '" + ZipModel.MAX_COMMENT_SIZE + "' in length"); + throw new IllegalArgumentException("Entry comment should not exceed '" + + ZipModel.MAX_COMMENT_SIZE + "' in length"); this.comment = comment; return this; diff --git a/src/main/java/ru/olegcherednik/zip4jvm/model/settings/ZipInfoSettings.java b/src/main/java/ru/olegcherednik/zip4jvm/model/settings/ZipInfoSettings.java index 31464ae51..4070e3c9e 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/model/settings/ZipInfoSettings.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/model/settings/ZipInfoSettings.java @@ -18,13 +18,14 @@ */ package ru.olegcherednik.zip4jvm.model.settings; -import lombok.Getter; -import org.apache.commons.lang3.ArrayUtils; import ru.olegcherednik.zip4jvm.model.Charsets; import ru.olegcherednik.zip4jvm.model.password.NoPasswordProvider; import ru.olegcherednik.zip4jvm.model.password.PasswordProvider; import ru.olegcherednik.zip4jvm.model.password.SinglePasswordProvider; +import lombok.Getter; +import org.apache.commons.lang3.ArrayUtils; + import java.nio.charset.Charset; import java.util.Arrays; import java.util.Optional; diff --git a/src/main/java/ru/olegcherednik/zip4jvm/model/settings/ZipSettings.java b/src/main/java/ru/olegcherednik/zip4jvm/model/settings/ZipSettings.java index b3f2c288b..2aab23874 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/model/settings/ZipSettings.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/model/settings/ZipSettings.java @@ -18,12 +18,13 @@ */ package ru.olegcherednik.zip4jvm.model.settings; +import ru.olegcherednik.zip4jvm.model.ZipModel; +import ru.olegcherednik.zip4jvm.model.ZipSymlink; + import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; import org.apache.commons.lang3.StringUtils; -import ru.olegcherednik.zip4jvm.model.ZipModel; -import ru.olegcherednik.zip4jvm.model.ZipSymlink; import java.util.Optional; import java.util.function.Function; @@ -58,7 +59,8 @@ private ZipSettings(Builder builder) { } public Builder toBuilder() { - return builder().splitSize(splitSize).comment(comment).zip64(zip64).entrySettingsProvider(entrySettingsProvider); + return builder().splitSize(splitSize).comment(comment).zip64(zip64) + .entrySettingsProvider(entrySettingsProvider); } @NoArgsConstructor(access = AccessLevel.PRIVATE) @@ -77,7 +79,8 @@ public ZipSettings build() { public Builder splitSize(long splitSize) { if (splitSize > 0 && splitSize < ZipModel.MIN_SPLIT_SIZE) - throw new IllegalArgumentException("Zip split size should be <= 0 (no split) or >= " + ZipModel.MIN_SPLIT_SIZE); + throw new IllegalArgumentException( + "Zip split size should be <= 0 (no split) or >= " + ZipModel.MIN_SPLIT_SIZE); this.splitSize = splitSize; return this; @@ -85,7 +88,8 @@ public Builder splitSize(long splitSize) { public Builder comment(String comment) { if (StringUtils.length(comment) > ZipModel.MAX_COMMENT_SIZE) - throw new IllegalArgumentException("File comment should be " + ZipModel.MAX_COMMENT_SIZE + " characters maximum"); + throw new IllegalArgumentException( + "File comment should be " + ZipModel.MAX_COMMENT_SIZE + " characters maximum"); this.comment = StringUtils.isEmpty(comment) ? null : comment; return this; @@ -97,7 +101,8 @@ public Builder zip64(boolean zip64) { } public Builder entrySettingsProvider(Function entrySettingsProvider) { - this.entrySettingsProvider = Optional.ofNullable(entrySettingsProvider).orElse(ZipEntrySettings.DEFAULT_PROVIDER); + this.entrySettingsProvider = Optional.ofNullable(entrySettingsProvider) + .orElse(ZipEntrySettings.DEFAULT_PROVIDER); return this; } diff --git a/src/main/java/ru/olegcherednik/zip4jvm/model/src/PkwareSplitSrcZip.java b/src/main/java/ru/olegcherednik/zip4jvm/model/src/PkwareSplitSrcZip.java index b131e84f2..22b9e6d62 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/model/src/PkwareSplitSrcZip.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/model/src/PkwareSplitSrcZip.java @@ -18,11 +18,12 @@ */ package ru.olegcherednik.zip4jvm.model.src; -import org.apache.commons.io.FilenameUtils; import ru.olegcherednik.zip4jvm.exception.SplitPartNotFoundException; import ru.olegcherednik.zip4jvm.io.readers.ZipModelReader; import ru.olegcherednik.zip4jvm.utils.PathUtils; +import org.apache.commons.io.FilenameUtils; + import java.nio.file.Files; import java.nio.file.Path; import java.util.LinkedList; diff --git a/src/main/java/ru/olegcherednik/zip4jvm/model/src/SevenZipSplitSrcZip.java b/src/main/java/ru/olegcherednik/zip4jvm/model/src/SevenZipSplitSrcZip.java index 0160f8093..c63235976 100644 --- a/src/main/java/ru/olegcherednik/zip4jvm/model/src/SevenZipSplitSrcZip.java +++ b/src/main/java/ru/olegcherednik/zip4jvm/model/src/SevenZipSplitSrcZip.java @@ -18,11 +18,12 @@ */ package ru.olegcherednik.zip4jvm.model.src; -import org.apache.commons.io.FilenameUtils; -import org.apache.commons.lang3.math.NumberUtils; import ru.olegcherednik.zip4jvm.exception.SplitPartNotFoundException; import ru.olegcherednik.zip4jvm.utils.PathUtils; +import org.apache.commons.io.FilenameUtils; +import org.apache.commons.lang3.math.NumberUtils; + import java.nio.file.Files; import java.nio.file.Path; import java.util.LinkedList; @@ -30,7 +31,8 @@ import java.util.Set; /** - * 7-Zip has not standard split algorithm. It creates the whole zip file first and then split it with required part size. It has following naming + * 7-Zip has not standard split algorithm. It creates the whole zip file first and then split it with required part + * size. It has following naming * convention: *
  * filename.zip.001
diff --git a/src/main/java/ru/olegcherednik/zip4jvm/model/src/SrcZip.java b/src/main/java/ru/olegcherednik/zip4jvm/model/src/SrcZip.java
index 5c3a53dea..26fc22476 100644
--- a/src/main/java/ru/olegcherednik/zip4jvm/model/src/SrcZip.java
+++ b/src/main/java/ru/olegcherednik/zip4jvm/model/src/SrcZip.java
@@ -18,13 +18,14 @@
  */
 package ru.olegcherednik.zip4jvm.model.src;
 
+import ru.olegcherednik.zip4jvm.model.ZipModel;
+
 import lombok.AccessLevel;
 import lombok.Builder;
 import lombok.Getter;
 import org.apache.commons.io.FilenameUtils;
 import org.apache.commons.io.filefilter.RegexFileFilter;
 import org.apache.commons.lang3.ArrayUtils;
-import ru.olegcherednik.zip4jvm.model.ZipModel;
 
 import java.io.File;
 import java.io.FileFilter;
@@ -75,8 +76,11 @@ private static long calcSize(List disks) {
     }
 
     private static long calcSplitSize(List disks) {
-        return disks.size() == 1 ? ZipModel.NO_SPLIT :
-               disks.stream().mapToLong(Disk::getSize).max().orElse(ZipModel.NO_SPLIT);
+        return disks.size() == 1 ? ZipModel.NO_SPLIT
+                                 : disks.stream()
+                                        .mapToLong(Disk::getSize)
+                                        .max()
+                                        .orElse(ZipModel.NO_SPLIT);
     }
 
     public int getTotalDisks() {
diff --git a/src/main/java/ru/olegcherednik/zip4jvm/utils/BitUtils.java b/src/main/java/ru/olegcherednik/zip4jvm/utils/BitUtils.java
index dafb6e297..a7ac9e99d 100644
--- a/src/main/java/ru/olegcherednik/zip4jvm/utils/BitUtils.java
+++ b/src/main/java/ru/olegcherednik/zip4jvm/utils/BitUtils.java
@@ -95,6 +95,6 @@ public static int updateBits(int val, int bits, boolean value) {
     }
 
     public static byte updateBits(byte val, int bits, boolean value) {
-        return (byte)updateBits((int)val, bits, value);
+        return (byte) updateBits((int) val, bits, value);
     }
 }
diff --git a/src/main/java/ru/olegcherednik/zip4jvm/utils/EmptyInputStreamSupplier.java b/src/main/java/ru/olegcherednik/zip4jvm/utils/EmptyInputStreamSupplier.java
index e260d2d36..b6f4d01c1 100644
--- a/src/main/java/ru/olegcherednik/zip4jvm/utils/EmptyInputStreamSupplier.java
+++ b/src/main/java/ru/olegcherednik/zip4jvm/utils/EmptyInputStreamSupplier.java
@@ -18,12 +18,13 @@
  */
 package ru.olegcherednik.zip4jvm.utils;
 
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
 import ru.olegcherednik.zip4jvm.model.entry.ZipEntry;
 import ru.olegcherednik.zip4jvm.utils.function.ZipEntryInputStreamSupplier;
 import ru.olegcherednik.zip4jvm.utils.quitely.functions.InputStreamSupplier;
 
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+
 import java.io.IOException;
 import java.io.InputStream;
 
@@ -45,4 +46,5 @@ public InputStream get() throws IOException {
     public InputStream get(ZipEntry zipEntry) {
         return EmptyInputStream.INSTANCE;
     }
+
 }
diff --git a/src/main/java/ru/olegcherednik/zip4jvm/utils/PathUtils.java b/src/main/java/ru/olegcherednik/zip4jvm/utils/PathUtils.java
index 91d03b4cf..9330771dd 100644
--- a/src/main/java/ru/olegcherednik/zip4jvm/utils/PathUtils.java
+++ b/src/main/java/ru/olegcherednik/zip4jvm/utils/PathUtils.java
@@ -18,10 +18,11 @@
  */
 package ru.olegcherednik.zip4jvm.utils;
 
+import ru.olegcherednik.zip4jvm.exception.Zip4jvmException;
+
 import lombok.AccessLevel;
 import lombok.NoArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
-import ru.olegcherednik.zip4jvm.exception.Zip4jvmException;
 
 import java.io.IOException;
 import java.nio.file.Files;
diff --git a/src/main/java/ru/olegcherednik/zip4jvm/utils/ValidationUtils.java b/src/main/java/ru/olegcherednik/zip4jvm/utils/ValidationUtils.java
index a4845edc5..8ec3cf19b 100644
--- a/src/main/java/ru/olegcherednik/zip4jvm/utils/ValidationUtils.java
+++ b/src/main/java/ru/olegcherednik/zip4jvm/utils/ValidationUtils.java
@@ -18,13 +18,14 @@
  */
 package ru.olegcherednik.zip4jvm.utils;
 
+import ru.olegcherednik.zip4jvm.exception.PathNotExistsException;
+import ru.olegcherednik.zip4jvm.exception.RealBigZip64NotSupportedException;
+
 import lombok.AccessLevel;
 import lombok.NoArgsConstructor;
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang3.ArrayUtils;
 import org.apache.commons.lang3.StringUtils;
-import ru.olegcherednik.zip4jvm.exception.PathNotExistsException;
-import ru.olegcherednik.zip4jvm.exception.RealBigZip64NotSupportedException;
 
 import java.nio.file.Files;
 import java.nio.file.Path;
@@ -56,7 +57,8 @@ public static void realBigZip64(long value, String type) {
     }
 
     public static  T requireNotNull(T obj, String name) {
-        return Optional.ofNullable(obj).orElseThrow(() -> new IllegalArgumentException("Parameter should not be null: " + name));
+        return Optional.ofNullable(obj)
+                       .orElseThrow(() -> new IllegalArgumentException("Parameter should not be null: " + name));
     }
 
     public static void requireExists(Path path) {
diff --git a/src/main/java/ru/olegcherednik/zip4jvm/utils/ZipUtils.java b/src/main/java/ru/olegcherednik/zip4jvm/utils/ZipUtils.java
index c45aa5d6b..279d67922 100644
--- a/src/main/java/ru/olegcherednik/zip4jvm/utils/ZipUtils.java
+++ b/src/main/java/ru/olegcherednik/zip4jvm/utils/ZipUtils.java
@@ -18,14 +18,13 @@
  */
 package ru.olegcherednik.zip4jvm.utils;
 
+import ru.olegcherednik.zip4jvm.ZipFile;
+
 import lombok.AccessLevel;
 import lombok.NoArgsConstructor;
 import org.apache.commons.io.FilenameUtils;
 import org.apache.commons.io.IOUtils;
 import org.apache.commons.lang3.StringUtils;
-import ru.olegcherednik.zip4jvm.ZipFile;
-import ru.olegcherednik.zip4jvm.exception.Zip4jvmException;
-import ru.olegcherednik.zip4jvm.utils.quitely.functions.SupplierWithException;
 
 import java.io.IOException;
 import java.io.InputStream;
@@ -76,7 +75,8 @@ public static String getFileNameNoDirectoryMarker(String fileName) {
     }
 
     public static long copyLarge(InputStream input, OutputStream output) throws IOException {
-        try (InputStream in = input; OutputStream out = output) {
+        try (InputStream in = input;
+             OutputStream out = output) {
             return IOUtils.copyLarge(in, out);
         }
     }
diff --git a/src/main/java/ru/olegcherednik/zip4jvm/utils/function/FileReader.java b/src/main/java/ru/olegcherednik/zip4jvm/utils/function/FileReader.java
index 0b51e3cd3..ed8c68205 100644
--- a/src/main/java/ru/olegcherednik/zip4jvm/utils/function/FileReader.java
+++ b/src/main/java/ru/olegcherednik/zip4jvm/utils/function/FileReader.java
@@ -23,6 +23,7 @@
 import java.io.IOException;
 
 /**
+ * @param  the type of results supplied by this reader
  * @author Oleg Cherednik
  * @since 07.09.2019
  */
diff --git a/src/main/java/ru/olegcherednik/zip4jvm/utils/function/LocalSupplier.java b/src/main/java/ru/olegcherednik/zip4jvm/utils/function/LocalSupplier.java
index 470c355bd..5fb3db602 100644
--- a/src/main/java/ru/olegcherednik/zip4jvm/utils/function/LocalSupplier.java
+++ b/src/main/java/ru/olegcherednik/zip4jvm/utils/function/LocalSupplier.java
@@ -19,6 +19,7 @@
 package ru.olegcherednik.zip4jvm.utils.function;
 
 /**
+ * @param  the type of results supplied by this supplier
  * @author Oleg Cherednik
  * @since 19.10.2019
  */
diff --git a/src/main/java/ru/olegcherednik/zip4jvm/utils/function/Reader.java b/src/main/java/ru/olegcherednik/zip4jvm/utils/function/Reader.java
index 678d66c68..53e73bf77 100644
--- a/src/main/java/ru/olegcherednik/zip4jvm/utils/function/Reader.java
+++ b/src/main/java/ru/olegcherednik/zip4jvm/utils/function/Reader.java
@@ -21,6 +21,7 @@
 import ru.olegcherednik.zip4jvm.io.in.data.DataInput;
 
 /**
+ * @param  the type of results supplied by this reader
  * @author Oleg Cherednik
  * @since 20.12.2022
  */
diff --git a/src/main/java/ru/olegcherednik/zip4jvm/utils/quitely/Quietly.java b/src/main/java/ru/olegcherednik/zip4jvm/utils/quitely/Quietly.java
index fa371bdbc..0e8927cf7 100644
--- a/src/main/java/ru/olegcherednik/zip4jvm/utils/quitely/Quietly.java
+++ b/src/main/java/ru/olegcherednik/zip4jvm/utils/quitely/Quietly.java
@@ -18,13 +18,14 @@
  */
 package ru.olegcherednik.zip4jvm.utils.quitely;
 
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
 import ru.olegcherednik.zip4jvm.exception.Zip4jvmException;
 import ru.olegcherednik.zip4jvm.utils.quitely.functions.IntSupplierWithException;
 import ru.olegcherednik.zip4jvm.utils.quitely.functions.SupplierWithException;
 import ru.olegcherednik.zip4jvm.utils.quitely.functions.TaskWithException;
 
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+
 /**
  * @author Oleg Cherednik
  * @since 15.04.2023
diff --git a/src/main/java/ru/olegcherednik/zip4jvm/utils/quitely/functions/SupplierWithException.java b/src/main/java/ru/olegcherednik/zip4jvm/utils/quitely/functions/SupplierWithException.java
index 107030390..e9e3132a3 100644
--- a/src/main/java/ru/olegcherednik/zip4jvm/utils/quitely/functions/SupplierWithException.java
+++ b/src/main/java/ru/olegcherednik/zip4jvm/utils/quitely/functions/SupplierWithException.java
@@ -19,6 +19,7 @@
 package ru.olegcherednik.zip4jvm.utils.quitely.functions;
 
 /**
+ * @param  the type of results supplied by this supplier
  * @author Oleg Cherednik
  * @since 15.04.2023
  */
diff --git a/src/main/java/ru/olegcherednik/zip4jvm/utils/time/DosTimestampConverterUtils.java b/src/main/java/ru/olegcherednik/zip4jvm/utils/time/DosTimestampConverterUtils.java
index a3d61ea94..3462b58eb 100644
--- a/src/main/java/ru/olegcherednik/zip4jvm/utils/time/DosTimestampConverterUtils.java
+++ b/src/main/java/ru/olegcherednik/zip4jvm/utils/time/DosTimestampConverterUtils.java
@@ -35,8 +35,12 @@ public final class DosTimestampConverterUtils {
     /* @see {@link java.util.zip.ZipUtils#dosToJavaTime(long)} */
     @SuppressWarnings({ "deprecation", "MagicConstant" })
     public static long dosToJavaTime(int dtime) {
-        return new Date(((dtime >> 25) & 0x7F) + 80, ((dtime >> 21) & 0x0F) - 1, (dtime >> 16) & 0x1F, (dtime >> 11) & 0x1F,
-                (dtime >> 5) & 0x3F, (dtime << 1) & 0x3E).getTime();
+        return new Date(((dtime >> 25) & 0x7F) + 80,
+                        ((dtime >> 21) & 0x0F) - 1,
+                        (dtime >> 16) & 0x1F,
+                        (dtime >> 11) & 0x1F,
+                        (dtime >> 5) & 0x3F,
+                        (dtime << 1) & 0x3E).getTime();
     }
 
     /* @see {@link java.util.zip.ZipUtils#javaToDosTime(long)} */
diff --git a/src/main/java/ru/olegcherednik/zip4jvm/view/BaseView.java b/src/main/java/ru/olegcherednik/zip4jvm/view/BaseView.java
index 737e76fa2..749b1be68 100644
--- a/src/main/java/ru/olegcherednik/zip4jvm/view/BaseView.java
+++ b/src/main/java/ru/olegcherednik/zip4jvm/view/BaseView.java
@@ -18,9 +18,10 @@
  */
 package ru.olegcherednik.zip4jvm.view;
 
+import ru.olegcherednik.zip4jvm.model.block.Block;
+
 import lombok.Getter;
 import org.apache.commons.lang3.StringUtils;
-import ru.olegcherednik.zip4jvm.model.block.Block;
 
 import java.io.PrintStream;
 import java.util.Locale;
@@ -129,7 +130,9 @@ public void printValueWithLocation(PrintStream out, String valueName, Block bloc
         if (totalDisks > 1)
             printLine(out, String.format("  - disk (%04X):", block.getDiskNo()), block.getFileName());
 
-        printLine(out, "  - size:", String.format("%d bytes (%d record%s)", block.getSize(), total, total == 1 ? "" : "s"));
+        printLine(out,
+                  "  - size:",
+                  String.format("%d bytes (%d record%s)", block.getSize(), total, total == 1 ? "" : "s"));
     }
 
     @Deprecated
@@ -162,10 +165,10 @@ public static String signature(int signature) {
         StringBuilder buf = new StringBuilder();
 
         for (int i = 0; i < 4; i++) {
-            byte code = (byte)signature;
+            byte code = (byte) signature;
 
-            if (Character.isAlphabetic((char)code) || Character.isDigit((char)code))
-                buf.append((char)code);
+            if (Character.isAlphabetic((char) code) || Character.isDigit((char) code))
+                buf.append((char) code);
             else
                 buf.append(code < 10 ? "0" + code : code);
 
diff --git a/src/main/java/ru/olegcherednik/zip4jvm/view/CompressionMethodView.java b/src/main/java/ru/olegcherednik/zip4jvm/view/CompressionMethodView.java
index b970cf96a..88eeb5c28 100644
--- a/src/main/java/ru/olegcherednik/zip4jvm/view/CompressionMethodView.java
+++ b/src/main/java/ru/olegcherednik/zip4jvm/view/CompressionMethodView.java
@@ -23,8 +23,6 @@
 
 import java.io.PrintStream;
 
-import static ru.olegcherednik.zip4jvm.utils.ValidationUtils.requireNotNull;
-
 /**
  * @author Oleg Cherednik
  * @since 15.10.2019
@@ -34,15 +32,14 @@ public final class CompressionMethodView extends BaseView {
     private final CompressionMethod compressionMethod;
     private final GeneralPurposeFlag generalPurposeFlag;
 
-    public CompressionMethodView(int offs, int columnWidth) {
-        this(null, null, offs, columnWidth);
-    }
-
     public CompressionMethodView(CompressionMethod compressionMethod, int offs, int columnWidth) {
         this(compressionMethod, null, offs, columnWidth);
     }
 
-    public CompressionMethodView(CompressionMethod compressionMethod, GeneralPurposeFlag generalPurposeFlag, int offs, int columnWidth) {
+    public CompressionMethodView(CompressionMethod compressionMethod,
+                                 GeneralPurposeFlag generalPurposeFlag,
+                                 int offs,
+                                 int columnWidth) {
         super(offs, columnWidth);
         this.compressionMethod = compressionMethod;
         this.generalPurposeFlag = generalPurposeFlag;
@@ -53,16 +50,27 @@ public boolean printTextInfo(PrintStream out) {
         if (compressionMethod == null)
             printLine(out, "compression method (--):", "----");
         else {
-            printLine(out, String.format("compression method (%02d):", compressionMethod.getCode()), compressionMethod.getTitle());
+            printLine(out,
+                      String.format("compression method (%02d):", compressionMethod.getCode()),
+                      compressionMethod.getTitle());
 
             if (generalPurposeFlag != null) {
                 if (compressionMethod == CompressionMethod.FILE_IMPLODED) {
-                    printLine(out, "  size of sliding dictionary (implosion):", generalPurposeFlag.getSlidingDictionarySize().getTitle());
-                    printLine(out, "  number of Shannon-Fano trees (implosion):", generalPurposeFlag.getShannonFanoTreesNumber().getTitle());
+                    printLine(out,
+                              "  size of sliding dictionary (implosion):",
+                              generalPurposeFlag.getSlidingDictionarySize().getTitle());
+                    printLine(out,
+                              "  number of Shannon-Fano trees (implosion):",
+                              generalPurposeFlag.getShannonFanoTreesNumber().getTitle());
                 } else if (compressionMethod == CompressionMethod.LZMA)
-                    printLine(out, "  end-of-stream (EOS) marker:", generalPurposeFlag.isLzmaEosMarker() ? "yes" : "no");
-                else if (compressionMethod == CompressionMethod.DEFLATE || compressionMethod == CompressionMethod.ENHANCED_DEFLATE)
-                    printLine(out, "  compression sub-type (deflation):", generalPurposeFlag.getCompressionLevel().getTitle());
+                    printLine(out,
+                              "  end-of-stream (EOS) marker:",
+                              generalPurposeFlag.isLzmaEosMarker() ? "yes" : "no");
+                else if (compressionMethod == CompressionMethod.DEFLATE
+                        || compressionMethod == CompressionMethod.ENHANCED_DEFLATE)
+                    printLine(out,
+                              "  compression sub-type (deflation):",
+                              generalPurposeFlag.getCompressionLevel().getTitle());
             }
         }
 
diff --git a/src/main/java/ru/olegcherednik/zip4jvm/view/EndCentralDirectoryView.java b/src/main/java/ru/olegcherednik/zip4jvm/view/EndCentralDirectoryView.java
index b787db0fa..e97d2ad0b 100644
--- a/src/main/java/ru/olegcherednik/zip4jvm/view/EndCentralDirectoryView.java
+++ b/src/main/java/ru/olegcherednik/zip4jvm/view/EndCentralDirectoryView.java
@@ -57,7 +57,9 @@ public EndCentralDirectoryView(EndCentralDirectory ecd,
     public boolean printTextInfo(PrintStream out) {
         printTitle(out, EndCentralDirectory.SIGNATURE, "End of Central directory record", block);
         printLine(out, String.format("part number of this part (%04X):", ecd.getTotalDisks()), ecd.getTotalDisks() + 1);
-        printLine(out, String.format("part number of start of central dir (%04X):", ecd.getMainDiskNo()), ecd.getMainDiskNo() + 1);
+        printLine(out,
+                  String.format("part number of start of central dir (%04X):", ecd.getMainDiskNo()),
+                  ecd.getMainDiskNo() + 1);
         printLine(out, "number of entries in central dir in this part:", ecd.getDiskEntries());
         printTotalEntries(out);
         printLine(out, "size of central dir:", String.format("%d bytes", ecd.getCentralDirectorySize()));
diff --git a/src/main/java/ru/olegcherednik/zip4jvm/view/ExternalFileAttributesView.java b/src/main/java/ru/olegcherednik/zip4jvm/view/ExternalFileAttributesView.java
index f0dcf2d11..80ecd8ee6 100644
--- a/src/main/java/ru/olegcherednik/zip4jvm/view/ExternalFileAttributesView.java
+++ b/src/main/java/ru/olegcherednik/zip4jvm/view/ExternalFileAttributesView.java
@@ -46,7 +46,9 @@ public boolean printTextInfo(PrintStream out) {
 
         printLine(out, "external file attributes:", String.format("0x%08X", val));
         printLine(out, String.format("  WINDOWS   (0x%02X):", val & 0xFF), externalFileAttributes.getDetailsWin());
-        printLine(out, String.format("  POSIX (0x%06X):", val >> 8 & 0xFFFFFF), externalFileAttributes.getDetailsPosix());
+        printLine(out,
+                  String.format("  POSIX (0x%06X):", val >> 8 & 0xFFFFFF),
+                  externalFileAttributes.getDetailsPosix());
 
         return true;
     }
diff --git a/src/main/java/ru/olegcherednik/zip4jvm/view/GeneralPurposeFlagView.java b/src/main/java/ru/olegcherednik/zip4jvm/view/GeneralPurposeFlagView.java
index 50416250b..a1fe38d23 100644
--- a/src/main/java/ru/olegcherednik/zip4jvm/view/GeneralPurposeFlagView.java
+++ b/src/main/java/ru/olegcherednik/zip4jvm/view/GeneralPurposeFlagView.java
@@ -18,10 +18,11 @@
  */
 package ru.olegcherednik.zip4jvm.view;
 
-import org.apache.commons.lang3.StringUtils;
 import ru.olegcherednik.zip4jvm.model.CompressionMethod;
 import ru.olegcherednik.zip4jvm.model.GeneralPurposeFlag;
 
+import org.apache.commons.lang3.StringUtils;
+
 import java.io.PrintStream;
 import java.util.Objects;
 
@@ -34,7 +35,10 @@ public final class GeneralPurposeFlagView extends BaseView {
     private final GeneralPurposeFlag generalPurposeFlag;
     private final CompressionMethod compressionMethod;
 
-    public GeneralPurposeFlagView(GeneralPurposeFlag generalPurposeFlag, CompressionMethod compressionMethod, int offs, int columnWidth) {
+    public GeneralPurposeFlagView(GeneralPurposeFlag generalPurposeFlag,
+                                  CompressionMethod compressionMethod,
+                                  int offs,
+                                  int columnWidth) {
         super(offs, columnWidth);
         this.generalPurposeFlag = generalPurposeFlag;
         this.compressionMethod = compressionMethod;
@@ -48,13 +52,17 @@ public boolean printTextInfo(PrintStream out) {
         int val = generalPurposeFlag.getAsInt(compressionMethod);
 
         printLine(out, String.format("general purpose bit flag (0x%04X) (bit 15..0):", val),
-                String.format("%s.%s %s.%s",
-                        StringUtils.leftPad(Integer.toBinaryString(val >> 12 & 0xF), 4, '0'),
-                        StringUtils.leftPad(Integer.toBinaryString(val >> 8 & 0xF), 4, '0'),
-                        StringUtils.leftPad(Integer.toBinaryString(val >> 4 & 0xF), 4, '0'),
-                        StringUtils.leftPad(Integer.toBinaryString(val & 0xF), 4, '0')));
-        printLine(out, "  file security status  (bit 0):", generalPurposeFlag.isEncrypted() ? "encrypted" : "not encrypted");
-        printLine(out, "  data descriptor       (bit 3):", generalPurposeFlag.isDataDescriptorAvailable() ? "yes" : "no");
+                  String.format("%s.%s %s.%s",
+                                StringUtils.leftPad(Integer.toBinaryString(val >> 12 & 0xF), 4, '0'),
+                                StringUtils.leftPad(Integer.toBinaryString(val >> 8 & 0xF), 4, '0'),
+                                StringUtils.leftPad(Integer.toBinaryString(val >> 4 & 0xF), 4, '0'),
+                                StringUtils.leftPad(Integer.toBinaryString(val & 0xF), 4, '0')));
+        printLine(out,
+                  "  file security status  (bit 0):",
+                  generalPurposeFlag.isEncrypted() ? "encrypted" : "not encrypted");
+        printLine(out,
+                  "  data descriptor       (bit 3):",
+                  generalPurposeFlag.isDataDescriptorAvailable() ? "yes" : "no");
         printLine(out, "  strong encryption     (bit 6):", generalPurposeFlag.isStrongEncryption() ? "yes" : "no");
         printLine(out, "  UTF-8 names          (bit 11):", generalPurposeFlag.isUtf8() ? "yes" : "no");
 
diff --git a/src/main/java/ru/olegcherednik/zip4jvm/view/VersionView.java b/src/main/java/ru/olegcherednik/zip4jvm/view/VersionView.java
index ce35ce5b9..355ecbcd0 100644
--- a/src/main/java/ru/olegcherednik/zip4jvm/view/VersionView.java
+++ b/src/main/java/ru/olegcherednik/zip4jvm/view/VersionView.java
@@ -52,7 +52,9 @@ private boolean printVersionMadeBy(PrintStream out) {
         Version.FileSystem fileSystem = versionMadeBy.getFileSystem();
         int zipVersion = versionMadeBy.getZipSpecificationVersion();
 
-        printLine(out, String.format("version made by operating system (%02d):", fileSystem.getCode()), fileSystem.getTitle());
+        printLine(out,
+                  String.format("version made by operating system (%02d):", fileSystem.getCode()),
+                  fileSystem.getTitle());
         printLine(out, String.format("version made by zip software (%02d):", zipVersion), zipVersion / 10.);
 
         return true;
@@ -65,7 +67,9 @@ private boolean printVersionToExtract(PrintStream out) {
         Version.FileSystem fileSystem = versionToExtract.getFileSystem();
         int zipVersion = versionToExtract.getZipSpecificationVersion();
 
-        printLine(out, String.format("operat. system version needed to extract (%02d):", fileSystem.getCode()), fileSystem.getTitle());
+        printLine(out,
+                  String.format("operat. system version needed to extract (%02d):", fileSystem.getCode()),
+                  fileSystem.getTitle());
         printLine(out, String.format("unzip software version needed to extract (%02d):", zipVersion), zipVersion / 10.);
 
         return true;
diff --git a/src/main/java/ru/olegcherednik/zip4jvm/view/centraldirectory/DigitalSignatureView.java b/src/main/java/ru/olegcherednik/zip4jvm/view/centraldirectory/DigitalSignatureView.java
index 5965b1de1..c6364bef6 100644
--- a/src/main/java/ru/olegcherednik/zip4jvm/view/centraldirectory/DigitalSignatureView.java
+++ b/src/main/java/ru/olegcherednik/zip4jvm/view/centraldirectory/DigitalSignatureView.java
@@ -36,7 +36,11 @@ public final class DigitalSignatureView extends BaseView {
     private final CentralDirectory.DigitalSignature digitalSignature;
     private final Block block;
 
-    public DigitalSignatureView(CentralDirectory.DigitalSignature digitalSignature, Block block, int offs, int columnWidth, long totalDisks) {
+    public DigitalSignatureView(CentralDirectory.DigitalSignature digitalSignature,
+                                Block block,
+                                int offs,
+                                int columnWidth,
+                                long totalDisks) {
         super(offs, columnWidth, totalDisks);
         this.digitalSignature = requireNotNull(digitalSignature, "DigitalSignatureView.centralDirectory");
         this.block = requireNotNull(block, "DigitalSignatureView.block");
diff --git a/src/main/java/ru/olegcherednik/zip4jvm/view/centraldirectory/EncryptedCentralDirectoryView.java b/src/main/java/ru/olegcherednik/zip4jvm/view/centraldirectory/EncryptedCentralDirectoryView.java
index 47e22973d..1d674131b 100644
--- a/src/main/java/ru/olegcherednik/zip4jvm/view/centraldirectory/EncryptedCentralDirectoryView.java
+++ b/src/main/java/ru/olegcherednik/zip4jvm/view/centraldirectory/EncryptedCentralDirectoryView.java
@@ -49,7 +49,9 @@ public boolean printTextInfo(PrintStream out) {
         super.printTextInfo(out);
 
         if (extensibleDataSector != null) {
-            new CompressionMethodView(extensibleDataSector.getCompressionMethod(), offs, columnWidth).printTextInfo(out);
+            new CompressionMethodView(extensibleDataSector.getCompressionMethod(),
+                                      offs,
+                                      columnWidth).printTextInfo(out);
             printEncryptionAlgorithm(out);
         }
 
diff --git a/src/main/java/ru/olegcherednik/zip4jvm/view/centraldirectory/EncryptedFileHeaderView.java b/src/main/java/ru/olegcherednik/zip4jvm/view/centraldirectory/EncryptedFileHeaderView.java
index 3c345b40c..28770a3fa 100644
--- a/src/main/java/ru/olegcherednik/zip4jvm/view/centraldirectory/EncryptedFileHeaderView.java
+++ b/src/main/java/ru/olegcherednik/zip4jvm/view/centraldirectory/EncryptedFileHeaderView.java
@@ -43,7 +43,9 @@ public EncryptedFileHeaderView(CentralDirectory.FileHeader fileHeader,
 
     @Override
     protected void printLocationTitle(PrintStream out, Block block) {
-        printLine(out, "- location in central directory:", String.format("%1$d (0x%1$08X) bytes", block.getRelativeOffs()));
+        printLine(out,
+                  "- location in central directory:",
+                  String.format("%1$d (0x%1$08X) bytes", block.getRelativeOffs()));
     }
 
 }
diff --git a/src/main/java/ru/olegcherednik/zip4jvm/view/centraldirectory/FileHeaderView.java b/src/main/java/ru/olegcherednik/zip4jvm/view/centraldirectory/FileHeaderView.java
index ab7a46138..2530baef7 100644
--- a/src/main/java/ru/olegcherednik/zip4jvm/view/centraldirectory/FileHeaderView.java
+++ b/src/main/java/ru/olegcherednik/zip4jvm/view/centraldirectory/FileHeaderView.java
@@ -20,9 +20,9 @@
 
 import ru.olegcherednik.zip4jvm.model.CentralDirectory;
 import ru.olegcherednik.zip4jvm.model.CompressionMethod;
-import ru.olegcherednik.zip4jvm.model.extrafield.PkwareExtraField;
 import ru.olegcherednik.zip4jvm.model.GeneralPurposeFlag;
 import ru.olegcherednik.zip4jvm.model.block.CentralDirectoryBlock;
+import ru.olegcherednik.zip4jvm.model.extrafield.PkwareExtraField;
 import ru.olegcherednik.zip4jvm.view.BaseView;
 import ru.olegcherednik.zip4jvm.view.CompressionMethodView;
 import ru.olegcherednik.zip4jvm.view.ExternalFileAttributesView;
@@ -82,20 +82,34 @@ public boolean printTextInfo(PrintStream out) {
     }
 
     private void printTitle(PrintStream out) {
-        printSubTitle(out, CentralDirectory.FileHeader.SIGNATURE, pos, '[' + charset.name() + "] " + fileHeader.getFileName(), block);
+        printSubTitle(out,
+                      CentralDirectory.FileHeader.SIGNATURE,
+                      pos,
+                      '[' + charset.name() + "] " + fileHeader.getFileName(),
+                      block);
     }
 
     private void printLocation(PrintStream out) {
-        printLine(out, String.format("part number of this part (%04X):", fileHeader.getDiskNo()), String.valueOf(fileHeader.getDiskNo() + 1));
-        printLine(out, "relative offset of local header:", String.format("%1$d (0x%1$08X) bytes", fileHeader.getLocalFileHeaderRelativeOffs()));
+        printLine(out,
+                  String.format("part number of this part (%04X):", fileHeader.getDiskNo()),
+                  String.valueOf(fileHeader.getDiskNo() + 1));
+        printLine(out,
+                  "relative offset of local header:",
+                  String.format("%1$d (0x%1$08X) bytes", fileHeader.getLocalFileHeaderRelativeOffs()));
     }
 
     private void printVersion(PrintStream out) {
-        new VersionView(fileHeader.getVersionMadeBy(), fileHeader.getVersionToExtract(), offs, columnWidth).printTextInfo(out);
+        new VersionView(fileHeader.getVersionMadeBy(),
+                        fileHeader.getVersionToExtract(),
+                        offs,
+                        columnWidth).printTextInfo(out);
     }
 
     private void printGeneralPurposeFlag(PrintStream out) {
-        new GeneralPurposeFlagView(fileHeader.getGeneralPurposeFlag(), fileHeader.getCompressionMethod(), offs, columnWidth).printTextInfo(out);
+        new GeneralPurposeFlagView(fileHeader.getGeneralPurposeFlag(),
+                                   fileHeader.getCompressionMethod(),
+                                   offs,
+                                   columnWidth).printTextInfo(out);
     }
 
     private void printCompressionMethod(PrintStream out) {
diff --git a/src/main/java/ru/olegcherednik/zip4jvm/view/crypto/AesEncryptionHeaderView.java b/src/main/java/ru/olegcherednik/zip4jvm/view/crypto/AesEncryptionHeaderView.java
index c173366d3..7a024194d 100644
--- a/src/main/java/ru/olegcherednik/zip4jvm/view/crypto/AesEncryptionHeaderView.java
+++ b/src/main/java/ru/olegcherednik/zip4jvm/view/crypto/AesEncryptionHeaderView.java
@@ -35,7 +35,7 @@ final class AesEncryptionHeaderView extends BaseView {
     private final AesEncryptionHeaderBlock block;
     private final long pos;
 
-    public AesEncryptionHeaderView(AesEncryptionHeaderBlock block, long pos, int offs, int columnWidth, long totalDisks) {
+    AesEncryptionHeaderView(AesEncryptionHeaderBlock block, long pos, int offs, int columnWidth, long totalDisks) {
         super(offs, columnWidth, totalDisks);
         this.block = requireNotNull(block, "BlockAesEncryptionHeaderView.centralDirectory");
         this.pos = pos;
diff --git a/src/main/java/ru/olegcherednik/zip4jvm/view/crypto/EncryptionHeaderView.java b/src/main/java/ru/olegcherednik/zip4jvm/view/crypto/EncryptionHeaderView.java
index dd4a92bb8..9a5f34800 100644
--- a/src/main/java/ru/olegcherednik/zip4jvm/view/crypto/EncryptionHeaderView.java
+++ b/src/main/java/ru/olegcherednik/zip4jvm/view/crypto/EncryptionHeaderView.java
@@ -20,9 +20,9 @@
 
 import ru.olegcherednik.zip4jvm.crypto.strong.DecryptionHeader;
 import ru.olegcherednik.zip4jvm.model.block.crypto.AesEncryptionHeaderBlock;
-import ru.olegcherednik.zip4jvm.model.block.crypto.strong.DecryptionHeaderBlock;
 import ru.olegcherednik.zip4jvm.model.block.crypto.EncryptionHeaderBlock;
 import ru.olegcherednik.zip4jvm.model.block.crypto.PkwareEncryptionHeaderBlock;
+import ru.olegcherednik.zip4jvm.model.block.crypto.strong.DecryptionHeaderBlock;
 import ru.olegcherednik.zip4jvm.view.BaseView;
 import ru.olegcherednik.zip4jvm.view.crypto.strong.DecryptionHeaderView;
 
@@ -40,7 +40,11 @@ public final class EncryptionHeaderView extends BaseView {
     private final EncryptionHeaderBlock block;
     private final long pos;
 
-    public EncryptionHeaderView(DecryptionHeader decryptionHeader, EncryptionHeaderBlock block, long pos, int offs, int columnWidth,
+    public EncryptionHeaderView(DecryptionHeader decryptionHeader,
+                                EncryptionHeaderBlock block,
+                                long pos,
+                                int offs,
+                                int columnWidth,
                                 long totalDisks) {
         super(offs, columnWidth, totalDisks);
         this.decryptionHeader = decryptionHeader;
@@ -51,11 +55,24 @@ public EncryptionHeaderView(DecryptionHeader decryptionHeader, EncryptionHeaderB
     @Override
     public boolean printTextInfo(PrintStream out) {
         if (block instanceof AesEncryptionHeaderBlock)
-            new AesEncryptionHeaderView((AesEncryptionHeaderBlock)block, pos, offs, columnWidth, totalDisks).printTextInfo(out);
+            new AesEncryptionHeaderView((AesEncryptionHeaderBlock) block,
+                                        pos,
+                                        offs,
+                                        columnWidth,
+                                        totalDisks).printTextInfo(out);
         else if (block instanceof PkwareEncryptionHeaderBlock)
-            new PkwareEncryptionHeaderView((PkwareEncryptionHeaderBlock)block, pos, offs, columnWidth, totalDisks).printTextInfo(out);
+            new PkwareEncryptionHeaderView((PkwareEncryptionHeaderBlock) block,
+                                           pos,
+                                           offs,
+                                           columnWidth,
+                                           totalDisks).printTextInfo(out);
         else if (block instanceof DecryptionHeaderBlock)
-            new DecryptionHeaderView(decryptionHeader, (DecryptionHeaderBlock)block, pos, offs, columnWidth, totalDisks).printTextInfo(out);
+            new DecryptionHeaderView(decryptionHeader,
+                                     (DecryptionHeaderBlock) block,
+                                     pos,
+                                     offs,
+                                     columnWidth,
+                                     totalDisks).printTextInfo(out);
 
         return true;
     }
diff --git a/src/main/java/ru/olegcherednik/zip4jvm/view/crypto/PkwareEncryptionHeaderView.java b/src/main/java/ru/olegcherednik/zip4jvm/view/crypto/PkwareEncryptionHeaderView.java
index b2c98a581..d711dee66 100644
--- a/src/main/java/ru/olegcherednik/zip4jvm/view/crypto/PkwareEncryptionHeaderView.java
+++ b/src/main/java/ru/olegcherednik/zip4jvm/view/crypto/PkwareEncryptionHeaderView.java
@@ -35,7 +35,11 @@ final class PkwareEncryptionHeaderView extends BaseView {
     private final PkwareEncryptionHeaderBlock block;
     private final long pos;
 
-    public PkwareEncryptionHeaderView(PkwareEncryptionHeaderBlock block, long pos, int offs, int columnWidth, long totalDisks) {
+    PkwareEncryptionHeaderView(PkwareEncryptionHeaderBlock block,
+                               long pos,
+                               int offs,
+                               int columnWidth,
+                               long totalDisks) {
         super(offs, columnWidth, totalDisks);
         this.block = requireNotNull(block, "PkwareEncryptionHeaderView.centralDirectory");
         this.pos = pos;
diff --git a/src/main/java/ru/olegcherednik/zip4jvm/view/crypto/strong/DecryptionHeaderView.java b/src/main/java/ru/olegcherednik/zip4jvm/view/crypto/strong/DecryptionHeaderView.java
index 79ec77bc3..9ba07656a 100644
--- a/src/main/java/ru/olegcherednik/zip4jvm/view/crypto/strong/DecryptionHeaderView.java
+++ b/src/main/java/ru/olegcherednik/zip4jvm/view/crypto/strong/DecryptionHeaderView.java
@@ -18,7 +18,6 @@
  */
 package ru.olegcherednik.zip4jvm.view.crypto.strong;
 
-import org.apache.commons.lang3.ArrayUtils;
 import ru.olegcherednik.zip4jvm.crypto.strong.DecryptionHeader;
 import ru.olegcherednik.zip4jvm.crypto.strong.EncryptionAlgorithm;
 import ru.olegcherednik.zip4jvm.crypto.strong.Flags;
@@ -30,6 +29,8 @@
 import ru.olegcherednik.zip4jvm.view.SizeView;
 import ru.olegcherednik.zip4jvm.view.crypto.RecipientView;
 
+import org.apache.commons.lang3.ArrayUtils;
+
 import java.io.PrintStream;
 import java.util.Optional;
 
@@ -101,7 +102,8 @@ private void printFlags(PrintStream out) {
     }
 
     private void printEncryptedRandomData(PrintStream out) {
-        byte[] encryptedRandomData = Optional.ofNullable(decryptionHeader.getEncryptedRandomData()).orElse(ArrayUtils.EMPTY_BYTE_ARRAY);
+        byte[] encryptedRandomData = Optional.ofNullable(decryptionHeader.getEncryptedRandomData())
+                                             .orElse(ArrayUtils.EMPTY_BYTE_ARRAY);
         printLine(out, "length of encrypted random data:", String.format("%d bytes", encryptedRandomData.length));
         new ByteArrayHexView(encryptedRandomData, offs, columnWidth).printTextInfo(out);
     }
@@ -113,7 +115,8 @@ private void printHashAlgorithm(PrintStream out) {
     }
 
     private void printPasswordValidationData(PrintStream out) {
-        byte[] passwordValidationData = Optional.ofNullable(decryptionHeader.getPasswordValidationData()).orElse(ArrayUtils.EMPTY_BYTE_ARRAY);
+        byte[] passwordValidationData = Optional.ofNullable(decryptionHeader.getPasswordValidationData()).orElse(
+                ArrayUtils.EMPTY_BYTE_ARRAY);
         printLine(out, "password validation data:", String.format("%d bytes", passwordValidationData.length));
         new ByteArrayHexView(passwordValidationData, offs, columnWidth).printTextInfo(out);
     }
diff --git a/src/main/java/ru/olegcherednik/zip4jvm/view/entry/DataDescriptorView.java b/src/main/java/ru/olegcherednik/zip4jvm/view/entry/DataDescriptorView.java
index 055337f4d..bec4bbbb0 100644
--- a/src/main/java/ru/olegcherednik/zip4jvm/view/entry/DataDescriptorView.java
+++ b/src/main/java/ru/olegcherednik/zip4jvm/view/entry/DataDescriptorView.java
@@ -36,7 +36,12 @@ public final class DataDescriptorView extends BaseView {
     private final Block block;
     private final long pos;
 
-    public DataDescriptorView(DataDescriptor dataDescriptor, Block block, long pos, int offs, int columnWidth, long totalDisks) {
+    public DataDescriptorView(DataDescriptor dataDescriptor,
+                              Block block,
+                              long pos,
+                              int offs,
+                              int columnWidth,
+                              long totalDisks) {
         super(offs, columnWidth, totalDisks);
         this.dataDescriptor = dataDescriptor;
         this.block = block;
diff --git a/src/main/java/ru/olegcherednik/zip4jvm/view/entry/LocalFileHeaderView.java b/src/main/java/ru/olegcherednik/zip4jvm/view/entry/LocalFileHeaderView.java
index 955877a78..e485ce5fb 100644
--- a/src/main/java/ru/olegcherednik/zip4jvm/view/entry/LocalFileHeaderView.java
+++ b/src/main/java/ru/olegcherednik/zip4jvm/view/entry/LocalFileHeaderView.java
@@ -18,8 +18,6 @@
  */
 package ru.olegcherednik.zip4jvm.view.entry;
 
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
 import ru.olegcherednik.zip4jvm.model.Charsets;
 import ru.olegcherednik.zip4jvm.model.CompressionMethod;
 import ru.olegcherednik.zip4jvm.model.GeneralPurposeFlag;
@@ -38,6 +36,9 @@
 import ru.olegcherednik.zip4jvm.view.VersionView;
 import ru.olegcherednik.zip4jvm.view.extrafield.ExtraFieldView;
 
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+
 import java.io.PrintStream;
 import java.nio.charset.Charset;
 import java.util.Optional;
diff --git a/src/main/java/ru/olegcherednik/zip4jvm/view/extrafield/AesExtraFieldRecordView.java b/src/main/java/ru/olegcherednik/zip4jvm/view/extrafield/AesExtraFieldRecordView.java
index b293ac853..613bdf89f 100644
--- a/src/main/java/ru/olegcherednik/zip4jvm/view/extrafield/AesExtraFieldRecordView.java
+++ b/src/main/java/ru/olegcherednik/zip4jvm/view/extrafield/AesExtraFieldRecordView.java
@@ -18,11 +18,11 @@
  */
 package ru.olegcherednik.zip4jvm.view.extrafield;
 
-import ru.olegcherednik.zip4jvm.model.extrafield.records.AesExtraFieldRecord;
 import ru.olegcherednik.zip4jvm.model.CompressionMethod;
 import ru.olegcherednik.zip4jvm.model.GeneralPurposeFlag;
-import ru.olegcherednik.zip4jvm.view.CompressionMethodView;
+import ru.olegcherednik.zip4jvm.model.extrafield.records.AesExtraFieldRecord;
 import ru.olegcherednik.zip4jvm.view.BaseView;
+import ru.olegcherednik.zip4jvm.view.CompressionMethodView;
 
 /**
  * @author Oleg Cherednik
@@ -36,15 +36,18 @@ public static Builder builder() {
 
     private AesExtraFieldRecordView(Builder builder) {
         super(builder, (record, view, out) -> {
-            view.printLine(out, "  Encryption Tag Version:", String.format("%s-%d", record.getVendor(), record.getVersionNumber()));
+            view.printLine(out,
+                           "  Encryption Tag Version:",
+                           String.format("%s-%d", record.getVendor(), record.getVersionNumber()));
             view.printLine(out, "  Encryption Key Bits:", record.getStrength().getSize());
             compressionMethodView(record, view, builder).printTextInfo(out);
         });
     }
 
-    private static CompressionMethodView compressionMethodView(AesExtraFieldRecord record,
-                                                               BaseView view,
-                                                               Builder builder) {
+    private static CompressionMethodView compressionMethodView(
+            AesExtraFieldRecord record,
+            BaseView view,
+            Builder builder) {
         CompressionMethod compressionMethod = record.getCompressionMethod();
         GeneralPurposeFlag generalPurposeFlag = builder.getGeneralPurposeFlag();
         int offs = view.getOffs() + 2;
diff --git a/src/main/java/ru/olegcherednik/zip4jvm/view/extrafield/Builder.java b/src/main/java/ru/olegcherednik/zip4jvm/view/extrafield/Builder.java
index dca663232..79aaf6d53 100644
--- a/src/main/java/ru/olegcherednik/zip4jvm/view/extrafield/Builder.java
+++ b/src/main/java/ru/olegcherednik/zip4jvm/view/extrafield/Builder.java
@@ -18,16 +18,19 @@
  */
 package ru.olegcherednik.zip4jvm.view.extrafield;
 
-import lombok.Getter;
-import org.apache.commons.lang3.ArrayUtils;
 import ru.olegcherednik.zip4jvm.model.GeneralPurposeFlag;
 import ru.olegcherednik.zip4jvm.model.block.Block;
 import ru.olegcherednik.zip4jvm.model.extrafield.PkwareExtraField;
 
+import lombok.Getter;
+import org.apache.commons.lang3.ArrayUtils;
+
 import java.util.Objects;
 import java.util.function.Function;
 
 /**
+ * @param  {@link PkwareExtraField.Record}
+ * @param  {@link ExtraFieldRecordView}
  * @author Oleg Cherednik
  * @since 03.12.2019
  */
diff --git a/src/main/java/ru/olegcherednik/zip4jvm/view/extrafield/ExtendedTimestampExtraFieldRecordView.java b/src/main/java/ru/olegcherednik/zip4jvm/view/extrafield/ExtendedTimestampExtraFieldRecordView.java
index 8f7e61126..ad7f1f67c 100644
--- a/src/main/java/ru/olegcherednik/zip4jvm/view/extrafield/ExtendedTimestampExtraFieldRecordView.java
+++ b/src/main/java/ru/olegcherednik/zip4jvm/view/extrafield/ExtendedTimestampExtraFieldRecordView.java
@@ -31,7 +31,8 @@ public static Builder(ExtendedTimestampExtraFieldRecordView::new);
     }
 
-    private ExtendedTimestampExtraFieldRecordView(Builder builder) {
+    private ExtendedTimestampExtraFieldRecordView(
+            Builder builder) {
         super(builder, (record, view, out) -> {
             if (record.getFlag().isLastModificationTime() && record.getLastModificationTime() >= 0)
                 view.printLine(out, "  Last Modified Date:", ZipUtils.utcDateTime(record.getLastModificationTime()));
diff --git a/src/main/java/ru/olegcherednik/zip4jvm/view/extrafield/ExtraFieldRecordView.java b/src/main/java/ru/olegcherednik/zip4jvm/view/extrafield/ExtraFieldRecordView.java
index dfae6e6c8..90c6cdd1a 100644
--- a/src/main/java/ru/olegcherednik/zip4jvm/view/extrafield/ExtraFieldRecordView.java
+++ b/src/main/java/ru/olegcherednik/zip4jvm/view/extrafield/ExtraFieldRecordView.java
@@ -18,14 +18,15 @@
  */
 package ru.olegcherednik.zip4jvm.view.extrafield;
 
-import ru.olegcherednik.zip4jvm.model.extrafield.PkwareExtraField;
 import ru.olegcherednik.zip4jvm.model.block.Block;
+import ru.olegcherednik.zip4jvm.model.extrafield.PkwareExtraField;
 import ru.olegcherednik.zip4jvm.view.BaseView;
 
 import java.io.PrintStream;
 import java.util.regex.Pattern;
 
 /**
+ * @param  {@link PkwareExtraField.Record}
  * @author Oleg Cherednik
  * @since 24.11.2019
  */
diff --git a/src/main/java/ru/olegcherednik/zip4jvm/view/extrafield/ExtraFieldView.java b/src/main/java/ru/olegcherednik/zip4jvm/view/extrafield/ExtraFieldView.java
index b63b54b57..c44395804 100644
--- a/src/main/java/ru/olegcherednik/zip4jvm/view/extrafield/ExtraFieldView.java
+++ b/src/main/java/ru/olegcherednik/zip4jvm/view/extrafield/ExtraFieldView.java
@@ -20,7 +20,6 @@
 
 import ru.olegcherednik.zip4jvm.model.GeneralPurposeFlag;
 import ru.olegcherednik.zip4jvm.model.Zip64;
-import ru.olegcherednik.zip4jvm.model.block.Block;
 import ru.olegcherednik.zip4jvm.model.block.ExtraFieldBlock;
 import ru.olegcherednik.zip4jvm.model.extrafield.PkwareExtraField;
 import ru.olegcherednik.zip4jvm.model.extrafield.records.AesExtraFieldRecord;
@@ -48,21 +47,21 @@ public final class ExtraFieldView extends BaseView {
 
     private final Function> createView = record -> {
         if (record instanceof NtfsTimestampExtraFieldRecord)
-            return createView((NtfsTimestampExtraFieldRecord)record);
+            return createView((NtfsTimestampExtraFieldRecord) record);
         if (record instanceof InfoZipOldUnixExtraFieldRecord)
-            return createView((InfoZipOldUnixExtraFieldRecord)record);
+            return createView((InfoZipOldUnixExtraFieldRecord) record);
         if (record instanceof InfoZipNewUnixExtraFieldRecord)
-            return createView((InfoZipNewUnixExtraFieldRecord)record);
+            return createView((InfoZipNewUnixExtraFieldRecord) record);
         if (record instanceof ExtendedTimestampExtraFieldRecord)
-            return createView((ExtendedTimestampExtraFieldRecord)record);
+            return createView((ExtendedTimestampExtraFieldRecord) record);
         if (record instanceof Zip64.ExtendedInfo)
-            return createView((Zip64.ExtendedInfo)record);
+            return createView((Zip64.ExtendedInfo) record);
         if (record instanceof AesExtraFieldRecord)
-            return createView((AesExtraFieldRecord)record);
+            return createView((AesExtraFieldRecord) record);
         if (record instanceof StrongEncryptionHeaderExtraFieldRecord)
-            return createView((StrongEncryptionHeaderExtraFieldRecord)record);
+            return createView((StrongEncryptionHeaderExtraFieldRecord) record);
         if (record instanceof AlignmentExtraFieldRecord)
-            return createView((AlignmentExtraFieldRecord)record);
+            return createView((AlignmentExtraFieldRecord) record);
         return createView(record);
     };
 
@@ -159,11 +158,9 @@ private AlignmentExtraFieldRecordView createView(AlignmentExtraFieldRecord recor
     }
 
     private UnknownExtraFieldRecordView createView(PkwareExtraField.Record record) {
-        Block block = this.block.getRecord(record.getSignature());
-
         return UnknownExtraFieldRecordView.builder()
                                           .record(record)
-                                          .block(block)
+                                          .block(this.block.getRecord(record.getSignature()))
                                           .position(offs, columnWidth, totalDisks).build();
     }
 
diff --git a/src/main/java/ru/olegcherednik/zip4jvm/view/extrafield/InfoZipNewUnixExtraFieldRecordView.java b/src/main/java/ru/olegcherednik/zip4jvm/view/extrafield/InfoZipNewUnixExtraFieldRecordView.java
index 4709f761f..f60753d8a 100644
--- a/src/main/java/ru/olegcherednik/zip4jvm/view/extrafield/InfoZipNewUnixExtraFieldRecordView.java
+++ b/src/main/java/ru/olegcherednik/zip4jvm/view/extrafield/InfoZipNewUnixExtraFieldRecordView.java
@@ -18,10 +18,11 @@
  */
 package ru.olegcherednik.zip4jvm.view.extrafield;
 
-import org.apache.commons.lang3.StringUtils;
 import ru.olegcherednik.zip4jvm.model.extrafield.records.InfoZipNewUnixExtraFieldRecord;
-import ru.olegcherednik.zip4jvm.view.ByteArrayHexView;
 import ru.olegcherednik.zip4jvm.view.BaseView;
+import ru.olegcherednik.zip4jvm.view.ByteArrayHexView;
+
+import org.apache.commons.lang3.StringUtils;
 
 import java.io.PrintStream;
 
@@ -35,21 +36,24 @@ public static Builder(InfoZipNewUnixExtraFieldRecordView::new);
     }
 
-    private InfoZipNewUnixExtraFieldRecordView(Builder builder) {
+    private InfoZipNewUnixExtraFieldRecordView(
+            Builder builder) {
         super(builder, new PrintConsumer() {
             @Override
             public void print(InfoZipNewUnixExtraFieldRecord record, BaseView view, PrintStream out) {
                 InfoZipNewUnixExtraFieldRecord.Payload payload = record.getPayload();
 
                 if (payload instanceof InfoZipNewUnixExtraFieldRecord.VersionOnePayload)
-                    print((InfoZipNewUnixExtraFieldRecord.VersionOnePayload)record.getPayload(), view, out);
+                    print((InfoZipNewUnixExtraFieldRecord.VersionOnePayload) record.getPayload(), view, out);
                 else if (payload instanceof InfoZipNewUnixExtraFieldRecord.VersionUnknownPayload)
-                    print((InfoZipNewUnixExtraFieldRecord.VersionUnknownPayload)record.getPayload(), view, out);
+                    print((InfoZipNewUnixExtraFieldRecord.VersionUnknownPayload) record.getPayload(), view, out);
 
                 // TODO add final else
             }
 
-            private void print(InfoZipNewUnixExtraFieldRecord.VersionOnePayload payload, BaseView view, PrintStream out) {
+            private void print(InfoZipNewUnixExtraFieldRecord.VersionOnePayload payload,
+                               BaseView view,
+                               PrintStream out) {
                 view.printLine(out, "  version:", String.valueOf(payload.getVersion()));
 
                 if (StringUtils.isNotBlank(payload.getUid()))
@@ -58,7 +62,9 @@ private void print(InfoZipNewUnixExtraFieldRecord.VersionOnePayload payload, Bas
                     view.printLine(out, "  Group Identifier (GID):", payload.getGid());
             }
 
-            private void print(InfoZipNewUnixExtraFieldRecord.VersionUnknownPayload payload, BaseView view, PrintStream out) {
+            private void print(InfoZipNewUnixExtraFieldRecord.VersionUnknownPayload payload,
+                               BaseView view,
+                               PrintStream out) {
                 view.printLine(out, "  version:", String.format("%d (unknown)", payload.getVersion()));
                 new ByteArrayHexView(payload.getData(), view.getOffs(), view.getColumnWidth()).printTextInfo(out);
             }
diff --git a/src/main/java/ru/olegcherednik/zip4jvm/view/extrafield/InfoZipOldUnixExtraFieldRecordView.java b/src/main/java/ru/olegcherednik/zip4jvm/view/extrafield/InfoZipOldUnixExtraFieldRecordView.java
index 89b3a20a8..c9e5425b7 100644
--- a/src/main/java/ru/olegcherednik/zip4jvm/view/extrafield/InfoZipOldUnixExtraFieldRecordView.java
+++ b/src/main/java/ru/olegcherednik/zip4jvm/view/extrafield/InfoZipOldUnixExtraFieldRecordView.java
@@ -33,7 +33,8 @@ public static Builder(InfoZipOldUnixExtraFieldRecordView::new);
     }
 
-    private InfoZipOldUnixExtraFieldRecordView(Builder builder) {
+    private InfoZipOldUnixExtraFieldRecordView(
+            Builder builder) {
         super(builder, (record, view, out) -> {
             view.printLine(out, "  Last Modified Date:", ZipUtils.utcDateTime(record.getLastModificationTime()));
             view.printLine(out, "  Last Accessed Date:", ZipUtils.utcDateTime(record.getLastAccessTime()));
diff --git a/src/main/java/ru/olegcherednik/zip4jvm/view/extrafield/NtfsTimestampExtraFieldRecordView.java b/src/main/java/ru/olegcherednik/zip4jvm/view/extrafield/NtfsTimestampExtraFieldRecordView.java
index db1590271..7421807e1 100644
--- a/src/main/java/ru/olegcherednik/zip4jvm/view/extrafield/NtfsTimestampExtraFieldRecordView.java
+++ b/src/main/java/ru/olegcherednik/zip4jvm/view/extrafield/NtfsTimestampExtraFieldRecordView.java
@@ -20,8 +20,8 @@
 
 import ru.olegcherednik.zip4jvm.model.extrafield.records.NtfsTimestampExtraFieldRecord;
 import ru.olegcherednik.zip4jvm.utils.ZipUtils;
-import ru.olegcherednik.zip4jvm.view.ByteArrayHexView;
 import ru.olegcherednik.zip4jvm.view.BaseView;
+import ru.olegcherednik.zip4jvm.view.ByteArrayHexView;
 
 import java.io.PrintStream;
 
@@ -35,7 +35,8 @@ public static Builder(NtfsTimestampExtraFieldRecordView::new);
     }
 
-    private NtfsTimestampExtraFieldRecordView(Builder builder) {
+    private NtfsTimestampExtraFieldRecordView(
+            Builder builder) {
         super(builder, new PrintConsumer() {
             @Override
             public void print(NtfsTimestampExtraFieldRecord record, BaseView view, PrintStream out) {
@@ -43,22 +44,26 @@ public void print(NtfsTimestampExtraFieldRecord record, BaseView view, PrintStre
 
                 for (NtfsTimestampExtraFieldRecord.Tag tag : record.getTags()) {
                     if (tag instanceof NtfsTimestampExtraFieldRecord.OneTag)
-                        print((NtfsTimestampExtraFieldRecord.OneTag)tag, view, out);
+                        print((NtfsTimestampExtraFieldRecord.OneTag) tag, view, out);
                     else if (tag instanceof NtfsTimestampExtraFieldRecord.UnknownTag)
-                        print((NtfsTimestampExtraFieldRecord.UnknownTag)tag, view, out);
+                        print((NtfsTimestampExtraFieldRecord.UnknownTag) tag, view, out);
                     // TODO tag could be unknown for view
                 }
             }
 
             private void print(NtfsTimestampExtraFieldRecord.OneTag tag, BaseView view, PrintStream out) {
-                view.printLine(out, String.format("  (0x%04X) Tag1:", tag.getSignature()), String.format("%d bytes", tag.getSize()));
+                view.printLine(out,
+                               String.format("  (0x%04X) Tag1:", tag.getSignature()),
+                               String.format("%d bytes", tag.getSize()));
                 view.printLine(out, "    Creation Date:", ZipUtils.utcDateTime(tag.getCreationTime()));
                 view.printLine(out, "    Last Modified Date:", ZipUtils.utcDateTime(tag.getLastModificationTime()));
                 view.printLine(out, "    Last Accessed Date:", ZipUtils.utcDateTime(tag.getLastAccessTime()));
             }
 
             private void print(NtfsTimestampExtraFieldRecord.UnknownTag tag, BaseView view, PrintStream out) {
-                view.printLine(out, String.format("  (0x%04X) Unknown Tag:", tag.getSignature()), String.format("%d bytes", tag.getSize()));
+                view.printLine(out,
+                               String.format("  (0x%04X) Unknown Tag:", tag.getSignature()),
+                               String.format("%d bytes", tag.getSize()));
                 new ByteArrayHexView(tag.getData(), view.getOffs(), view.getColumnWidth()).printTextInfo(out);
             }
         });
diff --git a/src/main/java/ru/olegcherednik/zip4jvm/view/extrafield/PrintConsumer.java b/src/main/java/ru/olegcherednik/zip4jvm/view/extrafield/PrintConsumer.java
index 3b8eb703f..321a33739 100644
--- a/src/main/java/ru/olegcherednik/zip4jvm/view/extrafield/PrintConsumer.java
+++ b/src/main/java/ru/olegcherednik/zip4jvm/view/extrafield/PrintConsumer.java
@@ -24,6 +24,8 @@
 import java.io.PrintStream;
 
 /**
+ * @param  {@link PkwareExtraField.Record}
+ * @param  {@link BaseView}
  * @author Oleg Cherednik
  * @since 02.12.2019
  */
diff --git a/src/main/java/ru/olegcherednik/zip4jvm/view/extrafield/StrongEncryptionHeaderExtraFieldRecordView.java b/src/main/java/ru/olegcherednik/zip4jvm/view/extrafield/StrongEncryptionHeaderExtraFieldRecordView.java
index 3ef7c7039..20fb78991 100644
--- a/src/main/java/ru/olegcherednik/zip4jvm/view/extrafield/StrongEncryptionHeaderExtraFieldRecordView.java
+++ b/src/main/java/ru/olegcherednik/zip4jvm/view/extrafield/StrongEncryptionHeaderExtraFieldRecordView.java
@@ -27,19 +27,24 @@
  * @author Oleg Cherednik
  * @since 16.02.2020
  */
-final class StrongEncryptionHeaderExtraFieldRecordView extends ExtraFieldRecordView {
+final class StrongEncryptionHeaderExtraFieldRecordView
+        extends ExtraFieldRecordView {
 
-    public static Builder builder() {
+    public static Builder builder() {
         return new Builder<>(StrongEncryptionHeaderExtraFieldRecordView::new);
     }
 
-    private StrongEncryptionHeaderExtraFieldRecordView(Builder builder) {
+    private StrongEncryptionHeaderExtraFieldRecordView(
+            Builder builder) {
         super(builder, (record, view, out) -> {
             EncryptionAlgorithm encryptionAlgorithm = record.getEncryptionAlgorithm();
             Flags flags = record.getFlags();
 
             view.printLine(out, "  format:", record.getFormat());
-            view.printLine(out, String.format("  encryption algorithm (0x%04X):", encryptionAlgorithm.getCode()), encryptionAlgorithm.getTitle());
+            view.printLine(out,
+                           String.format("  encryption algorithm (0x%04X):", encryptionAlgorithm.getCode()),
+                           encryptionAlgorithm.getTitle());
             view.printLine(out, "  encryption key bits:", record.getBitLength());
             view.printLine(out, String.format("  flags (0x%02X):", flags.getCode()), flags.getTitle());
             view.printLine(out, "  encryption variable data:", String.format("%d bytes", record.getUnknown().length));
diff --git a/src/main/java/ru/olegcherednik/zip4jvm/view/extrafield/UnknownExtraFieldRecordView.java b/src/main/java/ru/olegcherednik/zip4jvm/view/extrafield/UnknownExtraFieldRecordView.java
index 69715befd..298921dab 100644
--- a/src/main/java/ru/olegcherednik/zip4jvm/view/extrafield/UnknownExtraFieldRecordView.java
+++ b/src/main/java/ru/olegcherednik/zip4jvm/view/extrafield/UnknownExtraFieldRecordView.java
@@ -32,7 +32,11 @@ public static Builder buil
     }
 
     private UnknownExtraFieldRecordView(Builder builder) {
-        super(builder, (record, view, out) -> new ByteArrayHexView(builder.getData(), view.getOffs(), view.getColumnWidth()).printTextInfo(out));
+        super(builder,
+              (record, view, out) -> new ByteArrayHexView(builder.getData(),
+                                                          view.getOffs(),
+                                                          view.getColumnWidth()).printTextInfo(out));
     }
+
 }
 
diff --git a/src/main/java/ru/olegcherednik/zip4jvm/view/extrafield/Zip64ExtendedInfoView.java b/src/main/java/ru/olegcherednik/zip4jvm/view/extrafield/Zip64ExtendedInfoView.java
index a223df395..d7eca0145 100644
--- a/src/main/java/ru/olegcherednik/zip4jvm/view/extrafield/Zip64ExtendedInfoView.java
+++ b/src/main/java/ru/olegcherednik/zip4jvm/view/extrafield/Zip64ExtendedInfoView.java
@@ -18,8 +18,8 @@
  */
 package ru.olegcherednik.zip4jvm.view.extrafield;
 
-import ru.olegcherednik.zip4jvm.model.extrafield.PkwareExtraField;
 import ru.olegcherednik.zip4jvm.model.Zip64;
+import ru.olegcherednik.zip4jvm.model.extrafield.PkwareExtraField;
 
 /**
  * @author Oleg Cherednik
@@ -34,14 +34,21 @@ public static Builder builder() {
     private Zip64ExtendedInfoView(Builder builder) {
         super(builder, (record, view, out) -> {
             if (record.getUncompressedSize() != PkwareExtraField.NO_DATA)
-                view.printLine(out, "  original compressed size:", String.format("%d bytes", record.getUncompressedSize()));
+                view.printLine(out,
+                               "  original compressed size:",
+                               String.format("%d bytes", record.getUncompressedSize()));
             if (record.getCompressedSize() != PkwareExtraField.NO_DATA)
-                view.printLine(out, "  original uncompressed size:", String.format("%d bytes", record.getCompressedSize()));
+                view.printLine(out,
+                               "  original uncompressed size:",
+                               String.format("%d bytes", record.getCompressedSize()));
             if (record.getLocalFileHeaderRelativeOffs() != PkwareExtraField.NO_DATA)
                 view.printLine(out, "  original relative offset of local header:",
-                        String.format("%1$d (0x%1$08X) bytes", record.getLocalFileHeaderRelativeOffs()));
+                               String.format("%1$d (0x%1$08X) bytes", record.getLocalFileHeaderRelativeOffs()));
             if (record.getDiskNo() != PkwareExtraField.NO_DATA)
-                view.printLine(out, String.format("  original part number of this part (%04X):", record.getDiskNo()), record.getDiskNo());
+                view.printLine(out,
+                               String.format("  original part number of this part (%04X):", record.getDiskNo()),
+                               record.getDiskNo());
         });
     }
+
 }
diff --git a/src/main/java/ru/olegcherednik/zip4jvm/view/zip64/EndCentralDirectoryLocatorView.java b/src/main/java/ru/olegcherednik/zip4jvm/view/zip64/EndCentralDirectoryLocatorView.java
index 55e9ded76..60f261f2e 100644
--- a/src/main/java/ru/olegcherednik/zip4jvm/view/zip64/EndCentralDirectoryLocatorView.java
+++ b/src/main/java/ru/olegcherednik/zip4jvm/view/zip64/EndCentralDirectoryLocatorView.java
@@ -48,7 +48,9 @@ public EndCentralDirectoryLocatorView(Zip64.EndCentralDirectoryLocator locator,
     @Override
     public boolean printTextInfo(PrintStream out) {
         printTitle(out, Zip64.EndCentralDirectoryLocator.SIGNATURE, "ZIP64 End of Central directory locator", block);
-        printLine(out, String.format("part number of new-end-of-central-dir (%04X):", locator.getMainDiskNo()), locator.getMainDiskNo() + 1);
+        printLine(out,
+                  String.format("part number of new-end-of-central-dir (%04X):", locator.getMainDiskNo()),
+                  locator.getMainDiskNo() + 1);
         printLine(out, "relative offset of new-end-of-central-dir:",
                   String.format("%1$d (0x%1$08X) bytes", locator.getEndCentralDirectoryRelativeOffs()));
         printLine(out, "total number of parts in archive:", locator.getTotalDisks());
diff --git a/src/main/java/ru/olegcherednik/zip4jvm/view/zip64/EndCentralDirectoryView.java b/src/main/java/ru/olegcherednik/zip4jvm/view/zip64/EndCentralDirectoryView.java
index cc5727770..8235f09d0 100644
--- a/src/main/java/ru/olegcherednik/zip4jvm/view/zip64/EndCentralDirectoryView.java
+++ b/src/main/java/ru/olegcherednik/zip4jvm/view/zip64/EndCentralDirectoryView.java
@@ -49,14 +49,20 @@ public EndCentralDirectoryView(Zip64.EndCentralDirectory ecd,
     @Override
     public boolean printTextInfo(PrintStream out) {
         printTitle(out, Zip64.EndCentralDirectory.SIGNATURE, "ZIP64 End of Central directory record", block);
-        printLine(out, "number of bytes in rest of record:", String.format("%d bytes", ecd.getEndCentralDirectorySize()));
+        printLine(out,
+                  "number of bytes in rest of record:",
+                  String.format("%d bytes", ecd.getEndCentralDirectorySize()));
         printVersion(out);
         printLine(out, String.format("part number of this part (%04d):", ecd.getDiskNo()), ecd.getDiskNo() + 1);
-        printLine(out, String.format("part number of start of central dir (%04d):", ecd.getMainDiskNo()), ecd.getMainDiskNo() + 1);
+        printLine(out,
+                  String.format("part number of start of central dir (%04d):", ecd.getMainDiskNo()),
+                  ecd.getMainDiskNo() + 1);
         printLine(out, "number of entries in central dir in this part:", ecd.getDiskEntries());
         printLine(out, "total number of entries in central dir:", ecd.getTotalEntries());
         printLine(out, "size of central dir:", String.format("%d bytes", ecd.getCentralDirectorySize()));
-        printLine(out, "relative offset of central dir:", String.format("%1$d (0x%1$08X) bytes", ecd.getCentralDirectoryRelativeOffs()));
+        printLine(out,
+                  "relative offset of central dir:",
+                  String.format("%1$d (0x%1$08X) bytes", ecd.getCentralDirectoryRelativeOffs()));
         return true;
     }
 
diff --git a/src/main/java/ru/olegcherednik/zip4jvm/view/zip64/ExtensibleDataSectorView.java b/src/main/java/ru/olegcherednik/zip4jvm/view/zip64/ExtensibleDataSectorView.java
index c45adc73f..8d4eeff1c 100644
--- a/src/main/java/ru/olegcherednik/zip4jvm/view/zip64/ExtensibleDataSectorView.java
+++ b/src/main/java/ru/olegcherednik/zip4jvm/view/zip64/ExtensibleDataSectorView.java
@@ -18,7 +18,6 @@
  */
 package ru.olegcherednik.zip4jvm.view.zip64;
 
-import org.apache.commons.lang3.ArrayUtils;
 import ru.olegcherednik.zip4jvm.crypto.strong.EncryptionAlgorithm;
 import ru.olegcherednik.zip4jvm.crypto.strong.Flags;
 import ru.olegcherednik.zip4jvm.crypto.strong.HashAlgorithm;
@@ -30,6 +29,8 @@
 import ru.olegcherednik.zip4jvm.view.CompressionMethodView;
 import ru.olegcherednik.zip4jvm.view.SizeView;
 
+import org.apache.commons.lang3.ArrayUtils;
+
 import java.io.PrintStream;
 import java.util.Optional;
 
@@ -49,7 +50,8 @@ public ExtensibleDataSectorView(Zip64.ExtensibleDataSector extensibleDataSector,
                                     int offs,
                                     int columnWidth) {
         super(offs, columnWidth);
-        this.extensibleDataSector = requireNotNull(extensibleDataSector, "ExtensibleDataSectorView.extensibleDataSector");
+        this.extensibleDataSector = requireNotNull(extensibleDataSector,
+                                                   "ExtensibleDataSectorView.extensibleDataSector");
         this.block = requireNotNull(block, "ExtensibleDataSectorView.block");
     }
 
@@ -72,8 +74,12 @@ private void printCompressionMethod(PrintStream out) {
     }
 
     private void printSize(PrintStream out) {
-        new SizeView("compressed size:", extensibleDataSector.getCompressedSize(), offs, columnWidth).printTextInfo(out);
-        new SizeView("uncompressed size:", extensibleDataSector.getUncompressedSize(), offs, columnWidth).printTextInfo(out);
+        new SizeView("compressed size:",
+                     extensibleDataSector.getCompressedSize(),
+                     offs,
+                     columnWidth).printTextInfo(out);
+        new SizeView("uncompressed size:", extensibleDataSector.getUncompressedSize(), offs, columnWidth).printTextInfo(
+                out);
     }
 
     private void printEncryptionAlgorithm(PrintStream out) {
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/Foo.java b/src/test/java/ru/olegcherednik/zip4jvm/Foo.java
index 1a43231d0..6defd9532 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/Foo.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/Foo.java
@@ -18,8 +18,6 @@
  */
 package ru.olegcherednik.zip4jvm;
 
-import ru.olegcherednik.zip4jvm.model.password.PasswordProvider;
-import ru.olegcherednik.zip4jvm.model.settings.UnzipSettings;
 import ru.olegcherednik.zip4jvm.model.settings.ZipInfoSettings;
 
 import java.io.IOException;
@@ -27,12 +25,11 @@
 import java.nio.file.Paths;
 import java.util.concurrent.TimeUnit;
 
-import static ru.olegcherednik.zip4jvm.Zip4jvmSuite.password;
-
 /**
  * @author Oleg Cherednik
  * @since 19.10.2022
  */
+@SuppressWarnings("all")
 public class Foo {
 
     public static void main(String[] args) throws IOException {
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/ModifyCommentTest.java b/src/test/java/ru/olegcherednik/zip4jvm/ModifyCommentTest.java
index 0b0e52957..fef3439de 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/ModifyCommentTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/ModifyCommentTest.java
@@ -18,16 +18,17 @@
  */
 package ru.olegcherednik.zip4jvm;
 
-import org.apache.commons.lang3.StringUtils;
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.model.Compression;
 import ru.olegcherednik.zip4jvm.model.CompressionLevel;
 import ru.olegcherednik.zip4jvm.model.ZipModel;
 import ru.olegcherednik.zip4jvm.model.settings.ZipEntrySettings;
 import ru.olegcherednik.zip4jvm.model.settings.ZipSettings;
 
+import org.apache.commons.lang3.StringUtils;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Path;
@@ -59,12 +60,14 @@ public static void removeDir() throws IOException {
     }
 
     public void shouldCreateNewZipWithComment() throws IOException {
-        ZipSettings settings = ZipSettings.builder()
-                                          .entrySettingsProvider(fileName ->
-                                                                         ZipEntrySettings.builder()
-                                                                                         .compression(Compression.DEFLATE, CompressionLevel.NORMAL)
-                                                                                         .build())
-                                          .comment("Oleg Cherednik - Олег Чередник").build();
+        ZipSettings settings = ZipSettings
+                .builder()
+                .entrySettingsProvider(fileName ->
+                                               ZipEntrySettings.builder()
+                                                               .compression(Compression.DEFLATE,
+                                                                            CompressionLevel.NORMAL)
+                                                               .build())
+                .comment("Oleg Cherednik - Олег Чередник").build();
         ZipIt.zip(zip).settings(settings).add(fileOlegCherednik);
         assertThatZipFile(zip).exists().hasComment("Oleg Cherednik - Олег Чередник");
     }
@@ -90,20 +93,20 @@ public void shouldAddCommentToEncryptedZip() throws IOException {
     }
 
     public void shouldSetCommentWithMaxLength() throws IOException {
-        Path zip = Zip4jvmSuite.subDirNameAsMethodName(rootDir).resolve("src.zip");
-        Files.createDirectories(zip.getParent());
-        Files.copy(zipDeflateSolid, zip);
+        Path srcZip = Zip4jvmSuite.subDirNameAsMethodName(rootDir).resolve("src.zip");
+        Files.createDirectories(srcZip.getParent());
+        Files.copy(zipDeflateSolid, srcZip);
 
-        ZipMisc.zip(zip).setComment(StringUtils.repeat("_", ZipModel.MAX_COMMENT_SIZE));
-        assertThatZipFile(zip).hasCommentSize(ZipModel.MAX_COMMENT_SIZE);
+        ZipMisc.zip(srcZip).setComment(StringUtils.repeat("_", ZipModel.MAX_COMMENT_SIZE));
+        assertThatZipFile(srcZip).hasCommentSize(ZipModel.MAX_COMMENT_SIZE);
     }
 
     public void shouldThrowExceptionWhenCommentIsOverMaxLength() throws IOException {
-        Path zip = Zip4jvmSuite.subDirNameAsMethodName(rootDir).resolve("src.zip");
-        Files.createDirectories(zip.getParent());
-        Files.copy(zipDeflateSolid, zip);
+        Path srcZip = Zip4jvmSuite.subDirNameAsMethodName(rootDir).resolve("src.zip");
+        Files.createDirectories(srcZip.getParent());
+        Files.copy(zipDeflateSolid, srcZip);
 
-        assertThatThrownBy(() -> ZipMisc.zip(zip).setComment(StringUtils.repeat("_", ZipModel.MAX_COMMENT_SIZE + 1)))
+        assertThatThrownBy(() -> ZipMisc.zip(srcZip).setComment(StringUtils.repeat("_", ZipModel.MAX_COMMENT_SIZE + 1)))
                 .isInstanceOf(IllegalArgumentException.class);
     }
 
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/TestData.java b/src/test/java/ru/olegcherednik/zip4jvm/TestData.java
index f8dd55f0b..b8b3cdd2b 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/TestData.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/TestData.java
@@ -18,11 +18,12 @@
  */
 package ru.olegcherednik.zip4jvm;
 
+import ru.olegcherednik.zip4jvm.exception.Zip4jvmException;
+
 import lombok.AccessLevel;
 import lombok.NoArgsConstructor;
 import org.apache.commons.io.FilenameUtils;
 import org.apache.commons.lang3.StringUtils;
-import ru.olegcherednik.zip4jvm.exception.Zip4jvmException;
 
 import java.io.IOException;
 import java.nio.file.Files;
@@ -39,9 +40,9 @@
 @NoArgsConstructor(access = AccessLevel.PRIVATE)
 public final class TestData {
 
-    public static final Path dirRoot = createTempDirectory("zip4jvm");
-//    public static final Path dirRoot = Paths.get("/Users/o.cherednik/Documents/zip4jvm/foo");
-//    public static final Path dirRoot = Paths.get("d:/zip4jvm/foo");
+    //public static final Path dirRoot = createTempDirectory("zip4jvm");
+    //    public static final Path dirRoot = Paths.get("/Users/o.cherednik/Documents/zip4jvm/foo");
+    public static final Path dirRoot = Paths.get("d:/zip4jvm/foo");
 
     public static final String dirNameSrcData = "data";
 
@@ -150,60 +151,65 @@ public final class TestData {
     public static final Path zipDeflateSolidAes = dirRoot.resolve("deflate/solid/aes/src.zip");
 
     // winrar
-    public static final Path winRarStoreSolidZip = Paths.get("src/test/resources/winrar/store_solid_off.zip").toAbsolutePath();
-    public static final Path winRarStoreSolidPkwareZip = Paths.get("src/test/resources/winrar/store_solid_pkware.zip").toAbsolutePath();
-    public static final Path winRarStoreSolidAesZip = Paths.get("src/test/resources/winrar/store_solid_aes.zip").toAbsolutePath();
-    public static final Path winRarDeflateSolidZip = Paths.get("src/test/resources/winrar/deflate_solid_off.zip").toAbsolutePath();
-    public static final Path winRarDeflateSolidPkwareZip = Paths.get("src/test/resources/winrar/deflate_solid_pkware.zip").toAbsolutePath();
-    public static final Path winRarDeflateSolidAesZip = Paths.get("src/test/resources/winrar/deflate_solid_aes.zip").toAbsolutePath();
+    private static final Path dirWinRar = Paths.get("src/test/resources/winrar").toAbsolutePath();
+    public static final Path winRarStoreSolidZip = dirWinRar.resolve("store_solid_off.zip");
+    public static final Path winRarStoreSolidPkwareZip = dirWinRar.resolve("store_solid_pkware.zip");
+    public static final Path winRarStoreSolidAesZip = dirWinRar.resolve("store_solid_aes.zip");
+    public static final Path winRarDeflateSolidZip = dirWinRar.resolve("deflate_solid_off.zip");
+    public static final Path winRarDeflateSolidPkwareZip = dirWinRar.resolve("deflate_solid_pkware.zip");
+    public static final Path winRarDeflateSolidAesZip = dirWinRar.resolve("deflate_solid_aes.zip");
 
     // 7-Zip
-    public static final Path sevenZipStoreSplitZip = Paths.get("src/test/resources/seven-zip/store_split_off/src.zip.001").toAbsolutePath();
-    public static final Path sevenZipStoreSolidPkwareZip = Paths.get("src/test/resources/seven-zip/lzma_solid_aes.zip").toAbsolutePath();
-    public static final Path sevenZipLzmaSolidZip = Paths.get("src/test/resources/seven-zip/lzma_solid_off.zip").toAbsolutePath();
-    public static final Path sevenZipLzmaSolidAesZip = Paths.get("src/test/resources/seven-zip/lzma_solid_aes.zip").toAbsolutePath();
-    public static final Path sevenZipZstdSolidZip = Paths.get("src/test/resources/seven-zip/zstd_solid_off.zip").toAbsolutePath();
-    public static final Path sevenZipZstdSolidAesZip = Paths.get("src/test/resources/seven-zip/zstd_solid_aes.zip").toAbsolutePath();
+    private static final Path dirSevenZip = Paths.get("src/test/resources/seven-zip").toAbsolutePath();
+    public static final Path sevenZipStoreSplitZip = dirSevenZip.resolve("store_split_off/src.zip.001");
+    public static final Path sevenZipStoreSolidPkwareZip = dirSevenZip.resolve("lzma_solid_aes.zip");
+    public static final Path sevenZipLzmaSolidZip = dirSevenZip.resolve("lzma_solid_off.zip");
+    public static final Path sevenZipLzmaSolidAesZip = dirSevenZip.resolve("lzma_solid_aes.zip");
+    public static final Path sevenZipZstdSolidZip = dirSevenZip.resolve("zstd_solid_off.zip");
+    public static final Path sevenZipZstdSolidAesZip = dirSevenZip.resolve("zstd_solid_aes.zip");
 
     // secure-zip
-    public static final Path secureZipStoreSolidAesZip = Paths.get("src/test/resources/secure-zip/store_solid_aes.zip").toAbsolutePath();
-    public static final Path secureZipStoreSplitZip = Paths.get("src/test/resources/secure-zip/store_split_off/src.zip").toAbsolutePath();
-    public static final Path secureZipLzmaSolidZip = Paths.get("src/test/resources/secure-zip/lzma_solid_off.zip").toAbsolutePath();
-    public static final Path secureZipBzip2SolidZip = Paths.get("src/test/resources/secure-zip/bzip2_solid_off.zip").toAbsolutePath();
-    public static final Path secureZipBzip2SolidPkwareZip = Paths.get("src/test/resources/secure-zip/bzip2_solid_pkware.zip").toAbsolutePath();
-    public static final Path secureZipEnhancedDeflateSolidZip = Paths.get("src/test/resources/secure-zip/ed_solid_off.zip").toAbsolutePath();
+    private static final Path dirSecureZip = Paths.get("src/test/resources/secure-zip").toAbsolutePath();
+    public static final Path secureZipStoreSolidAesZip = dirSecureZip.resolve("store_solid_aes.zip");
+    public static final Path secureZipStoreSplitZip = dirSecureZip.resolve("store_split_off/src.zip");
+    public static final Path secureZipLzmaSolidZip = dirSecureZip.resolve("lzma_solid_off.zip");
+    public static final Path secureZipBzip2SolidZip = dirSecureZip.resolve("bzip2_solid_off.zip");
+    public static final Path secureZipBzip2SolidPkwareZip = dirSecureZip.resolve("bzip2_solid_pkware.zip");
+    public static final Path secureZipEnhancedDeflateSolidZip = dirSecureZip.resolve("ed_solid_off.zip");
 
     // strong
+    private static final Path dirSecureZipStrong = dirSecureZip.resolve("strong");
     public static final Path secureZipStoreSolidAes256StrongZip =
-            Paths.get("src/test/resources/secure-zip/strong/store_solid_aes256_strong.zip").toAbsolutePath();
+            dirSecureZipStrong.resolve("store_solid_aes256_strong.zip");
     public static final Path secureZipStoreSolidAes192StrongZip =
-            Paths.get("src/test/resources/secure-zip/strong/store_solid_aes192_strong.zip").toAbsolutePath();
+            dirSecureZipStrong.resolve("store_solid_aes192_strong.zip");
     public static final Path secureZipStoreSolidAes128StrongZip =
-            Paths.get("src/test/resources/secure-zip/strong/store_solid_aes128_strong.zip").toAbsolutePath();
+            dirSecureZipStrong.resolve("store_solid_aes128_strong.zip");
     public static final Path secureZipDeflateSolidAes256StrongZip =
-            Paths.get("src/test/resources/secure-zip/strong/deflate_solid_aes256_strong.zip").toAbsolutePath();
+            dirSecureZipStrong.resolve("deflate_solid_aes256_strong.zip");
     public static final Path secureZipBzip2SolidAes256StrongZip =
-            Paths.get("src/test/resources/secure-zip/strong/bzip2_solid_aes256_strong.zip").toAbsolutePath();
+            dirSecureZipStrong.resolve("bzip2_solid_aes256_strong.zip");
     public static final Path secureZipDeflate64SolidAes256StrongZip =
-            Paths.get("src/test/resources/secure-zip/strong/deflate64_solid_aes256_strong.zip").toAbsolutePath();
+            dirSecureZipStrong.resolve("deflate64_solid_aes256_strong.zip");
     public static final Path secureZipLzmaSolidAes256StrongZip =
-            Paths.get("src/test/resources/secure-zip/strong/lzma_solid_aes256_strong.zip").toAbsolutePath();
+            dirSecureZipStrong.resolve("lzma_solid_aes256_strong.zip");
     public static final Path secureZipBzip2SplitAes256StrongZip =
-            Paths.get("src/test/resources/secure-zip/strong/bzip2_split_aes_strong/split_bzip2_aes_strong.zip").toAbsolutePath();
+            dirSecureZipStrong.resolve("bzip2_split_aes_strong/split_bzip2_aes_strong.zip");
 
     // encrypted central directory
+    private static final Path dirSecureZipEcd = dirSecureZipStrong.resolve("ecd");
     public static final Path secureZipStoreSolidAes256StrongEcdZip =
-            Paths.get("src/test/resources/secure-zip/strong/ecd/store_solid_aes256_strong_ecd.zip").toAbsolutePath();
+            dirSecureZipEcd.resolve("store_solid_aes256_strong_ecd.zip");
     public static final Path secureZipDeflateSolidAes256StrongEcdZip =
-            Paths.get("src/test/resources/secure-zip/strong/ecd/deflate_solid_aes256_strong_ecd.zip").toAbsolutePath();
+            dirSecureZipEcd.resolve("deflate_solid_aes256_strong_ecd.zip");
     public static final Path secureZipDeflate64SolidAes256StrongEcdZip =
-            Paths.get("src/test/resources/secure-zip/strong/ecd/deflate64_solid_aes256_strong_ecd.zip").toAbsolutePath();
+            dirSecureZipEcd.resolve("deflate64_solid_aes256_strong_ecd.zip");
     public static final Path secureZipBzip2SolidAes256StrongEcdZip =
-            Paths.get("src/test/resources/secure-zip/strong/ecd/bzip2_solid_aes256_strong_ecd.zip").toAbsolutePath();
+            dirSecureZipEcd.resolve("bzip2_solid_aes256_strong_ecd.zip");
     public static final Path secureZipLzmaSolidAes256StrongEcdZip =
-            Paths.get("src/test/resources/secure-zip/strong/ecd/lzma_solid_aes256_strong_ecd.zip").toAbsolutePath();
+            dirSecureZipEcd.resolve("lzma_solid_aes256_strong_ecd.zip");
     public static final Path secureZipBzip2SplitAes256StrongEcdZip =
-            Paths.get("src/test/resources/secure-zip/strong/ecd/bzip2_split_aes_strong_ecd/split_bzip2_aes_strong_ecd.zip").toAbsolutePath();
+            dirSecureZipEcd.resolve("bzip2_split_aes_strong_ecd/split_bzip2_aes_strong_ecd.zip");
 
     // apk
     public static final Path appApk = Paths.get("src/test/resources/apk/app.apk").toAbsolutePath();
@@ -229,7 +235,7 @@ private static String getSymlinkName(String fileName, String prefix) {
     private static Path createTempDirectory(String prefix) {
         try {
             return Files.createTempDirectory(prefix);
-        } catch(IOException e) {
+        } catch (IOException e) {
             throw new Zip4jvmException(e);
         }
     }
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/TestDataAssert.java b/src/test/java/ru/olegcherednik/zip4jvm/TestDataAssert.java
index d73cdf8d7..4c3e0c25d 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/TestDataAssert.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/TestDataAssert.java
@@ -18,16 +18,17 @@
  */
 package ru.olegcherednik.zip4jvm;
 
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
 import ru.olegcherednik.zip4jvm.assertj.IDirectoryAssert;
 import ru.olegcherednik.zip4jvm.assertj.IRegularFileAssert;
 import ru.olegcherednik.zip4jvm.exception.Zip4jvmException;
 import ru.olegcherednik.zip4jvm.utils.ZipUtils;
 
-import java.io.FileOutputStream;
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+
 import java.io.IOException;
 import java.io.InputStream;
+import java.nio.file.Files;
 import java.nio.file.Path;
 import java.util.function.Consumer;
 
@@ -65,14 +66,19 @@ public final class TestDataAssert {
         TestDataAssert.fileSaintPetersburgAssert.accept(dir.regularFile(fileNameSaintPetersburg));
         TestDataAssert.fileSigSauerAssert.accept(dir.regularFile(fileNameSigSauer));
         TestDataAssert.fileEmptyAssert.accept(dir.regularFile(fileNameEmpty));
-//        TestDataAssert.zipFileOlegCherednikAssert.accept(dir.file(fileNameOlegCherednik));
+        // TestDataAssert.zipFileOlegCherednikAssert.accept(dir.file(fileNameOlegCherednik));
     };
 
-    public static final Consumer> fileMcdonnelDouglasAssert = file -> file.exists().isImage().hasSize(624_746);
-    public static final Consumer> fileSaintPetersburgAssert = file -> file.exists().isImage().hasSize(1_074_836);
-    public static final Consumer> fileSigSauerAssert = file -> file.exists().isImage().hasSize(431_478);
-    public static final Consumer> fileEmptyAssert = file -> file.exists().hasSize(0);
-    public static final Consumer> zipFileOlegCherednikAssert = file -> file.exists().hasSize(1_395_362);
+    public static final Consumer> fileMcdonnelDouglasAssert =
+            file -> file.exists().isImage().hasSize(624_746);
+    public static final Consumer> fileSaintPetersburgAssert =
+            file -> file.exists().isImage().hasSize(1_074_836);
+    public static final Consumer> fileSigSauerAssert =
+            file -> file.exists().isImage().hasSize(431_478);
+    public static final Consumer> fileEmptyAssert =
+            file -> file.exists().hasSize(0);
+    // public static final Consumer> zipFileOlegCherednikAssert =
+    //         file -> file.exists().hasSize(1_395_362);
 
     public static final Consumer> dirBikesAssert = dir -> {
         dir.exists().hasEntries(4).hasRegularFiles(4);
@@ -82,10 +88,14 @@ public final class TestDataAssert {
         TestDataAssert.fileSuzukiAssert.accept(dir.regularFile(fileNameSuzuki));
     };
 
-    public static final Consumer> fileDucatiAssert = file -> file.exists().isImage().hasSize(293_823);
-    public static final Consumer> fileHondaAssert = file -> file.exists().isImage().hasSize(154_591);
-    public static final Consumer> fileKawasakiAssert = file -> file.exists().isImage().hasSize(167_026);
-    public static final Consumer> fileSuzukiAssert = file -> file.exists().isImage().hasSize(287_349);
+    public static final Consumer> fileDucatiAssert =
+            file -> file.exists().isImage().hasSize(293_823);
+    public static final Consumer> fileHondaAssert =
+            file -> file.exists().isImage().hasSize(154_591);
+    public static final Consumer> fileKawasakiAssert =
+            file -> file.exists().isImage().hasSize(167_026);
+    public static final Consumer> fileSuzukiAssert =
+            file -> file.exists().isImage().hasSize(287_349);
 
     public static final Consumer> dirCarsAssert = dir -> {
         dir.exists().hasEntries(3).hasRegularFiles(3);
@@ -94,14 +104,17 @@ public final class TestDataAssert {
         TestDataAssert.fileWiesmannAssert.accept(dir.regularFile(fileNameWiesmann));
     };
 
-    public static final Consumer> fileBentleyAssert = file -> file.exists().isImage().hasSize(1_395_362);
-    public static final Consumer> fileFerrariAssert = file -> file.exists().isImage().hasSize(320_894);
-    public static final Consumer> fileWiesmannAssert = file -> file.exists().isImage().hasSize(729_633);
+    public static final Consumer> fileBentleyAssert =
+            file -> file.exists().isImage().hasSize(1_395_362);
+    public static final Consumer> fileFerrariAssert =
+            file -> file.exists().isImage().hasSize(320_894);
+    public static final Consumer> fileWiesmannAssert =
+            file -> file.exists().isImage().hasSize(729_633);
 
     public static final Consumer> dirEmptyAssert = dir -> dir.exists().hasEntries(0);
 
     public static void copyLarge(InputStream in, Path dst) throws IOException {
-        ZipUtils.copyLarge(in, new FileOutputStream(dst.toFile()));
+        ZipUtils.copyLarge(in, Files.newOutputStream(dst.toFile().toPath()));
     }
 
     public static String getMethodName() {
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/UnzipItSolidTest.java b/src/test/java/ru/olegcherednik/zip4jvm/UnzipItSolidTest.java
index 1f9787fe0..1d4d930af 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/UnzipItSolidTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/UnzipItSolidTest.java
@@ -18,11 +18,12 @@
  */
 package ru.olegcherednik.zip4jvm;
 
+import ru.olegcherednik.zip4jvm.model.Charsets;
+import ru.olegcherednik.zip4jvm.model.settings.UnzipSettings;
+
 import org.testng.annotations.AfterClass;
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
-import ru.olegcherednik.zip4jvm.model.Charsets;
-import ru.olegcherednik.zip4jvm.model.settings.UnzipSettings;
 
 import java.io.IOException;
 import java.nio.charset.Charset;
@@ -107,11 +108,9 @@ public void shouldExtractZipArchiveWhenZipWasCreatedUnderMac() throws IOExceptio
 
         UnzipIt.zip(zip).destDir(destDir).extract();
 
-        int a = 0;
-        a++;
-//    TODO commented tests
-//        assertThatDirectory(destDir).hasDirectories(0).hasFiles(2);
-//        assertThatDirectory(destDir).file("fff - 副本.txt").exists();
+        //    TODO commented tests
+        //        assertThatDirectory(destDir).hasDirectories(0).hasFiles(2);
+        //        assertThatDirectory(destDir).file("fff - 副本.txt").exists();
     }
 
     public void shouldExtractZipArchiveWhenUtf8Charset() throws IOException {
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/UnzipItSplitTest.java b/src/test/java/ru/olegcherednik/zip4jvm/UnzipItSplitTest.java
index 1cd385020..f755b86dc 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/UnzipItSplitTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/UnzipItSplitTest.java
@@ -18,15 +18,16 @@
  */
 package ru.olegcherednik.zip4jvm;
 
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.exception.SplitPartNotFoundException;
 import ru.olegcherednik.zip4jvm.model.Compression;
 import ru.olegcherednik.zip4jvm.model.CompressionLevel;
 import ru.olegcherednik.zip4jvm.model.settings.ZipEntrySettings;
 import ru.olegcherednik.zip4jvm.model.settings.ZipSettings;
 
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Path;
@@ -77,7 +78,8 @@ public void shouldUnzipRequiredFilesWhenSplit() throws IOException {
     }
 
     public void shouldThrowFileNotFoundExceptionAndNotExtractPartialFilesWhenZipPartMissing() throws IOException {
-        ZipEntrySettings entrySettings = ZipEntrySettings.builder().compression(Compression.STORE, CompressionLevel.NORMAL).build();
+        ZipEntrySettings entrySettings = ZipEntrySettings.builder().compression(Compression.STORE,
+                                                                                CompressionLevel.NORMAL).build();
         ZipSettings settings = ZipSettings.builder()
                                           .entrySettingsProvider(fileName -> entrySettings)
                                           .splitSize(SIZE_1MB)
@@ -94,7 +96,8 @@ public void shouldThrowFileNotFoundExceptionAndNotExtractPartialFilesWhenZipPart
         Path unzipDir = destDir.resolve("unzip");
         Files.createDirectory(unzipDir);
 
-        assertThatThrownBy(() -> UnzipIt.zip(zip).destDir(unzipDir).extract()).isExactlyInstanceOf(SplitPartNotFoundException.class);
+        assertThatThrownBy(() -> UnzipIt.zip(zip).destDir(unzipDir).extract()).isExactlyInstanceOf(
+                SplitPartNotFoundException.class);
         assertThatDirectory(unzipDir).isEmpty();
     }
 
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/Zip4jvmSuite.java b/src/test/java/ru/olegcherednik/zip4jvm/Zip4jvmSuite.java
index 8ced27295..fba566b38 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/Zip4jvmSuite.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/Zip4jvmSuite.java
@@ -18,13 +18,6 @@
  */
 package ru.olegcherednik.zip4jvm;
 
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-import net.lingala.zip4j.ZipFile;
-import org.apache.commons.io.FileUtils;
-import org.apache.commons.io.FilenameUtils;
-import org.testng.annotations.AfterSuite;
-import org.testng.annotations.BeforeSuite;
 import ru.olegcherednik.zip4jvm.data.DefalteZipData;
 import ru.olegcherednik.zip4jvm.data.StoreZipData;
 import ru.olegcherednik.zip4jvm.data.SymlinkData;
@@ -33,6 +26,14 @@
 import ru.olegcherednik.zip4jvm.utils.ZipUtils;
 import ru.olegcherednik.zip4jvm.view.View;
 
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import net.lingala.zip4j.ZipFile;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.FilenameUtils;
+import org.testng.annotations.AfterSuite;
+import org.testng.annotations.BeforeSuite;
+
 import java.io.ByteArrayOutputStream;
 import java.io.File;
 import java.io.IOException;
@@ -128,7 +129,8 @@ public static Path copy(Path destDir, Path zip) throws IOException {
             final String fileName = FilenameUtils.getBaseName(zip.getFileName().toString());
 
             List parts = Files.walk(zip.getParent()).filter(Files::isRegularFile).filter(
-                    path -> FilenameUtils.getBaseName(path.getFileName().toString()).equals(fileName)).collect(Collectors.toList());
+                    path -> FilenameUtils.getBaseName(path.getFileName().toString()).equals(fileName)).collect(
+                    Collectors.toList());
 
             for (Path part : parts)
                 Files.copy(part, destDir.resolve(part.getFileName()));
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/ZipFileTest.java b/src/test/java/ru/olegcherednik/zip4jvm/ZipFileTest.java
index 49dc3350b..7ce952d58 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/ZipFileTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/ZipFileTest.java
@@ -18,15 +18,16 @@
  */
 package ru.olegcherednik.zip4jvm;
 
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.model.Compression;
 import ru.olegcherednik.zip4jvm.model.CompressionLevel;
 import ru.olegcherednik.zip4jvm.model.Encryption;
 import ru.olegcherednik.zip4jvm.model.settings.ZipEntrySettings;
 import ru.olegcherednik.zip4jvm.model.settings.ZipSettings;
 
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Path;
@@ -75,7 +76,9 @@ public static void removeDir() throws IOException {
     }
 
     public void shouldCreateZipFileWhenUseZipFileAndAddFiles() throws IOException {
-        ZipEntrySettings entrySettings = ZipEntrySettings.builder().compression(Compression.STORE, CompressionLevel.NORMAL).build();
+        ZipEntrySettings entrySettings = ZipEntrySettings.builder()
+                                                         .compression(Compression.STORE, CompressionLevel.NORMAL)
+                                                         .build();
 
         try (ZipFile.Writer zipFile = ZipIt.zip(file).entrySettings(entrySettings).open()) {
             zipFile.add(fileBentley);
@@ -92,7 +95,9 @@ public void shouldCreateZipFileWhenUseZipFileAndAddFiles() throws IOException {
 
     @Test(dependsOnMethods = "shouldCreateZipFileWhenUseZipFileAndAddFiles")
     public void shouldAddFilesToExistedZipWhenUseZipFile() throws IOException {
-        ZipEntrySettings entrySettings = ZipEntrySettings.builder().compression(Compression.STORE, CompressionLevel.NORMAL).build();
+        ZipEntrySettings entrySettings = ZipEntrySettings.builder()
+                                                         .compression(Compression.STORE, CompressionLevel.NORMAL)
+                                                         .build();
 
         try (ZipFile.Writer zipFile = ZipIt.zip(file).entrySettings(entrySettings).open()) {
             zipFile.add(fileDucati);
@@ -113,29 +118,38 @@ public void shouldAddFilesToExistedZipWhenUseZipFile() throws IOException {
     }
 
     public void shouldCreateZipFileWithEntryCommentWhenUseZipFile() throws IOException {
-        Path file = Zip4jvmSuite.subDirNameAsMethodName(rootDir).resolve("src.zip");
+        Path zip = Zip4jvmSuite.subDirNameAsMethodName(rootDir).resolve("src.zip");
 
         Function entrySettingsProvider = fileName -> {
             if ("bentley-continental.jpg".equals(fileName))
-                return ZipEntrySettings.builder().compression(Compression.STORE, CompressionLevel.NORMAL).comment("bentley-continental").build();
+                return ZipEntrySettings.builder()
+                                       .compression(Compression.STORE, CompressionLevel.NORMAL)
+                                       .comment("bentley-continental").build();
             if ("ferrari-458-italia.jpg".equals(fileName))
-                return ZipEntrySettings.builder().compression(Compression.DEFLATE, CompressionLevel.NORMAL).comment("ferrari-458-italia").build();
+                return ZipEntrySettings.builder()
+                                       .compression(Compression.DEFLATE, CompressionLevel.NORMAL)
+                                       .comment("ferrari-458-italia").build();
             if ("wiesmann-gt-mf5.jpg".equals(fileName))
-                return ZipEntrySettings.builder().compression(Compression.STORE, CompressionLevel.NORMAL).comment("wiesmann-gt-mf5").build();
+                return ZipEntrySettings.builder()
+                                       .compression(Compression.STORE, CompressionLevel.NORMAL)
+                                       .comment("wiesmann-gt-mf5").build();
             return ZipEntrySettings.DEFAULT;
         };
 
-        try (ZipFile.Writer zipFile = ZipIt.zip(file).entrySettings(entrySettingsProvider).open()) {
+        try (ZipFile.Writer zipFile = ZipIt.zip(zip).entrySettings(entrySettingsProvider).open()) {
             zipFile.add(fileBentley);
             zipFile.add(fileFerrari);
             zipFile.add(fileWiesmann);
         }
 
-        assertThatDirectory(file.getParent()).exists().hasOnlyRegularFiles(1);
-        assertThatZipFile(file).exists().root().hasOnlyRegularFiles(3);
-        assertThatZipFile(file).regularFile("bentley-continental.jpg").exists().hasSize(1_395_362).hasComment("bentley-continental");
-        assertThatZipFile(file).regularFile("ferrari-458-italia.jpg").exists().hasSize(320_894).hasComment("ferrari-458-italia");
-        assertThatZipFile(file).regularFile("wiesmann-gt-mf5.jpg").exists().hasSize(729_633).hasComment("wiesmann-gt-mf5");
+        assertThatDirectory(zip.getParent()).exists().hasOnlyRegularFiles(1);
+        assertThatZipFile(zip).exists().root().hasOnlyRegularFiles(3);
+        assertThatZipFile(zip).regularFile("bentley-continental.jpg")
+                              .exists().hasSize(1_395_362).hasComment("bentley-continental");
+        assertThatZipFile(zip).regularFile("ferrari-458-italia.jpg")
+                              .exists().hasSize(320_894).hasComment("ferrari-458-italia");
+        assertThatZipFile(zip).regularFile("wiesmann-gt-mf5.jpg")
+                              .exists().hasSize(729_633).hasComment("wiesmann-gt-mf5");
     }
 
     // TODO add unzip tests for such ZipFile
@@ -155,20 +169,23 @@ public void shouldCreateZipFileWithEntryDifferentEncryptionAndPasswordWhenUseZip
             return ZipEntrySettings.DEFAULT.toBuilder().password(Zip4jvmSuite.password).build();
         };
 
-        Path file = Zip4jvmSuite.subDirNameAsMethodName(rootDir).resolve("src.zip");
+        Path zip = Zip4jvmSuite.subDirNameAsMethodName(rootDir).resolve("src.zip");
 
-        try (ZipFile.Writer zipFile = ZipIt.zip(file).entrySettings(entrySettingsProvider).open()) {
+        try (ZipFile.Writer zipFile = ZipIt.zip(zip).entrySettings(entrySettingsProvider).open()) {
             zipFile.add(fileBentley);
             zipFile.add(fileFerrari);
             zipFile.add(fileWiesmann);
         }
 
-        assertThatDirectory(file.getParent()).exists().hasOnlyRegularFiles(1);
+        assertThatDirectory(zip.getParent()).exists().hasOnlyRegularFiles(1);
         // TODO commented test
-//        assertThatZipFile(file).exists().rootEntry().hasSubDirectories(0).hasFiles(3);
-//        assertThatZipFile(file).file("bentley-continental.jpg").exists().isImage().hasSize(1_395_362).hasComment("bentley-continental");
-//        assertThatZipFile(file).file("ferrari-458-italia.jpg").exists().isImage().hasSize(320_894).hasComment("ferrari-458-italia");
-//        assertThatZipFile(file).file("wiesmann-gt-mf5.jpg").exists().isImage().hasSize(729_633).hasComment("wiesmann-gt-mf5");
+        // assertThatZipFile(file).exists().rootEntry().hasSubDirectories(0).hasFiles(3);
+        // assertThatZipFile(file).file("bentley-continental.jpg").exists()
+        //                        .isImage().hasSize(1_395_362).hasComment("bentley-continental");
+        // assertThatZipFile(file).file("ferrari-458-italia.jpg").exists()
+        //                       .isImage().hasSize(320_894).hasComment("ferrari-458-italia");
+        // assertThatZipFile(file).file("wiesmann-gt-mf5.jpg").exists()
+        //                       .isImage().hasSize(729_633).hasComment("wiesmann-gt-mf5");
     }
 
     public void shouldCreateZipFileWithContentWhenUseZipFile() throws IOException {
@@ -198,11 +215,11 @@ public void shouldCreateZipFileWithContentWhenUseZipFile() throws IOException {
         }
 
         // TODO commented test
-//        assertThatDirectory(file.getParent()).exists().hasSubDirectories(0).hasFiles(1);
-//        assertThatZipFile(file).exists().rootEntry().hasSubDirectories(0).hasFiles(3);
-//        assertThatZipFile(file).file("bentley-continental.jpg").exists().isImage().hasSize(1_395_362);
-//        assertThatZipFile(file).file("ferrari-458-italia.jpg").exists().isImage().hasSize(320_894);
-//        assertThatZipFile(file).file("wiesmann-gt-mf5.jpg").exists().isImage().hasSize(729_633);
+        // assertThatDirectory(file.getParent()).exists().hasSubDirectories(0).hasFiles(1);
+        // assertThatZipFile(file).exists().rootEntry().hasSubDirectories(0).hasFiles(3);
+        // assertThatZipFile(file).file("bentley-continental.jpg").exists().isImage().hasSize(1_395_362);
+        // assertThatZipFile(file).file("ferrari-458-italia.jpg").exists().isImage().hasSize(320_894);
+        // assertThatZipFile(file).file("wiesmann-gt-mf5.jpg").exists().isImage().hasSize(729_633);
     }
 
     public void shouldCreateZipFileWithEmptyDirectoryWhenAddEmptyDirectory() throws IOException {
@@ -219,8 +236,8 @@ public void shouldCreateZipFileWithEmptyDirectoryWhenAddEmptyDirectory() throws
         assertThatDirectory(zip.getParent()).exists().hasOnlyRegularFiles(1);
         assertThatZipFile(zip).exists().root().hasEntries(1).hasDirectories(1);
         // TODO commented test
-//        assertThatZipFile(file).file("bentley-continental.jpg").exists().isImage().hasSize(1_395_362);
-//        assertThatZipFile(file).file("ferrari-458-italia.jpg").exists().isImage().hasSize(320_894);
-//        assertThatZipFile(file).file("wiesmann-gt-mf5.jpg").exists().isImage().hasSize(729_633);
+        // assertThatZipFile(file).file("bentley-continental.jpg").exists().isImage().hasSize(1_395_362);
+        // assertThatZipFile(file).file("ferrari-458-italia.jpg").exists().isImage().hasSize(320_894);
+        // assertThatZipFile(file).file("wiesmann-gt-mf5.jpg").exists().isImage().hasSize(729_633);
     }
 }
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/ZipFilesNoSplitTest.java b/src/test/java/ru/olegcherednik/zip4jvm/ZipFilesNoSplitTest.java
index 506afb836..d8b31adf8 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/ZipFilesNoSplitTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/ZipFilesNoSplitTest.java
@@ -18,15 +18,16 @@
  */
 package ru.olegcherednik.zip4jvm;
 
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.assertj.Zip4jvmAssertions;
 import ru.olegcherednik.zip4jvm.model.Compression;
 import ru.olegcherednik.zip4jvm.model.CompressionLevel;
 import ru.olegcherednik.zip4jvm.model.settings.ZipEntrySettings;
 import ru.olegcherednik.zip4jvm.model.settings.ZipSettings;
 
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Path;
@@ -59,12 +60,14 @@ public static void removeDir() throws IOException {
     }
 
     public void shouldCreateNewZipWithFiles() throws IOException {
-        ZipSettings settings = ZipSettings.builder()
-                                          .entrySettingsProvider(fileName ->
-                                                                         ZipEntrySettings.builder()
-                                                                                         .compression(Compression.DEFLATE, CompressionLevel.NORMAL)
-                                                                                         .build())
-                                          .build();
+        ZipSettings settings = ZipSettings
+                .builder()
+                .entrySettingsProvider(fileName ->
+                                               ZipEntrySettings.builder()
+                                                               .compression(Compression.DEFLATE,
+                                                                            CompressionLevel.NORMAL)
+                                                               .build())
+                .build();
 
         List files = Arrays.asList(fileBentley, fileFerrari, fileWiesmann);
         ZipIt.zip(zip).settings(settings).add(files);
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/ZipFilesSplitTest.java b/src/test/java/ru/olegcherednik/zip4jvm/ZipFilesSplitTest.java
index fc5e1f113..2339ddb3a 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/ZipFilesSplitTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/ZipFilesSplitTest.java
@@ -18,9 +18,6 @@
  */
 package ru.olegcherednik.zip4jvm;
 
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.io.readers.ZipModelReader;
 import ru.olegcherednik.zip4jvm.model.Compression;
 import ru.olegcherednik.zip4jvm.model.CompressionLevel;
@@ -31,6 +28,10 @@
 import ru.olegcherednik.zip4jvm.model.settings.ZipSettings;
 import ru.olegcherednik.zip4jvm.model.src.SrcZip;
 
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Path;
@@ -65,28 +66,33 @@ public static void removeDir() throws IOException {
 
     public void shouldCreateNewSplitZipWithFiles() throws IOException {
         Path zip = Zip4jvmSuite.subDirNameAsMethodName(rootDir).resolve("src.zip");
-        ZipSettings settings = ZipSettings.builder()
-                                          .entrySettingsProvider(fileName ->
-                                                  ZipEntrySettings.builder()
-                                                                  .compression(Compression.DEFLATE, CompressionLevel.NORMAL).build())
-                                          .splitSize(SIZE_1MB).build();
+        ZipSettings settings = ZipSettings
+                .builder()
+                .entrySettingsProvider(fileName ->
+                                               ZipEntrySettings.builder()
+                                                               .compression(Compression.DEFLATE,
+                                                                            CompressionLevel.NORMAL).build())
+                .splitSize(SIZE_1MB).build();
         List files = Arrays.asList(fileBentley, fileFerrari, fileWiesmann);
         ZipIt.zip(zip).settings(settings).add(files);
-//    TODO commented tests
-//        assertThatDirectory(zipFile.getParent()).exists().hasSubDirectories(0).hasFiles(1);
-//        assertThatZipFile(zipFile).exists().rootEntry().hasSubDirectories(1).hasFiles(0);
-//        assertThatZipFile(zipFile).directory("/").matches(TestUtils.zipCarsDirAssert);
+        //    TODO commented tests
+        //        assertThatDirectory(zipFile.getParent()).exists().hasSubDirectories(0).hasFiles(1);
+        //        assertThatZipFile(zipFile).exists().rootEntry().hasSubDirectories(1).hasFiles(0);
+        //        assertThatZipFile(zipFile).directory("/").matches(TestUtils.zipCarsDirAssert);
     }
 
     @SuppressWarnings("LocalVariableNamingConvention")
     public void shouldSetTotalDiskWhenSplitZip64() throws IOException {
         Path zip = Zip4jvmSuite.subDirNameAsMethodName(rootDir).resolve("src.zip");
-        ZipSettings settings = ZipSettings.builder()
-                                          .zip64(true)
-                                          .entrySettingsProvider(fileName ->
-                                                  ZipEntrySettings.builder()
-                                                                  .compression(Compression.DEFLATE, CompressionLevel.NORMAL).build())
-                                          .splitSize(SIZE_1MB).build();
+        ZipSettings settings = ZipSettings
+                .builder()
+                .zip64(true)
+                .entrySettingsProvider(fileName ->
+                                               ZipEntrySettings.builder()
+                                                               .compression(Compression.DEFLATE,
+                                                                            CompressionLevel.NORMAL)
+                                                               .build())
+                .splitSize(SIZE_1MB).build();
         List files = Arrays.asList(fileBentley, fileFerrari, fileWiesmann);
         ZipIt.zip(zip).settings(settings).add(files);
 
@@ -95,7 +101,8 @@ public void shouldSetTotalDiskWhenSplitZip64() throws IOException {
         reader.readCentralData();
 
         EndCentralDirectory endCentralDirectory = reader.getEndCentralDirectory();
-        Zip64.EndCentralDirectoryLocator zip64EndCentralDirectoryLocator = reader.getZip64().getEndCentralDirectoryLocator();
+        Zip64.EndCentralDirectoryLocator zip64EndCentralDirectoryLocator = reader.getZip64()
+                                                                                 .getEndCentralDirectoryLocator();
 
         assertThat(endCentralDirectory.getMainDiskNo()).isEqualTo(ZipModel.MAX_TOTAL_DISKS);
         assertThat(endCentralDirectory.getTotalDisks()).isEqualTo(ZipModel.MAX_TOTAL_DISKS);
@@ -107,11 +114,14 @@ public void shouldSetTotalDiskWhenSplitZip64() throws IOException {
 
     public void shouldSetTotalDiskWhenSplit() throws IOException {
         Path zip = Zip4jvmSuite.subDirNameAsMethodName(rootDir).resolve("src.zip");
-        ZipSettings settings = ZipSettings.builder()
-                                          .entrySettingsProvider(fileName ->
-                                                  ZipEntrySettings.builder()
-                                                                  .compression(Compression.DEFLATE, CompressionLevel.NORMAL).build())
-                                          .splitSize(SIZE_1MB).build();
+        ZipSettings settings = ZipSettings
+                .builder()
+                .entrySettingsProvider(fileName ->
+                                               ZipEntrySettings.builder()
+                                                               .compression(Compression.DEFLATE,
+                                                                            CompressionLevel.NORMAL)
+                                                               .build())
+                .splitSize(SIZE_1MB).build();
         List files = Arrays.asList(fileBentley, fileFerrari, fileWiesmann);
         ZipIt.zip(zip).settings(settings).add(files);
 
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/ZipFolderNoSplitTest.java b/src/test/java/ru/olegcherednik/zip4jvm/ZipFolderNoSplitTest.java
index 6262e7980..33e78a437 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/ZipFolderNoSplitTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/ZipFolderNoSplitTest.java
@@ -18,17 +18,18 @@
  */
 package ru.olegcherednik.zip4jvm;
 
-import org.assertj.core.api.Assertions;
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Ignore;
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.assertj.Zip4jvmAssertions;
 import ru.olegcherednik.zip4jvm.model.Compression;
 import ru.olegcherednik.zip4jvm.model.CompressionLevel;
 import ru.olegcherednik.zip4jvm.model.settings.ZipEntrySettings;
 import ru.olegcherednik.zip4jvm.model.settings.ZipSettings;
 
+import org.assertj.core.api.Assertions;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Ignore;
+import org.testng.annotations.Test;
+
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Path;
@@ -58,12 +59,13 @@ public static void removeDir() throws IOException {
 
     @Test
     public void shouldCreateNewZipWithFolder() throws IOException {
-        ZipSettings settings = ZipSettings.builder()
-                                          .entrySettingsProvider(fileName ->
-                                                                         ZipEntrySettings.builder()
-                                                                                         .compression(Compression.DEFLATE, CompressionLevel.NORMAL)
-                                                                                         .build())
-                                          .build();
+        ZipSettings settings = ZipSettings
+                .builder().entrySettingsProvider(fileName ->
+                                                         ZipEntrySettings.builder()
+                                                                         .compression(Compression.DEFLATE,
+                                                                                      CompressionLevel.NORMAL)
+                                                                         .build())
+                .build();
         ZipIt.zip(zip).settings(settings).add(dirCars);
 
         Zip4jvmAssertions.assertThatDirectory(zip.getParent()).exists().hasOnlyRegularFiles(1);
@@ -71,28 +73,31 @@ public void shouldCreateNewZipWithFolder() throws IOException {
         Zip4jvmAssertions.assertThatZipFile(zip).directory("cars/").matches(TestDataAssert.dirCarsAssert);
     }
 
-    @Test(dependsOnMethods = "shouldCreateNewZipWithFolder")
-    @Ignore
-    public void shouldAddFolderToExistedZip() throws IOException {
-        Assertions.assertThat(Files.exists(zip)).isTrue();
-        Assertions.assertThat(Files.isRegularFile(zip)).isTrue();
-
-        ZipSettings settings = ZipSettings.builder()
-                                          .entrySettingsProvider(fileName ->
-                                                                         ZipEntrySettings.builder()
-                                                                                         .compression(Compression.DEFLATE, CompressionLevel.NORMAL)
-                                                                                         .build())
-                                          .build();
-
-
-        // TODO commented test
-//        ZipIt.add(zip, Zip4jvmSuite.starWarsDir, settings);
-//
-//        Zip4jvmAssertions.assertThatDirectory(ZipFolderNoSplitTest.zip.getParent()).exists().hasSubDirectories(0).hasFiles(1);
-//        Zip4jvmAssertions.assertThatZipFile(ZipFolderNoSplitTest.zip).exists().rootEntry().hasSubDirectories(2).hasFiles(0);
-//        Zip4jvmAssertions.assertThatZipFile(ZipFolderNoSplitTest.zip).directory("cars/").matches(TestDataAssert.zipCarsDirAssert);
-//        Zip4jvmAssertions.assertThatZipFile(ZipFolderNoSplitTest.zip).directory("Star Wars/").matches(TestDataAssert.zipStarWarsDirAssert);
-    }
+    // @Test(dependsOnMethods = "shouldCreateNewZipWithFolder")
+    // @Ignore
+    // public void shouldAddFolderToExistedZip() throws IOException {
+    //    Assertions.assertThat(Files.exists(zip)).isTrue();
+    //    Assertions.assertThat(Files.isRegularFile(zip)).isTrue();
+    //
+    //    ZipSettings settings = ZipSettings.builder()
+    //                                      .entrySettingsProvider(fileName ->
+    //                                                                   ZipEntrySettings.builder()
+    //                                                                       .compression(Compression.DEFLATE,
+    //                                                                                          CompressionLevel.NORMAL)
+    //                                                                                     .build())
+    //                                      .build();
+    // TODO commented test
+    //        ZipIt.add(zip, Zip4jvmSuite.starWarsDir, settings);
+    //
+    //   Zip4jvmAssertions.assertThatDirectory(ZipFolderNoSplitTest.zip.getParent()).exists()
+    //   .hasSubDirectories(0).hasFiles(1);
+    //   Zip4jvmAssertions.assertThatZipFile(ZipFolderNoSplitTest.zip).exists().rootEntry()
+    //   .hasSubDirectories(2).hasFiles(0);
+    //   Zip4jvmAssertions.assertThatZipFile(ZipFolderNoSplitTest.zip).directory("cars/")
+    //   .matches(TestDataAssert.zipCarsDirAssert);
+    //   Zip4jvmAssertions.assertThatZipFile(ZipFolderNoSplitTest.zip).directory("Star Wars/")
+    //   .matches(TestDataAssert.zipStarWarsDirAssert);
+    //}
 
     @Test(dependsOnMethods = "shouldAddFolderToExistedZip")
     @Ignore
@@ -100,19 +105,22 @@ public void shouldAddEmptyDirectoryToExistedZip() throws IOException {
         Assertions.assertThat(Files.exists(zip)).isTrue();
         Assertions.assertThat(Files.isRegularFile(zip)).isTrue();
 
-        ZipSettings settings = ZipSettings.builder()
-                                          .entrySettingsProvider(fileName ->
-                                                                         ZipEntrySettings.builder()
-                                                                                         .compression(Compression.DEFLATE, CompressionLevel.NORMAL)
-                                                                                         .build())
-                                          .build();
+        ZipSettings settings = ZipSettings
+                .builder()
+                .entrySettingsProvider(fileName ->
+                                               ZipEntrySettings.builder()
+                                                               .compression(Compression.DEFLATE,
+                                                                            CompressionLevel.NORMAL)
+                                                               .build())
+                .build();
         ZipIt.zip(zip).settings(settings).add(dirEmpty);
 
         Zip4jvmAssertions.assertThatDirectory(zip.getParent()).exists().hasOnlyRegularFiles(1);
         Zip4jvmAssertions.assertThatZipFile(zip).exists().root().hasEntries(3).hasDirectories(3);
         Zip4jvmAssertions.assertThatZipFile(zip).directory("cars/").matches(TestDataAssert.dirCarsAssert);
         // TODO commented test
-//        Zip4jvmAssertions.assertThatZipFile(zip).directory("Star Wars/").matches(TestDataAssert.zipStarWarsDirAssert);
+        // Zip4jvmAssertions.assertThatZipFile(zip).directory("Star Wars/")
+        // =.matches(TestDataAssert.zipStarWarsDirAssert);
         Zip4jvmAssertions.assertThatZipFile(zip).directory("empty_dir/").matches(TestDataAssert.dirEmptyAssert);
     }
 
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/ZipFolderSplitTest.java b/src/test/java/ru/olegcherednik/zip4jvm/ZipFolderSplitTest.java
index c9e87ce9d..c48f10e47 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/ZipFolderSplitTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/ZipFolderSplitTest.java
@@ -18,14 +18,15 @@
  */
 package ru.olegcherednik.zip4jvm;
 
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.model.Compression;
 import ru.olegcherednik.zip4jvm.model.CompressionLevel;
 import ru.olegcherednik.zip4jvm.model.settings.ZipEntrySettings;
 import ru.olegcherednik.zip4jvm.model.settings.ZipSettings;
 
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Path;
@@ -57,25 +58,32 @@ public static void removeDir() throws IOException {
 
     @Test
     public void shouldCreateNewZipWithFolder() throws IOException {
-        ZipEntrySettings entrySettings = ZipEntrySettings.builder().compression(Compression.DEFLATE, CompressionLevel.NORMAL).build();
-        ZipSettings settings = ZipSettings.builder().entrySettingsProvider(fileName -> entrySettings).splitSize(SIZE_1MB).build();
+        ZipEntrySettings entrySettings = ZipEntrySettings.builder()
+                                                         .compression(Compression.DEFLATE, CompressionLevel.NORMAL)
+                                                         .build();
+        ZipSettings settings = ZipSettings.builder()
+                                          .entrySettingsProvider(fileName -> entrySettings)
+                                          .splitSize(SIZE_1MB)
+                                          .build();
 
         ZipIt.zip(zip).settings(settings).add(contentDirSrc);
         assertThatDirectory(zip.getParent()).exists().hasEntries(6).hasRegularFiles(6);
         assertThat(Files.exists(zip)).isTrue();
         assertThat(Files.isRegularFile(zip)).isTrue();
         // TODO ZipFile does not read split archive
-//        assertThatZipFile(zipFile).directory("/").matches(TestUtils.zipRootDirAssert);
+        //        assertThatZipFile(zipFile).directory("/").matches(TestUtils.zipRootDirAssert);
     }
-//    TODO commented tests
-//    @Test(dependsOnMethods = "shouldCreateNewZipWithFolder")
-//    public void shouldThrowExceptionWhenModifySplitZip() {
-//        ZipFileWriterSettings settings = ZipFileWriterSettings.builder()
-//                                                  .entrySettings(
-//                                                          ZipEntrySettings.builder()
-//                                                                          .compression(Compression.DEFLATE, CompressionLevel.NORMAL).build())
-//                                                  .splitSize(2014 * 1024).build();
-//
-//        assertThatThrownBy(() -> ZipIt.add(zip, Zip4jSuite.starWarsDir, settings)).isExactlyInstanceOf(Zip4jvmException.class);
-//    }
+    //    TODO commented tests
+    //    @Test(dependsOnMethods = "shouldCreateNewZipWithFolder")
+    //    public void shouldThrowExceptionWhenModifySplitZip() {
+    //        ZipFileWriterSettings settings = ZipFileWriterSettings.builder()
+    //                                                  .entrySettings(
+    //                                                          ZipEntrySettings.builder()
+    //                                                                          .compression(Compression.DEFLATE,
+    //                                                                          CompressionLevel.NORMAL).build())
+    //                                                  .splitSize(2014 * 1024).build();
+    //
+    //        assertThatThrownBy(() -> ZipIt.add(zip, Zip4jSuite.starWarsDir, settings))
+    //        .isExactlyInstanceOf(Zip4jvmException.class);
+    //    }
 }
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/ZipInfoDecomposeTest.java b/src/test/java/ru/olegcherednik/zip4jvm/ZipInfoDecomposeTest.java
index 03dc5f448..1aede9610 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/ZipInfoDecomposeTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/ZipInfoDecomposeTest.java
@@ -21,12 +21,10 @@
 import org.testng.annotations.AfterClass;
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
-import ru.olegcherednik.zip4jvm.model.settings.ZipInfoSettings;
 
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Path;
-import java.nio.file.Paths;
 
 import static ru.olegcherednik.zip4jvm.Zip4jvmSuite.password;
 import static ru.olegcherednik.zip4jvm.assertj.Zip4jvmAssertions.assertThatDirectory;
@@ -184,34 +182,4 @@ public void shouldDecomposeWhenStrongBzip2AesSplitEcd() throws IOException {
         assertThatDirectory(dir).matchesResourceDirectory("/decompose/strong/ecd/strong_bzip2_aes_split_ecd");
     }
 
-    private static ZipInfo zipInfo() {
-        Path path = Paths.get("d:/zip4jvm/tmp/aes.zip");
-//        Files.deleteIfExists(path);
-
-//        ZipInfo res = ZipInfo.zip(Paths.get("d:/zip4jvm/tmp/lzma/lzma_16mb.zip"));
-//        ZipInfo res = ZipInfo.zip(Paths.get("d:/zip4jvm/tmp/lzma/lzma_1mb_32.zip"));
-//        ZipInfo res = ZipInfo.zip(Paths.get("d:/zip4jvm/tmp/lzma/enc/lzma-ultra.zip"));
-//        res = res.settings(ZipInfoSettings.builder().readEntries(false).build());
-//        ZipInfo res = ZipInfo.zip(sevenZipLzmaSolidZip);
-//        ZipInfo res = ZipInfo.zip(Paths.get("d:/zip4jvm/3des/3des_store_168.zip"));
-//        ZipInfo res = ZipInfo.zip(Paths.get("d:/zip4jvm/bzip2/bzip2.zip"));
-//        ZipInfo res = ZipInfo.zip(Paths.get("d:/zip4jvm/bzip2/min.zip"));
-        ZipInfo res = ZipInfo.zip(Paths.get("d:/zip4jvm/ZIpCrypto/src.zip"));
-
-//        ZipInfo res = ZipInfo.zip(Paths.get("d:/zip4jvm/securezip/aes/aes128.zip"));
-//        ZipInfo res = ZipInfo.zip(Paths.get("d:/zip4jvm/securezip/aes/aes192.zip"));
-//        ZipInfo res = ZipInfo.zip(Paths.get("d:/zip4jvm/securezip/aes/aes256.zip"));
-//        ZipInfo res = ZipInfo.zip(Paths.get("D:\\zip4jvm\\foo\\compression\\1581465466689\\CompressionLzmaTest\\shouldCreateSingleZipWithFilesWhenLzmaCompressionAndAesEncryption/src.zip"));
-//        ZipInfo res = ZipInfo.zip(
-//                Paths.get("D:\\zip4jvm\\foo\\encryption\\1581466463189\\EncryptionAesTest\\shouldCreateNewZipWithFolderAndAes256Encryption/src.zip"));
-
-        return res;
-    }
-
-    @Test(enabled = false)
-    public void decompose() throws IOException {
-        ZipInfoSettings settings = ZipInfoSettings.builder().copyPayload(true).build();
-        zipInfo().settings(settings).decompose(Zip4jvmSuite.subDirNameAsMethodName(rootDir));
-    }
-
 }
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/ZipInfoPrintShortInfoTest.java b/src/test/java/ru/olegcherednik/zip4jvm/ZipInfoPrintShortInfoTest.java
index afe601e9e..3d2229be1 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/ZipInfoPrintShortInfoTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/ZipInfoPrintShortInfoTest.java
@@ -21,13 +21,11 @@
 import org.testng.annotations.AfterClass;
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
-import ru.olegcherednik.zip4jvm.model.settings.ZipInfoSettings;
 
 import java.io.IOException;
 import java.io.PrintStream;
 import java.nio.file.Files;
 import java.nio.file.Path;
-import java.nio.file.Paths;
 
 import static ru.olegcherednik.zip4jvm.assertj.Zip4jvmAssertions.assertThatFile;
 
@@ -127,34 +125,4 @@ public void shouldPrintShortInfoWhenSingleItemZip() throws IOException {
         assertThatFile(file).matchesTextLines("/info/single_item.txt");
     }
 
-    private static ZipInfo zipInfo() {
-        Path path = Paths.get("d:/zip4jvm/tmp/aes.zip");
-//        Files.deleteIfExists(path);
-
-//        ZipInfo res = ZipInfo.zip(Paths.get("d:/zip4jvm/tmp/lzma/lzma_16mb.zip"));
-//        ZipInfo res = ZipInfo.zip(Paths.get("d:/zip4jvm/tmp/lzma/lzma_1mb_32.zip"));
-//        ZipInfo res = ZipInfo.zip(Paths.get("d:/zip4jvm/tmp/lzma/enc/lzma-ultra.zip"));
-//        res = res.settings(ZipInfoSettings.builder().readEntries(false).build());
-//        ZipInfo res = ZipInfo.zip(sevenZipLzmaSolidZip);
-//        ZipInfo res = ZipInfo.zip(Paths.get("d:/zip4jvm/3des/3des_store_168.zip"));
-//        ZipInfo res = ZipInfo.zip(Paths.get("d:/zip4jvm/bzip2/bzip2.zip"));
-//        ZipInfo res = ZipInfo.zip(Paths.get("d:/zip4jvm/bzip2/min.zip"));
-        ZipInfo res = ZipInfo.zip(Paths.get("d:/zip4jvm/ZIpCrypto/src.zip"));
-
-//        ZipInfo res = ZipInfo.zip(Paths.get("d:/zip4jvm/securezip/aes/aes128.zip"));
-//        ZipInfo res = ZipInfo.zip(Paths.get("d:/zip4jvm/securezip/aes/aes192.zip"));
-//        ZipInfo res = ZipInfo.zip(Paths.get("d:/zip4jvm/securezip/aes/aes256.zip"));
-//        ZipInfo res = ZipInfo.zip(Paths.get("D:\\zip4jvm\\foo\\compression\\1581465466689\\CompressionLzmaTest\\shouldCreateSingleZipWithFilesWhenLzmaCompressionAndAesEncryption/src.zip"));
-//        ZipInfo res = ZipInfo.zip(
-//                Paths.get("D:\\zip4jvm\\foo\\encryption\\1581466463189\\EncryptionAesTest\\shouldCreateNewZipWithFolderAndAes256Encryption/src.zip"));
-
-        return res;
-    }
-
-    @Test(enabled = false)
-    public void printShortInfo() throws IOException {
-        ZipInfoSettings settings = ZipInfoSettings.builder().copyPayload(true).build();
-        zipInfo().settings(settings).printShortInfo(System.out);
-    }
-
 }
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/ZipIt64Test.java b/src/test/java/ru/olegcherednik/zip4jvm/ZipIt64Test.java
index 203b4eb1f..ecc1205fb 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/ZipIt64Test.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/ZipIt64Test.java
@@ -18,13 +18,7 @@
  */
 package ru.olegcherednik.zip4jvm;
 
-import org.apache.commons.io.IOUtils;
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.model.Charsets;
-import ru.olegcherednik.zip4jvm.model.Compression;
-import ru.olegcherednik.zip4jvm.model.CompressionLevel;
 import ru.olegcherednik.zip4jvm.model.Encryption;
 import ru.olegcherednik.zip4jvm.model.ExternalFileAttributes;
 import ru.olegcherednik.zip4jvm.model.ZipModel;
@@ -33,17 +27,18 @@
 import ru.olegcherednik.zip4jvm.model.settings.ZipSettings;
 import ru.olegcherednik.zip4jvm.model.src.SrcZip;
 
+import org.apache.commons.io.IOUtils;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
 import java.io.IOException;
-import java.io.RandomAccessFile;
 import java.nio.file.Files;
 import java.nio.file.Path;
-import java.util.Arrays;
 import java.util.stream.IntStream;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static ru.olegcherednik.zip4jvm.TestData.contentDirSrc;
-import static ru.olegcherednik.zip4jvm.TestData.fileBentley;
-import static ru.olegcherednik.zip4jvm.TestData.fileNameBentley;
 import static ru.olegcherednik.zip4jvm.TestDataAssert.rootAssert;
 import static ru.olegcherednik.zip4jvm.Zip4jvmSuite.SIZE_1MB;
 import static ru.olegcherednik.zip4jvm.Zip4jvmSuite.password;
@@ -120,8 +115,8 @@ public void shouldZipWhenZip64AndSplit() throws IOException {
         ZipIt.zip(zipSplit).settings(settings).add(contentDirSrc);
 
         // TODO it seems it could be checked with commons-compress
-//        assertThatDirectory(zipFile.getParent()).exists().hasSubDirectories(0).hasFiles(1);
-//        assertThatZipFile(zipFile).directory("/").matches(TestUtils.zipRootDirAssert);
+        //        assertThatDirectory(zipFile.getParent()).exists().hasSubDirectories(0).hasFiles(1);
+        //        assertThatZipFile(zipFile).directory("/").matches(TestUtils.zipRootDirAssert);
     }
 
     @Test(dependsOnMethods = "shouldZipWhenZip64AndSplit")
@@ -131,6 +126,7 @@ public void shouldUnzipWhenZip64AndSplit() throws IOException {
         assertThatDirectory(destDir).matches(rootAssert);
     }
 
+    @SuppressWarnings("AbbreviationAsWordInName")
     public void shouldUseZip64WhenTotalEntriesOverFFFF() throws IOException {
         Path zipManyEntries = Zip4jvmSuite.subDirNameAsMethodName(rootDir).resolve("src.zip");
 
@@ -152,34 +148,36 @@ public void shouldUseZip64WhenTotalEntriesOverFFFF() throws IOException {
         assertThat(zipModel.isZip64()).isTrue();
     }
 
-//    // TODO it works but it's too slow
-//    @Test(dependsOnMethods = "shouldUseZip64WhenTotalEntriesOverFFFF")
-//    public void shouldUnzipZip64WhenTotalEntriesOverFFFF() throws IOException {
-//        Path destDir = Zip4jvmSuite.subDirNameAsMethodName(rootDir);
-//        UnzipIt.extract(zipManyEntries, destDir);
-//        assertThatDirectory(destDir).hasDirectories(0).hasFiles(ZipModel.MAX_TOTAL_ENTRIES + 1);
-//    }
-
-//    public void shouldUseZip64WhenEntrySizeOverFFFFFFFF() throws IOException {
-//        Path dir = Zip4jvmSuite.subDirNameAsMethodName(rootDir);
-//        Files.createDirectories(dir);
-//
-//        Path file = dir.resolve("file.txt");
-//
-//        try (RandomAccessFile f = new RandomAccessFile(file.toFile(), "rw")) {
-//            f.setLength(ZipModel.MAX_ENTRY_SIZE + 1);
-//        }
-//
-//        Path zipHugeEntry = dir.resolve("src.zip");
-//        ZipEntrySettings entrySettings = ZipEntrySettings.builder().compression(Compression.STORE, CompressionLevel.NORMAL).build();
-//        ZipSettings settings = ZipSettings.builder().entrySettingsProvider(fileNam -> entrySettings).build();
-//        ZipIt.zip(zipHugeEntry).settings(settings).add(Arrays.asList(file, fileBentley));
-//
-//        ZipModel zipModel = ZipModelBuilder.read(SrcZip.of(zipHugeEntry));
-//        assertThat(zipModel.getZipEntryByFileName("file.txt").getUncompressedSize()).isEqualTo(ZipModel.MAX_ENTRY_SIZE + 1);
-//        assertThat(zipModel.getZipEntryByFileName(fileNameBentley).getUncompressedSize()).isEqualTo(1_395_362);
-//
-//        // TODO asserts in zip should be using
-//    }
+    //    // TODO it works but it's too slow
+    //    @Test(dependsOnMethods = "shouldUseZip64WhenTotalEntriesOverFFFF")
+    //    public void shouldUnzipZip64WhenTotalEntriesOverFFFF() throws IOException {
+    //        Path destDir = Zip4jvmSuite.subDirNameAsMethodName(rootDir);
+    //        UnzipIt.extract(zipManyEntries, destDir);
+    //        assertThatDirectory(destDir).hasDirectories(0).hasFiles(ZipModel.MAX_TOTAL_ENTRIES + 1);
+    //    }
+
+    //    public void shouldUseZip64WhenEntrySizeOverFFFFFFFF() throws IOException {
+    //        Path dir = Zip4jvmSuite.subDirNameAsMethodName(rootDir);
+    //        Files.createDirectories(dir);
+    //
+    //        Path file = dir.resolve("file.txt");
+    //
+    //        try (RandomAccessFile f = new RandomAccessFile(file.toFile(), "rw")) {
+    //            f.setLength(ZipModel.MAX_ENTRY_SIZE + 1);
+    //        }
+    //
+    //        Path zipHugeEntry = dir.resolve("src.zip");
+    //        ZipEntrySettings entrySettings = ZipEntrySettings.builder().compression(Compression.STORE,
+    //        CompressionLevel.NORMAL).build();
+    //        ZipSettings settings = ZipSettings.builder().entrySettingsProvider(fileNam -> entrySettings).build();
+    //        ZipIt.zip(zipHugeEntry).settings(settings).add(Arrays.asList(file, fileBentley));
+    //
+    //        ZipModel zipModel = ZipModelBuilder.read(SrcZip.of(zipHugeEntry));
+    //        assertThat(zipModel.getZipEntryByFileName("file.txt").getUncompressedSize())
+    //        .isEqualTo(ZipModel.MAX_ENTRY_SIZE + 1);
+    //        assertThat(zipModel.getZipEntryByFileName(fileNameBentley).getUncompressedSize()).isEqualTo(1_395_362);
+    //
+    //        // TODO asserts in zip should be using
+    //    }
 
 }
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/ZipItTest.java b/src/test/java/ru/olegcherednik/zip4jvm/ZipItTest.java
index 21b555d8f..07765731c 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/ZipItTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/ZipItTest.java
@@ -18,15 +18,16 @@
  */
 package ru.olegcherednik.zip4jvm;
 
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.model.Compression;
 import ru.olegcherednik.zip4jvm.model.CompressionLevel;
 import ru.olegcherednik.zip4jvm.model.settings.ZipEntrySettings;
 import ru.olegcherednik.zip4jvm.model.settings.ZipSettings;
 import ru.olegcherednik.zip4jvm.utils.ReflectionUtils;
 
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Path;
@@ -129,17 +130,21 @@ public void shouldAddRegularFilesAndDirectoriesWhenZipExistsDefaultSettings() th
     }
 
     public void shouldThrowExceptionWhenAddNullPathAndDefaultSettings() {
-        assertThatThrownBy(() -> ZipIt.zip(defSingleZip).add((Path)null)).isExactlyInstanceOf(IllegalArgumentException.class);
+        assertThatThrownBy(() -> ZipIt.zip(defSingleZip)
+                                      .add((Path) null)).isExactlyInstanceOf(IllegalArgumentException.class);
     }
 
     public void shouldThrowExceptionWhenAddNullPathAndCustomSettings() {
-        ZipEntrySettings entrySettings = ZipEntrySettings.builder().compression(Compression.STORE, CompressionLevel.NORMAL).build();
+        ZipEntrySettings entrySettings = ZipEntrySettings.builder().compression(Compression.STORE,
+                                                                                CompressionLevel.NORMAL).build();
         ZipSettings settings = ZipSettings.builder().entrySettingsProvider(fileName -> entrySettings).build();
-        assertThatThrownBy(() -> ZipIt.zip(customSingleZip).settings(settings).add((Path)null)).isExactlyInstanceOf(IllegalArgumentException.class);
+        assertThatThrownBy(() -> ZipIt.zip(customSingleZip).settings(settings).add((Path) null)).isExactlyInstanceOf(
+                IllegalArgumentException.class);
     }
 
     public void shouldCreateZipWhenAddRegularFileAndCustomSettings() throws IOException {
-        ZipEntrySettings entrySettings = ZipEntrySettings.builder().compression(Compression.STORE, CompressionLevel.NORMAL).build();
+        ZipEntrySettings entrySettings = ZipEntrySettings.builder().compression(Compression.STORE,
+                                                                                CompressionLevel.NORMAL).build();
         ZipSettings settings = ZipSettings.builder().entrySettingsProvider(fileName -> entrySettings).build();
 
         ZipIt.zip(customSingleZip).settings(settings).add(fileBentley);
@@ -149,7 +154,8 @@ public void shouldCreateZipWhenAddRegularFileAndCustomSettings() throws IOExcept
     }
 
     public void shouldCreateZipWhenAddDirectoryAndCustomSettings() throws IOException {
-        ZipEntrySettings entrySettings = ZipEntrySettings.builder().compression(Compression.STORE, CompressionLevel.NORMAL).build();
+        ZipEntrySettings entrySettings = ZipEntrySettings.builder().compression(Compression.STORE,
+                                                                                CompressionLevel.NORMAL).build();
         ZipSettings settings = ZipSettings.builder().entrySettingsProvider(fileName -> entrySettings).build();
 
         Path zip = Zip4jvmSuite.subDirNameAsMethodName(rootDir).resolve("src.zip");
@@ -162,7 +168,8 @@ public void shouldCreateZipWhenAddDirectoryAndCustomSettings() throws IOExceptio
 
     @Test(dependsOnMethods = "shouldCreateZipWhenAddRegularFileAndCustomSettings")
     public void shouldAddRegularFileWhenZipExistsCustomSettings() throws IOException {
-        ZipEntrySettings entrySettings = ZipEntrySettings.builder().compression(Compression.STORE, CompressionLevel.NORMAL).build();
+        ZipEntrySettings entrySettings = ZipEntrySettings.builder().compression(Compression.STORE,
+                                                                                CompressionLevel.NORMAL).build();
         ZipSettings settings = ZipSettings.builder().entrySettingsProvider(fileName -> entrySettings).build();
 
         ZipIt.zip(customSingleZip).settings(settings).add(fileSaintPetersburg);
@@ -174,7 +181,8 @@ public void shouldAddRegularFileWhenZipExistsCustomSettings() throws IOException
 
     @Test(dependsOnMethods = "shouldAddRegularFileWhenZipExistsCustomSettings")
     public void shouldAddDirectoryWhenZipExistsCustomSettings() throws IOException {
-        ZipEntrySettings entrySettings = ZipEntrySettings.builder().compression(Compression.STORE, CompressionLevel.NORMAL).build();
+        ZipEntrySettings entrySettings = ZipEntrySettings.builder().compression(Compression.STORE,
+                                                                                CompressionLevel.NORMAL).build();
         ZipSettings settings = ZipSettings.builder().entrySettingsProvider(fileName -> entrySettings).build();
 
         ZipIt.zip(customSingleZip).settings(settings).add(dirCars);
@@ -186,7 +194,8 @@ public void shouldAddDirectoryWhenZipExistsCustomSettings() throws IOException {
     }
 
     public void shouldCreateZipWhenAddRegularFilesAndDirectoriesAndCustomSettings() throws IOException {
-        ZipEntrySettings entrySettings = ZipEntrySettings.builder().compression(Compression.STORE, CompressionLevel.NORMAL).build();
+        ZipEntrySettings entrySettings = ZipEntrySettings.builder().compression(Compression.STORE,
+                                                                                CompressionLevel.NORMAL).build();
         ZipSettings settings = ZipSettings.builder().entrySettingsProvider(fileName -> entrySettings).build();
 
         ZipIt.zip(customMultiZip).settings(settings).add(Arrays.asList(fileHonda, dirCars));
@@ -198,7 +207,8 @@ public void shouldCreateZipWhenAddRegularFilesAndDirectoriesAndCustomSettings()
 
     @Test(dependsOnMethods = "shouldCreateZipWhenAddRegularFilesAndDirectoriesAndCustomSettings")
     public void shouldAddRegularFilesAndDirectoriesWhenZipExistsCustomSettings() throws IOException {
-        ZipEntrySettings entrySettings = ZipEntrySettings.builder().compression(Compression.STORE, CompressionLevel.NORMAL).build();
+        ZipEntrySettings entrySettings = ZipEntrySettings.builder().compression(Compression.STORE,
+                                                                                CompressionLevel.NORMAL).build();
         ZipSettings settings = ZipSettings.builder().entrySettingsProvider(fileName -> entrySettings).build();
 
         ZipIt.zip(customMultiZip).settings(settings).add(Arrays.asList(fileSaintPetersburg, dirBikes));
@@ -236,11 +246,12 @@ public void shouldUseDefaultZipEntrySettingsWhenSetNull() throws NoSuchFieldExce
         ZipIt zipIt = ZipIt.zip(defEntryZip);
         assertThat(getSettings(zipIt).getEntrySettingsProvider()).isSameAs(ZipEntrySettings.DEFAULT_PROVIDER);
 
-        ZipEntrySettings entrySettings = ZipEntrySettings.builder().compression(Compression.STORE, CompressionLevel.NORMAL).build();
+        ZipEntrySettings entrySettings = ZipEntrySettings.builder().compression(Compression.STORE,
+                                                                                CompressionLevel.NORMAL).build();
         zipIt.entrySettings(entrySettings);
         assertThat(getSettings(zipIt).getEntrySettingsProvider().apply("aa")).isSameAs(entrySettings);
 
-        zipIt.entrySettings((ZipEntrySettings)null);
+        zipIt.entrySettings((ZipEntrySettings) null);
         assertThat(getSettings(zipIt).getEntrySettingsProvider()).isSameAs(ZipEntrySettings.DEFAULT_PROVIDER);
     }
 
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/ZipMiscTest.java b/src/test/java/ru/olegcherednik/zip4jvm/ZipMiscTest.java
index 8cb9e0036..4a3a7b266 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/ZipMiscTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/ZipMiscTest.java
@@ -18,9 +18,6 @@
  */
 package ru.olegcherednik.zip4jvm;
 
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.exception.EntryDuplicationException;
 import ru.olegcherednik.zip4jvm.exception.EntryNotFoundException;
 import ru.olegcherednik.zip4jvm.exception.PathNotExistsException;
@@ -29,6 +26,10 @@
 import ru.olegcherednik.zip4jvm.model.settings.ZipEntrySettings;
 import ru.olegcherednik.zip4jvm.model.settings.ZipSettings;
 
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Path;
@@ -91,19 +92,22 @@ public void shouldRetrieveAllEntryNamesForExistedEncryptedZip() throws IOExcepti
     }
 
     public void shouldThrowExceptionWhenAddedFileNotExists() throws IOException {
-        ZipSettings settings = ZipSettings.builder()
-                                          .entrySettingsProvider(fileName ->
-                                                                         ZipEntrySettings.builder()
-                                                                                         .compression(Compression.STORE, CompressionLevel.NORMAL)
-                                                                                         .build())
-                                          .build();
+        ZipSettings settings = ZipSettings
+                .builder()
+                .entrySettingsProvider(fileName ->
+                                               ZipEntrySettings.builder()
+                                                               .compression(Compression.STORE,
+                                                                            CompressionLevel.NORMAL)
+                                                               .build())
+                .build();
 
         Path notExisted = dirCars.resolve(UUID.randomUUID().toString());
         List files = Arrays.asList(fileBentley, fileFerrari, fileWiesmann, notExisted);
 
         Path zip = Zip4jvmSuite.subDirNameAsMethodName(rootDir).resolve("src.zip");
 
-        assertThatThrownBy(() -> ZipIt.zip(zip).settings(settings).add(files)).isExactlyInstanceOf(PathNotExistsException.class);
+        assertThatThrownBy(() -> ZipIt.zip(zip).settings(settings).add(files)).isExactlyInstanceOf(
+                PathNotExistsException.class);
     }
 
     public void shouldMergeSplitZip() throws IOException {
@@ -114,7 +118,8 @@ public void shouldMergeSplitZip() throws IOException {
 
     @Test(dependsOnMethods = "shouldMergeSplitZip")
     public void shouldThrowExceptionWhenMergeWithDuplicatedEntries() throws IOException {
-        assertThatThrownBy(() -> ZipMisc.zip(zipDeflateSplit).merge(zipMerge)).isExactlyInstanceOf(EntryDuplicationException.class);
+        assertThatThrownBy(() -> ZipMisc.zip(zipDeflateSplit).merge(zipMerge)).isExactlyInstanceOf(
+                EntryDuplicationException.class);
     }
 
     public void shouldRetrieveTrueWhenSplitZipWithMultipleDisks() throws IOException {
@@ -122,13 +127,15 @@ public void shouldRetrieveTrueWhenSplitZipWithMultipleDisks() throws IOException
     }
 
     public void shouldRetrieveTrueWhenSplitZipWithOneDisk() throws IOException {
-        ZipSettings settings = ZipSettings.builder()
-                                          .splitSize(SIZE_1MB)
-                                          .entrySettingsProvider(fileName ->
-                                                                         ZipEntrySettings.builder()
-                                                                                         .compression(Compression.STORE, CompressionLevel.NORMAL)
-                                                                                         .build())
-                                          .build();
+        ZipSettings settings = ZipSettings
+                .builder()
+                .splitSize(SIZE_1MB)
+                .entrySettingsProvider(fileName ->
+                                               ZipEntrySettings.builder()
+                                                               .compression(Compression.STORE,
+                                                                            CompressionLevel.NORMAL)
+                                                               .build())
+                .build();
         Path zip = Zip4jvmSuite.subDirNameAsMethodName(rootDir).resolve("src.zip");
         ZipIt.zip(zip).settings(settings).add(Collections.singleton(fileOlegCherednik));
 
@@ -171,7 +178,8 @@ public void shouldThrowExceptionWhenRemovedEntryWithExactNameDoesNotExists() thr
         ZipMisc zipFile = ZipMisc.zip(zip);
         assertThat(zipFile.getEntries()).hasSize(13);
 
-        assertThatThrownBy(() -> ZipMisc.zip(zip).removeEntryByName(dirNameCars)).isExactlyInstanceOf(EntryNotFoundException.class);
+        assertThatThrownBy(() -> ZipMisc.zip(zip).removeEntryByName(dirNameCars)).isExactlyInstanceOf(
+                EntryNotFoundException.class);
         assertThat(zipFile.getEntries()).hasSize(13);
     }
 
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/assertj/AbstractZipEntryAssert.java b/src/test/java/ru/olegcherednik/zip4jvm/assertj/AbstractZipEntryAssert.java
index c04bf7657..11ad162fe 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/assertj/AbstractZipEntryAssert.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/assertj/AbstractZipEntryAssert.java
@@ -24,10 +24,12 @@
 import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
 
 /**
+ * @param  {@link AbstractZipEntryAssert}
  * @author Oleg Cherednik
  * @since 25.03.2019
  */
-public abstract class AbstractZipEntryAssert> extends AbstractAssert {
+public abstract class AbstractZipEntryAssert>
+        extends AbstractAssert {
 
     protected final ZipFileDecorator zipFile;
 
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/assertj/DirectoryAssert.java b/src/test/java/ru/olegcherednik/zip4jvm/assertj/DirectoryAssert.java
index 495614f8b..4bd08c4e7 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/assertj/DirectoryAssert.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/assertj/DirectoryAssert.java
@@ -18,13 +18,14 @@
  */
 package ru.olegcherednik.zip4jvm.assertj;
 
-import org.apache.commons.io.FilenameUtils;
-import org.assertj.core.api.AbstractFileAssert;
-import org.assertj.core.internal.Failures;
 import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
 import ru.olegcherednik.zip4jvm.exception.Zip4jvmException;
 import ru.olegcherednik.zip4jvm.utils.PathUtils;
 
+import org.apache.commons.io.FilenameUtils;
+import org.assertj.core.api.AbstractFileAssert;
+import org.assertj.core.internal.Failures;
+
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Path;
@@ -72,8 +73,11 @@ public DirectoryAssert hasDirectories(int expected) {
 
         if (actual != expected)
             throw Failures.instance().failure(
-                    String.format("Directory '%s' contains illegal amount of directories: actual - '%d', expected - '%d'",
-                                  this.actual.getAbsolutePath(), actual, expected));
+                    String.format(
+                            "Directory '%s' contains illegal amount of directories: actual - '%d', expected - '%d'",
+                            this.actual.getAbsolutePath(),
+                            actual,
+                            expected));
 
         return myself;
     }
@@ -83,8 +87,11 @@ public DirectoryAssert hasRegularFiles(int expected) {
         int actual = getRegularFiles(this.actual.toPath()).size();
 
         if (actual != expected)
-            throw Failures.instance().failure(String.format("Directory '%s' contains illegal amount of files: actual - '%d', expected - '%d'",
-                                                            this.actual.getAbsolutePath(), actual, expected));
+            throw Failures.instance().failure(String.format(
+                    "Directory '%s' contains illegal amount of files: actual - '%d', expected - '%d'",
+                    this.actual.getAbsolutePath(),
+                    actual,
+                    expected));
 
         return myself;
     }
@@ -94,8 +101,11 @@ public DirectoryAssert hasSymlinks(int expected) {
         int actual = getSymlinks(this.actual.toPath()).size();
 
         if (actual != expected)
-            throw Failures.instance().failure(String.format("Directory '%s' contains illegal amount of files: actual - '%d', expected - '%d'",
-                                                            this.actual.getAbsolutePath(), actual, expected));
+            throw Failures.instance().failure(String.format(
+                    "Directory '%s' contains illegal amount of files: actual - '%d', expected - '%d'",
+                    this.actual.getAbsolutePath(),
+                    actual,
+                    expected));
 
         return myself;
     }
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/assertj/IDirectoryAssert.java b/src/test/java/ru/olegcherednik/zip4jvm/assertj/IDirectoryAssert.java
index 1066be9fd..2843f1ad2 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/assertj/IDirectoryAssert.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/assertj/IDirectoryAssert.java
@@ -21,9 +21,11 @@
 import java.util.function.Consumer;
 
 /**
+ * @param  {@link IDirectoryAssert}
  * @author Oleg Cherednik
  * @since 03.10.2019
  */
+@SuppressWarnings("AbbreviationAsWordInName")
 public interface IDirectoryAssert> {
 
     S exists();
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/assertj/IRegularFileAssert.java b/src/test/java/ru/olegcherednik/zip4jvm/assertj/IRegularFileAssert.java
index 6063a81e0..daeec8a09 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/assertj/IRegularFileAssert.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/assertj/IRegularFileAssert.java
@@ -21,9 +21,11 @@
 import java.util.function.Consumer;
 
 /**
+ * @param  {@link IRegularFileAssert}
  * @author Oleg Cherednik
  * @since 03.10.2019
  */
+@SuppressWarnings("AbbreviationAsWordInName")
 public interface IRegularFileAssert> {
 
     S exists();
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/assertj/ISymlinkAssert.java b/src/test/java/ru/olegcherednik/zip4jvm/assertj/ISymlinkAssert.java
index 9142ac5f7..494ccef2b 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/assertj/ISymlinkAssert.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/assertj/ISymlinkAssert.java
@@ -19,9 +19,11 @@
 package ru.olegcherednik.zip4jvm.assertj;
 
 /**
+ * @param  {@link ISymlinkAssert}
  * @author Oleg Cherednik
  * @since 17.03.2023
  */
+@SuppressWarnings("AbbreviationAsWordInName")
 public interface ISymlinkAssert> {
 
     S exists();
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/assertj/RegularFileAssert.java b/src/test/java/ru/olegcherednik/zip4jvm/assertj/RegularFileAssert.java
index b08f88613..aca07c9f8 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/assertj/RegularFileAssert.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/assertj/RegularFileAssert.java
@@ -18,11 +18,11 @@
  */
 package ru.olegcherednik.zip4jvm.assertj;
 
+import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
+
 import org.apache.commons.lang3.StringUtils;
 import org.assertj.core.api.AbstractPathAssert;
-import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
 
-import javax.imageio.ImageIO;
 import java.io.BufferedReader;
 import java.io.InputStream;
 import java.nio.file.Files;
@@ -31,6 +31,7 @@
 import java.util.function.Consumer;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
+import javax.imageio.ImageIO;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy;
@@ -40,7 +41,8 @@
  * @author Oleg Cherednik
  * @since 28.03.2019
  */
-public class RegularFileAssert extends AbstractPathAssert implements IRegularFileAssert {
+public class RegularFileAssert extends AbstractPathAssert
+        implements IRegularFileAssert {
 
     private static final Pattern REGEX = Pattern.compile("<--\\sregexp\\((?.+)\\)\\s-->.+");
 
@@ -124,11 +126,11 @@ public RegularFileAssert matchesTextLines(String resourceFile) {
                         continue;
 
                     throw new AssertionError(
-                            String.format(
-                                    "(line %d)\r\nExpecting:\r\n<\"%s\">\r\nto be match the pattern:\r\n<\"%s\">\r\nbut was not.",
-                                    pos,
-                                    actual,
-                                    regex));
+                            String.format("(line %d)\r\nExpecting:\r\n<\"%s\">\r\nto be match"
+                                                  + " the pattern:\r\n<\"%s\">\r\nbut was not.",
+                                          pos,
+                                          actual,
+                                          regex));
                 } else
                     assertThatStringLine(this.actual, pos, actual).isEqualTo(expected);
             }
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/assertj/StringLineAssert.java b/src/test/java/ru/olegcherednik/zip4jvm/assertj/StringLineAssert.java
index 684bd8d65..61e5e19c3 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/assertj/StringLineAssert.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/assertj/StringLineAssert.java
@@ -41,7 +41,7 @@ public StringLineAssert(Path path, int pos, String actual) {
     public StringLineAssert isEqualTo(Object expected) {
         try {
             return super.isEqualTo(expected);
-        } catch(AssertionError e) {
+        } catch (AssertionError e) {
             throw new AssertionError(String.format("%s (line %d) %s", path.toAbsolutePath(), pos, e.getMessage()), e);
         }
     }
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/assertj/Zip4jvmAssertions.java b/src/test/java/ru/olegcherednik/zip4jvm/assertj/Zip4jvmAssertions.java
index 30ca018d7..edf5e40c7 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/assertj/Zip4jvmAssertions.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/assertj/Zip4jvmAssertions.java
@@ -18,10 +18,11 @@
  */
 package ru.olegcherednik.zip4jvm.assertj;
 
+import ru.olegcherednik.zip4jvm.model.src.SrcZip;
+
 import lombok.AccessLevel;
 import lombok.NoArgsConstructor;
 import org.assertj.core.api.Assertions;
-import ru.olegcherednik.zip4jvm.model.src.SrcZip;
 
 import java.io.IOException;
 import java.nio.file.Files;
@@ -36,11 +37,13 @@
 public final class Zip4jvmAssertions extends Assertions {
 
     public static ZipFileAssert assertThatZipFile(Path zip) throws IOException {
-        return new ZipFileAssert(isSplit(zip) ? new ZipFileSplitDecorator(zip) : new ZipFileSolidNoEncryptedDecorator(zip));
+        return new ZipFileAssert(isSplit(zip) ? new ZipFileSplitDecorator(zip)
+                                              : new ZipFileSolidNoEncryptedDecorator(zip));
     }
 
     public static ZipFileAssert assertThatZipFile(Path zip, char[] password) throws IOException {
-        return new ZipFileAssert(isSplit(zip) ? new ZipFileSplitDecorator(zip, password) : new ZipFileEncryptedDecoder(zip, password));
+        return new ZipFileAssert(isSplit(zip) ? new ZipFileSplitDecorator(zip, password)
+                                              : new ZipFileEncryptedDecoder(zip, password));
     }
 
     public static DirectoryAssert assertThatDirectory(Path path) {
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/assertj/ZipEntryDirectoryAssert.java b/src/test/java/ru/olegcherednik/zip4jvm/assertj/ZipEntryDirectoryAssert.java
index ae69a097f..9117f0981 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/assertj/ZipEntryDirectoryAssert.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/assertj/ZipEntryDirectoryAssert.java
@@ -18,9 +18,10 @@
  */
 package ru.olegcherednik.zip4jvm.assertj;
 
+import ru.olegcherednik.zip4jvm.utils.ZipUtils;
+
 import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
 import org.assertj.core.internal.Failures;
-import ru.olegcherednik.zip4jvm.utils.ZipUtils;
 
 import java.util.function.Consumer;
 import java.util.function.Predicate;
@@ -29,7 +30,8 @@
  * @author Oleg Cherednik
  * @since 25.03.2019
  */
-public class ZipEntryDirectoryAssert extends AbstractZipEntryAssert implements IDirectoryAssert {
+public class ZipEntryDirectoryAssert extends AbstractZipEntryAssert
+        implements IDirectoryAssert {
 
     public ZipEntryDirectoryAssert(ZipArchiveEntry actual, ZipFileDecorator zipFile) {
         super(actual, ZipEntryDirectoryAssert.class, zipFile);
@@ -41,8 +43,11 @@ public ZipEntryDirectoryAssert hasEntries(int expected) {
 
         if (actual != expected)
             throw Failures.instance().failure(
-                    String.format("Zip directory '%s' contains illegal amount of entries: actual - '%d', expected - '%d'",
-                                  this.actual, actual, expected));
+                    String.format(
+                            "Zip directory '%s' contains illegal amount of entries: actual - '%d', expected - '%d'",
+                            this.actual,
+                            actual,
+                            expected));
 
         return myself;
     }
@@ -53,8 +58,11 @@ public ZipEntryDirectoryAssert hasDirectories(int expected) {
 
         if (actual != expected)
             throw Failures.instance().failure(
-                    String.format("Zip directory '%s' contains illegal amount of directories: actual - '%d', expected - '%d'",
-                                  this.actual, actual, expected));
+                    String.format(
+                            "Zip directory '%s' contains illegal amount of directories: actual - '%d', expected - '%d'",
+                            this.actual,
+                            actual,
+                            expected));
 
         return myself;
     }
@@ -64,8 +72,11 @@ public ZipEntryDirectoryAssert hasRegularFiles(int expected) {
         long actual = getZipEntriesAmount(ZipEntryUtils::isRegularFile);
 
         if (actual != expected)
-            throw Failures.instance().failure(String.format("Zip directory '%s' contains illegal amount of files: actual - '%d', expected - '%d'",
-                                                            this.actual, actual, expected));
+            throw Failures.instance().failure(String.format(
+                    "Zip directory '%s' contains illegal amount of files: actual - '%d', expected - '%d'",
+                    this.actual,
+                    actual,
+                    expected));
 
         return myself;
     }
@@ -75,8 +86,11 @@ public ZipEntryDirectoryAssert hasSymlinks(int expected) {
         long actual = getZipEntriesAmount(ZipEntryUtils::isSymlink);
 
         if (actual != expected)
-            throw Failures.instance().failure(String.format("Zip directory '%s' contains illegal amount of symlinks: actual - '%d', expected - '%d'",
-                                                            this.actual, actual, expected));
+            throw Failures.instance().failure(String.format(
+                    "Zip directory '%s' contains illegal amount of symlinks: actual - '%d', expected - '%d'",
+                    this.actual,
+                    actual,
+                    expected));
 
         return myself;
     }
@@ -119,14 +133,14 @@ private int getEntriesAmount() {
     }
 
     private int getZipEntriesAmount(Predicate predicate) {
-        return (int)zipFile.getSubEntries(actual.getName()).stream()
-                           .map(ZipUtils::getFileNameNoDirectoryMarker)
-                           .map(entryName -> {
-                               String parent = "/".equals(actual.getName()) ? "" : actual.getName();
-                               return zipFile.getEntry(parent + entryName);
-                           })
-                           .filter(predicate)
-                           .count();
+        return (int) zipFile.getSubEntries(actual.getName()).stream()
+                            .map(ZipUtils::getFileNameNoDirectoryMarker)
+                            .map(entryName -> {
+                                String parent = "/".equals(actual.getName()) ? "" : actual.getName();
+                                return zipFile.getEntry(parent + entryName);
+                            })
+                            .filter(predicate)
+                            .count();
     }
 
 }
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/assertj/ZipEntryRegularFileAssert.java b/src/test/java/ru/olegcherednik/zip4jvm/assertj/ZipEntryRegularFileAssert.java
index 4bb79f02f..6db3812bb 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/assertj/ZipEntryRegularFileAssert.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/assertj/ZipEntryRegularFileAssert.java
@@ -18,16 +18,17 @@
  */
 package ru.olegcherednik.zip4jvm.assertj;
 
+import ru.olegcherednik.zip4jvm.model.Charsets;
+
 import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
 import org.apache.commons.io.IOUtils;
 import org.apache.commons.lang3.ArrayUtils;
-import ru.olegcherednik.zip4jvm.model.Charsets;
 
-import javax.imageio.ImageIO;
 import java.io.InputStream;
 import java.util.List;
 import java.util.function.Consumer;
 import java.util.regex.Pattern;
+import javax.imageio.ImageIO;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy;
@@ -36,7 +37,8 @@
  * @author Oleg Cherednik
  * @since 25.03.2019
  */
-public class ZipEntryRegularFileAssert extends AbstractZipEntryAssert implements IRegularFileAssert {
+public class ZipEntryRegularFileAssert extends AbstractZipEntryAssert
+        implements IRegularFileAssert {
 
     private static final Pattern NEW_LINE = Pattern.compile("\\r?\\n");
 
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/assertj/ZipEntrySymlinkAssert.java b/src/test/java/ru/olegcherednik/zip4jvm/assertj/ZipEntrySymlinkAssert.java
index 92de6ac38..4ef7d7b1d 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/assertj/ZipEntrySymlinkAssert.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/assertj/ZipEntrySymlinkAssert.java
@@ -18,9 +18,10 @@
  */
 package ru.olegcherednik.zip4jvm.assertj;
 
+import ru.olegcherednik.zip4jvm.model.Charsets;
+
 import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
 import org.apache.commons.io.IOUtils;
-import ru.olegcherednik.zip4jvm.model.Charsets;
 
 import java.io.IOException;
 import java.io.InputStream;
@@ -32,7 +33,8 @@
  * @author Oleg Cherednik
  * @since 17.03.2023
  */
-public class ZipEntrySymlinkAssert extends AbstractZipEntryAssert implements ISymlinkAssert {
+public class ZipEntrySymlinkAssert extends AbstractZipEntryAssert
+        implements ISymlinkAssert {
 
     public ZipEntrySymlinkAssert(ZipArchiveEntry actual, ZipFileDecorator zipFile) {
         super(actual, ZipEntrySymlinkAssert.class, zipFile);
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/assertj/ZipEntryUtils.java b/src/test/java/ru/olegcherednik/zip4jvm/assertj/ZipEntryUtils.java
index 421276be4..95a036795 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/assertj/ZipEntryUtils.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/assertj/ZipEntryUtils.java
@@ -18,10 +18,11 @@
  */
 package ru.olegcherednik.zip4jvm.assertj;
 
+import ru.olegcherednik.zip4jvm.model.ExternalFileAttributes;
+
 import lombok.AccessLevel;
 import lombok.NoArgsConstructor;
 import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
-import ru.olegcherednik.zip4jvm.model.ExternalFileAttributes;
 
 @NoArgsConstructor(access = AccessLevel.PRIVATE)
 final class ZipEntryUtils {
@@ -43,10 +44,10 @@ private static ExternalFileAttributes getExternalAttributes(ZipArchiveEntry entr
         long attr = entry.getExternalAttributes();
 
         return new ExternalFileAttributes(new byte[] {
-                (byte)(attr & 0xFF),
-                (byte)((attr >> 8) & 0xFF),
-                (byte)((attr >> 16) & 0xFF),
-                (byte)((attr >> 24) & 0xFF)
+                (byte) (attr & 0xFF),
+                (byte) ((attr >> 8) & 0xFF),
+                (byte) ((attr >> 16) & 0xFF),
+                (byte) ((attr >> 24) & 0xFF)
         });
     }
 }
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/assertj/ZipFileAssert.java b/src/test/java/ru/olegcherednik/zip4jvm/assertj/ZipFileAssert.java
index fb5659ff4..45e330209 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/assertj/ZipFileAssert.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/assertj/ZipFileAssert.java
@@ -46,7 +46,8 @@ public ZipEntryDirectoryAssert directory(String name) {
 
         if (!entry.isDirectory())
             throw Failures.instance().failure(
-                    String.format("Zip file does not contain directory entry '%s' (directory entry should end with '/'", name));
+                    String.format("Zip file does not contain directory entry '%s' (directory entry should end with '/'",
+                                  name));
 
         return new ZipEntryDirectoryAssert(entry, actual);
     }
@@ -60,7 +61,8 @@ public ZipEntryRegularFileAssert regularFile(String name) {
 
         if (entry.isDirectory())
             throw Failures.instance().failure(
-                    String.format("Zip file does not contain file entry '%s' (file entry should not end with '/'", name));
+                    String.format("Zip file does not contain file entry '%s' (file entry should not end with '/'",
+                                  name));
 
         return new ZipEntryRegularFileAssert(entry, actual);
     }
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/assertj/ZipFileDecorator.java b/src/test/java/ru/olegcherednik/zip4jvm/assertj/ZipFileDecorator.java
index 10d605d61..0b03b9b39 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/assertj/ZipFileDecorator.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/assertj/ZipFileDecorator.java
@@ -18,10 +18,11 @@
  */
 package ru.olegcherednik.zip4jvm.assertj;
 
+import ru.olegcherednik.zip4jvm.exception.Zip4jvmException;
+
 import lombok.Getter;
 import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
 import org.apache.commons.compress.archivers.zip.ZipFile;
-import ru.olegcherednik.zip4jvm.exception.Zip4jvmException;
 
 import java.io.InputStream;
 import java.nio.file.Path;
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/assertj/ZipFileEncryptedDecoder.java b/src/test/java/ru/olegcherednik/zip4jvm/assertj/ZipFileEncryptedDecoder.java
index 18ccfebca..9afeacd1d 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/assertj/ZipFileEncryptedDecoder.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/assertj/ZipFileEncryptedDecoder.java
@@ -18,6 +18,8 @@
  */
 package ru.olegcherednik.zip4jvm.assertj;
 
+import ru.olegcherednik.zip4jvm.exception.Zip4jvmException;
+
 import net.sf.sevenzipjbinding.ArchiveFormat;
 import net.sf.sevenzipjbinding.ExtractOperationResult;
 import net.sf.sevenzipjbinding.IInArchive;
@@ -31,7 +33,6 @@
 import org.apache.commons.io.FilenameUtils;
 import org.apache.commons.lang3.ArrayUtils;
 import org.apache.commons.lang3.StringUtils;
-import ru.olegcherednik.zip4jvm.exception.Zip4jvmException;
 
 import java.io.ByteArrayInputStream;
 import java.io.InputStream;
@@ -52,7 +53,7 @@ class ZipFileEncryptedDecoder extends ZipFileDecorator {
     private final String password;
 
     @SuppressWarnings("MethodCanBeVariableArityMethod")
-    public ZipFileEncryptedDecoder(Path zipFile, char[] password) {
+    ZipFileEncryptedDecoder(Path zipFile, char[] password) {
         super(zipFile, entries(zipFile));
         this.password = password == null ? null : new String(password);
     }
@@ -67,9 +68,9 @@ public InputStream getInputStream(ZipEntry entry) {
                     return getInputStream(item);
 
             throw new Zip4jvmException("Entry '" + entry + "' was not found");
-        } catch(Zip4jvmException e) {
+        } catch (Zip4jvmException e) {
             throw e;
-        } catch(Exception e) {
+        } catch (Exception e) {
             throw new Zip4jvmException(e);
         }
     }
@@ -86,9 +87,9 @@ public String getComment() {
              IInArchive zip = SevenZip.openInArchive(ArchiveFormat.ZIP, in)) {
             String str = zip.getStringArchiveProperty(PropID.COMMENT);
             return StringUtils.length(str) == 0 ? null : str;
-        } catch(Zip4jvmException e) {
+        } catch (Zip4jvmException e) {
             throw e;
-        } catch(Exception e) {
+        } catch (Exception e) {
             throw new Zip4jvmException(e);
         }
     }
@@ -132,9 +133,9 @@ private static Map entries(Path path) {
             }
 
             return map;
-        } catch(Zip4jvmException e) {
+        } catch (Zip4jvmException e) {
             throw e;
-        } catch(Exception e) {
+        } catch (Exception e) {
             throw new Zip4jvmException(e);
         }
     }
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/assertj/ZipFileSolidNoEncryptedDecorator.java b/src/test/java/ru/olegcherednik/zip4jvm/assertj/ZipFileSolidNoEncryptedDecorator.java
index 638caea1b..b13c08614 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/assertj/ZipFileSolidNoEncryptedDecorator.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/assertj/ZipFileSolidNoEncryptedDecorator.java
@@ -18,15 +18,16 @@
  */
 package ru.olegcherednik.zip4jvm.assertj;
 
+import ru.olegcherednik.zip4jvm.ZipInfo;
+import ru.olegcherednik.zip4jvm.exception.Zip4jvmException;
+import ru.olegcherednik.zip4jvm.model.CentralDirectory;
+
 import com.github.luben.zstd.Zstd;
 import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
 import org.apache.commons.compress.archivers.zip.ZipFile;
 import org.apache.commons.compress.archivers.zip.ZipMethod;
 import org.apache.commons.io.IOUtils;
 import org.tukaani.xz.LZMAInputStream;
-import ru.olegcherednik.zip4jvm.ZipInfo;
-import ru.olegcherednik.zip4jvm.exception.Zip4jvmException;
-import ru.olegcherednik.zip4jvm.model.CentralDirectory;
 
 import java.io.ByteArrayInputStream;
 import java.io.IOException;
@@ -42,12 +43,12 @@
  * @author Oleg Cherednik
  * @since 03.10.2019
  */
-@SuppressWarnings("MagicConstant")
+@SuppressWarnings({ "MagicConstant", "AnonInnerLength" })
 class ZipFileSolidNoEncryptedDecorator extends ZipFileDecorator {
 
     private static final int METHOD_ZSTD = 93;
 
-    public ZipFileSolidNoEncryptedDecorator(Path zip) {
+    ZipFileSolidNoEncryptedDecorator(Path zip) {
         super(zip);
     }
 
@@ -67,12 +68,13 @@ else if (zipEntry.getMethod() == ZipMethod.LZMA.getCode()) {
                         InputStream in = zipFile.getRawInputStream(zipEntry);
                         ByteBuffer buffer = ByteBuffer.wrap(IOUtils.readFully(in, 9)).order(ByteOrder.LITTLE_ENDIAN);
 
-                        int majorVersion = buffer.get();
-                        int minorVersion = buffer.get();
+                        buffer.get();    // majorVersion
+                        buffer.get();    // minorVersion
                         int size = buffer.getShort() & 0xFFFF;
 
                         if (size != 5)
-                            throw new UnsupportedOperationException("ZipEntry LZMA should have size 5 in header: " + zipEntry.getName());
+                            throw new UnsupportedOperationException(
+                                    "ZipEntry LZMA should have size 5 in header: " + zipEntry.getName());
 
                         CentralDirectory.FileHeader fileHeader = ZipInfo.zip(zip).getFileHeader(zipEntry.getName());
                         boolean lzmaEosMarker = fileHeader.getGeneralPurposeFlag().isLzmaEosMarker();
@@ -83,8 +85,13 @@ else if (zipEntry.getMethod() == ZipMethod.LZMA.getCode()) {
                     } else if (zipEntry.getMethod() == METHOD_ZSTD) {
                         InputStream in = zipFile.getRawInputStream(zipEntry);
                         byte[] compressed = IOUtils.toByteArray(in);
-                        byte[] decompressed = new byte[(int)zipEntry.getSize()];
-                        long total = Zstd.decompressByteArray(decompressed, 0, decompressed.length, compressed, 0, compressed.length);
+                        byte[] decompressed = new byte[(int) zipEntry.getSize()];
+                        long total = Zstd.decompressByteArray(decompressed,
+                                                              0,
+                                                              decompressed.length,
+                                                              compressed,
+                                                              0,
+                                                              compressed.length);
 
                         assertThat(total).isEqualTo(decompressed.length);
 
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/assertj/ZipFileSplitDecorator.java b/src/test/java/ru/olegcherednik/zip4jvm/assertj/ZipFileSplitDecorator.java
index 4b5b840ab..13d725f83 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/assertj/ZipFileSplitDecorator.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/assertj/ZipFileSplitDecorator.java
@@ -18,11 +18,12 @@
  */
 package ru.olegcherednik.zip4jvm.assertj;
 
+import ru.olegcherednik.zip4jvm.exception.Zip4jvmException;
+
 import net.lingala.zip4j.ZipFile;
 import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
 import org.apache.commons.io.FilenameUtils;
 import org.apache.commons.lang3.ArrayUtils;
-import ru.olegcherednik.zip4jvm.exception.Zip4jvmException;
 
 import java.io.FileInputStream;
 import java.io.InputStream;
@@ -43,11 +44,11 @@ class ZipFileSplitDecorator extends ZipFileDecorator {
 
     private final char[] password;
 
-    public ZipFileSplitDecorator(Path zip) {
+    ZipFileSplitDecorator(Path zip) {
         this(zip, null);
     }
 
-    public ZipFileSplitDecorator(Path zip, char[] password) {
+    ZipFileSplitDecorator(Path zip, char[] password) {
         super(zip, entries(zip));
         this.password = ArrayUtils.clone(password);
     }
@@ -60,7 +61,7 @@ public InputStream getInputStream(ZipEntry entry) {
             zipFile.extractFile(entry.getName(), tmp.getParent().toString(), tmp.getFileName().toString());
 
             return new FileInputStream(tmp.toFile());
-        } catch(Exception e) {
+        } catch (Exception e) {
             throw new Zip4jvmException(e);
         }
     }
@@ -76,7 +77,7 @@ private static Map entries(Path path) {
                               return entry;
                           })
                           .collect(Collectors.toMap(ZipEntry::getName, Function.identity()));
-        } catch(Exception e) {
+        } catch (Exception e) {
             throw new Zip4jvmException(e);
         }
     }
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/compatibility/Zip4jvmToJdkCompatibilityTest.java b/src/test/java/ru/olegcherednik/zip4jvm/compatibility/Zip4jvmToJdkCompatibilityTest.java
index 4c39db1d4..ab15eccfb 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/compatibility/Zip4jvmToJdkCompatibilityTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/compatibility/Zip4jvmToJdkCompatibilityTest.java
@@ -18,10 +18,11 @@
  */
 package ru.olegcherednik.zip4jvm.compatibility;
 
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.TestDataAssert;
 import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
 
+import org.testng.annotations.Test;
+
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Path;
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/compatibility/Zip4jvmToWinZipAesCompatibilityTest.java b/src/test/java/ru/olegcherednik/zip4jvm/compatibility/Zip4jvmToWinZipAesCompatibilityTest.java
index 449d2e9d4..10047df94 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/compatibility/Zip4jvmToWinZipAesCompatibilityTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/compatibility/Zip4jvmToWinZipAesCompatibilityTest.java
@@ -18,12 +18,13 @@
  */
 package ru.olegcherednik.zip4jvm.compatibility;
 
+import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
+import ru.olegcherednik.zip4jvm.model.Charsets;
+
 import de.idyl.winzipaes.AesZipFileDecrypter;
 import de.idyl.winzipaes.impl.AESDecrypterJCA;
 import de.idyl.winzipaes.impl.ExtZipEntry;
 import org.testng.annotations.Test;
-import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
-import ru.olegcherednik.zip4jvm.model.Charsets;
 
 import java.io.IOException;
 import java.nio.file.Files;
@@ -42,7 +43,8 @@
 @SuppressWarnings({ "NewClassNamingConvention", "FieldNamingConvention" })
 public class Zip4jvmToWinZipAesCompatibilityTest {
 
-    private static final Path rootDir = Zip4jvmSuite.generateSubDirNameWithTime(Zip4jvmToWinZipAesCompatibilityTest.class);
+    private static final Path rootDir =
+            Zip4jvmSuite.generateSubDirNameWithTime(Zip4jvmToWinZipAesCompatibilityTest.class);
 
     public void checkCompatibilityWithWinZipAes() throws IOException, DataFormatException {
         Path dstDir = Zip4jvmSuite.subDirNameAsMethodName(rootDir);
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/compatibility/apk/ApkTest.java b/src/test/java/ru/olegcherednik/zip4jvm/compatibility/apk/ApkTest.java
index 1fa159801..b5d29ef20 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/compatibility/apk/ApkTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/compatibility/apk/ApkTest.java
@@ -18,11 +18,12 @@
  */
 package ru.olegcherednik.zip4jvm.compatibility.apk;
 
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.UnzipIt;
 import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
 import ru.olegcherednik.zip4jvm.assertj.DirectoryAssert;
 
+import org.testng.annotations.Test;
+
 import java.io.IOException;
 import java.nio.file.Path;
 
@@ -48,7 +49,7 @@ public void shouldExtractApk() throws IOException {
         assertThatDirectory(destDir).matches(dir -> {
             dir.exists().hasDirectories(3).hasRegularFiles(10);
 
-            DirectoryAssert dirKotlin = (DirectoryAssert)dir.directory("kotlin");
+            DirectoryAssert dirKotlin = (DirectoryAssert) dir.directory("kotlin");
             dirKotlin.exists().hasDirectories(6).hasRegularFiles(1);
             dirKotlin.directory("annotation").exists().hasDirectories(0).hasRegularFiles(1);
             dirKotlin.directory("collections").exists().hasDirectories(0).hasRegularFiles(1);
@@ -57,7 +58,7 @@ public void shouldExtractApk() throws IOException {
             dirKotlin.directory("ranges").exists().hasDirectories(0).hasRegularFiles(1);
             dirKotlin.directory("reflect").exists().hasDirectories(0).hasRegularFiles(1);
 
-            DirectoryAssert dirMetaInf = (DirectoryAssert)dir.directory("META-INF");
+            DirectoryAssert dirMetaInf = (DirectoryAssert) dir.directory("META-INF");
             dirMetaInf.exists().hasDirectories(2).hasRegularFiles(39);
             dirMetaInf.directory("com").exists().hasDirectories(1).hasRegularFiles(0);
             dirMetaInf.directory("com/android").exists().hasDirectories(1).hasRegularFiles(0);
@@ -65,7 +66,7 @@ public void shouldExtractApk() throws IOException {
             dirMetaInf.directory("com/android/build/gradle").exists().hasDirectories(0).hasRegularFiles(1);
             dirMetaInf.directory("services").exists().hasDirectories(0).hasRegularFiles(2);
 
-            DirectoryAssert dirRes = (DirectoryAssert)dir.directory("res");
+            DirectoryAssert dirRes = (DirectoryAssert) dir.directory("res");
             dirRes.exists().hasDirectories(42).hasRegularFiles(0);
             dirRes.directory("anim").exists().hasDirectories(0).hasRegularFiles(27);
             dirRes.directory("anim-v21").exists().hasDirectories(0).hasRegularFiles(4);
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/compatibility/securezip/SecureZipEncryptedCentralDirectoryToZip4jvmCompatibilityTest.java b/src/test/java/ru/olegcherednik/zip4jvm/compatibility/securezip/SecureZipEncryptedCentralDirectoryToZip4jvmCompatibilityTest.java
index c9083b39d..9a5d866b6 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/compatibility/securezip/SecureZipEncryptedCentralDirectoryToZip4jvmCompatibilityTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/compatibility/securezip/SecureZipEncryptedCentralDirectoryToZip4jvmCompatibilityTest.java
@@ -18,10 +18,11 @@
  */
 package ru.olegcherednik.zip4jvm.compatibility.securezip;
 
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.UnzipIt;
 import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
 
+import org.testng.annotations.Test;
+
 import java.io.IOException;
 import java.nio.file.Path;
 
@@ -29,12 +30,8 @@
 import static ru.olegcherednik.zip4jvm.TestData.secureZipBzip2SplitAes256StrongEcdZip;
 import static ru.olegcherednik.zip4jvm.TestData.secureZipDeflate64SolidAes256StrongEcdZip;
 import static ru.olegcherednik.zip4jvm.TestData.secureZipDeflateSolidAes256StrongEcdZip;
-import static ru.olegcherednik.zip4jvm.TestData.secureZipDeflateSolidAes256StrongZip;
 import static ru.olegcherednik.zip4jvm.TestData.secureZipLzmaSolidAes256StrongEcdZip;
-import static ru.olegcherednik.zip4jvm.TestData.secureZipStoreSolidAes128StrongZip;
-import static ru.olegcherednik.zip4jvm.TestData.secureZipStoreSolidAes192StrongZip;
 import static ru.olegcherednik.zip4jvm.TestData.secureZipStoreSolidAes256StrongEcdZip;
-import static ru.olegcherednik.zip4jvm.TestData.secureZipStoreSolidAes256StrongZip;
 import static ru.olegcherednik.zip4jvm.TestDataAssert.dirBikesAssert;
 import static ru.olegcherednik.zip4jvm.TestDataAssert.rootAssert;
 import static ru.olegcherednik.zip4jvm.Zip4jvmSuite.password;
@@ -48,7 +45,8 @@
 @SuppressWarnings({ "FieldNamingConvention", "NewClassNamingConvention" })
 public class SecureZipEncryptedCentralDirectoryToZip4jvmCompatibilityTest {
 
-    private static final Path rootDir = Zip4jvmSuite.generateSubDirNameWithTime(SecureZipEncryptedCentralDirectoryToZip4jvmCompatibilityTest.class);
+    private static final Path rootDir = Zip4jvmSuite.generateSubDirNameWithTime(
+            SecureZipEncryptedCentralDirectoryToZip4jvmCompatibilityTest.class);
 
     public void shouldUnzipWhenStoreSolidAes256StrongEncryptedCentralDirectory() throws IOException {
         Path destDir = Zip4jvmSuite.subDirNameAsMethodName(rootDir);
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/compatibility/securezip/SecureZipStrongToZip4jvmCompatibilityTest.java b/src/test/java/ru/olegcherednik/zip4jvm/compatibility/securezip/SecureZipStrongToZip4jvmCompatibilityTest.java
index 3844c367f..800741f97 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/compatibility/securezip/SecureZipStrongToZip4jvmCompatibilityTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/compatibility/securezip/SecureZipStrongToZip4jvmCompatibilityTest.java
@@ -18,10 +18,11 @@
  */
 package ru.olegcherednik.zip4jvm.compatibility.securezip;
 
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.UnzipIt;
 import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
 
+import org.testng.annotations.Test;
+
 import java.io.IOException;
 import java.nio.file.Path;
 
@@ -46,7 +47,8 @@
 @SuppressWarnings({ "FieldNamingConvention", "NewClassNamingConvention" })
 public class SecureZipStrongToZip4jvmCompatibilityTest {
 
-    private static final Path rootDir = Zip4jvmSuite.generateSubDirNameWithTime(SecureZipStrongToZip4jvmCompatibilityTest.class);
+    private static final Path rootDir = Zip4jvmSuite.generateSubDirNameWithTime(
+            SecureZipStrongToZip4jvmCompatibilityTest.class);
 
     public void shouldUnzipWhenStoreSolidAes256Strong() throws IOException {
         Path destDir = Zip4jvmSuite.subDirNameAsMethodName(rootDir);
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/compatibility/securezip/SecureZipToZip4jvmCompatibilityTest.java b/src/test/java/ru/olegcherednik/zip4jvm/compatibility/securezip/SecureZipToZip4jvmCompatibilityTest.java
index abba66a28..7cccd865b 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/compatibility/securezip/SecureZipToZip4jvmCompatibilityTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/compatibility/securezip/SecureZipToZip4jvmCompatibilityTest.java
@@ -18,10 +18,11 @@
  */
 package ru.olegcherednik.zip4jvm.compatibility.securezip;
 
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.UnzipIt;
 import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
 
+import org.testng.annotations.Test;
+
 import java.io.IOException;
 import java.nio.file.Path;
 
@@ -44,7 +45,8 @@
 @SuppressWarnings({ "FieldNamingConvention", "NewClassNamingConvention" })
 public class SecureZipToZip4jvmCompatibilityTest {
 
-    private static final Path rootDir = Zip4jvmSuite.generateSubDirNameWithTime(SecureZipToZip4jvmCompatibilityTest.class);
+    private static final Path rootDir =
+            Zip4jvmSuite.generateSubDirNameWithTime(SecureZipToZip4jvmCompatibilityTest.class);
 
     public void shouldUnzipWhenLzmaSolid() throws IOException {
         Path destDir = Zip4jvmSuite.subDirNameAsMethodName(rootDir);
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/compatibility/sevenzip/SevenZipToZip4jvmCompatibilityTest.java b/src/test/java/ru/olegcherednik/zip4jvm/compatibility/sevenzip/SevenZipToZip4jvmCompatibilityTest.java
index 2710984af..0170ec9af 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/compatibility/sevenzip/SevenZipToZip4jvmCompatibilityTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/compatibility/sevenzip/SevenZipToZip4jvmCompatibilityTest.java
@@ -18,10 +18,11 @@
  */
 package ru.olegcherednik.zip4jvm.compatibility.sevenzip;
 
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.UnzipIt;
 import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
 
+import org.testng.annotations.Test;
+
 import java.io.IOException;
 import java.nio.file.Path;
 
@@ -44,7 +45,8 @@
 @SuppressWarnings({ "FieldNamingConvention", "NewClassNamingConvention" })
 public class SevenZipToZip4jvmCompatibilityTest {
 
-    private static final Path rootDir = Zip4jvmSuite.generateSubDirNameWithTime(SevenZipToZip4jvmCompatibilityTest.class);
+    private static final Path rootDir =
+            Zip4jvmSuite.generateSubDirNameWithTime(SevenZipToZip4jvmCompatibilityTest.class);
 
     public void shouldUnzipWhenLzmaSolid() throws IOException {
         Path destDir = Zip4jvmSuite.subDirNameAsMethodName(rootDir);
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/compatibility/sevenzip/Zip4jvmToSevenZipCompatibilityTest.java b/src/test/java/ru/olegcherednik/zip4jvm/compatibility/sevenzip/Zip4jvmToSevenZipCompatibilityTest.java
index d82fed798..d8cee9e26 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/compatibility/sevenzip/Zip4jvmToSevenZipCompatibilityTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/compatibility/sevenzip/Zip4jvmToSevenZipCompatibilityTest.java
@@ -18,6 +18,9 @@
  */
 package ru.olegcherednik.zip4jvm.compatibility.sevenzip;
 
+import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
+import ru.olegcherednik.zip4jvm.exception.Zip4jvmException;
+
 import net.sf.sevenzipjbinding.ArchiveFormat;
 import net.sf.sevenzipjbinding.ExtractOperationResult;
 import net.sf.sevenzipjbinding.IInArchive;
@@ -27,8 +30,6 @@
 import net.sf.sevenzipjbinding.simple.ISimpleInArchiveItem;
 import org.apache.commons.lang3.ArrayUtils;
 import org.testng.annotations.Test;
-import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
-import ru.olegcherednik.zip4jvm.exception.Zip4jvmException;
 
 import java.io.IOException;
 import java.io.RandomAccessFile;
@@ -49,10 +50,12 @@
  * @since 05.04.2019
  */
 @Test
-@SuppressWarnings({ "FieldNamingConvention", "NewClassNamingConvention", "LocalVariableNamingConvention", "OverlyNestedMethod" })
+@SuppressWarnings({ "FieldNamingConvention", "NewClassNamingConvention", "LocalVariableNamingConvention",
+        "OverlyNestedMethod" })
 public class Zip4jvmToSevenZipCompatibilityTest {
 
-    private static final Path rootDir = Zip4jvmSuite.generateSubDirNameWithTime(Zip4jvmToSevenZipCompatibilityTest.class);
+    private static final Path rootDir =
+            Zip4jvmSuite.generateSubDirNameWithTime(Zip4jvmToSevenZipCompatibilityTest.class);
 
     public void checkCompatibilityWithSevenZip() throws IOException {
         Path parentDir = Zip4jvmSuite.subDirNameAsMethodName(rootDir);
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/compatibility/winrar/WinRarToZip4jvmCompatibilityTest.java b/src/test/java/ru/olegcherednik/zip4jvm/compatibility/winrar/WinRarToZip4jvmCompatibilityTest.java
index 0c8874747..63dcc7019 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/compatibility/winrar/WinRarToZip4jvmCompatibilityTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/compatibility/winrar/WinRarToZip4jvmCompatibilityTest.java
@@ -18,10 +18,11 @@
  */
 package ru.olegcherednik.zip4jvm.compatibility.winrar;
 
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.UnzipIt;
 import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
 
+import org.testng.annotations.Test;
+
 import java.io.IOException;
 import java.nio.file.Path;
 import java.util.Arrays;
@@ -49,8 +50,12 @@ public class WinRarToZip4jvmCompatibilityTest {
     public void checkCompatibilityWithWinRar() throws IOException {
         Path dir = Zip4jvmSuite.subDirNameAsMethodName(rootDir);
 
-        for (Path zip : Arrays.asList(winRarStoreSolidZip, winRarStoreSolidPkwareZip, winRarStoreSolidAesZip, winRarDeflateSolidZip,
-                winRarDeflateSolidPkwareZip, winRarDeflateSolidAesZip)) {
+        for (Path zip : Arrays.asList(winRarStoreSolidZip,
+                                      winRarStoreSolidPkwareZip,
+                                      winRarStoreSolidAesZip,
+                                      winRarDeflateSolidZip,
+                                      winRarDeflateSolidPkwareZip,
+                                      winRarDeflateSolidAesZip)) {
             Path destDir = Zip4jvmSuite.subDirNameAsRelativePathToRoot(dir, zip);
             UnzipIt.zip(zip).destDir(destDir).password(password).extract();
             assertThatDirectory(destDir).matches(dirBikesAssert);
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/compatibility/winzip/WinZipAesToZip4jvmCompatibilityTest.java b/src/test/java/ru/olegcherednik/zip4jvm/compatibility/winzip/WinZipAesToZip4jvmCompatibilityTest.java
index 46598775e..b52e74e23 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/compatibility/winzip/WinZipAesToZip4jvmCompatibilityTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/compatibility/winzip/WinZipAesToZip4jvmCompatibilityTest.java
@@ -18,13 +18,14 @@
  */
 package ru.olegcherednik.zip4jvm.compatibility.winzip;
 
-import de.idyl.winzipaes.AesZipFileEncrypter;
-import de.idyl.winzipaes.impl.AESEncrypterJCA;
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.UnzipIt;
 import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
 import ru.olegcherednik.zip4jvm.utils.PathUtils;
 
+import de.idyl.winzipaes.AesZipFileEncrypter;
+import de.idyl.winzipaes.impl.AESEncrypterJCA;
+import org.testng.annotations.Test;
+
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Path;
@@ -32,8 +33,8 @@
 import java.util.List;
 import java.util.stream.Collectors;
 
-import static ru.olegcherednik.zip4jvm.TestData.dirSrcData;
 import static ru.olegcherednik.zip4jvm.TestData.dirNameEmpty;
+import static ru.olegcherednik.zip4jvm.TestData.dirSrcData;
 import static ru.olegcherednik.zip4jvm.TestData.fileNameOlegCherednik;
 import static ru.olegcherednik.zip4jvm.TestData.fileOlegCherednik;
 import static ru.olegcherednik.zip4jvm.TestDataAssert.rootAssert;
@@ -49,7 +50,8 @@
 @SuppressWarnings({ "NewClassNamingConvention", "FieldNamingConvention" })
 public class WinZipAesToZip4jvmCompatibilityTest {
 
-    private static final Path rootDir = Zip4jvmSuite.generateSubDirNameWithTime(WinZipAesToZip4jvmCompatibilityTest.class);
+    private static final Path rootDir =
+            Zip4jvmSuite.generateSubDirNameWithTime(WinZipAesToZip4jvmCompatibilityTest.class);
 
     public void winZipAesShouldBeReadableForZip4jvm() throws IOException {
         Path zip = zipItWithWinZipAes(Zip4jvmSuite.subDirNameAsMethodName(rootDir));
@@ -99,7 +101,7 @@ private static List getDirectoryEntries(Path dir) {
             return Files.walk(dir)
                         .filter(path -> Files.isRegularFile(path) || Files.isDirectory(path))
                         .collect(Collectors.toList());
-        } catch(IOException e) {
+        } catch (IOException e) {
             return Collections.emptyList();
         }
     }
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/compression/CompressionBzip2Test.java b/src/test/java/ru/olegcherednik/zip4jvm/compression/CompressionBzip2Test.java
index 99af63945..257c8e788 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/compression/CompressionBzip2Test.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/compression/CompressionBzip2Test.java
@@ -18,9 +18,6 @@
  */
 package ru.olegcherednik.zip4jvm.compression;
 
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.UnzipIt;
 import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
 import ru.olegcherednik.zip4jvm.ZipInfo;
@@ -32,6 +29,10 @@
 import ru.olegcherednik.zip4jvm.model.settings.ZipEntrySettings;
 import ru.olegcherednik.zip4jvm.model.settings.ZipSettings;
 
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Path;
@@ -97,7 +98,8 @@ public void shouldCreateSingleZipWithFilesWhenBzip2CompressionSuperFast() throws
     }
 
     public void shouldUseCompressStoreWhenFileEmpty() throws IOException {
-        ZipEntrySettings entrySettings = ZipEntrySettings.builder().compression(Compression.BZIP2, CompressionLevel.NORMAL).build();
+        ZipEntrySettings entrySettings = ZipEntrySettings.builder().compression(Compression.BZIP2,
+                                                                                CompressionLevel.NORMAL).build();
         ZipSettings settings = ZipSettings.builder().entrySettingsProvider(fileName -> entrySettings).build();
 
         Path zip = Zip4jvmSuite.subDirNameAsMethodName(rootDir).resolve("src.zip");
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/compression/CompressionDeflateTest.java b/src/test/java/ru/olegcherednik/zip4jvm/compression/CompressionDeflateTest.java
index f99e0bf09..f081981f8 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/compression/CompressionDeflateTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/compression/CompressionDeflateTest.java
@@ -18,9 +18,6 @@
  */
 package ru.olegcherednik.zip4jvm.compression;
 
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.UnzipIt;
 import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
 import ru.olegcherednik.zip4jvm.ZipInfo;
@@ -33,6 +30,10 @@
 import ru.olegcherednik.zip4jvm.model.settings.ZipEntrySettings;
 import ru.olegcherednik.zip4jvm.model.settings.ZipSettings;
 
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Path;
@@ -79,7 +80,9 @@ public static void removeDir() throws IOException {
     }
 
     public void shouldCreateSingleZipWithFilesWhenDeflateCompression() throws IOException {
-        ZipEntrySettings entrySettings = ZipEntrySettings.builder().compression(Compression.DEFLATE, CompressionLevel.NORMAL).build();
+        ZipEntrySettings entrySettings = ZipEntrySettings.builder()
+                                                         .compression(Compression.DEFLATE,
+                                                                      CompressionLevel.NORMAL).build();
         ZipSettings settings = ZipSettings.builder().entrySettingsProvider(fileName -> entrySettings).build();
 
         Path zip = Zip4jvmSuite.subDirNameAsMethodName(rootDir).resolve("src.zip");
@@ -90,8 +93,10 @@ public void shouldCreateSingleZipWithFilesWhenDeflateCompression() throws IOExce
     }
 
     public void shouldCreateSplitZipWithFilesWhenDeflateCompression() throws IOException {
-        ZipEntrySettings entrySettings = ZipEntrySettings.builder().compression(Compression.DEFLATE, CompressionLevel.NORMAL).build();
-        ZipSettings settings = ZipSettings.builder().entrySettingsProvider(fileName -> entrySettings).splitSize(SIZE_1MB).build();
+        ZipEntrySettings entrySettings = ZipEntrySettings.builder().compression(Compression.DEFLATE,
+                                                                                CompressionLevel.NORMAL).build();
+        ZipSettings settings = ZipSettings.builder().entrySettingsProvider(fileName -> entrySettings)
+                                          .splitSize(SIZE_1MB).build();
 
         Path zip = Zip4jvmSuite.subDirNameAsMethodName(rootDir).resolve("src.zip");
 
@@ -101,7 +106,8 @@ public void shouldCreateSplitZipWithFilesWhenDeflateCompression() throws IOExcep
     }
 
     public void shouldCreateSingleZipWithEntireFolderWhenDeflateCompression() throws IOException {
-        ZipEntrySettings entrySettings = ZipEntrySettings.builder().compression(Compression.DEFLATE, CompressionLevel.NORMAL).build();
+        ZipEntrySettings entrySettings = ZipEntrySettings.builder().compression(Compression.DEFLATE,
+                                                                                CompressionLevel.NORMAL).build();
         ZipSettings settings = ZipSettings.builder().entrySettingsProvider(fileName -> entrySettings).build();
 
         Path zip = Zip4jvmSuite.subDirNameAsMethodName(rootDir).resolve("src.zip");
@@ -113,8 +119,10 @@ public void shouldCreateSingleZipWithEntireFolderWhenDeflateCompression() throws
     }
 
     public void shouldCreateSplitZipWithEntireFolderWhenStoreCompression() throws IOException {
-        ZipEntrySettings entrySettings = ZipEntrySettings.builder().compression(Compression.STORE, CompressionLevel.NORMAL).build();
-        ZipSettings settings = ZipSettings.builder().entrySettingsProvider(fileName -> entrySettings).splitSize(SIZE_1MB).build();
+        ZipEntrySettings entrySettings = ZipEntrySettings.builder().compression(Compression.STORE,
+                                                                                CompressionLevel.NORMAL).build();
+        ZipSettings settings = ZipSettings.builder().entrySettingsProvider(fileName -> entrySettings)
+                                          .splitSize(SIZE_1MB).build();
 
         Path zip = Zip4jvmSuite.subDirNameAsMethodName(rootDir).resolve("src.zip");
 
@@ -151,7 +159,8 @@ public void shouldUnzipWhenWhenDeflateCompressionAndAesEncryption() throws IOExc
     }
 
     public void shouldUseCompressStoreWhenFileEmpty() throws IOException {
-        ZipEntrySettings entrySettings = ZipEntrySettings.builder().compression(Compression.DEFLATE, CompressionLevel.NORMAL).build();
+        ZipEntrySettings entrySettings = ZipEntrySettings.builder().compression(Compression.DEFLATE,
+                                                                                CompressionLevel.NORMAL).build();
         ZipSettings settings = ZipSettings.builder().entrySettingsProvider(fileName -> entrySettings).build();
 
         Path zip = Zip4jvmSuite.subDirNameAsMethodName(rootDir).resolve("src.zip");
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/compression/CompressionLzmaTest.java b/src/test/java/ru/olegcherednik/zip4jvm/compression/CompressionLzmaTest.java
index 7d8fcd444..2f20cdbb1 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/compression/CompressionLzmaTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/compression/CompressionLzmaTest.java
@@ -18,9 +18,6 @@
  */
 package ru.olegcherednik.zip4jvm.compression;
 
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
 import ru.olegcherednik.zip4jvm.ZipInfo;
 import ru.olegcherednik.zip4jvm.ZipIt;
@@ -31,6 +28,10 @@
 import ru.olegcherednik.zip4jvm.model.settings.ZipEntrySettings;
 import ru.olegcherednik.zip4jvm.model.settings.ZipSettings;
 
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Path;
@@ -116,7 +117,8 @@ public void shouldCreateSingleZipWithFilesWhenLzmaCompressionSuperFastLevelNoEos
     }
 
     public void shouldUseCompressStoreWhenFileEmpty() throws IOException {
-        ZipEntrySettings entrySettings = ZipEntrySettings.builder().compression(Compression.LZMA, CompressionLevel.NORMAL).build();
+        ZipEntrySettings entrySettings = ZipEntrySettings.builder().compression(Compression.LZMA,
+                                                                                CompressionLevel.NORMAL).build();
         ZipSettings settings = ZipSettings.builder().entrySettingsProvider(fileName -> entrySettings).build();
 
         Path zip = Zip4jvmSuite.subDirNameAsMethodName(rootDir).resolve("src.zip");
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/compression/CompressionStoreTest.java b/src/test/java/ru/olegcherednik/zip4jvm/compression/CompressionStoreTest.java
index 89ebf4090..ed0bbb39f 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/compression/CompressionStoreTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/compression/CompressionStoreTest.java
@@ -18,9 +18,6 @@
  */
 package ru.olegcherednik.zip4jvm.compression;
 
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.UnzipIt;
 import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
 import ru.olegcherednik.zip4jvm.ZipIt;
@@ -30,6 +27,10 @@
 import ru.olegcherednik.zip4jvm.model.settings.ZipEntrySettings;
 import ru.olegcherednik.zip4jvm.model.settings.ZipSettings;
 
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Path;
@@ -71,7 +72,8 @@ public static void removeDir() throws IOException {
     }
 
     public void shouldCreateSingleZipWithFilesWhenStoreCompression() throws IOException {
-        ZipEntrySettings entrySettings = ZipEntrySettings.builder().compression(Compression.STORE, CompressionLevel.NORMAL).build();
+        ZipEntrySettings entrySettings = ZipEntrySettings.builder().compression(Compression.STORE,
+                                                                                CompressionLevel.NORMAL).build();
         ZipSettings settings = ZipSettings.builder().entrySettingsProvider(fileName -> entrySettings).build();
 
         Path zip = Zip4jvmSuite.subDirNameAsMethodName(rootDir).resolve("src.zip");
@@ -82,8 +84,10 @@ public void shouldCreateSingleZipWithFilesWhenStoreCompression() throws IOExcept
     }
 
     public void shouldCreateSplitZipWithFilesWhenStoreCompression() throws IOException {
-        ZipEntrySettings entrySettings = ZipEntrySettings.builder().compression(Compression.STORE, CompressionLevel.NORMAL).build();
-        ZipSettings settings = ZipSettings.builder().entrySettingsProvider(fileName -> entrySettings).splitSize(SIZE_1MB).build();
+        ZipEntrySettings entrySettings = ZipEntrySettings.builder().compression(Compression.STORE,
+                                                                                CompressionLevel.NORMAL).build();
+        ZipSettings settings = ZipSettings.builder().entrySettingsProvider(fileName -> entrySettings)
+                                          .splitSize(SIZE_1MB).build();
 
         Path zip = Zip4jvmSuite.subDirNameAsMethodName(rootDir).resolve("src.zip");
 
@@ -93,7 +97,8 @@ public void shouldCreateSplitZipWithFilesWhenStoreCompression() throws IOExcepti
     }
 
     public void shouldCreateSingleZipWithEntireFolderWhenStoreCompression() throws IOException {
-        ZipEntrySettings entrySettings = ZipEntrySettings.builder().compression(Compression.STORE, CompressionLevel.NORMAL).build();
+        ZipEntrySettings entrySettings = ZipEntrySettings.builder().compression(Compression.STORE,
+                                                                                CompressionLevel.NORMAL).build();
         ZipSettings settings = ZipSettings.builder().entrySettingsProvider(fileName -> entrySettings).build();
 
         Path zip = Zip4jvmSuite.subDirNameAsMethodName(rootDir).resolve("src.zip");
@@ -105,8 +110,10 @@ public void shouldCreateSingleZipWithEntireFolderWhenStoreCompression() throws I
     }
 
     public void shouldCreateSplitZipWithEntireFolderWhenStoreCompression() throws IOException {
-        ZipEntrySettings entrySettings = ZipEntrySettings.builder().compression(Compression.STORE, CompressionLevel.NORMAL).build();
-        ZipSettings settings = ZipSettings.builder().entrySettingsProvider(fileName -> entrySettings).splitSize(SIZE_1MB).build();
+        ZipEntrySettings entrySettings = ZipEntrySettings.builder().compression(Compression.STORE,
+                                                                                CompressionLevel.NORMAL).build();
+        ZipSettings settings = ZipSettings.builder().entrySettingsProvider(fileName -> entrySettings)
+                                          .splitSize(SIZE_1MB).build();
 
         Path zip = Zip4jvmSuite.subDirNameAsMethodName(rootDir).resolve("src.zip");
 
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/compression/CompressionZstdTest.java b/src/test/java/ru/olegcherednik/zip4jvm/compression/CompressionZstdTest.java
index c7c5847a3..2830b6e66 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/compression/CompressionZstdTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/compression/CompressionZstdTest.java
@@ -18,9 +18,6 @@
  */
 package ru.olegcherednik.zip4jvm.compression;
 
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
 import ru.olegcherednik.zip4jvm.ZipInfo;
 import ru.olegcherednik.zip4jvm.ZipIt;
@@ -31,6 +28,10 @@
 import ru.olegcherednik.zip4jvm.model.settings.ZipEntrySettings;
 import ru.olegcherednik.zip4jvm.model.settings.ZipSettings;
 
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Path;
@@ -77,7 +78,8 @@ public void shouldCreateSingleZipWithFilesWhenZstdCompressionNormalLevel() throw
     }
 
     public void shouldUseCompressStoreWhenFileEmpty() throws IOException {
-        ZipEntrySettings entrySettings = ZipEntrySettings.builder().compression(Compression.ZSTD, CompressionLevel.NORMAL).build();
+        ZipEntrySettings entrySettings = ZipEntrySettings.builder().compression(Compression.ZSTD,
+                                                                                CompressionLevel.NORMAL).build();
         ZipSettings settings = ZipSettings.builder().entrySettingsProvider(fileName -> entrySettings).build();
 
         Path zip = Zip4jvmSuite.subDirNameAsMethodName(rootDir).resolve("src.zip");
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/crypto/aes/AesDecoderTest.java b/src/test/java/ru/olegcherednik/zip4jvm/crypto/aes/AesDecoderTest.java
index f13d6b015..e9e0d519f 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/crypto/aes/AesDecoderTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/crypto/aes/AesDecoderTest.java
@@ -18,14 +18,15 @@
  */
 package ru.olegcherednik.zip4jvm.crypto.aes;
 
-import org.apache.commons.lang3.ArrayUtils;
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.exception.Zip4jvmException;
 import ru.olegcherednik.zip4jvm.io.in.data.DataInput;
 import ru.olegcherednik.zip4jvm.io.in.file.DataInputFile;
 import ru.olegcherednik.zip4jvm.model.entry.ZipEntry;
 import ru.olegcherednik.zip4jvm.utils.ReflectionUtils;
 
+import org.apache.commons.lang3.ArrayUtils;
+import org.testng.annotations.Test;
+
 import javax.crypto.Cipher;
 import javax.crypto.Mac;
 import javax.crypto.ShortBufferException;
@@ -41,7 +42,6 @@
  * @since 03.10.2019
  */
 @Test
-@SuppressWarnings("NewMethodNamingConvention")
 public class AesDecoderTest {
 
     public void shouldThrowZip4jvmExceptionWhenCreateAndException() {
@@ -52,7 +52,8 @@ public void shouldThrowZip4jvmExceptionWhenCreateAndException() {
 
     public void shouldThrowZip4jvmExceptionWhenDecryptAndException() throws ShortBufferException {
         AesDecoder decoder = createAesDecoder(new AesEngine(mock(Cipher.class), mock(Mac.class)), 3);
-        assertThatThrownBy(() -> decoder.decrypt(ArrayUtils.EMPTY_BYTE_ARRAY, 0, 10)).isExactlyInstanceOf(Zip4jvmException.class);
+        assertThatThrownBy(() -> decoder.decrypt(ArrayUtils.EMPTY_BYTE_ARRAY, 0, 10)).isExactlyInstanceOf(
+                Zip4jvmException.class);
     }
 
     public void shouldThrowExceptionWhenMessageAuthenticationCodeNotMatch() throws Exception {
@@ -70,7 +71,10 @@ public void shouldThrowExceptionWhenMessageAuthenticationCodeNotMatch() throws E
     }
 
     private static AesDecoder createAesDecoder(AesEngine engine, long compressedSize) {
-        return ReflectionUtils.invokeConstructor(AesDecoder.class, new Class[] { AesEngine.class, long.class }, engine, compressedSize);
+        return ReflectionUtils.invokeConstructor(AesDecoder.class,
+                                                 new Class[] { AesEngine.class, long.class },
+                                                 engine,
+                                                 compressedSize);
     }
 
 }
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/crypto/aes/AesEncoderTest.java b/src/test/java/ru/olegcherednik/zip4jvm/crypto/aes/AesEncoderTest.java
index 123f6b911..d3d0a230e 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/crypto/aes/AesEncoderTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/crypto/aes/AesEncoderTest.java
@@ -18,12 +18,13 @@
  */
 package ru.olegcherednik.zip4jvm.crypto.aes;
 
-import org.apache.commons.lang3.ArrayUtils;
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.exception.Zip4jvmException;
 import ru.olegcherednik.zip4jvm.model.entry.ZipEntry;
 import ru.olegcherednik.zip4jvm.utils.ReflectionUtils;
 
+import org.apache.commons.lang3.ArrayUtils;
+import org.testng.annotations.Test;
+
 import javax.crypto.Cipher;
 import javax.crypto.Mac;
 import javax.crypto.ShortBufferException;
@@ -50,11 +51,16 @@ public void shouldThrowZip4jvmExceptionWhenEncryptAndException() throws ShortBuf
         byte[] passwordChecksum = { 0, 0, 0 };
 
         AesEncoder encoder = createAesEncoder(cipher, mac, salt, passwordChecksum);
-        assertThatThrownBy(() -> encoder.encrypt(ArrayUtils.EMPTY_BYTE_ARRAY, 0, 10)).isExactlyInstanceOf(Zip4jvmException.class);
+        assertThatThrownBy(() -> encoder.encrypt(ArrayUtils.EMPTY_BYTE_ARRAY, 0, 10)).isExactlyInstanceOf(
+                Zip4jvmException.class);
     }
 
     private static AesEncoder createAesEncoder(Cipher cipher, Mac mac, byte[] salt, byte[] passwordChecksum) {
-        return ReflectionUtils.invokeConstructor(AesEncoder.class, new Class[] { Cipher.class, Mac.class, byte[].class, byte[].class },
-                cipher, mac, salt, passwordChecksum);
+        return ReflectionUtils.invokeConstructor(AesEncoder.class,
+                                                 new Class[] { Cipher.class, Mac.class, byte[].class, byte[].class },
+                                                 cipher,
+                                                 mac,
+                                                 salt,
+                                                 passwordChecksum);
     }
 }
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/crypto/aes/AesEngineTest.java b/src/test/java/ru/olegcherednik/zip4jvm/crypto/aes/AesEngineTest.java
index 72c6da00a..6a31af58f 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/crypto/aes/AesEngineTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/crypto/aes/AesEngineTest.java
@@ -18,11 +18,11 @@
  */
 package ru.olegcherednik.zip4jvm.crypto.aes;
 
-import org.testng.annotations.DataProvider;
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.model.EncryptionMethod;
 import ru.olegcherednik.zip4jvm.utils.ReflectionUtils;
 
+import org.testng.annotations.Test;
+
 import javax.crypto.Cipher;
 import javax.crypto.Mac;
 
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/data/DefalteZipData.java b/src/test/java/ru/olegcherednik/zip4jvm/data/DefalteZipData.java
index 76d088e26..da7bc3c1c 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/data/DefalteZipData.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/data/DefalteZipData.java
@@ -18,8 +18,6 @@
  */
 package ru.olegcherednik.zip4jvm.data;
 
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
 import ru.olegcherednik.zip4jvm.ZipIt;
 import ru.olegcherednik.zip4jvm.model.Compression;
 import ru.olegcherednik.zip4jvm.model.CompressionLevel;
@@ -27,6 +25,9 @@
 import ru.olegcherednik.zip4jvm.model.settings.ZipEntrySettings;
 import ru.olegcherednik.zip4jvm.model.settings.ZipSettings;
 
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+
 import java.io.IOException;
 import java.nio.file.Files;
 import java.util.function.Function;
@@ -58,7 +59,10 @@ public static void createDeflateZip() throws IOException {
     }
 
     private static void createDeflateSolidZip() throws IOException {
-        ZipEntrySettings entrySettings = ZipEntrySettings.builder().compression(Compression.DEFLATE, CompressionLevel.NORMAL).build();
+        ZipEntrySettings entrySettings = ZipEntrySettings.builder()
+                                                         .compression(Compression.DEFLATE,
+                                                                      CompressionLevel.NORMAL)
+                                                         .build();
         ZipSettings settings = ZipSettings.builder().entrySettingsProvider(fileName -> entrySettings).build();
 
         ZipIt.zip(zipDeflateSolid).settings(settings).add(contentDirSrc);
@@ -69,8 +73,10 @@ private static void createDeflateSolidZip() throws IOException {
     }
 
     private static void createDeflateSplitZip() throws IOException {
-        ZipEntrySettings entrySettings = ZipEntrySettings.builder().compression(Compression.DEFLATE, CompressionLevel.NORMAL).build();
-        ZipSettings settings = ZipSettings.builder().entrySettingsProvider(fileName -> entrySettings).splitSize(SIZE_1MB).build();
+        ZipEntrySettings entrySettings = ZipEntrySettings.builder().compression(Compression.DEFLATE,
+                                                                                CompressionLevel.NORMAL).build();
+        ZipSettings settings = ZipSettings.builder().entrySettingsProvider(fileName -> entrySettings)
+                                          .splitSize(SIZE_1MB).build();
 
         ZipIt.zip(zipDeflateSplit).settings(settings).add(contentDirSrc);
         assertThat(Files.exists(zipDeflateSplit)).isTrue();
@@ -86,7 +92,7 @@ private static void createDeflateSolidPkwareZip() throws IOException {
                                           .entrySettingsProvider(fileName -> entrySettings)
                                           // TODO temporary
                                           .comment("abcабвгдеёжзийклмнопрстуфхцчшщъыьэюя").build();
-//                                          .comment("password: " + passwordStr).build();
+        //                                      .comment("password: " + passwordStr).build();
 
         ZipIt.zip(zipDeflateSolidPkware).settings(settings).add(contentDirSrc);
         assertThat(Files.exists(zipDeflateSolidPkware)).isTrue();
@@ -100,7 +106,8 @@ private static void createDeflateSolidAesZip() throws IOException {
                 fileName -> ZipEntrySettings.builder()
                                             .compression(Compression.DEFLATE, CompressionLevel.NORMAL)
                                             .encryption(Encryption.AES_256, fileName.toCharArray()).build();
-        ZipSettings settings = ZipSettings.builder().entrySettingsProvider(entrySettingsProvider).comment("password: ").build();
+        ZipSettings settings = ZipSettings.builder().entrySettingsProvider(entrySettingsProvider).comment(
+                "password: ").build();
 
         ZipIt.zip(zipDeflateSolidAes).settings(settings).add(contentDirSrc);
         assertThat(Files.exists(zipDeflateSolidAes)).isTrue();
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/data/StoreZipData.java b/src/test/java/ru/olegcherednik/zip4jvm/data/StoreZipData.java
index 8eb259a21..d0aa81fb2 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/data/StoreZipData.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/data/StoreZipData.java
@@ -18,8 +18,6 @@
  */
 package ru.olegcherednik.zip4jvm.data;
 
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
 import ru.olegcherednik.zip4jvm.ZipIt;
 import ru.olegcherednik.zip4jvm.model.Compression;
 import ru.olegcherednik.zip4jvm.model.CompressionLevel;
@@ -27,6 +25,9 @@
 import ru.olegcherednik.zip4jvm.model.settings.ZipEntrySettings;
 import ru.olegcherednik.zip4jvm.model.settings.ZipSettings;
 
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+
 import java.io.IOException;
 import java.nio.file.Files;
 import java.util.function.Function;
@@ -64,7 +65,8 @@ public static void createStoreZip() throws IOException {
     }
 
     private static void createStoreSolidZip() throws IOException {
-        ZipEntrySettings entrySettings = ZipEntrySettings.builder().compression(Compression.STORE, CompressionLevel.NORMAL).build();
+        ZipEntrySettings entrySettings = ZipEntrySettings.builder().compression(Compression.STORE,
+                                                                                CompressionLevel.NORMAL).build();
         ZipSettings settings = ZipSettings.builder().entrySettingsProvider(fileName -> entrySettings).build();
 
         ZipIt.zip(zipStoreSolid).settings(settings).add(contentDirSrc);
@@ -76,8 +78,10 @@ private static void createStoreSolidZip() throws IOException {
     }
 
     private static void createStoreSplitZip() throws IOException {
-        ZipEntrySettings entrySettings = ZipEntrySettings.builder().compression(Compression.STORE, CompressionLevel.NORMAL).build();
-        ZipSettings settings = ZipSettings.builder().entrySettingsProvider(fileName -> entrySettings).splitSize(SIZE_1MB).build();
+        ZipEntrySettings entrySettings = ZipEntrySettings.builder().compression(Compression.STORE,
+                                                                                CompressionLevel.NORMAL).build();
+        ZipSettings settings = ZipSettings.builder().entrySettingsProvider(fileName -> entrySettings)
+                                          .splitSize(SIZE_1MB).build();
 
         ZipIt.zip(zipStoreSplit).settings(settings).add(contentDirSrc);
         assertThat(Files.exists(zipStoreSplit)).isTrue();
@@ -106,7 +110,8 @@ private static void createStoreSolidAesZip() throws IOException {
                 fileName -> ZipEntrySettings.builder()
                                             .compression(Compression.STORE, CompressionLevel.NORMAL)
                                             .encryption(Encryption.AES_192, fileName.toCharArray()).build();
-        ZipSettings settings = ZipSettings.builder().entrySettingsProvider(entrySettingsProvider).comment("password: ").build();
+        ZipSettings settings = ZipSettings.builder().entrySettingsProvider(entrySettingsProvider).comment(
+                "password: ").build();
 
         ZipIt.zip(zipStoreSolidAes).settings(settings).add(contentDirSrc);
         assertThat(Files.exists(zipStoreSolidAes)).isTrue();
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/data/SymlinkData.java b/src/test/java/ru/olegcherednik/zip4jvm/data/SymlinkData.java
index 69f201807..9bc6e8eed 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/data/SymlinkData.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/data/SymlinkData.java
@@ -18,9 +18,10 @@
  */
 package ru.olegcherednik.zip4jvm.data;
 
+import ru.olegcherednik.zip4jvm.engine.ZipSymlinkEngine;
+
 import lombok.AccessLevel;
 import lombok.NoArgsConstructor;
-import ru.olegcherednik.zip4jvm.engine.ZipSymlinkEngine;
 
 import java.io.IOException;
 import java.nio.file.Files;
@@ -54,10 +55,6 @@
 @NoArgsConstructor(access = AccessLevel.PRIVATE)
 public final class SymlinkData {
 
-    public static void main(String... args) throws IOException {
-        createSymlinkData();
-    }
-
     public static void createSymlinkData() throws IOException {
         Files.createDirectories(dirSrcSymlink);
 
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/encryption/EncryptedCentralDirectoryTest.java b/src/test/java/ru/olegcherednik/zip4jvm/encryption/EncryptedCentralDirectoryTest.java
index 66c401014..505c101bb 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/encryption/EncryptedCentralDirectoryTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/encryption/EncryptedCentralDirectoryTest.java
@@ -18,9 +18,6 @@
  */
 package ru.olegcherednik.zip4jvm.encryption;
 
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.UnzipIt;
 import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
 import ru.olegcherednik.zip4jvm.exception.EncryptionNotSupportedException;
@@ -28,6 +25,10 @@
 import ru.olegcherednik.zip4jvm.model.password.PasswordProvider;
 import ru.olegcherednik.zip4jvm.model.settings.UnzipSettings;
 
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Path;
@@ -55,17 +56,17 @@ public static void removeDir() throws IOException {
         Zip4jvmSuite.removeDir(rootDir);
     }
 
-//    public void shouldUnzipWhenStoreSolidAes() throws IOException {
-//        Path zip = Zip4jvmSuite.getResourcePath("/encrypted-central-directory/aes128bit.zip");
-//        Path destDir = Zip4jvmSuite.subDirNameAsMethodName(rootDir);
-//
-//        UnzipSettings settings = UnzipSettings.builder().password(password).build();
-//
-//        UnzipIt.zip(zip).destDir(destDir).settings(settings).extract();
-////        assertThatDirectory(destDir).matches(rootAssert);
-//        int a = 0;
-//        a++;
-//    }
+    //    public void shouldUnzipWhenStoreSolidAes() throws IOException {
+    //        Path zip = Zip4jvmSuite.getResourcePath("/encrypted-central-directory/aes128bit.zip");
+    //        Path destDir = Zip4jvmSuite.subDirNameAsMethodName(rootDir);
+    //
+    //        UnzipSettings settings = UnzipSettings.builder().password(password).build();
+    //
+    //        UnzipIt.zip(zip).destDir(destDir).settings(settings).extract();
+    ////        assertThatDirectory(destDir).matches(rootAssert);
+    //        int a = 0;
+    //        a++;
+    //    }
 
     public void shouldThrowEncryptionNotSupportedExceptionWhenReadEncryptedCentralDirectory() throws IOException {
         Path zip = Zip4jvmSuite.getResourcePath("/encrypted-central-directory/3des168bit.zip");
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/encryption/Encryption3DesTest.java b/src/test/java/ru/olegcherednik/zip4jvm/encryption/Encryption3DesTest.java
deleted file mode 100644
index 407214e54..000000000
--- a/src/test/java/ru/olegcherednik/zip4jvm/encryption/Encryption3DesTest.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package ru.olegcherednik.zip4jvm.encryption;
-
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.BeforeClass;
-import ru.olegcherednik.zip4jvm.UnzipIt;
-import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
-import ru.olegcherednik.zip4jvm.model.settings.UnzipSettings;
-
-import java.io.IOException;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-
-import static ru.olegcherednik.zip4jvm.TestDataAssert.rootAssert;
-import static ru.olegcherednik.zip4jvm.Zip4jvmSuite.password;
-import static ru.olegcherednik.zip4jvm.assertj.Zip4jvmAssertions.assertThatDirectory;
-
-/**
- * @author Oleg Cherednik
- * @since 16.02.2020
- */
-//@Test
-@SuppressWarnings("FieldNamingConvention")
-public class Encryption3DesTest {
-
-    private static final Path rootDir = Zip4jvmSuite.generateSubDirNameWithTime(Encryption3DesTest.class);
-
-    @BeforeClass
-    public static void createDir() throws IOException {
-        Files.createDirectories(rootDir);
-    }
-
-    @AfterClass(enabled = Zip4jvmSuite.clear)
-    public static void removeDir() throws IOException {
-        Zip4jvmSuite.removeDir(rootDir);
-    }
-
-    public void shouldUnzipWhenStoreSolidAes() throws IOException {
-        Path destDir = Zip4jvmSuite.subDirNameAsMethodName(rootDir);
-
-        UnzipSettings settings = UnzipSettings.builder().password(password).build();
-
-//        UnzipIt.zip(Paths.get("d:/zip4jvm/3des/3des_lk.zip")).destDir(destDir).settings(settings).extract();
-//        UnzipIt.zip(Paths.get("d:/zip4jvm/securezip/aes/aes128.zip")).destDir(destDir).settings(settings).extract();
-//        UnzipIt.zip(Paths.get("d:/zip4jvm/securezip/aes/aes192.zip")).destDir(destDir).settings(settings).extract();
-        UnzipIt.zip(Paths.get("d:/zip4jvm/securezip/aes/aes256.zip")).destDir(destDir).settings(settings).extract();
-        assertThatDirectory(destDir).matches(rootAssert);
-    }
-
-}
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/encryption/EncryptionAesTest.java b/src/test/java/ru/olegcherednik/zip4jvm/encryption/EncryptionAesTest.java
index 619fbe2e8..19170dba4 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/encryption/EncryptionAesTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/encryption/EncryptionAesTest.java
@@ -18,10 +18,6 @@
  */
 package ru.olegcherednik.zip4jvm.encryption;
 
-import org.apache.commons.lang3.ArrayUtils;
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.UnzipIt;
 import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
 import ru.olegcherednik.zip4jvm.ZipIt;
@@ -34,6 +30,11 @@
 import ru.olegcherednik.zip4jvm.model.settings.ZipEntrySettings;
 import ru.olegcherednik.zip4jvm.model.settings.ZipSettings;
 
+import org.apache.commons.lang3.ArrayUtils;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Path;
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/encryption/EncryptionPkwareTest.java b/src/test/java/ru/olegcherednik/zip4jvm/encryption/EncryptionPkwareTest.java
index d47388a0c..9355001cb 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/encryption/EncryptionPkwareTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/encryption/EncryptionPkwareTest.java
@@ -18,11 +18,6 @@
  */
 package ru.olegcherednik.zip4jvm.encryption;
 
-import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.lang3.ArrayUtils;
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.UnzipIt;
 import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
 import ru.olegcherednik.zip4jvm.ZipIt;
@@ -35,6 +30,12 @@
 import ru.olegcherednik.zip4jvm.model.settings.ZipEntrySettings;
 import ru.olegcherednik.zip4jvm.model.settings.ZipSettings;
 
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.ArrayUtils;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Path;
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/engine/UnzipEngineTest.java b/src/test/java/ru/olegcherednik/zip4jvm/engine/UnzipEngineTest.java
index 288b0c81d..96b119ca3 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/engine/UnzipEngineTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/engine/UnzipEngineTest.java
@@ -18,16 +18,17 @@
  */
 package ru.olegcherednik.zip4jvm.engine;
 
-import org.apache.commons.io.FileUtils;
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.UnzipIt;
 import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
 import ru.olegcherednik.zip4jvm.ZipIt;
 import ru.olegcherednik.zip4jvm.model.Charsets;
 import ru.olegcherednik.zip4jvm.model.settings.UnzipSettings;
 
+import org.apache.commons.io.FileUtils;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Path;
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/engine/ZipEngineSolidTest.java b/src/test/java/ru/olegcherednik/zip4jvm/engine/ZipEngineSolidTest.java
index 162321d8a..b7783b730 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/engine/ZipEngineSolidTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/engine/ZipEngineSolidTest.java
@@ -18,10 +18,6 @@
  */
 package ru.olegcherednik.zip4jvm.engine;
 
-import org.apache.commons.io.IOUtils;
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
 import ru.olegcherednik.zip4jvm.ZipFile;
 import ru.olegcherednik.zip4jvm.ZipIt;
@@ -35,6 +31,11 @@
 import ru.olegcherednik.zip4jvm.model.settings.ZipEntrySettings;
 import ru.olegcherednik.zip4jvm.model.settings.ZipSettings;
 
+import org.apache.commons.io.IOUtils;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Path;
@@ -133,7 +134,8 @@ private static Function entrySettingsProvider() {
     }
 
     public void shouldThrowNullPointerExceptionWhenArgumentIsNull() {
-        assertThatThrownBy(() -> new ZipEngine(null, ZipSettings.DEFAULT)).isExactlyInstanceOf(NullPointerException.class);
+        assertThatThrownBy(() -> new ZipEngine(null,
+                                               ZipSettings.DEFAULT)).isExactlyInstanceOf(NullPointerException.class);
         assertThatThrownBy(() -> new ZipEngine(zipStoreSolid, null)).isExactlyInstanceOf(NullPointerException.class);
     }
 
@@ -183,7 +185,7 @@ public void shouldThrowExceptionWhenAddNullEntry() throws IOException {
 
         assertThatThrownBy(() -> {
             try (ZipFile.Writer zipFile = new ZipEngine(zip, ZipSettings.DEFAULT)) {
-                zipFile.add((ZipFile.Entry)null);
+                zipFile.add((ZipFile.Entry) null);
             }
         }).isExactlyInstanceOf(NullPointerException.class);
     }
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/engine/ZipEngineSplitTest.java b/src/test/java/ru/olegcherednik/zip4jvm/engine/ZipEngineSplitTest.java
index c5ade3f7c..4fc375dd2 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/engine/ZipEngineSplitTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/engine/ZipEngineSplitTest.java
@@ -18,10 +18,6 @@
  */
 package ru.olegcherednik.zip4jvm.engine;
 
-import org.apache.commons.io.IOUtils;
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
 import ru.olegcherednik.zip4jvm.ZipFile;
 import ru.olegcherednik.zip4jvm.ZipIt;
@@ -35,6 +31,11 @@
 import ru.olegcherednik.zip4jvm.model.settings.ZipEntrySettings;
 import ru.olegcherednik.zip4jvm.model.settings.ZipSettings;
 
+import org.apache.commons.io.IOUtils;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Path;
@@ -137,7 +138,8 @@ private static Function entrySettingsProvider() {
     }
 
     public void shouldThrowNullPointerExceptionWhenArgumentIsNull() {
-        assertThatThrownBy(() -> new ZipEngine(null, ZipSettings.DEFAULT)).isExactlyInstanceOf(NullPointerException.class);
+        assertThatThrownBy(() -> new ZipEngine(null,
+                                               ZipSettings.DEFAULT)).isExactlyInstanceOf(NullPointerException.class);
         assertThatThrownBy(() -> new ZipEngine(zipStoreSolid, null)).isExactlyInstanceOf(NullPointerException.class);
     }
 
@@ -189,7 +191,7 @@ public void shouldThrowExceptionWhenAddNullEntry() throws IOException {
 
         assertThatThrownBy(() -> {
             try (ZipFile.Writer zipFile = new ZipEngine(zip, ZipSettings.DEFAULT)) {
-                zipFile.add((ZipFile.Entry)null);
+                zipFile.add((ZipFile.Entry) null);
             }
         }).isExactlyInstanceOf(NullPointerException.class);
     }
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/io/in/ZipInputStreamTest.java b/src/test/java/ru/olegcherednik/zip4jvm/io/in/ZipInputStreamTest.java
index 089566b0d..6170229fc 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/io/in/ZipInputStreamTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/io/in/ZipInputStreamTest.java
@@ -18,16 +18,17 @@
  */
 package ru.olegcherednik.zip4jvm.io.in;
 
+import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
+import ru.olegcherednik.zip4jvm.io.in.file.LittleEndianDataInputFile;
+import ru.olegcherednik.zip4jvm.model.Charsets;
+import ru.olegcherednik.zip4jvm.model.src.SrcZip;
+
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.io.IOUtils;
 import org.testng.annotations.AfterClass;
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Ignore;
 import org.testng.annotations.Test;
-import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
-import ru.olegcherednik.zip4jvm.io.in.file.LittleEndianDataInputFile;
-import ru.olegcherednik.zip4jvm.model.Charsets;
-import ru.olegcherednik.zip4jvm.model.src.SrcZip;
 
 import java.io.IOException;
 import java.nio.file.Files;
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/io/out/SolidZipOutputStreamTest.java b/src/test/java/ru/olegcherednik/zip4jvm/io/out/SolidZipOutputStreamTest.java
index 986b9b2af..853d386b7 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/io/out/SolidZipOutputStreamTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/io/out/SolidZipOutputStreamTest.java
@@ -18,16 +18,17 @@
  */
 package ru.olegcherednik.zip4jvm.io.out;
 
-import org.apache.commons.io.FileUtils;
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
 import ru.olegcherednik.zip4jvm.exception.Zip4jvmException;
-import ru.olegcherednik.zip4jvm.model.src.SrcZip;
 import ru.olegcherednik.zip4jvm.io.out.data.SolidZipOutputStream;
 import ru.olegcherednik.zip4jvm.model.Charsets;
 import ru.olegcherednik.zip4jvm.model.ZipModel;
+import ru.olegcherednik.zip4jvm.model.src.SrcZip;
+
+import org.apache.commons.io.FileUtils;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
 
 import java.io.IOException;
 import java.nio.file.Files;
@@ -77,7 +78,7 @@ public void shouldWriteStreamWhenUsingDataOutput() throws IOException {
             out.writeBytes("oleg".getBytes(Charsets.UTF_8));
             assertThat(out.getRelativeOffs()).isEqualTo(18);
 
-            out.writeBytes((byte)0x11);
+            out.writeBytes((byte) 0x11);
             assertThat(out.getRelativeOffs()).isEqualTo(19);
 
             out.writeBytes(new byte[] { 0x12, 0x13, 0x14 });
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/io/out/SplitZipOutputStreamTest.java b/src/test/java/ru/olegcherednik/zip4jvm/io/out/SplitZipOutputStreamTest.java
index d6fe208fa..0d80ef645 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/io/out/SplitZipOutputStreamTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/io/out/SplitZipOutputStreamTest.java
@@ -18,15 +18,16 @@
  */
 package ru.olegcherednik.zip4jvm.io.out;
 
-import org.apache.commons.io.FileUtils;
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
-import ru.olegcherednik.zip4jvm.model.src.SrcZip;
 import ru.olegcherednik.zip4jvm.io.out.data.SplitZipOutputStream;
 import ru.olegcherednik.zip4jvm.model.Charsets;
 import ru.olegcherednik.zip4jvm.model.ZipModel;
+import ru.olegcherednik.zip4jvm.model.src.SrcZip;
+
+import org.apache.commons.io.FileUtils;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
 
 import java.io.IOException;
 import java.nio.file.Files;
@@ -77,7 +78,7 @@ public void shouldWriteStreamWhenUsingDataOutput() throws IOException {
             out.writeBytes("oleg".getBytes(Charsets.UTF_8));
             assertThat(out.getRelativeOffs()).isEqualTo(2);
 
-            out.writeBytes((byte)0x11);
+            out.writeBytes((byte) 0x11);
             assertThat(out.getRelativeOffs()).isEqualTo(3);
 
             out.writeBytes(new byte[] { 0x12, 0x13, 0x14 });
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/io/out/file/LittleEndianWriteFileTest.java b/src/test/java/ru/olegcherednik/zip4jvm/io/out/file/LittleEndianWriteFileTest.java
index 1a96c4754..5d6790203 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/io/out/file/LittleEndianWriteFileTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/io/out/file/LittleEndianWriteFileTest.java
@@ -18,11 +18,11 @@
  */
 package ru.olegcherednik.zip4jvm.io.out.file;
 
+import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
+
 import org.testng.annotations.AfterClass;
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
-import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
-import ru.olegcherednik.zip4jvm.ZipItTest;
 
 import java.io.IOException;
 import java.nio.file.Files;
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/model/CompressionMethodTest.java b/src/test/java/ru/olegcherednik/zip4jvm/model/CompressionMethodTest.java
index d0294d6f3..401541466 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/model/CompressionMethodTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/model/CompressionMethodTest.java
@@ -18,9 +18,10 @@
  */
 package ru.olegcherednik.zip4jvm.model;
 
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.exception.UnknownCompressionMethodException;
 
+import org.testng.annotations.Test;
+
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/model/CompressionTest.java b/src/test/java/ru/olegcherednik/zip4jvm/model/CompressionTest.java
index 1f009000c..b768c03de 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/model/CompressionTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/model/CompressionTest.java
@@ -18,9 +18,10 @@
  */
 package ru.olegcherednik.zip4jvm.model;
 
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.exception.CompressionNotSupportedException;
 
+import org.testng.annotations.Test;
+
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 
@@ -46,7 +47,7 @@ public void shouldThrowExceptionWhenCompressionMethodNotSupported() {
     private static Compression parseCompressionMethod(CompressionMethod compressionMethod) {
         try {
             return Compression.parseCompressionMethod(compressionMethod);
-        } catch(CompressionNotSupportedException ignore) {
+        } catch (CompressionNotSupportedException ignore) {
             return null;
         }
     }
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/model/EncryptionTest.java b/src/test/java/ru/olegcherednik/zip4jvm/model/EncryptionTest.java
index f48ff1387..4b8ca7f80 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/model/EncryptionTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/model/EncryptionTest.java
@@ -26,16 +26,17 @@
 // TODO Should be fix
 public class EncryptionTest {
 
-//    public void shouldThrowExceptionWhenStrongEncryptionFlatIsSet() {
-//        ExtraField.Record record = mock(ExtraField.Record.class);
-//        when(record.isNull()).thenReturn(false);
-//        when(record.getSignature()).thenReturn(666);
-//
-//        ExtraField extraField = ExtraField.builder().addRecord(record).build();
-//
-//        GeneralPurposeFlag generalPurposeFlag = new GeneralPurposeFlag();
-//        generalPurposeFlag.setStrongEncryption(true);
-//
-//        assertThatThrownBy(() -> Encryption.get(extraField, generalPurposeFlag)).isExactlyInstanceOf(Zip4jvmException.class);
-//    }
+    //    public void shouldThrowExceptionWhenStrongEncryptionFlatIsSet() {
+    //        ExtraField.Record record = mock(ExtraField.Record.class);
+    //        when(record.isNull()).thenReturn(false);
+    //        when(record.getSignature()).thenReturn(666);
+    //
+    //        ExtraField extraField = ExtraField.builder().addRecord(record).build();
+    //
+    //        GeneralPurposeFlag generalPurposeFlag = new GeneralPurposeFlag();
+    //        generalPurposeFlag.setStrongEncryption(true);
+    //
+    //        assertThatThrownBy(() -> Encryption.get(extraField, generalPurposeFlag))
+    //        .isExactlyInstanceOf(Zip4jvmException.class);
+    //    }
 }
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/model/ExternalFileAttributesTest.java b/src/test/java/ru/olegcherednik/zip4jvm/model/ExternalFileAttributesTest.java
index 9f129bca2..de720a88e 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/model/ExternalFileAttributesTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/model/ExternalFileAttributesTest.java
@@ -18,11 +18,12 @@
  */
 package ru.olegcherednik.zip4jvm.model;
 
+import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
+
 import org.mockito.ArgumentCaptor;
 import org.testng.annotations.AfterClass;
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
-import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
 
 import java.io.IOException;
 import java.nio.file.FileSystem;
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/model/FileHeaderTest.java b/src/test/java/ru/olegcherednik/zip4jvm/model/FileHeaderTest.java
index 8934e44fd..3734283db 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/model/FileHeaderTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/model/FileHeaderTest.java
@@ -18,12 +18,13 @@
  */
 package ru.olegcherednik.zip4jvm.model;
 
+import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
+import ru.olegcherednik.zip4jvm.model.extrafield.PkwareExtraField;
+
 import org.apache.commons.lang3.ArrayUtils;
 import org.testng.annotations.AfterClass;
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
-import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
-import ru.olegcherednik.zip4jvm.model.extrafield.PkwareExtraField;
 
 import java.io.IOException;
 import java.nio.file.Files;
@@ -31,14 +32,13 @@
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static ru.olegcherednik.zip4jvm.TestData.fileBentley;
-import static ru.olegcherednik.zip4jvm.model.ExternalFileAttributes.WIN;
 
 /**
  * @author Oleg Cherednik
  * @since 15.09.2019
  */
 @Test
-@SuppressWarnings("FieldNamingConvention")
+@SuppressWarnings({ "FieldNamingConvention", "VariableDeclarationUsageDistance" })
 public class FileHeaderTest {
 
     private static final Path rootDir = Zip4jvmSuite.generateSubDirNameWithTime(FileHeaderTest.class);
@@ -57,11 +57,13 @@ public void shouldUseSettersGettersCorrectly() throws IOException {
         GeneralPurposeFlag generalPurposeFlag = new GeneralPurposeFlag();
         InternalFileAttributes internalFileAttributes = new InternalFileAttributes(new byte[] { 1, 2 });
         ExternalFileAttributes externalFileAttributes = ExternalFileAttributes.regularFile(fileBentley);
-        PkwareExtraField extraField = PkwareExtraField.builder().addRecord(Zip64.ExtendedInfo.builder().uncompressedSize(4).build()).build();
+        PkwareExtraField extraField = PkwareExtraField.builder().addRecord(Zip64.ExtendedInfo.builder()
+                                                                                             .uncompressedSize(4)
+                                                                                             .build()).build();
 
-//    TODO commented tests
-//        assertThat(internalFileAttributes).isNotSameAs(InternalFileAttributes.NULL);
-//        assertThat(externalFileAttributes).isNotSameAs(ExternalFileAttributes.NULL);
+        //    TODO commented tests
+        //        assertThat(internalFileAttributes).isNotSameAs(InternalFileAttributes.NULL);
+        //        assertThat(externalFileAttributes).isNotSameAs(ExternalFileAttributes.NULL);
         assertThat(extraField).isNotSameAs(PkwareExtraField.NULL);
 
         Version versionMadeBy = Version.of(Version.FileSystem.MS_DOS_OS2_NT_FAT, 20);
@@ -136,7 +138,8 @@ public void shouldRetrieveIsZip64TrueWhenZip64ExtendedInfoIsNotNull() {
         assertThat(fileHeader.getExtraField().getExtendedInfo()).isSameAs(Zip64.ExtendedInfo.NULL);
         assertThat(fileHeader.isZip64()).isFalse();
 
-        Zip64.ExtendedInfo extendedInfo = Zip64.ExtendedInfo.builder().uncompressedSize(1).compressedSize(2).localFileHeaderRelativeOffs(3)
+        Zip64.ExtendedInfo extendedInfo = Zip64.ExtendedInfo.builder().uncompressedSize(1).compressedSize(2)
+                                                            .localFileHeaderRelativeOffs(3)
                                                             .diskNo(4).build();
 
         fileHeader.setExtraField(PkwareExtraField.builder().addRecord(extendedInfo).build());
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/model/GeneralPurposeFlagTest.java b/src/test/java/ru/olegcherednik/zip4jvm/model/GeneralPurposeFlagTest.java
index f2c454416..3ffa2784e 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/model/GeneralPurposeFlagTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/model/GeneralPurposeFlagTest.java
@@ -18,9 +18,10 @@
  */
 package ru.olegcherednik.zip4jvm.model;
 
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.utils.BitUtils;
 
+import org.testng.annotations.Test;
+
 import java.util.Arrays;
 
 import static org.assertj.core.api.Assertions.assertThat;
@@ -163,7 +164,8 @@ public void shouldRetrieveLzmaBitsWhenLzma() {
     }
 
     public void shouldRetrieveDeflateBitsWhenDeflate() {
-        for (CompressionMethod compressionMethod : Arrays.asList(CompressionMethod.DEFLATE, CompressionMethod.ENHANCED_DEFLATE)) {
+        for (CompressionMethod compressionMethod : Arrays.asList(CompressionMethod.DEFLATE,
+                                                                 CompressionMethod.ENHANCED_DEFLATE)) {
             GeneralPurposeFlag generalPurposeFlag = new GeneralPurposeFlag();
             assertThat(generalPurposeFlag.getAsInt(compressionMethod)).isEqualTo(0x0);
 
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/model/InternalFileAttributesTest.java b/src/test/java/ru/olegcherednik/zip4jvm/model/InternalFileAttributesTest.java
index e816d885a..7be8404f1 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/model/InternalFileAttributesTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/model/InternalFileAttributesTest.java
@@ -20,10 +20,6 @@
 
 import org.testng.annotations.Test;
 
-import java.util.Arrays;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
 /**
  * @author Oleg Cherednik
  * @since 25.09.2019
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/model/LocalFileHeaderBlockTest.java b/src/test/java/ru/olegcherednik/zip4jvm/model/LocalFileHeaderBlockTest.java
index b2faac841..245974e86 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/model/LocalFileHeaderBlockTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/model/LocalFileHeaderBlockTest.java
@@ -18,9 +18,10 @@
  */
 package ru.olegcherednik.zip4jvm.model;
 
+import ru.olegcherednik.zip4jvm.model.extrafield.PkwareExtraField;
+
 import org.apache.commons.lang3.ArrayUtils;
 import org.testng.annotations.Test;
-import ru.olegcherednik.zip4jvm.model.extrafield.PkwareExtraField;
 
 import java.io.IOException;
 
@@ -35,7 +36,11 @@ public class LocalFileHeaderBlockTest {
 
     public void shouldUseSettersGettersCorrectly() throws IOException {
         GeneralPurposeFlag generalPurposeFlag = new GeneralPurposeFlag();
-        PkwareExtraField extraField = PkwareExtraField.builder().addRecord(Zip64.ExtendedInfo.builder().uncompressedSize(4).build()).build();
+        PkwareExtraField extraField = PkwareExtraField.builder()
+                                                      .addRecord(Zip64.ExtendedInfo.builder()
+                                                                                   .uncompressedSize(4)
+                                                                                   .build())
+                                                      .build();
 
         Version versionToExtract = Version.of(Version.FileSystem.Z_SYSTEM, 15);
 
@@ -59,7 +64,7 @@ public void shouldUseSettersGettersCorrectly() throws IOException {
         assertThat(localFileHeader.getCrc32()).isEqualTo(4);
         assertThat(localFileHeader.getCompressedSize()).isEqualTo(5);
         assertThat(localFileHeader.getUncompressedSize()).isEqualTo(6);
-        assertThat(((PkwareExtraField)localFileHeader.getExtraField()).getExtendedInfo()).isNotNull();
+        assertThat(((PkwareExtraField) localFileHeader.getExtraField()).getExtendedInfo()).isNotNull();
         assertThat(localFileHeader.getFileName()).isEqualTo("fileName");
     }
 
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/model/Zip64Test.java b/src/test/java/ru/olegcherednik/zip4jvm/model/Zip64Test.java
index 33f360aff..c5987d196 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/model/Zip64Test.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/model/Zip64Test.java
@@ -18,9 +18,10 @@
  */
 package ru.olegcherednik.zip4jvm.model;
 
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.io.out.data.DataOutput;
 
+import org.testng.annotations.Test;
+
 import java.io.IOException;
 
 import static org.assertj.core.api.Assertions.assertThat;
@@ -51,7 +52,9 @@ public void shouldRetrieveNullObjectWhenAllArgumentsAreNull() {
     }
 
     public void shouldRetrieveSpecialStringForNullObjectWhenToString() {
-        Zip64 zip64 = Zip64.of(new Zip64.EndCentralDirectoryLocator(), new Zip64.EndCentralDirectory(), Zip64.ExtensibleDataSector.builder().build());
+        Zip64 zip64 = Zip64.of(new Zip64.EndCentralDirectoryLocator(),
+                               new Zip64.EndCentralDirectory(),
+                               Zip64.ExtensibleDataSector.builder().build());
         assertThat(zip64.toString()).isNotEqualTo("");
         assertThat(Zip64.NULL.toString()).isEqualTo("");
     }
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/model/builders/FileHeaderBuilderTest.java b/src/test/java/ru/olegcherednik/zip4jvm/model/builders/FileHeaderBuilderTest.java
index 922562278..e6e7e6b37 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/model/builders/FileHeaderBuilderTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/model/builders/FileHeaderBuilderTest.java
@@ -18,7 +18,6 @@
  */
 package ru.olegcherednik.zip4jvm.model.builders;
 
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.model.CentralDirectory;
 import ru.olegcherednik.zip4jvm.model.Zip64;
 import ru.olegcherednik.zip4jvm.model.ZipModel;
@@ -26,6 +25,8 @@
 import ru.olegcherednik.zip4jvm.model.entry.ZipEntryBuilder;
 import ru.olegcherednik.zip4jvm.model.settings.ZipEntrySettings;
 
+import org.testng.annotations.Test;
+
 import java.io.IOException;
 import java.nio.file.Files;
 
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/model/builders/LocalFileHeaderBlockBuilderTest.java b/src/test/java/ru/olegcherednik/zip4jvm/model/builders/LocalFileHeaderBlockBuilderTest.java
index b7ef5bbd9..98cc6dacd 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/model/builders/LocalFileHeaderBlockBuilderTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/model/builders/LocalFileHeaderBlockBuilderTest.java
@@ -18,7 +18,6 @@
  */
 package ru.olegcherednik.zip4jvm.model.builders;
 
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.model.LocalFileHeader;
 import ru.olegcherednik.zip4jvm.model.Zip64;
 import ru.olegcherednik.zip4jvm.model.entry.ZipEntry;
@@ -26,6 +25,8 @@
 import ru.olegcherednik.zip4jvm.model.extrafield.PkwareExtraField;
 import ru.olegcherednik.zip4jvm.model.settings.ZipEntrySettings;
 
+import org.testng.annotations.Test;
+
 import java.io.IOException;
 import java.nio.file.Files;
 
@@ -53,7 +54,7 @@ public void shouldCreateLocalFileHeaderWhenZip64Entry() throws IOException {
         assertThat(localFileHeader.getCompressedSize()).isEqualTo(LOOK_IN_EXTRA_FIELD);
         assertThat(localFileHeader.getUncompressedSize()).isEqualTo(LOOK_IN_EXTRA_FIELD);
 
-        Zip64.ExtendedInfo extendedInfo = ((PkwareExtraField)localFileHeader.getExtraField()).getExtendedInfo();
+        Zip64.ExtendedInfo extendedInfo = ((PkwareExtraField) localFileHeader.getExtraField()).getExtendedInfo();
         assertThat(extendedInfo).isNotSameAs(Zip64.ExtendedInfo.NULL);
         assertThat(extendedInfo.getUncompressedSize()).isEqualTo(Files.size(fileDucati));
         assertThat(extendedInfo.getCompressedSize()).isEqualTo(0);
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/model/builders/Zip64BuilderTest.java b/src/test/java/ru/olegcherednik/zip4jvm/model/builders/Zip64BuilderTest.java
index 2ba7194f8..62f5e3aff 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/model/builders/Zip64BuilderTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/model/builders/Zip64BuilderTest.java
@@ -18,12 +18,13 @@
  */
 package ru.olegcherednik.zip4jvm.model.builders;
 
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.model.Zip64;
 import ru.olegcherednik.zip4jvm.model.ZipModel;
 import ru.olegcherednik.zip4jvm.model.entry.ZipEntry;
 import ru.olegcherednik.zip4jvm.model.src.SrcZip;
 
+import org.testng.annotations.Test;
+
 import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/model/builders/ZipModelBuilderTest.java b/src/test/java/ru/olegcherednik/zip4jvm/model/builders/ZipModelBuilderTest.java
index bbb9db386..64be27959 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/model/builders/ZipModelBuilderTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/model/builders/ZipModelBuilderTest.java
@@ -18,7 +18,6 @@
  */
 package ru.olegcherednik.zip4jvm.model.builders;
 
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.exception.Zip4jvmException;
 import ru.olegcherednik.zip4jvm.model.CentralDirectory;
 import ru.olegcherednik.zip4jvm.model.EndCentralDirectory;
@@ -27,6 +26,8 @@
 import ru.olegcherednik.zip4jvm.model.settings.ZipSettings;
 import ru.olegcherednik.zip4jvm.model.src.SrcZip;
 
+import org.testng.annotations.Test;
+
 import java.nio.charset.Charset;
 import java.util.function.Function;
 
@@ -43,7 +44,8 @@
 public class ZipModelBuilderTest {
 
     public void shouldThrowExceptionWhenCreateModelForExistedFile() {
-        assertThatThrownBy(() -> ZipModelBuilder.build(zipStoreSolid, ZipSettings.DEFAULT)).isExactlyInstanceOf(Zip4jvmException.class);
+        assertThatThrownBy(() -> ZipModelBuilder.build(zipStoreSolid, ZipSettings.DEFAULT)).isExactlyInstanceOf(
+                Zip4jvmException.class);
     }
 
     public void shouldCreateEmptyZipModelWhenCentralDirectoryNull() {
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/model/entry/ZipEntryTest.java b/src/test/java/ru/olegcherednik/zip4jvm/model/entry/ZipEntryTest.java
index f4c98b81b..6fe147bc5 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/model/entry/ZipEntryTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/model/entry/ZipEntryTest.java
@@ -18,9 +18,10 @@
  */
 package ru.olegcherednik.zip4jvm.model.entry;
 
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.model.settings.ZipEntrySettings;
 
+import org.testng.annotations.Test;
+
 import java.io.IOException;
 
 import static org.assertj.core.api.Assertions.assertThat;
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/model/extrafield/ExtraFieldTest.java b/src/test/java/ru/olegcherednik/zip4jvm/model/extrafield/ExtraFieldTest.java
index 07e820224..7b4f784ad 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/model/extrafield/ExtraFieldTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/model/extrafield/ExtraFieldTest.java
@@ -18,12 +18,13 @@
  */
 package ru.olegcherednik.zip4jvm.model.extrafield;
 
-import org.mockito.InOrder;
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.io.out.data.DataOutput;
 import ru.olegcherednik.zip4jvm.model.Zip64;
 import ru.olegcherednik.zip4jvm.model.extrafield.records.UnknownExtraFieldRecord;
 
+import org.mockito.InOrder;
+import org.testng.annotations.Test;
+
 import java.io.IOException;
 
 import static org.assertj.core.api.Assertions.assertThat;
@@ -44,9 +45,11 @@ public void shouldRetrieveNullObjectWhenBuildEmptyExtraField() {
     }
 
     public void shouldIgnoreNullOrNullObjectRecordWhenBuildExtraField() {
-        assertThat(PkwareExtraField.builder().addRecord((PkwareExtraField.Record)null).build()).isSameAs(PkwareExtraField.NULL);
+        assertThat(PkwareExtraField.builder().addRecord((PkwareExtraField.Record) null).build()).isSameAs(
+                PkwareExtraField.NULL);
         assertThat(PkwareExtraField.builder().build()).isSameAs(PkwareExtraField.NULL);
-        assertThat(PkwareExtraField.builder().addRecord(Zip64.ExtendedInfo.NULL).build()).isSameAs(PkwareExtraField.NULL);
+        assertThat(PkwareExtraField.builder().addRecord(Zip64.ExtendedInfo.NULL)
+                                   .build()).isSameAs(PkwareExtraField.NULL);
     }
 
     public void shouldRetrieveCorrectStringWhenToString() {
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/model/extrafield/records/AesExtraFieldRecordTest.java b/src/test/java/ru/olegcherednik/zip4jvm/model/extrafield/records/AesExtraFieldRecordTest.java
index 0b8bda722..90976d29b 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/model/extrafield/records/AesExtraFieldRecordTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/model/extrafield/records/AesExtraFieldRecordTest.java
@@ -18,13 +18,13 @@
  */
 package ru.olegcherednik.zip4jvm.model.extrafield.records;
 
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.crypto.aes.AesStrength;
 import ru.olegcherednik.zip4jvm.exception.Zip4jvmException;
 import ru.olegcherednik.zip4jvm.io.out.data.DataOutput;
 import ru.olegcherednik.zip4jvm.model.Charsets;
 import ru.olegcherednik.zip4jvm.model.CompressionMethod;
-import ru.olegcherednik.zip4jvm.model.extrafield.records.AesExtraFieldRecord;
+
+import org.testng.annotations.Test;
 
 import java.io.IOException;
 
@@ -73,7 +73,8 @@ public void shouldRetrieveNullStringWhenToStringForNullObject() {
     }
 
     public void shouldThrowExceptionWhenSetVendorMoreThan2CharactersLength() {
-        assertThatThrownBy(() -> AesExtraFieldRecord.builder().vendor("AEAE")).isExactlyInstanceOf(Zip4jvmException.class);
+        assertThatThrownBy(() -> AesExtraFieldRecord.builder()
+                                                    .vendor("AEAE")).isExactlyInstanceOf(Zip4jvmException.class);
     }
 
     public void shouldRetrieveNullWhenGetVendorWithGivenCharset() {
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/snippets/UnzipItSnippet.java b/src/test/java/ru/olegcherednik/zip4jvm/snippets/UnzipItSnippet.java
index 954091642..76e025159 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/snippets/UnzipItSnippet.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/snippets/UnzipItSnippet.java
@@ -18,16 +18,16 @@
  */
 package ru.olegcherednik.zip4jvm.snippets;
 
+import ru.olegcherednik.zip4jvm.UnzipIt;
+import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
+import ru.olegcherednik.zip4jvm.model.settings.UnzipSettings;
+
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.io.IOUtils;
 import org.testng.annotations.AfterClass;
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
-import ru.olegcherednik.zip4jvm.UnzipIt;
-import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
-import ru.olegcherednik.zip4jvm.model.settings.UnzipSettings;
 
-import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
@@ -35,7 +35,6 @@
 import java.nio.file.Path;
 import java.util.Arrays;
 import java.util.List;
-import java.util.function.Function;
 
 import static ru.olegcherednik.zip4jvm.TestData.dirNameBikes;
 import static ru.olegcherednik.zip4jvm.TestData.dirNameCars;
@@ -85,7 +84,9 @@ public void extractDirectoryIntoGivenDirectory() throws IOException {
     }
 
     public void extractSomeEntriesIntoGivenDirectory() throws IOException {
-        List fileNames = Arrays.asList(dirNameCars, dirNameBikes + '/' + fileNameDucati, fileNameSaintPetersburg);
+        List fileNames = Arrays.asList(dirNameCars,
+                                               dirNameBikes + '/' + fileNameDucati,
+                                               fileNameSaintPetersburg);
         Path destDir = Zip4jvmSuite.subDirNameAsMethodName(rootDir).resolve("filename_content");
         UnzipIt.zip(zip).destDir(destDir).extract(fileNames);
     }
@@ -94,31 +95,36 @@ public void getStreamForRegularFileEntry() throws IOException {
         Path destFile = Zip4jvmSuite.subDirNameAsMethodName(rootDir).resolve("bentley.jpg");
         Files.createDirectories(destFile.getParent());
 
-        try (InputStream in = UnzipIt.zip(zip).stream("cars/bentley-continental.jpg"); OutputStream out = new FileOutputStream(destFile.toFile())) {
+        try (InputStream in = UnzipIt.zip(zip).stream("cars/bentley-continental.jpg");
+             OutputStream out = Files.newOutputStream(destFile.toFile().toPath())) {
             IOUtils.copyLarge(in, out);
         }
     }
 
     public void unzipWithSinglePasswordForAllEntries() throws IOException {
-        Path zip = Zip4jvmSuite.subDirNameAsMethodName(rootDir).resolve("filename.zip");
-        FileUtils.copyFile(zipDeflateSolidPkware.toFile(), zip.toFile());
+        Path srcZip = Zip4jvmSuite.subDirNameAsMethodName(rootDir).resolve("filename.zip");
+        FileUtils.copyFile(zipDeflateSolidPkware.toFile(), srcZip.toFile());
 
         Path destDir = Zip4jvmSuite.subDirNameAsMethodName(rootDir).resolve("filename_content");
 
         char[] password = passwordStr.toCharArray();
-        List fileNames = Arrays.asList(dirNameCars, dirNameBikes + '/' + fileNameDucati, fileNameSaintPetersburg);
-        UnzipIt.zip(zip).destDir(destDir).password(password).extract(fileNames);
+        List fileNames = Arrays.asList(dirNameCars,
+                                               dirNameBikes + '/' + fileNameDucati,
+                                               fileNameSaintPetersburg);
+        UnzipIt.zip(srcZip).destDir(destDir).password(password).extract(fileNames);
     }
 
     public void unzipWithSeparatePasswordForEachEntry() throws IOException {
-        Path zip = Zip4jvmSuite.subDirNameAsMethodName(rootDir).resolve("filename.zip");
-        FileUtils.copyFile(zipDeflateSolidAes.toFile(), zip.toFile());
+        Path srcZip = Zip4jvmSuite.subDirNameAsMethodName(rootDir).resolve("filename.zip");
+        FileUtils.copyFile(zipDeflateSolidAes.toFile(), srcZip.toFile());
 
         Path destDir = Zip4jvmSuite.subDirNameAsMethodName(rootDir).resolve("filename_content");
 
         UnzipSettings settings = UnzipSettings.builder().passwordProvider(fileNamePasswordProvider).build();
-        List fileNames = Arrays.asList(dirNameCars, dirNameBikes + '/' + fileNameDucati, fileNameSaintPetersburg);
-        UnzipIt.zip(zip).destDir(destDir).settings(settings).extract(fileNames);
+        List fileNames = Arrays.asList(dirNameCars,
+                                               dirNameBikes + '/' + fileNameDucati,
+                                               fileNameSaintPetersburg);
+        UnzipIt.zip(srcZip).destDir(destDir).settings(settings).extract(fileNames);
     }
 
 }
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/snippets/ZipItSnippet.java b/src/test/java/ru/olegcherednik/zip4jvm/snippets/ZipItSnippet.java
index 214581fa2..1014a6a87 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/snippets/ZipItSnippet.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/snippets/ZipItSnippet.java
@@ -18,14 +18,15 @@
  */
 package ru.olegcherednik.zip4jvm.snippets;
 
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
 import ru.olegcherednik.zip4jvm.ZipFile;
 import ru.olegcherednik.zip4jvm.ZipIt;
 import ru.olegcherednik.zip4jvm.model.ExternalFileAttributes;
 
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Path;
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/snippets/ZipMiscSnippet.java b/src/test/java/ru/olegcherednik/zip4jvm/snippets/ZipMiscSnippet.java
index e9ed20392..5d3225b07 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/snippets/ZipMiscSnippet.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/snippets/ZipMiscSnippet.java
@@ -18,21 +18,19 @@
  */
 package ru.olegcherednik.zip4jvm.snippets;
 
+import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
+import ru.olegcherednik.zip4jvm.ZipMisc;
+
 import org.apache.commons.io.FileUtils;
 import org.testng.annotations.AfterClass;
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
-import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
-import ru.olegcherednik.zip4jvm.ZipFile;
-import ru.olegcherednik.zip4jvm.ZipMisc;
 
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.util.Arrays;
 import java.util.Collection;
-import java.util.List;
-import java.util.stream.Collectors;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static ru.olegcherednik.zip4jvm.TestData.dirNameBikes;
@@ -65,10 +63,10 @@ public static void removeDir() throws IOException {
     }
 
     public void modifyZipArchiveComment() throws IOException {
-        Path zip = Zip4jvmSuite.subDirNameAsMethodName(rootDir).resolve("filename.zip");
-        FileUtils.copyFile(zipDeflateSolid.toFile(), zip.toFile());
+        Path srcZip = Zip4jvmSuite.subDirNameAsMethodName(rootDir).resolve("filename.zip");
+        FileUtils.copyFile(zipDeflateSolid.toFile(), srcZip.toFile());
 
-        ZipMisc zipFile = ZipMisc.zip(zip);
+        ZipMisc zipFile = ZipMisc.zip(srcZip);
 
         assertThat(zipFile.getComment()).isNull();
 
@@ -85,34 +83,30 @@ public void modifyZipArchiveComment() throws IOException {
         assertThat(zipFile.getComment()).isNull();
     }
 
-    public void getAllEntries() throws IOException {
-        ZipMisc zipFile = ZipMisc.zip(zip);
-        List entries = zipFile.getEntries().collect(Collectors.toList());
-    }
-
     public void removeEntryByName() throws IOException {
-        Path zip = Zip4jvmSuite.subDirNameAsMethodName(rootDir).resolve("filename.zip");
-        FileUtils.copyFile(zipDeflateSolid.toFile(), zip.toFile());
+        Path srcZip = Zip4jvmSuite.subDirNameAsMethodName(rootDir).resolve("filename.zip");
+        FileUtils.copyFile(zipDeflateSolid.toFile(), srcZip.toFile());
 
-        ZipMisc zipFile = ZipMisc.zip(zip);
+        ZipMisc zipFile = ZipMisc.zip(srcZip);
         zipFile.removeEntryByName(dirNameCars + '/' + fileNameFerrari);
     }
 
     public void removeSomeEntriesByName() throws IOException {
-        Path zip = Zip4jvmSuite.subDirNameAsMethodName(rootDir).resolve("filename.zip");
-        FileUtils.copyFile(zipDeflateSolid.toFile(), zip.toFile());
+        Path srcZip = Zip4jvmSuite.subDirNameAsMethodName(rootDir).resolve("filename.zip");
+        FileUtils.copyFile(zipDeflateSolid.toFile(), srcZip.toFile());
 
-        Collection entryNames = Arrays.asList(dirNameCars + '/' + fileNameFerrari, dirNameBikes + '/' + fileNameHonda);
+        Collection entryNames = Arrays.asList(dirNameCars + '/' + fileNameFerrari,
+                                                      dirNameBikes + '/' + fileNameHonda);
 
-        ZipMisc zipFile = ZipMisc.zip(zip);
+        ZipMisc zipFile = ZipMisc.zip(srcZip);
         zipFile.removeEntryByName(entryNames);
     }
 
     public void removeEntryByNamePrefix() throws IOException {
-        Path zip = Zip4jvmSuite.subDirNameAsMethodName(rootDir).resolve("filename.zip");
-        FileUtils.copyFile(zipDeflateSolid.toFile(), zip.toFile());
+        Path srcZip = Zip4jvmSuite.subDirNameAsMethodName(rootDir).resolve("filename.zip");
+        FileUtils.copyFile(zipDeflateSolid.toFile(), srcZip.toFile());
 
-        ZipMisc zipFile = ZipMisc.zip(zip);
+        ZipMisc zipFile = ZipMisc.zip(srcZip);
         zipFile.removeEntryByNamePrefix(dirNameCars);
     }
 
@@ -121,8 +115,9 @@ public void checkWhetherZipArchiveSplitOrNot() throws IOException {
     }
 
     public void mergeSplitArchiveIntoSolidOne() throws IOException {
-        Path zip = Zip4jvmSuite.subDirNameAsMethodName(rootDir).resolve("filename.zip");
+        Path srcZip = Zip4jvmSuite.subDirNameAsMethodName(rootDir).resolve("filename.zip");
         ZipMisc zipFile = ZipMisc.zip(zipDeflateSplit);
-        zipFile.merge(zip);
+        zipFile.merge(srcZip);
     }
+
 }
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/symlink/SymlinkCompatibilityTest.java b/src/test/java/ru/olegcherednik/zip4jvm/symlink/SymlinkCompatibilityTest.java
index 27b3d8ce2..cd7363496 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/symlink/SymlinkCompatibilityTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/symlink/SymlinkCompatibilityTest.java
@@ -18,12 +18,13 @@
  */
 package ru.olegcherednik.zip4jvm.symlink;
 
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.BeforeClass;
 import ru.olegcherednik.zip4jvm.UnzipIt;
 import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
 import ru.olegcherednik.zip4jvm.assertj.IDirectoryAssert;
 
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Path;
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/symlink/ZipItSymlinkTest.java b/src/test/java/ru/olegcherednik/zip4jvm/symlink/ZipItSymlinkTest.java
index 9bab08b39..023f67fb9 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/symlink/ZipItSymlinkTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/symlink/ZipItSymlinkTest.java
@@ -18,21 +18,19 @@
  */
 package ru.olegcherednik.zip4jvm.symlink;
 
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
-import ru.olegcherednik.zip4jvm.ZipInfo;
 import ru.olegcherednik.zip4jvm.ZipIt;
 import ru.olegcherednik.zip4jvm.assertj.IDirectoryAssert;
 import ru.olegcherednik.zip4jvm.model.ZipSymlink;
-import ru.olegcherednik.zip4jvm.model.settings.ZipInfoSettings;
 import ru.olegcherednik.zip4jvm.model.settings.ZipSettings;
 
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Path;
-import java.nio.file.Paths;
 import java.util.function.Consumer;
 
 import static ru.olegcherednik.zip4jvm.TestData.dirNameCars;
@@ -161,11 +159,12 @@ public void shouldCreateZipNoSymlinkWhenReplaceSymlinkWithUniqueTarget() throws
         Path zip = destDir.resolve("src.zip");
         ZipIt.zip(zip).settings(settings).add(dirSrcSymlink);
 
-//        zip = Paths.get("d:/Programming/GitHub/zip4jvm/src/test/resources/symlink/posix/unique-symlink-target.zip");
-//        destDir = Paths.get("d:/zip4jvm/bbb/bbb");
-//        destDir = Paths.get("d:/zip4jvm/bbb/aaa");
-//        Files.deleteIfExists(destDir);
-//        ZipInfo.zip(zip).settings(ZipInfoSettings.builder().copyPayload(true).build()).decompose(destDir);
+        //        zip = Paths.get("d:/Programming/GitHub/zip4jvm/src/test/resources/
+        //        symlink/posix/unique-symlink-target.zip");
+        //        destDir = Paths.get("d:/zip4jvm/bbb/bbb");
+        //        destDir = Paths.get("d:/zip4jvm/bbb/aaa");
+        //        Files.deleteIfExists(destDir);
+        //        ZipInfo.zip(zip).settings(ZipInfoSettings.builder().copyPayload(true).build()).decompose(destDir);
 
         assertThatDirectory(zip.getParent()).exists().hasEntries(1).hasRegularFiles(1);
         assertThatZipFile(zip).root().hasEntries(10).hasDirectories(2).hasRegularFiles(1).hasSymlinks(7);
@@ -184,9 +183,12 @@ public void shouldCreateZipNoSymlinkWhenReplaceSymlinkWithUniqueTarget() throws
         assertThatZipFile(zip).symlink(symlinkTrnDirNameData).hasTarget(symlinkAbsDirNameData + '/');
         assertThatZipFile(zip).symlink(symlinkAbsFileNameDucati).hasTarget(fileNameDucati);
         assertThatZipFile(zip).symlink(symlinkRelFileNameDucati).hasTarget(fileNameDucati);
-        assertThatZipFile(zip).symlink(symlinkAbsFileNameHonda).hasTarget(zipSymlinkAbsDirNameData + zipDirNameBikes + fileNameHonda);
-        assertThatZipFile(zip).symlink(symlinkRelFileNameHonda).hasTarget(zipSymlinkAbsDirNameData + zipDirNameBikes + fileNameHonda);
-        assertThatZipFile(zip).symlink(symlinkTrnFileNameHonda).hasTarget(zipSymlinkAbsDirNameData + zipDirNameBikes + fileNameHonda);
+        assertThatZipFile(zip).symlink(symlinkAbsFileNameHonda).hasTarget(
+                zipSymlinkAbsDirNameData + zipDirNameBikes + fileNameHonda);
+        assertThatZipFile(zip).symlink(symlinkRelFileNameHonda).hasTarget(
+                zipSymlinkAbsDirNameData + zipDirNameBikes + fileNameHonda);
+        assertThatZipFile(zip).symlink(symlinkTrnFileNameHonda).hasTarget(
+                zipSymlinkAbsDirNameData + zipDirNameBikes + fileNameHonda);
     }
 
     private static final Consumer> dirSymlinkCarsAssert = dir -> {
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/utils/ReflectionUtils.java b/src/test/java/ru/olegcherednik/zip4jvm/utils/ReflectionUtils.java
index 67b08b1c5..34dd8947c 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/utils/ReflectionUtils.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/utils/ReflectionUtils.java
@@ -25,34 +25,20 @@
 import java.lang.reflect.Field;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
 
 import static org.assertj.core.api.Assertions.assertThat;
 
-/** Class provides set of methods based on java reflections: invoke constructors, static and not static methods, set or read fields. */
+/**
+ * Class provides set of methods based on java reflections: invoke constructors,
+ * static and not static methods, set or read fields.
+ */
 @NoArgsConstructor(access = AccessLevel.PRIVATE)
 public class ReflectionUtils {
 
     public static  T getFieldValue(Object obj, String name) throws NoSuchFieldException, IllegalAccessException {
         Field field = getField(obj.getClass(), name);
         field.setAccessible(true);
-        return (T)field.get(obj);
-    }
-
-    public static  T getStaticFieldValue(Class cls, String name) throws NoSuchFieldException, IllegalAccessException {
-        Field field = getField(cls, name);
-        field.setAccessible(true);
-        return (T)field.get(cls);
-    }
-
-    public static  T invokeConstructor(Class cls) {
-        try {
-            Constructor constructor = cls.getDeclaredConstructor();
-            constructor.setAccessible(true);
-            return constructor.newInstance();
-        } catch (Exception ignored) {
-            return null;
-        }
+        return (T) field.get(obj);
     }
 
     public static  T invokeConstructor(Class cls, Class[] types, Object... values) {
@@ -65,7 +51,8 @@ public static  T invokeConstructor(Class cls, Class[] types, Object...
         }
     }
 
-    public static void setFieldValue(Object obj, String name, Object value) throws NoSuchFieldException, IllegalAccessException {
+    public static void setFieldValue(Object obj, String name, Object value)
+            throws NoSuchFieldException, IllegalAccessException {
         Field field = getField(obj.getClass(), name);
         boolean accessible = field.isAccessible();
 
@@ -77,100 +64,38 @@ public static void setFieldValue(Object obj, String name, Object value) throws N
         }
     }
 
-    public static void setStaticFieldValue(Class cls, String name, Object value) throws NoSuchFieldException, IllegalAccessException {
-        Field field = getField(cls, name);
-        boolean accessible = field.isAccessible();
-
-        try {
-            field.setAccessible(true);
-            clearFinalModifier(field);
-            setFileValue(field, null, value);
-        } finally {
-            field.setAccessible(accessible);
-        }
-    }
-
-    private static void clearFinalModifier(Field field) throws NoSuchFieldException, IllegalAccessException {
-        Field modifiersField = Field.class.getDeclaredField("modifiers");
-        modifiersField.setAccessible(true);
-        modifiersField.setInt(field, field.getModifiers() & ~Modifier.FINAL);
-    }
-
     private static void setFileValue(Field field, Object obj, Object value) throws IllegalAccessException {
         if (field.getType() == int.class) {
-            field.setInt(obj, (Integer)value);
+            field.setInt(obj, (Integer) value);
         } else if (field.getType() == boolean.class) {
-            field.setBoolean(obj, (Boolean)value);
+            field.setBoolean(obj, (Boolean) value);
         } else if (field.getType() == byte.class) {
-            field.setByte(obj, (Byte)value);
+            field.setByte(obj, (Byte) value);
         } else if (field.getType() == char.class) {
-            field.setChar(obj, (Character)value);
+            field.setChar(obj, (Character) value);
         } else if (field.getType() == double.class) {
-            field.setDouble(obj, (Double)value);
+            field.setDouble(obj, (Double) value);
         } else if (field.getType() == long.class) {
-            field.setLong(obj, (Long)value);
+            field.setLong(obj, (Long) value);
         } else if (field.getType() == short.class) {
-            field.setShort(obj, (Short)value);
+            field.setShort(obj, (Short) value);
         } else if (field.getType() == float.class) {
-            field.setFloat(obj, (Float)value);
+            field.setFloat(obj, (Float) value);
         } else {
             field.set(obj, value);
         }
     }
 
-    public static  T invokeStaticMethod(Class cls, String name) throws Throwable {
-        return invokeStaticMethod(cls, name, null);
-    }
-
-    public static  T invokeStaticMethod(Class cls, String name, Class type, Object value) throws Throwable {
-        return invokeStaticMethod(cls, name, new Class[] { type }, value);
-    }
-
-    public static  T invokeStaticMethod(Class cls, String name, Class type1, Class type2, Object value1, Object value2) throws Throwable {
-        return invokeStaticMethod(cls, name, new Class[] { type1, type2 }, value1, value2);
-    }
-
-    public static  T invokeStaticMethod(Class cls, String name, Class type1, Class type2, Class type3,
-                                           Object value1, Object value2, Object value3) throws Throwable {
-        return invokeStaticMethod(cls, name, new Class[] { type1, type2, type3 }, value1, value2, value3);
-    }
-
-    public static  T invokeStaticMethod(Class cls, String name, Class[] types, Object... values) throws Throwable {
-        try {
-            Method method = getMethod(cls, name, types);
-            method.setAccessible(true);
-            return (T)method.invoke(null, values);
-        } catch (InvocationTargetException e) {
-            throw e.getTargetException();
-        }
-    }
-
     public static  T invokeMethod(Object obj, String name) throws Throwable {
         assertThat(obj).isNotInstanceOf(Class.class);
         return invokeMethod(obj, name, null);
     }
 
-    public static  T invokeMethod(Object obj, String name, Class type, Object value) throws Throwable {
-        assertThat(obj).isNotInstanceOf(Class.class);
-        return invokeMethod(obj, name, new Class[] { type }, value);
-    }
-
-    public static  T invokeMethod(Object obj, String name, Class type1, Class type2, Object value1, Object value2) throws Throwable {
-        assertThat(obj).isNotInstanceOf(Class.class);
-        return invokeMethod(obj, name, new Class[] { type1, type2 }, value1, value2);
-    }
-
-    public static  T invokeMethod(Object obj, String name, Class type1, Class type2, Class type3, Object value1, Object value2,
-                                     Object value3) throws Throwable {
-        assertThat(obj).isNotInstanceOf(Class.class);
-        return invokeMethod(obj, name, new Class[] { type1, type2, type3 }, value1, value2, value3);
-    }
-
     public static  T invokeMethod(Object obj, String name, Class[] types, Object... values) throws Throwable {
         try {
             Method method = getMethod(obj.getClass(), name, types);
             method.setAccessible(true);
-            return (T)method.invoke(obj, values);
+            return (T) method.invoke(obj, values);
         } catch (InvocationTargetException e) {
             throw e.getTargetException();
         }
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/view/ByteArrayHexViewTest.java b/src/test/java/ru/olegcherednik/zip4jvm/view/ByteArrayHexViewTest.java
index 18028e1d6..9f0f0c98c 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/view/ByteArrayHexViewTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/view/ByteArrayHexViewTest.java
@@ -18,9 +18,10 @@
  */
 package ru.olegcherednik.zip4jvm.view;
 
+import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
+
 import org.apache.commons.lang3.ArrayUtils;
 import org.testng.annotations.Test;
-import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
 
 import java.io.IOException;
 import java.io.PrintStream;
@@ -36,7 +37,9 @@
 public class ByteArrayHexViewTest {
 
     public void shouldPrintOneLineWhenLessThanColumnWidth() throws IOException {
-        byte[] data = { 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xA, 0xB, 0xC, 0xD, 0xE, 0xF };
+        byte[] data = {
+                0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9,
+                0xA, 0xB, 0xC, 0xD, 0xE, 0xF };
 
         String[] lines = Zip4jvmSuite.execute(new ByteArrayHexView(data, 0, 52));
         assertThat(lines).hasSize(1);
@@ -44,8 +47,10 @@ public void shouldPrintOneLineWhenLessThanColumnWidth() throws IOException {
     }
 
     public void shouldPrintMoreThanOneLineWhenMoreThanColumnWidth() throws IOException {
-        byte[] data = { 0x64, 0x75, 0x63, 0x61, 0x74, 0x69, 0x2D, 0x70, 0x61, 0x6E, 0x69, 0x67, 0x61, 0x6C, 0x65, 0x2D, 0x31, 0x31, 0x39, 0x39, 0x2E,
-                0x6A, 0x70, 0x67 };
+        byte[] data = {
+                0x64, 0x75, 0x63, 0x61, 0x74, 0x69, 0x2D, 0x70, 0x61, 0x6E,
+                0x69, 0x67, 0x61, 0x6C, 0x65, 0x2D, 0x31, 0x31, 0x39, 0x39,
+                0x2E, 0x6A, 0x70, 0x67 };
 
         String[] lines = Zip4jvmSuite.execute(new ByteArrayHexView(data, 0, 52));
         assertThat(lines).hasSize(2);
@@ -54,8 +59,10 @@ public void shouldPrintMoreThanOneLineWhenMoreThanColumnWidth() throws IOExcepti
     }
 
     public void shouldFillWholeColumnWhenColumnWidthNotStandard() throws IOException {
-        byte[] data = { 0x64, 0x75, 0x63, 0x61, 0x74, 0x69, 0x2D, 0x70, 0x61, 0x6E, 0x69, 0x67, 0x61, 0x6C, 0x65, 0x2D, 0x31, 0x31, 0x39, 0x39, 0x2E,
-                0x6A, 0x70, 0x67 };
+        byte[] data = {
+                0x64, 0x75, 0x63, 0x61, 0x74, 0x69, 0x2D, 0x70, 0x61, 0x6E,
+                0x69, 0x67, 0x61, 0x6C, 0x65, 0x2D, 0x31, 0x31, 0x39, 0x39,
+                0x2E, 0x6A, 0x70, 0x67 };
 
         String[] lines = Zip4jvmSuite.execute(new ByteArrayHexView(data, 0, 70));
         assertThat(lines).hasSize(2);
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/view/CompressionMethodViewTest.java b/src/test/java/ru/olegcherednik/zip4jvm/view/CompressionMethodViewTest.java
index b9192f11b..5880a47ff 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/view/CompressionMethodViewTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/view/CompressionMethodViewTest.java
@@ -18,7 +18,6 @@
  */
 package ru.olegcherednik.zip4jvm.view;
 
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
 import ru.olegcherednik.zip4jvm.model.CompressionLevel;
 import ru.olegcherednik.zip4jvm.model.CompressionMethod;
@@ -26,12 +25,12 @@
 import ru.olegcherednik.zip4jvm.model.ShannonFanoTreesNumber;
 import ru.olegcherednik.zip4jvm.model.SlidingDictionarySize;
 
+import org.testng.annotations.Test;
+
 import java.io.IOException;
 import java.util.Arrays;
 
 import static org.assertj.core.api.Assertions.assertThat;
-import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.mockito.Mockito.mock;
 
 /**
  * @author Oleg Cherednik
@@ -41,7 +40,10 @@
 public class CompressionMethodViewTest {
 
     public void shouldRetrieveCompressionMethodTitleWhenSingleLine() throws IOException {
-        String[] lines = Zip4jvmSuite.execute(new CompressionMethodView(CompressionMethod.STORE, new GeneralPurposeFlag(), 0, 52));
+        String[] lines = Zip4jvmSuite.execute(new CompressionMethodView(CompressionMethod.STORE,
+                                                                        new GeneralPurposeFlag(),
+                                                                        0,
+                                                                        52));
         assertThat(lines).hasSize(1);
         assertThat(lines[0]).isEqualTo("compression method (00):                            none (stored)");
     }
@@ -51,7 +53,10 @@ public void shouldRetrieveThreeLinesWhenFileImplodedMethod() throws IOException
         generalPurposeFlag.setSlidingDictionarySize(SlidingDictionarySize.SD_4K);
         generalPurposeFlag.setShannonFanoTreesNumber(ShannonFanoTreesNumber.THREE);
 
-        String[] lines = Zip4jvmSuite.execute(new CompressionMethodView(CompressionMethod.FILE_IMPLODED, generalPurposeFlag, 0, 52));
+        String[] lines = Zip4jvmSuite.execute(new CompressionMethodView(CompressionMethod.FILE_IMPLODED,
+                                                                        generalPurposeFlag,
+                                                                        0,
+                                                                        52));
         assertThat(lines).hasSize(3);
         assertThat(lines[0]).isEqualTo("compression method (06):                            imploded");
         assertThat(lines[1]).isEqualTo("  size of sliding dictionary (implosion):           4K");
@@ -63,10 +68,14 @@ public void shouldRetrieveTwoLinesWhenLzmaMethod() throws IOException {
             GeneralPurposeFlag generalPurposeFlag = new GeneralPurposeFlag();
             generalPurposeFlag.setLzmaEosMarker(eosMarker);
 
-            String[] lines = Zip4jvmSuite.execute(new CompressionMethodView(CompressionMethod.LZMA, generalPurposeFlag, 0, 52));
+            String[] lines = Zip4jvmSuite.execute(new CompressionMethodView(CompressionMethod.LZMA,
+                                                                            generalPurposeFlag,
+                                                                            0,
+                                                                            52));
             assertThat(lines).hasSize(2);
             assertThat(lines[0]).isEqualTo("compression method (14):                            lzma encoding");
-            assertThat(lines[1]).isEqualTo("  end-of-stream (EOS) marker:                       " + (eosMarker ? "yes" : "no"));
+            assertThat(lines[1]).isEqualTo(
+                    "  end-of-stream (EOS) marker:                       " + (eosMarker ? "yes" : "no"));
         }
     }
 
@@ -74,14 +83,19 @@ public void shouldRetrieveCompressionSubTypeWhenDeflateCompressionMethod() throw
         GeneralPurposeFlag generalPurposeFlag = new GeneralPurposeFlag();
         generalPurposeFlag.setCompressionLevel(CompressionLevel.NORMAL);
 
-        for (CompressionMethod compressionMethod : Arrays.asList(CompressionMethod.DEFLATE, CompressionMethod.ENHANCED_DEFLATE)) {
-            String[] lines = Zip4jvmSuite.execute(new CompressionMethodView(compressionMethod, generalPurposeFlag, 0, 52));
+        for (CompressionMethod compressionMethod : Arrays.asList(CompressionMethod.DEFLATE,
+                                                                 CompressionMethod.ENHANCED_DEFLATE)) {
+            String[] lines = Zip4jvmSuite.execute(new CompressionMethodView(compressionMethod,
+                                                                            generalPurposeFlag,
+                                                                            0,
+                                                                            52));
             assertThat(lines).hasSize(2);
 
             if (compressionMethod == CompressionMethod.DEFLATE)
                 assertThat(lines[0]).isEqualTo("compression method (08):                            deflate");
             else if (compressionMethod == CompressionMethod.ENHANCED_DEFLATE)
-                assertThat(lines[0]).isEqualTo("compression method (09):                            deflate (enhanced)");
+                assertThat(lines[0])
+                        .isEqualTo("compression method (09):                            deflate (enhanced)");
 
             assertThat(lines[1]).isEqualTo("  compression sub-type (deflation):                 normal");
         }
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/view/EndCentralDirectoryViewTest.java b/src/test/java/ru/olegcherednik/zip4jvm/view/EndCentralDirectoryViewTest.java
index dfe98ac75..2c75eb438 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/view/EndCentralDirectoryViewTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/view/EndCentralDirectoryViewTest.java
@@ -18,13 +18,14 @@
  */
 package ru.olegcherednik.zip4jvm.view;
 
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
 import ru.olegcherednik.zip4jvm.model.Charsets;
 import ru.olegcherednik.zip4jvm.model.EndCentralDirectory;
 import ru.olegcherednik.zip4jvm.model.Zip64;
 import ru.olegcherednik.zip4jvm.model.block.Block;
 
+import org.testng.annotations.Test;
+
 import java.io.IOException;
 import java.util.Arrays;
 
@@ -47,7 +48,13 @@ public void shouldRetrieveAllLinesWhenEndCentralDirectoryExists() throws IOExcep
 
         EndCentralDirectory endCentralDirectory = createEndCentralDirectory(255533L);
 
-        String[] lines = Zip4jvmSuite.execute(new EndCentralDirectoryView(endCentralDirectory, block, Charsets.UTF_8, 2, 52, 0, false));
+        String[] lines = Zip4jvmSuite.execute(new EndCentralDirectoryView(endCentralDirectory,
+                                                                          block,
+                                                                          Charsets.UTF_8,
+                                                                          2,
+                                                                          52,
+                                                                          0,
+                                                                          false));
         assertThat(lines).hasSize(13);
         assertThat(lines[0]).isEqualTo("(PK0506) End of Central directory record");
         assertThat(lines[1]).isEqualTo("========================================");
@@ -72,18 +79,26 @@ public void shouldRetrieveZip64NoteWhenEndCentralDirectoryWithLargeOffs() throws
 
             EndCentralDirectory endCentralDirectory = createEndCentralDirectory(centralDirectoryOffs);
 
-            String[] lines = Zip4jvmSuite.execute(new EndCentralDirectoryView(endCentralDirectory, block, Charsets.UTF_8, 2, 52, 0, false));
+            String[] lines = Zip4jvmSuite.execute(new EndCentralDirectoryView(endCentralDirectory,
+                                                                              block,
+                                                                              Charsets.UTF_8,
+                                                                              2,
+                                                                              52,
+                                                                              0,
+                                                                              false));
             assertThat(lines).hasSize(14);
             assertThat(lines[0]).isEqualTo("(PK0506) End of Central directory record");
             assertThat(lines[1]).isEqualTo("========================================");
-            assertThat(lines[2]).isEqualTo("  - location:                                       255614 (0x0003E67E) bytes");
+            assertThat(lines[2]).isEqualTo(
+                    "  - location:                                       255614 (0x0003E67E) bytes");
             assertThat(lines[3]).isEqualTo("  - size:                                           33 bytes");
             assertThat(lines[4]).isEqualTo("  part number of this part (0001):                  2");
             assertThat(lines[5]).isEqualTo("  part number of start of central dir (0002):       3");
             assertThat(lines[6]).isEqualTo("  number of entries in central dir in this part:    13");
             assertThat(lines[7]).isEqualTo("  total number of entries in central dir:           15");
             assertThat(lines[8]).isEqualTo("  size of central dir:                              81 bytes");
-            assertThat(lines[9]).isEqualTo("  relative offset of central dir:                   4294967295 (0xFFFFFFFF) bytes");
+            assertThat(lines[9])
+                    .isEqualTo("  relative offset of central dir:                   4294967295 (0xFFFFFFFF) bytes");
             assertThat(lines[10]).isEqualTo("    (see real value in ZIP64 record)");
             assertThat(lines[11]).isEqualTo("  zipfile comment length:                           11 bytes");
             assertThat(lines[12]).isEqualTo("                                                    UTF-8");
@@ -94,9 +109,21 @@ public void shouldRetrieveZip64NoteWhenEndCentralDirectoryWithLargeOffs() throws
     public void shouldThrowIllegalArgumentExceptionWhenSomeParametersNull() {
         assertThatThrownBy(() -> new EndCentralDirectoryView(null, mock(Block.class), Charsets.UTF_8, 2, 52, 0, false))
                 .isExactlyInstanceOf(IllegalArgumentException.class);
-        assertThatThrownBy(() -> new EndCentralDirectoryView(mock(EndCentralDirectory.class), null, Charsets.UTF_8, 2, 52, 0, false))
+        assertThatThrownBy(() -> new EndCentralDirectoryView(mock(EndCentralDirectory.class),
+                                                             null,
+                                                             Charsets.UTF_8,
+                                                             2,
+                                                             52,
+                                                             0,
+                                                             false))
                 .isExactlyInstanceOf(IllegalArgumentException.class);
-        assertThatThrownBy(() -> new EndCentralDirectoryView(mock(EndCentralDirectory.class), mock(Block.class), null, 2, 52, 0, false))
+        assertThatThrownBy(() -> new EndCentralDirectoryView(mock(EndCentralDirectory.class),
+                                                             mock(Block.class),
+                                                             null,
+                                                             2,
+                                                             52,
+                                                             0,
+                                                             false))
                 .isExactlyInstanceOf(IllegalArgumentException.class);
     }
 
@@ -109,7 +136,13 @@ public void shouldRetrieveAllLinesWithDiskWhenSplitZip() throws IOException {
 
         EndCentralDirectory endCentralDirectory = createEndCentralDirectory(255533L);
 
-        String[] lines = Zip4jvmSuite.execute(new EndCentralDirectoryView(endCentralDirectory, block, Charsets.UTF_8, 2, 52, 5, false));
+        String[] lines = Zip4jvmSuite.execute(new EndCentralDirectoryView(endCentralDirectory,
+                                                                          block,
+                                                                          Charsets.UTF_8,
+                                                                          2,
+                                                                          52,
+                                                                          5,
+                                                                          false));
         assertThat(lines).hasSize(14);
         assertThat(lines[0]).isEqualTo("(PK0506) End of Central directory record");
         assertThat(lines[1]).isEqualTo("========================================");
@@ -121,7 +154,8 @@ public void shouldRetrieveAllLinesWithDiskWhenSplitZip() throws IOException {
         assertThat(lines[7]).isEqualTo("  number of entries in central dir in this part:    13");
         assertThat(lines[8]).isEqualTo("  total number of entries in central dir:           15");
         assertThat(lines[9]).isEqualTo("  size of central dir:                              81 bytes");
-        assertThat(lines[10]).isEqualTo("  relative offset of central dir:                   255533 (0x0003E62D) bytes");
+        assertThat(lines[10])
+                .isEqualTo("  relative offset of central dir:                   255533 (0x0003E62D) bytes");
         assertThat(lines[11]).isEqualTo("  zipfile comment length:                           11 bytes");
         assertThat(lines[12]).isEqualTo("                                                    UTF-8");
         assertThat(lines[13]).isEqualTo("  70 61 73 73 77 6F 72 64 3A 20 31                  password: 1");
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/view/ExternalFileAttributesViewTest.java b/src/test/java/ru/olegcherednik/zip4jvm/view/ExternalFileAttributesViewTest.java
index 9b9613e37..31ce5db18 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/view/ExternalFileAttributesViewTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/view/ExternalFileAttributesViewTest.java
@@ -18,16 +18,14 @@
  */
 package ru.olegcherednik.zip4jvm.view;
 
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
 import ru.olegcherednik.zip4jvm.model.ExternalFileAttributes;
-import ru.olegcherednik.zip4jvm.model.ExternalFileAttributesTest;
 import ru.olegcherednik.zip4jvm.utils.ReflectionUtils;
 
+import org.testng.annotations.Test;
+
 import java.io.IOException;
 import java.util.Arrays;
-import java.util.Optional;
-import java.util.function.Supplier;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static ru.olegcherednik.zip4jvm.utils.BitUtils.BIT0;
@@ -56,14 +54,15 @@ public class ExternalFileAttributesViewTest {
 
     public void shouldRetrieveWindowsAttributesWhenWin() throws IOException {
         ExternalFileAttributes externalFileAttributes = new ExternalFileAttributes(
-                new byte[] { (byte)(WINDOWS_READ_ONLY | WINDOWS_SYSTEM | WINDOWS_DIRECTORY), 0x0, 0x0, 0x0 });
+                new byte[] { (byte) (WINDOWS_READ_ONLY | WINDOWS_SYSTEM | WINDOWS_DIRECTORY), 0x0, 0x0, 0x0 });
 
         String[] lines = Zip4jvmSuite.execute(new ExternalFileAttributesView(externalFileAttributes, 0, 52));
 
         assertThat(lines).hasSize(3);
         assertThat(lines[0]).isEqualTo("external file attributes:                           0x00000015");
         assertThat(lines[1]).isEqualTo("  WINDOWS   (0x15):                                 rdo sys dir");
-        assertThat(lines[2]).isEqualTo("  POSIX (0x000000):                                 " + ExternalFileAttributes.NONE);
+        assertThat(lines[2]).isEqualTo(
+                "  POSIX (0x000000):                                 " + ExternalFileAttributes.NONE);
     }
 
     public void shouldRetrievePosixAttributesWhenMacOrUnix() throws Exception {
@@ -72,9 +71,9 @@ public void shouldRetrievePosixAttributesWhenMacOrUnix() throws Exception {
                     ReflectionUtils.invokeConstructor(ExternalFileAttributes.class,
                                                       new Class[] { byte[].class, String.class },
                                                       new byte[] { 0x0, 0x0,
-                                                              (byte)(POSIX_OTHERS_EXECUTE | POSIX_OTHERS_READ | POSIX_GROUP_WRITE |
-                                                                      POSIX_OWNER_EXECUTE),
-                                                              (byte)(POSIX_OWNER_READ | POSIX_REGULAR_FILE) }, osName);
+                                                              (byte) (POSIX_OTHERS_EXECUTE | POSIX_OTHERS_READ
+                                                                      | POSIX_GROUP_WRITE | POSIX_OWNER_EXECUTE),
+                                                              (byte) (POSIX_OWNER_READ | POSIX_REGULAR_FILE) }, osName);
 
             String[] lines = Zip4jvmSuite.execute(new ExternalFileAttributesView(externalFileAttributes, 0, 52));
 
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/view/GeneralPurposeFlagViewTest.java b/src/test/java/ru/olegcherednik/zip4jvm/view/GeneralPurposeFlagViewTest.java
index 2856a112e..63bd9505f 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/view/GeneralPurposeFlagViewTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/view/GeneralPurposeFlagViewTest.java
@@ -18,12 +18,13 @@
  */
 package ru.olegcherednik.zip4jvm.view;
 
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
 import ru.olegcherednik.zip4jvm.model.CompressionLevel;
 import ru.olegcherednik.zip4jvm.model.CompressionMethod;
 import ru.olegcherednik.zip4jvm.model.GeneralPurposeFlag;
 
+import org.testng.annotations.Test;
+
 import java.io.IOException;
 
 import static org.assertj.core.api.Assertions.assertThat;
@@ -36,7 +37,10 @@
 public class GeneralPurposeFlagViewTest {
 
     public void shouldRetrieveViewWithMultipleLinesWhenNotEncrypted() throws IOException {
-        String[] lines = Zip4jvmSuite.execute(new GeneralPurposeFlagView(new GeneralPurposeFlag(), CompressionMethod.STORE, 0, 52));
+        String[] lines = Zip4jvmSuite.execute(new GeneralPurposeFlagView(new GeneralPurposeFlag(),
+                                                                         CompressionMethod.STORE,
+                                                                         0,
+                                                                         52));
 
         assertThat(lines).hasSize(5);
         assertThat(lines[0]).isEqualTo("general purpose bit flag (0x0000) (bit 15..0):      0000.0000 0000.0000");
@@ -50,7 +54,10 @@ public void shouldRetrieveViewWithMultipleLinesWhenEncrypted() throws IOExceptio
         GeneralPurposeFlag generalPurposeFlag = new GeneralPurposeFlag();
         generalPurposeFlag.setEncrypted(true);
 
-        String[] lines = Zip4jvmSuite.execute(new GeneralPurposeFlagView(generalPurposeFlag, CompressionMethod.STORE, 0, 52));
+        String[] lines = Zip4jvmSuite.execute(new GeneralPurposeFlagView(generalPurposeFlag,
+                                                                         CompressionMethod.STORE,
+                                                                         0,
+                                                                         52));
 
         assertThat(lines).hasSize(5);
         assertThat(lines[0]).isEqualTo("general purpose bit flag (0x0001) (bit 15..0):      0000.0000 0000.0001");
@@ -64,7 +71,10 @@ public void shouldRetrieveViewWithMultipleLinesWhenDataDescriptorAvailable() thr
         GeneralPurposeFlag generalPurposeFlag = new GeneralPurposeFlag();
         generalPurposeFlag.setDataDescriptorAvailable(true);
 
-        String[] lines = Zip4jvmSuite.execute(new GeneralPurposeFlagView(generalPurposeFlag, CompressionMethod.STORE, 0, 52));
+        String[] lines = Zip4jvmSuite.execute(new GeneralPurposeFlagView(generalPurposeFlag,
+                                                                         CompressionMethod.STORE,
+                                                                         0,
+                                                                         52));
 
         assertThat(lines).hasSize(5);
         assertThat(lines[0]).isEqualTo("general purpose bit flag (0x0008) (bit 15..0):      0000.0000 0000.1000");
@@ -78,7 +88,10 @@ public void shouldRetrieveViewWithMultipleLinesWhenStringEncryption() throws IOE
         GeneralPurposeFlag generalPurposeFlag = new GeneralPurposeFlag();
         generalPurposeFlag.setStrongEncryption(true);
 
-        String[] lines = Zip4jvmSuite.execute(new GeneralPurposeFlagView(generalPurposeFlag, CompressionMethod.STORE, 0, 52));
+        String[] lines = Zip4jvmSuite.execute(new GeneralPurposeFlagView(generalPurposeFlag,
+                                                                         CompressionMethod.STORE,
+                                                                         0,
+                                                                         52));
 
         assertThat(lines).hasSize(5);
         assertThat(lines[0]).isEqualTo("general purpose bit flag (0x0040) (bit 15..0):      0000.0000 0100.0000");
@@ -92,7 +105,10 @@ public void shouldRetrieveViewWithMultipleLinesWhenUnicode() throws IOException
         GeneralPurposeFlag generalPurposeFlag = new GeneralPurposeFlag();
         generalPurposeFlag.setUtf8(true);
 
-        String[] lines = Zip4jvmSuite.execute(new GeneralPurposeFlagView(generalPurposeFlag, CompressionMethod.STORE, 0, 52));
+        String[] lines = Zip4jvmSuite.execute(new GeneralPurposeFlagView(generalPurposeFlag,
+                                                                         CompressionMethod.STORE,
+                                                                         0,
+                                                                         52));
 
         assertThat(lines).hasSize(5);
         assertThat(lines[0]).isEqualTo("general purpose bit flag (0x0800) (bit 15..0):      0000.1000 0000.0000");
@@ -106,7 +122,10 @@ public void shouldRetrieveViewWithMultipleLinesWhenDeflateSuperFast() throws IOE
         GeneralPurposeFlag generalPurposeFlag = new GeneralPurposeFlag();
         generalPurposeFlag.setCompressionLevel(CompressionLevel.SUPER_FAST);
 
-        String[] lines = Zip4jvmSuite.execute(new GeneralPurposeFlagView(generalPurposeFlag, CompressionMethod.DEFLATE, 0, 52));
+        String[] lines = Zip4jvmSuite.execute(new GeneralPurposeFlagView(generalPurposeFlag,
+                                                                         CompressionMethod.DEFLATE,
+                                                                         0,
+                                                                         52));
 
         assertThat(lines).hasSize(5);
         assertThat(lines[0]).isEqualTo("general purpose bit flag (0x0006) (bit 15..0):      0000.0000 0000.0110");
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/view/InternalFileAttributesViewTest.java b/src/test/java/ru/olegcherednik/zip4jvm/view/InternalFileAttributesViewTest.java
index 2c9a2175e..7b6e95ddc 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/view/InternalFileAttributesViewTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/view/InternalFileAttributesViewTest.java
@@ -18,10 +18,11 @@
  */
 package ru.olegcherednik.zip4jvm.view;
 
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
 import ru.olegcherednik.zip4jvm.model.InternalFileAttributes;
 
+import org.testng.annotations.Test;
+
 import java.io.IOException;
 
 import static org.assertj.core.api.Assertions.assertThat;
@@ -34,7 +35,8 @@
 public class InternalFileAttributesViewTest {
 
     public void shouldRetrieveWindowsAttributesWhenWin() throws IOException {
-        String[] lines = Zip4jvmSuite.execute(new InternalFileAttributesView(new InternalFileAttributes(new byte[] { 0x1, 0x2 }), 0, 52));
+        String[] lines = Zip4jvmSuite.execute(
+                new InternalFileAttributesView(new InternalFileAttributes(new byte[] { 0x1, 0x2 }), 0, 52));
 
         assertThat(lines).hasSize(2);
         assertThat(lines[0]).isEqualTo("internal file attributes:                           0x0201");
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/view/SizeViewTest.java b/src/test/java/ru/olegcherednik/zip4jvm/view/SizeViewTest.java
index 39a7f8d5e..905bb9a9b 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/view/SizeViewTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/view/SizeViewTest.java
@@ -18,9 +18,10 @@
  */
 package ru.olegcherednik.zip4jvm.view;
 
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
 
+import org.testng.annotations.Test;
+
 import java.io.IOException;
 import java.util.Arrays;
 
@@ -48,6 +49,10 @@ public void shouldPrintByteWhenNameNotBlankAnaOneByte() throws IOException {
 
     public void shouldThrowIllegalArgumentExceptionWhenNameBlank() {
         for (String name : Arrays.asList(null, "", "  "))
-            assertThatThrownBy(() -> new SizeView(name, 666, 4, 52)).isExactlyInstanceOf(IllegalArgumentException.class);
+            assertThatThrownBy(() -> new SizeView(name,
+                                                  666,
+                                                  4,
+                                                  52)).isExactlyInstanceOf(IllegalArgumentException.class);
     }
+
 }
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/view/StringHexViewTest.java b/src/test/java/ru/olegcherednik/zip4jvm/view/StringHexViewTest.java
index 65acf9573..63cb9d715 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/view/StringHexViewTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/view/StringHexViewTest.java
@@ -18,10 +18,11 @@
  */
 package ru.olegcherednik.zip4jvm.view;
 
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
 import ru.olegcherednik.zip4jvm.model.Charsets;
 
+import org.testng.annotations.Test;
+
 import java.io.IOException;
 import java.io.PrintStream;
 
@@ -64,7 +65,8 @@ public void shouldFillWholeColumnWhenColumnWidthNotStandard() throws IOException
         String[] lines = Zip4jvmSuite.execute(new StringHexView("bikes/honda-cbr600rr.jpg", Charsets.UTF_8, 0, 64));
         assertThat(lines).hasSize(3);
         assertThat(lines[0]).isEqualTo("                                                                UTF-8");
-        assertThat(lines[1]).isEqualTo("62 69 6B 65 73 2F 68 6F 6E 64 61 2D 63 62 72 36 30 30 72 72 2E  bikes/honda-cbr600rr.");
+        assertThat(lines[1]).isEqualTo(
+                "62 69 6B 65 73 2F 68 6F 6E 64 61 2D 63 62 72 36 30 30 72 72 2E  bikes/honda-cbr600rr.");
         assertThat(lines[2]).isEqualTo("6A 70 67                                                        jpg");
     }
 
@@ -83,6 +85,9 @@ public void shouldPrintDotInsteadOfControlCharacterWhenCommentContainsNotPrintab
     }
 
     public void shouldThrowIllegalArgumentExceptionWhenCharsetNull() {
-        assertThatThrownBy(() -> new StringHexView("oleg", null, 4, 52)).isExactlyInstanceOf(IllegalArgumentException.class);
+        assertThatThrownBy(() -> new StringHexView("oleg",
+                                                   null,
+                                                   4,
+                                                   52)).isExactlyInstanceOf(IllegalArgumentException.class);
     }
 }
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/view/VersionViewTest.java b/src/test/java/ru/olegcherednik/zip4jvm/view/VersionViewTest.java
index 85754aa02..5b4dc57d9 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/view/VersionViewTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/view/VersionViewTest.java
@@ -18,10 +18,11 @@
  */
 package ru.olegcherednik.zip4jvm.view;
 
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
 import ru.olegcherednik.zip4jvm.model.Version;
 
+import org.testng.annotations.Test;
+
 import java.io.IOException;
 import java.io.PrintStream;
 
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/view/centraldirectory/DigitalSignatureViewTest.java b/src/test/java/ru/olegcherednik/zip4jvm/view/centraldirectory/DigitalSignatureViewTest.java
index 5d1919653..0874f311e 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/view/centraldirectory/DigitalSignatureViewTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/view/centraldirectory/DigitalSignatureViewTest.java
@@ -18,11 +18,12 @@
  */
 package ru.olegcherednik.zip4jvm.view.centraldirectory;
 
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
 import ru.olegcherednik.zip4jvm.model.CentralDirectory;
 import ru.olegcherednik.zip4jvm.model.block.Block;
 
+import org.testng.annotations.Test;
+
 import java.io.IOException;
 
 import static org.assertj.core.api.Assertions.assertThat;
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/view/centraldirectory/EncryptedCentralDirectoryViewTest.java b/src/test/java/ru/olegcherednik/zip4jvm/view/centraldirectory/EncryptedCentralDirectoryViewTest.java
index f25eda072..037502fbb 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/view/centraldirectory/EncryptedCentralDirectoryViewTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/view/centraldirectory/EncryptedCentralDirectoryViewTest.java
@@ -18,7 +18,6 @@
  */
 package ru.olegcherednik.zip4jvm.view.centraldirectory;
 
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
 import ru.olegcherednik.zip4jvm.crypto.strong.EncryptionAlgorithm;
 import ru.olegcherednik.zip4jvm.model.CentralDirectory;
@@ -26,6 +25,8 @@
 import ru.olegcherednik.zip4jvm.model.Zip64;
 import ru.olegcherednik.zip4jvm.model.block.CentralDirectoryBlock;
 
+import org.testng.annotations.Test;
+
 import java.io.IOException;
 import java.util.Collections;
 
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/view/centraldirectory/FileHeaderViewTest.java b/src/test/java/ru/olegcherednik/zip4jvm/view/centraldirectory/FileHeaderViewTest.java
index 8be3ff0d8..47ec4ad20 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/view/centraldirectory/FileHeaderViewTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/view/centraldirectory/FileHeaderViewTest.java
@@ -18,7 +18,6 @@
  */
 package ru.olegcherednik.zip4jvm.view.centraldirectory;
 
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
 import ru.olegcherednik.zip4jvm.crypto.aes.AesStrength;
 import ru.olegcherednik.zip4jvm.model.CentralDirectory;
@@ -33,6 +32,8 @@
 import ru.olegcherednik.zip4jvm.model.extrafield.PkwareExtraField;
 import ru.olegcherednik.zip4jvm.model.extrafield.records.AesExtraFieldRecord;
 
+import org.testng.annotations.Test;
+
 import java.io.IOException;
 
 import static org.assertj.core.api.Assertions.assertThat;
@@ -90,7 +91,8 @@ public void shouldRetrieveAllLinesWhenFileHeader() throws IOException {
         assertThat(lines[26]).isEqualTo("      apparent file type:                           binary");
         assertThat(lines[27]).isEqualTo("    external file attributes:                       0x00000020");
         assertThat(lines[28]).isEqualTo("      WINDOWS   (0x20):                             arc");
-        assertThat(lines[29]).isEqualTo("      POSIX (0x000000):                             " + ExternalFileAttributes.NONE);
+        assertThat(lines[29]).isEqualTo(
+                "      POSIX (0x000000):                             " + ExternalFileAttributes.NONE);
     }
 
     public void shouldRetrieveExtraFieldLocationAndSizeWhenFileHeaderWithExtraField() throws IOException {
@@ -148,8 +150,10 @@ public void shouldRetrieveExtraFieldLocationAndSizeWhenFileHeaderWithExtraField(
         assertThat(lines[26]).isEqualTo("      apparent file type:                           binary");
         assertThat(lines[27]).isEqualTo("    external file attributes:                       0x00000020");
         assertThat(lines[28]).isEqualTo("      WINDOWS   (0x20):                             arc");
-        assertThat(lines[29]).isEqualTo("      POSIX (0x000000):                             " + ExternalFileAttributes.NONE);
-        assertThat(lines[30]).isEqualTo("    extra field:                                    255603 (0x0003E673) bytes");
+        assertThat(lines[29])
+                .isEqualTo("      POSIX (0x000000):                             " + ExternalFileAttributes.NONE);
+        assertThat(lines[30])
+                .isEqualTo("    extra field:                                    255603 (0x0003E673) bytes");
         assertThat(lines[31]).isEqualTo("      - size:                                       11 bytes (1 record)");
     }
 
@@ -198,7 +202,8 @@ public void shouldRetrieveCommentWhenFileHeaderWithComment() throws IOException
         assertThat(lines[28]).isEqualTo("      apparent file type:                           binary");
         assertThat(lines[29]).isEqualTo("    external file attributes:                       0x00000020");
         assertThat(lines[30]).isEqualTo("      WINDOWS   (0x20):                             arc");
-        assertThat(lines[31]).isEqualTo("      POSIX (0x000000):                             " + ExternalFileAttributes.NONE);
+        assertThat(lines[31]).isEqualTo(
+                "      POSIX (0x000000):                             " + ExternalFileAttributes.NONE);
     }
 
     private static CentralDirectory.FileHeader createFileHeader(boolean extraField, String comment) {
@@ -220,14 +225,16 @@ private static CentralDirectory.FileHeader createFileHeader(boolean extraField,
         fileHeader.setFileName("ducati-panigale-1199.jpg");
 
         if (extraField) {
-            fileHeader.setExtraField(PkwareExtraField.builder()
-                                                     .addRecord(AesExtraFieldRecord.builder()
-                                                                                   .dataSize(1)
-                                                                                   .versionNumber(2)
-                                                                                   .vendor("AE")
-                                                                                   .strength(AesStrength.S256)
-                                                                                   .compressionMethod(CompressionMethod.DEFLATE).build())
-                                                     .build());
+            fileHeader.setExtraField(
+                    PkwareExtraField.builder()
+                                    .addRecord(AesExtraFieldRecord.builder()
+                                                                  .dataSize(1)
+                                                                  .versionNumber(2)
+                                                                  .vendor("AE")
+                                                                  .strength(AesStrength.S256)
+                                                                  .compressionMethod(CompressionMethod.DEFLATE)
+                                                                  .build())
+                                    .build());
         }
 
         fileHeader.setComment(comment);
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/view/crypto/AesEncryptionHeaderViewTest.java b/src/test/java/ru/olegcherednik/zip4jvm/view/crypto/AesEncryptionHeaderViewTest.java
index bd030db5b..74c51824f 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/view/crypto/AesEncryptionHeaderViewTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/view/crypto/AesEncryptionHeaderViewTest.java
@@ -18,11 +18,12 @@
  */
 package ru.olegcherednik.zip4jvm.view.crypto;
 
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
 import ru.olegcherednik.zip4jvm.model.block.Block;
 import ru.olegcherednik.zip4jvm.model.block.crypto.AesEncryptionHeaderBlock;
 
+import org.testng.annotations.Test;
+
 import java.io.IOException;
 
 import static org.assertj.core.api.Assertions.assertThat;
@@ -114,7 +115,8 @@ public void shouldRetrieveMultipleLinesWithDiskWhenSplitZip() throws IOException
         assertThat(lines[7]).isEqualTo("    - disk (0005):                                  src.zip");
         assertThat(lines[8]).isEqualTo("    - size:                                         2 bytes");
         assertThat(lines[9]).isEqualTo("  05 06");
-        assertThat(lines[10]).isEqualTo("  mac:                                              255507 (0x0003E613) bytes");
+        assertThat(lines[10])
+                .isEqualTo("  mac:                                              255507 (0x0003E613) bytes");
         assertThat(lines[11]).isEqualTo("    - disk (0005):                                  src.zip");
         assertThat(lines[12]).isEqualTo("    - size:                                         10 bytes");
         assertThat(lines[13]).isEqualTo("  07 08 09 0A 0B 0C 0D 0E 0F");
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/view/crypto/PkwareEncryptionHeaderBlockViewTest.java b/src/test/java/ru/olegcherednik/zip4jvm/view/crypto/PkwareEncryptionHeaderBlockViewTest.java
index 2efa45f60..d291a9941 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/view/crypto/PkwareEncryptionHeaderBlockViewTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/view/crypto/PkwareEncryptionHeaderBlockViewTest.java
@@ -18,10 +18,11 @@
  */
 package ru.olegcherednik.zip4jvm.view.crypto;
 
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
 import ru.olegcherednik.zip4jvm.model.block.crypto.PkwareEncryptionHeaderBlock;
 
+import org.testng.annotations.Test;
+
 import java.io.IOException;
 
 import static org.assertj.core.api.Assertions.assertThat;
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/view/entry/DataDescriptorViewTest.java b/src/test/java/ru/olegcherednik/zip4jvm/view/entry/DataDescriptorViewTest.java
index d4fb3a6ef..b6bc13580 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/view/entry/DataDescriptorViewTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/view/entry/DataDescriptorViewTest.java
@@ -18,11 +18,12 @@
  */
 package ru.olegcherednik.zip4jvm.view.entry;
 
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
 import ru.olegcherednik.zip4jvm.model.DataDescriptor;
 import ru.olegcherednik.zip4jvm.model.block.Block;
 
+import org.testng.annotations.Test;
+
 import java.io.IOException;
 
 import static org.assertj.core.api.Assertions.assertThat;
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/view/extrafield/AesExtraFieldRecordViewTest.java b/src/test/java/ru/olegcherednik/zip4jvm/view/extrafield/AesExtraFieldRecordViewTest.java
index a80465ef0..ef6d8b327 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/view/extrafield/AesExtraFieldRecordViewTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/view/extrafield/AesExtraFieldRecordViewTest.java
@@ -18,13 +18,14 @@
  */
 package ru.olegcherednik.zip4jvm.view.extrafield;
 
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
 import ru.olegcherednik.zip4jvm.crypto.aes.AesStrength;
-import ru.olegcherednik.zip4jvm.model.extrafield.records.AesExtraFieldRecord;
 import ru.olegcherednik.zip4jvm.model.CompressionMethod;
 import ru.olegcherednik.zip4jvm.model.GeneralPurposeFlag;
 import ru.olegcherednik.zip4jvm.model.block.Block;
+import ru.olegcherednik.zip4jvm.model.extrafield.records.AesExtraFieldRecord;
+
+import org.testng.annotations.Test;
 
 import java.io.IOException;
 import java.io.PrintStream;
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/view/extrafield/AlignmentExtraFieldRecordViewTest.java b/src/test/java/ru/olegcherednik/zip4jvm/view/extrafield/AlignmentExtraFieldRecordViewTest.java
index f4823ca66..a0e328d42 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/view/extrafield/AlignmentExtraFieldRecordViewTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/view/extrafield/AlignmentExtraFieldRecordViewTest.java
@@ -18,11 +18,12 @@
  */
 package ru.olegcherednik.zip4jvm.view.extrafield;
 
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
 import ru.olegcherednik.zip4jvm.model.block.Block;
 import ru.olegcherednik.zip4jvm.model.extrafield.records.AlignmentExtraFieldRecord;
 
+import org.testng.annotations.Test;
+
 import java.io.IOException;
 
 import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/view/extrafield/ExtendedTimestampExtraFieldRecordViewTest.java b/src/test/java/ru/olegcherednik/zip4jvm/view/extrafield/ExtendedTimestampExtraFieldRecordViewTest.java
index a9f2fa5e1..9d7b5fe27 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/view/extrafield/ExtendedTimestampExtraFieldRecordViewTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/view/extrafield/ExtendedTimestampExtraFieldRecordViewTest.java
@@ -18,11 +18,12 @@
  */
 package ru.olegcherednik.zip4jvm.view.extrafield;
 
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
 import ru.olegcherednik.zip4jvm.model.block.Block;
 import ru.olegcherednik.zip4jvm.model.extrafield.records.ExtendedTimestampExtraFieldRecord;
 
+import org.testng.annotations.Test;
+
 import java.io.IOException;
 import java.io.PrintStream;
 
@@ -64,7 +65,8 @@ public void shouldRetrieveThreeTimesWhenAllTimesSet() throws IOException {
                                                                                    .position(0, 52, 0).build());
 
         assertThat(lines).hasSize(5);
-        assertThat(lines[0]).isEqualTo("(0x5455) Universal time:                            5296723 (0x0050D253) bytes");
+        assertThat(lines[0])
+                .isEqualTo("(0x5455) Universal time:                            5296723 (0x0050D253) bytes");
         assertThat(lines[1]).isEqualTo("  - size:                                           17 bytes");
         assertThat(lines[2]).isEqualTo("  Last Modified Date:                               2019-10-24 07:46:22");
         assertThat(lines[3]).isEqualTo("  Last Accessed Date:                               2019-10-22 00:13:05");
@@ -76,12 +78,13 @@ public void shouldRetrieveLastModificationTimeWhenOnlyItSet() throws IOException
         when(block.getSize()).thenReturn(17L);
         when(block.getRelativeOffs()).thenReturn(5296723L);
 
-        ExtendedTimestampExtraFieldRecord record = ExtendedTimestampExtraFieldRecord.builder()
-                                                                                    .dataSize(13)
-                                                                                    .flag(new ExtendedTimestampExtraFieldRecord.Flag(BIT0))
-                                                                                    .lastModificationTime(lastModifiedTime)
-                                                                                    .lastAccessTime(lastAccessTime)
-                                                                                    .creationTime(creationTime).build();
+        ExtendedTimestampExtraFieldRecord record =
+                ExtendedTimestampExtraFieldRecord.builder()
+                                                 .dataSize(13)
+                                                 .flag(new ExtendedTimestampExtraFieldRecord.Flag(BIT0))
+                                                 .lastModificationTime(lastModifiedTime)
+                                                 .lastAccessTime(lastAccessTime)
+                                                 .creationTime(creationTime).build();
 
         String[] lines = Zip4jvmSuite.execute(ExtendedTimestampExtraFieldRecordView.builder()
                                                                                    .record(record)
@@ -89,7 +92,8 @@ public void shouldRetrieveLastModificationTimeWhenOnlyItSet() throws IOException
                                                                                    .position(0, 52, 0).build());
 
         assertThat(lines).hasSize(3);
-        assertThat(lines[0]).isEqualTo("(0x5455) Universal time:                            5296723 (0x0050D253) bytes");
+        assertThat(lines[0])
+                .isEqualTo("(0x5455) Universal time:                            5296723 (0x0050D253) bytes");
         assertThat(lines[1]).isEqualTo("  - size:                                           17 bytes");
         assertThat(lines[2]).isEqualTo("  Last Modified Date:                               2019-10-24 07:46:22");
     }
@@ -99,12 +103,13 @@ public void shouldRetrieveLastAccessTimeWhenOnlyItSet() throws IOException {
         when(block.getSize()).thenReturn(17L);
         when(block.getRelativeOffs()).thenReturn(5296723L);
 
-        ExtendedTimestampExtraFieldRecord record = ExtendedTimestampExtraFieldRecord.builder()
-                                                                                    .dataSize(13)
-                                                                                    .flag(new ExtendedTimestampExtraFieldRecord.Flag(BIT1))
-                                                                                    .lastModificationTime(lastModifiedTime)
-                                                                                    .lastAccessTime(lastAccessTime)
-                                                                                    .creationTime(creationTime).build();
+        ExtendedTimestampExtraFieldRecord record =
+                ExtendedTimestampExtraFieldRecord.builder()
+                                                 .dataSize(13)
+                                                 .flag(new ExtendedTimestampExtraFieldRecord.Flag(BIT1))
+                                                 .lastModificationTime(lastModifiedTime)
+                                                 .lastAccessTime(lastAccessTime)
+                                                 .creationTime(creationTime).build();
 
         String[] lines = Zip4jvmSuite.execute(ExtendedTimestampExtraFieldRecordView.builder()
                                                                                    .record(record)
@@ -112,7 +117,8 @@ public void shouldRetrieveLastAccessTimeWhenOnlyItSet() throws IOException {
                                                                                    .position(0, 52, 0).build());
 
         assertThat(lines).hasSize(3);
-        assertThat(lines[0]).isEqualTo("(0x5455) Universal time:                            5296723 (0x0050D253) bytes");
+        assertThat(lines[0])
+                .isEqualTo("(0x5455) Universal time:                            5296723 (0x0050D253) bytes");
         assertThat(lines[1]).isEqualTo("  - size:                                           17 bytes");
         assertThat(lines[2]).isEqualTo("  Last Accessed Date:                               2019-10-22 00:13:05");
     }
@@ -122,12 +128,13 @@ public void shouldRetrieveCreationTimeWhenOnlyItSet() throws IOException {
         when(block.getSize()).thenReturn(17L);
         when(block.getRelativeOffs()).thenReturn(5296723L);
 
-        ExtendedTimestampExtraFieldRecord record = ExtendedTimestampExtraFieldRecord.builder()
-                                                                                    .dataSize(13)
-                                                                                    .flag(new ExtendedTimestampExtraFieldRecord.Flag(BIT2))
-                                                                                    .lastModificationTime(lastModifiedTime)
-                                                                                    .lastAccessTime(lastAccessTime)
-                                                                                    .creationTime(creationTime).build();
+        ExtendedTimestampExtraFieldRecord record =
+                ExtendedTimestampExtraFieldRecord.builder()
+                                                 .dataSize(13)
+                                                 .flag(new ExtendedTimestampExtraFieldRecord.Flag(BIT2))
+                                                 .lastModificationTime(lastModifiedTime)
+                                                 .lastAccessTime(lastAccessTime)
+                                                 .creationTime(creationTime).build();
 
         String[] lines = Zip4jvmSuite.execute(ExtendedTimestampExtraFieldRecordView.builder()
                                                                                    .record(record)
@@ -135,17 +142,19 @@ public void shouldRetrieveCreationTimeWhenOnlyItSet() throws IOException {
                                                                                    .position(0, 52, 0).build());
 
         assertThat(lines).hasSize(3);
-        assertThat(lines[0]).isEqualTo("(0x5455) Universal time:                            5296723 (0x0050D253) bytes");
+        assertThat(lines[0])
+                .isEqualTo("(0x5455) Universal time:                            5296723 (0x0050D253) bytes");
         assertThat(lines[1]).isEqualTo("  - size:                                           17 bytes");
         assertThat(lines[2]).isEqualTo("  Creation Date:                                    2019-11-04 21:33:02");
     }
 
     public void shouldRetrieveEmptyStringWhenRecordNull() throws IOException {
         PrintStream out = mock(PrintStream.class);
-        ExtendedTimestampExtraFieldRecordView view = ExtendedTimestampExtraFieldRecordView.builder()
-                                                                                          .record(ExtendedTimestampExtraFieldRecord.NULL)
-                                                                                          .block(mock(Block.class))
-                                                                                          .position(0, 52, 0).build();
+        ExtendedTimestampExtraFieldRecordView view =
+                ExtendedTimestampExtraFieldRecordView.builder()
+                                                     .record(ExtendedTimestampExtraFieldRecord.NULL)
+                                                     .block(mock(Block.class))
+                                                     .position(0, 52, 0).build();
         assertThat(view.printTextInfo(out)).isFalse();
     }
 
@@ -170,7 +179,8 @@ public void shouldRetrieveThreeTimesWithDiskWhenSplit() throws IOException {
                                                                                    .position(0, 52, 5).build());
 
         assertThat(lines).hasSize(6);
-        assertThat(lines[0]).isEqualTo("(0x5455) Universal time:                            5296723 (0x0050D253) bytes");
+        assertThat(lines[0])
+                .isEqualTo("(0x5455) Universal time:                            5296723 (0x0050D253) bytes");
         assertThat(lines[1]).isEqualTo("  - disk (0005):                                    src.zip");
         assertThat(lines[2]).isEqualTo("  - size:                                           17 bytes");
         assertThat(lines[3]).isEqualTo("  Last Modified Date:                               2019-10-24 07:46:22");
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/view/extrafield/InfoZipNewUnixExtraFieldRecordViewTest.java b/src/test/java/ru/olegcherednik/zip4jvm/view/extrafield/InfoZipNewUnixExtraFieldRecordViewTest.java
index 0da044c38..e96c51e2d 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/view/extrafield/InfoZipNewUnixExtraFieldRecordViewTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/view/extrafield/InfoZipNewUnixExtraFieldRecordViewTest.java
@@ -18,11 +18,12 @@
  */
 package ru.olegcherednik.zip4jvm.view.extrafield;
 
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
 import ru.olegcherednik.zip4jvm.model.block.Block;
 import ru.olegcherednik.zip4jvm.model.extrafield.records.InfoZipNewUnixExtraFieldRecord;
 
+import org.testng.annotations.Test;
+
 import java.io.IOException;
 import java.io.PrintStream;
 
@@ -45,7 +46,8 @@ public void shouldRetrieveVersionOneRecordWhenVersionOne() throws IOException {
 
         InfoZipNewUnixExtraFieldRecord.Payload payload = InfoZipNewUnixExtraFieldRecord.VersionOnePayload.builder()
                                                                                                          .uid("aaa")
-                                                                                                         .gid("bbb").build();
+                                                                                                         .gid("bbb")
+                                                                                                         .build();
 
         InfoZipNewUnixExtraFieldRecord record = InfoZipNewUnixExtraFieldRecord.builder()
                                                                               .dataSize(11)
@@ -57,7 +59,8 @@ public void shouldRetrieveVersionOneRecordWhenVersionOne() throws IOException {
                                                                                 .position(0, 52, 0).build());
 
         assertThat(lines).hasSize(5);
-        assertThat(lines[0]).isEqualTo("(0x7875) new InfoZIP Unix/OS2/NT:                   5296740 (0x0050D264) bytes");
+        assertThat(lines[0])
+                .isEqualTo("(0x7875) new InfoZIP Unix/OS2/NT:                   5296740 (0x0050D264) bytes");
         assertThat(lines[1]).isEqualTo("  - size:                                           15 bytes");
         assertThat(lines[2]).isEqualTo("  version:                                          1");
         assertThat(lines[3]).isEqualTo("  User identifier (UID):                            aaa");
@@ -69,10 +72,11 @@ public void shouldRetrieveUnknownVersionRecordWhenVersionNotOne() throws IOExcep
         when(block.getSize()).thenReturn(15L);
         when(block.getRelativeOffs()).thenReturn(5296740L);
 
-        InfoZipNewUnixExtraFieldRecord.Payload payload = InfoZipNewUnixExtraFieldRecord.VersionUnknownPayload.builder()
-                                                                                                             .version(2)
-                                                                                                             .data(new byte[] { 0x0, 0x1, 0x2, 0x3 })
-                                                                                                             .build();
+        InfoZipNewUnixExtraFieldRecord.Payload payload =
+                InfoZipNewUnixExtraFieldRecord.VersionUnknownPayload.builder()
+                                                                    .version(2)
+                                                                    .data(new byte[] { 0x0, 0x1, 0x2, 0x3 })
+                                                                    .build();
 
         InfoZipNewUnixExtraFieldRecord record = InfoZipNewUnixExtraFieldRecord.builder()
                                                                               .dataSize(11)
@@ -84,7 +88,8 @@ public void shouldRetrieveUnknownVersionRecordWhenVersionNotOne() throws IOExcep
                                                                                 .position(0, 52, 0).build());
 
         assertThat(lines).hasSize(4);
-        assertThat(lines[0]).isEqualTo("(0x7875) new InfoZIP Unix/OS2/NT:                   5296740 (0x0050D264) bytes");
+        assertThat(lines[0])
+                .isEqualTo("(0x7875) new InfoZIP Unix/OS2/NT:                   5296740 (0x0050D264) bytes");
         assertThat(lines[1]).isEqualTo("  - size:                                           15 bytes");
         assertThat(lines[2]).isEqualTo("  version:                                          2 (unknown)");
         assertThat(lines[3]).isEqualTo("00 01 02 03");
@@ -92,10 +97,11 @@ public void shouldRetrieveUnknownVersionRecordWhenVersionNotOne() throws IOExcep
 
     public void shouldRetrieveEmptyStringWhenRecordNull() throws IOException {
         PrintStream out = mock(PrintStream.class);
-        InfoZipNewUnixExtraFieldRecordView view = InfoZipNewUnixExtraFieldRecordView.builder()
-                                                                                    .record(InfoZipNewUnixExtraFieldRecord.NULL)
-                                                                                    .block(mock(Block.class))
-                                                                                    .position(0, 52, 0).build();
+        InfoZipNewUnixExtraFieldRecordView view =
+                InfoZipNewUnixExtraFieldRecordView.builder()
+                                                  .record(InfoZipNewUnixExtraFieldRecord.NULL)
+                                                  .block(mock(Block.class))
+                                                  .position(0, 52, 0).build();
         assertThat(view.printTextInfo(out)).isFalse();
     }
 
@@ -108,7 +114,8 @@ public void shouldRetrieveVersionOneRecordWithDiskWhenSplit() throws IOException
 
         InfoZipNewUnixExtraFieldRecord.Payload payload = InfoZipNewUnixExtraFieldRecord.VersionOnePayload.builder()
                                                                                                          .uid("aaa")
-                                                                                                         .gid("bbb").build();
+                                                                                                         .gid("bbb")
+                                                                                                         .build();
 
         InfoZipNewUnixExtraFieldRecord record = InfoZipNewUnixExtraFieldRecord.builder()
                                                                               .dataSize(11)
@@ -120,11 +127,13 @@ public void shouldRetrieveVersionOneRecordWithDiskWhenSplit() throws IOException
                                                                                 .position(0, 52, 5).build());
 
         assertThat(lines).hasSize(6);
-        assertThat(lines[0]).isEqualTo("(0x7875) new InfoZIP Unix/OS2/NT:                   5296740 (0x0050D264) bytes");
+        assertThat(lines[0])
+                .isEqualTo("(0x7875) new InfoZIP Unix/OS2/NT:                   5296740 (0x0050D264) bytes");
         assertThat(lines[1]).isEqualTo("  - disk (0005):                                    src.zip");
         assertThat(lines[2]).isEqualTo("  - size:                                           15 bytes");
         assertThat(lines[3]).isEqualTo("  version:                                          1");
         assertThat(lines[4]).isEqualTo("  User identifier (UID):                            aaa");
         assertThat(lines[5]).isEqualTo("  Group Identifier (GID):                           bbb");
     }
+
 }
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/view/extrafield/InfoZipOldUnixExtraFieldRecordViewTest.java b/src/test/java/ru/olegcherednik/zip4jvm/view/extrafield/InfoZipOldUnixExtraFieldRecordViewTest.java
index b0ca7f9e3..0fbd089e7 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/view/extrafield/InfoZipOldUnixExtraFieldRecordViewTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/view/extrafield/InfoZipOldUnixExtraFieldRecordViewTest.java
@@ -18,11 +18,12 @@
  */
 package ru.olegcherednik.zip4jvm.view.extrafield;
 
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
 import ru.olegcherednik.zip4jvm.model.block.Block;
 import ru.olegcherednik.zip4jvm.model.extrafield.records.InfoZipOldUnixExtraFieldRecord;
 
+import org.testng.annotations.Test;
+
 import java.io.IOException;
 import java.io.PrintStream;
 
@@ -59,7 +60,8 @@ public void shouldRetrieveAllDataWhenAllDataSet() throws IOException {
                                                                                 .position(0, 52, 0).build());
 
         assertThat(lines).hasSize(6);
-        assertThat(lines[0]).isEqualTo("(0x5855) old InfoZIP Unix/OS2/NT:                   5300395 (0x0050E0AB) bytes");
+        assertThat(lines[0])
+                .isEqualTo("(0x5855) old InfoZIP Unix/OS2/NT:                   5300395 (0x0050E0AB) bytes");
         assertThat(lines[1]).isEqualTo("  - size:                                           12 bytes");
         assertThat(lines[2]).isEqualTo("  Last Modified Date:                               2019-10-24 07:46:22");
         assertThat(lines[3]).isEqualTo("  Last Accessed Date:                               2019-10-22 00:13:05");
@@ -75,7 +77,8 @@ public void shouldRetrieveTimesOnlyWhenNoUserId() throws IOException {
         InfoZipOldUnixExtraFieldRecord record = InfoZipOldUnixExtraFieldRecord.builder()
                                                                               .dataSize(8)
                                                                               .lastAccessTime(lastAccessTime)
-                                                                              .lastModificationTime(lastModifiedTime).build();
+                                                                              .lastModificationTime(lastModifiedTime)
+                                                                              .build();
 
         String[] lines = Zip4jvmSuite.execute(InfoZipOldUnixExtraFieldRecordView.builder()
                                                                                 .record(record)
@@ -83,7 +86,8 @@ public void shouldRetrieveTimesOnlyWhenNoUserId() throws IOException {
                                                                                 .position(0, 52, 0).build());
 
         assertThat(lines).hasSize(4);
-        assertThat(lines[0]).isEqualTo("(0x5855) old InfoZIP Unix/OS2/NT:                   5300395 (0x0050E0AB) bytes");
+        assertThat(lines[0])
+                .isEqualTo("(0x5855) old InfoZIP Unix/OS2/NT:                   5300395 (0x0050E0AB) bytes");
         assertThat(lines[1]).isEqualTo("  - size:                                           12 bytes");
         assertThat(lines[2]).isEqualTo("  Last Modified Date:                               2019-10-24 07:46:22");
         assertThat(lines[3]).isEqualTo("  Last Accessed Date:                               2019-10-22 00:13:05");
@@ -91,10 +95,11 @@ public void shouldRetrieveTimesOnlyWhenNoUserId() throws IOException {
 
     public void shouldRetrieveEmptyStringWhenRecordNull() throws IOException {
         PrintStream out = mock(PrintStream.class);
-        InfoZipOldUnixExtraFieldRecordView view = InfoZipOldUnixExtraFieldRecordView.builder()
-                                                                                    .record(InfoZipOldUnixExtraFieldRecord.NULL)
-                                                                                    .block(mock(Block.class))
-                                                                                    .position(0, 52, 0).build();
+        InfoZipOldUnixExtraFieldRecordView view =
+                InfoZipOldUnixExtraFieldRecordView.builder()
+                                                  .record(InfoZipOldUnixExtraFieldRecord.NULL)
+                                                  .block(mock(Block.class))
+                                                  .position(0, 52, 0).build();
         assertThat(view.printTextInfo(out)).isFalse();
     }
 
@@ -118,7 +123,8 @@ public void shouldRetrieveAllDataWithDiskWhenSplit() throws IOException {
                                                                                 .position(0, 52, 5).build());
 
         assertThat(lines).hasSize(7);
-        assertThat(lines[0]).isEqualTo("(0x5855) old InfoZIP Unix/OS2/NT:                   5300395 (0x0050E0AB) bytes");
+        assertThat(lines[0])
+                .isEqualTo("(0x5855) old InfoZIP Unix/OS2/NT:                   5300395 (0x0050E0AB) bytes");
         assertThat(lines[1]).isEqualTo("  - disk (0005):                                    src.zip");
         assertThat(lines[2]).isEqualTo("  - size:                                           12 bytes");
         assertThat(lines[3]).isEqualTo("  Last Modified Date:                               2019-10-24 07:46:22");
@@ -126,4 +132,5 @@ public void shouldRetrieveAllDataWithDiskWhenSplit() throws IOException {
         assertThat(lines[5]).isEqualTo("  User identifier (UID):                            111");
         assertThat(lines[6]).isEqualTo("  Group Identifier (GID):                           222");
     }
+
 }
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/view/extrafield/NtfsTimestampExtraFieldRecordViewTest.java b/src/test/java/ru/olegcherednik/zip4jvm/view/extrafield/NtfsTimestampExtraFieldRecordViewTest.java
index 0bfd7e8e6..02a1bac8d 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/view/extrafield/NtfsTimestampExtraFieldRecordViewTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/view/extrafield/NtfsTimestampExtraFieldRecordViewTest.java
@@ -18,11 +18,12 @@
  */
 package ru.olegcherednik.zip4jvm.view.extrafield;
 
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
 import ru.olegcherednik.zip4jvm.model.block.Block;
 import ru.olegcherednik.zip4jvm.model.extrafield.records.NtfsTimestampExtraFieldRecord;
 
+import org.testng.annotations.Test;
+
 import java.io.IOException;
 import java.io.PrintStream;
 import java.util.Arrays;
@@ -31,7 +32,6 @@
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 
-
 /**
  * @author Oleg Cherednik
  * @since 09.11.2019
@@ -49,18 +49,24 @@ public void shouldRetrieveAllDataWhenAllDataSet() throws IOException {
         when(block.getSize()).thenReturn(36L);
         when(block.getRelativeOffs()).thenReturn(11208273272L);
 
-        NtfsTimestampExtraFieldRecord.Tag tagOne = NtfsTimestampExtraFieldRecord.OneTag.builder()
-                                                                                       .lastModificationTime(lastModifiedTime)
-                                                                                       .lastAccessTime(lastAccessTime)
-                                                                                       .creationTime(creationTime).build();
-
-        NtfsTimestampExtraFieldRecord.Tag tagUnknown = NtfsTimestampExtraFieldRecord.UnknownTag.builder()
-                                                                                               .signature(0x0002)
-                                                                                               .data(new byte[] { 0x0, 0x1, 0x2, 0x3 }).build();
-
-        NtfsTimestampExtraFieldRecord record = NtfsTimestampExtraFieldRecord.builder()
-                                                                            .dataSize(32)
-                                                                            .tags(Arrays.asList(tagOne, tagUnknown)).build();
+        NtfsTimestampExtraFieldRecord.Tag tagOne =
+                NtfsTimestampExtraFieldRecord.OneTag.builder()
+                                                    .lastModificationTime(lastModifiedTime)
+                                                    .lastAccessTime(lastAccessTime)
+                                                    .creationTime(creationTime)
+                                                    .build();
+
+        NtfsTimestampExtraFieldRecord.Tag tagUnknown =
+                NtfsTimestampExtraFieldRecord.UnknownTag.builder()
+                                                        .signature(0x0002)
+                                                        .data(new byte[] { 0x0, 0x1, 0x2, 0x3 })
+                                                        .build();
+
+        NtfsTimestampExtraFieldRecord record =
+                NtfsTimestampExtraFieldRecord.builder()
+                                             .dataSize(32)
+                                             .tags(Arrays.asList(tagOne, tagUnknown))
+                                             .build();
 
         String[] lines = Zip4jvmSuite.execute(NtfsTimestampExtraFieldRecordView.builder()
                                                                                .record(record)
@@ -68,7 +74,8 @@ public void shouldRetrieveAllDataWhenAllDataSet() throws IOException {
                                                                                .position(0, 52, 0).build());
 
         assertThat(lines).hasSize(9);
-        assertThat(lines[0]).isEqualTo("(0x000A) NTFS Timestamp:                            11208273272 (0x29C10AD78) bytes");
+        assertThat(lines[0]).isEqualTo(
+                "(0x000A) NTFS Timestamp:                            11208273272 (0x29C10AD78) bytes");
         assertThat(lines[1]).isEqualTo("  - size:                                           36 bytes");
         assertThat(lines[2]).isEqualTo("  - total tags:                                     2");
         assertThat(lines[3]).isEqualTo("  (0x0001) Tag1:                                    24 bytes");
@@ -81,10 +88,11 @@ public void shouldRetrieveAllDataWhenAllDataSet() throws IOException {
 
     public void shouldRetrieveEmptyStringWhenRecordNull() throws IOException {
         PrintStream out = mock(PrintStream.class);
-        NtfsTimestampExtraFieldRecordView view = NtfsTimestampExtraFieldRecordView.builder()
-                                                                                  .record(NtfsTimestampExtraFieldRecord.NULL)
-                                                                                  .block(mock(Block.class))
-                                                                                  .position(0, 52, 0).build();
+        NtfsTimestampExtraFieldRecordView view =
+                NtfsTimestampExtraFieldRecordView.builder()
+                                                 .record(NtfsTimestampExtraFieldRecord.NULL)
+                                                 .block(mock(Block.class))
+                                                 .position(0, 52, 0).build();
         assertThat(view.printTextInfo(out)).isFalse();
     }
 
@@ -95,18 +103,23 @@ public void shouldRetrieveAllDataWithDiskWhenSplit() throws IOException {
         when(block.getDiskNo()).thenReturn(5);
         when(block.getFileName()).thenReturn("src.zip");
 
-        NtfsTimestampExtraFieldRecord.Tag tagOne = NtfsTimestampExtraFieldRecord.OneTag.builder()
-                                                                                       .lastModificationTime(lastModifiedTime)
-                                                                                       .lastAccessTime(lastAccessTime)
-                                                                                       .creationTime(creationTime).build();
+        NtfsTimestampExtraFieldRecord.Tag tagOne =
+                NtfsTimestampExtraFieldRecord.OneTag.builder()
+                                                    .lastModificationTime(lastModifiedTime)
+                                                    .lastAccessTime(lastAccessTime)
+                                                    .creationTime(creationTime)
+                                                    .build();
 
-        NtfsTimestampExtraFieldRecord.Tag tagUnknown = NtfsTimestampExtraFieldRecord.UnknownTag.builder()
-                                                                                               .signature(0x0002)
-                                                                                               .data(new byte[] { 0x0, 0x1, 0x2, 0x3 }).build();
+        NtfsTimestampExtraFieldRecord.Tag tagUnknown =
+                NtfsTimestampExtraFieldRecord.UnknownTag.builder()
+                                                        .signature(0x0002)
+                                                        .data(new byte[] { 0x0, 0x1, 0x2, 0x3 })
+                                                        .build();
 
         NtfsTimestampExtraFieldRecord record = NtfsTimestampExtraFieldRecord.builder()
                                                                             .dataSize(32)
-                                                                            .tags(Arrays.asList(tagOne, tagUnknown)).build();
+                                                                            .tags(Arrays.asList(tagOne, tagUnknown))
+                                                                            .build();
 
         String[] lines = Zip4jvmSuite.execute(NtfsTimestampExtraFieldRecordView.builder()
                                                                                .record(record)
@@ -114,7 +127,8 @@ public void shouldRetrieveAllDataWithDiskWhenSplit() throws IOException {
                                                                                .position(0, 52, 5).build());
 
         assertThat(lines).hasSize(10);
-        assertThat(lines[0]).isEqualTo("(0x000A) NTFS Timestamp:                            11208273272 (0x29C10AD78) bytes");
+        assertThat(lines[0]).isEqualTo(
+                "(0x000A) NTFS Timestamp:                            11208273272 (0x29C10AD78) bytes");
         assertThat(lines[1]).isEqualTo("  - disk (0005):                                    src.zip");
         assertThat(lines[2]).isEqualTo("  - size:                                           36 bytes");
         assertThat(lines[3]).isEqualTo("  - total tags:                                     2");
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/view/extrafield/UnknownExtraFieldRecordViewTest.java b/src/test/java/ru/olegcherednik/zip4jvm/view/extrafield/UnknownExtraFieldRecordViewTest.java
index a03ac6974..19140793b 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/view/extrafield/UnknownExtraFieldRecordViewTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/view/extrafield/UnknownExtraFieldRecordViewTest.java
@@ -18,13 +18,13 @@
  */
 package ru.olegcherednik.zip4jvm.view.extrafield;
 
-import org.apache.commons.lang3.ArrayUtils;
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
-import ru.olegcherednik.zip4jvm.model.extrafield.PkwareExtraField;
 import ru.olegcherednik.zip4jvm.model.block.Block;
 import ru.olegcherednik.zip4jvm.model.extrafield.records.UnknownExtraFieldRecord;
 
+import org.apache.commons.lang3.ArrayUtils;
+import org.testng.annotations.Test;
+
 import java.io.IOException;
 
 import static org.assertj.core.api.Assertions.assertThat;
@@ -49,10 +49,12 @@ public void shouldRetrieveAllDataWhenAllDataSet() throws IOException {
                                                                          .record(record)
                                                                          .block(block)
                                                                          .data(new byte[] { 0x0, 0x1, 0x2, 0x3 })
-                                                                         .position(0, 52, 0).build());
+                                                                         .position(0, 52, 0)
+                                                                         .build());
 
         assertThat(lines).hasSize(3);
-        assertThat(lines[0]).isEqualTo("(0x0666) Unknown:                                   11208273272 (0x29C10AD78) bytes");
+        assertThat(lines[0])
+                .isEqualTo("(0x0666) Unknown:                                   11208273272 (0x29C10AD78) bytes");
         assertThat(lines[1]).isEqualTo("  - size:                                           36 bytes");
         assertThat(lines[2]).isEqualTo("00 01 02 03");
     }
@@ -73,9 +75,11 @@ public void shouldRetrieveAllDataWithDiskWhenSplit() throws IOException {
                                                                          .position(0, 52, 5).build());
 
         assertThat(lines).hasSize(4);
-        assertThat(lines[0]).isEqualTo("(0x0666) Unknown:                                   11208273272 (0x29C10AD78) bytes");
+        assertThat(lines[0])
+                .isEqualTo("(0x0666) Unknown:                                   11208273272 (0x29C10AD78) bytes");
         assertThat(lines[1]).isEqualTo("  - disk (0005):                                    src.zip");
         assertThat(lines[2]).isEqualTo("  - size:                                           36 bytes");
         assertThat(lines[3]).isEqualTo("00 01 02 03");
     }
+
 }
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/view/extrafield/Zip64ExtendedInfoViewTest.java b/src/test/java/ru/olegcherednik/zip4jvm/view/extrafield/Zip64ExtendedInfoViewTest.java
index c8b214aa4..6c6b95561 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/view/extrafield/Zip64ExtendedInfoViewTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/view/extrafield/Zip64ExtendedInfoViewTest.java
@@ -18,11 +18,12 @@
  */
 package ru.olegcherednik.zip4jvm.view.extrafield;
 
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
 import ru.olegcherednik.zip4jvm.model.Zip64;
 import ru.olegcherednik.zip4jvm.model.block.Block;
 
+import org.testng.annotations.Test;
+
 import java.io.IOException;
 import java.io.PrintStream;
 
@@ -55,7 +56,8 @@ public void shouldRetrieveAllDataWhenAllDataSet() throws IOException {
                                                                    .position(0, 52, 0).build());
 
         assertThat(lines).hasSize(6);
-        assertThat(lines[0]).isEqualTo("(0x0001) Zip64 Extended Information:                5300395 (0x0050E0AB) bytes");
+        assertThat(lines[0])
+                .isEqualTo("(0x0001) Zip64 Extended Information:                5300395 (0x0050E0AB) bytes");
         assertThat(lines[1]).isEqualTo("  - size:                                           12 bytes");
         assertThat(lines[2]).isEqualTo("  original compressed size:                         11322883953 bytes");
         assertThat(lines[3]).isEqualTo("  original uncompressed size:                       11208273150 bytes");
@@ -91,7 +93,8 @@ public void shouldRetrieveAllDataWithDiskWhenSplit() throws IOException {
                                                                    .position(0, 52, 5).build());
 
         assertThat(lines).hasSize(7);
-        assertThat(lines[0]).isEqualTo("(0x0001) Zip64 Extended Information:                5300395 (0x0050E0AB) bytes");
+        assertThat(lines[0])
+                .isEqualTo("(0x0001) Zip64 Extended Information:                5300395 (0x0050E0AB) bytes");
         assertThat(lines[1]).isEqualTo("  - disk (0005):                                    src.zip");
         assertThat(lines[2]).isEqualTo("  - size:                                           12 bytes");
         assertThat(lines[3]).isEqualTo("  original compressed size:                         11322883953 bytes");
@@ -99,4 +102,5 @@ public void shouldRetrieveAllDataWithDiskWhenSplit() throws IOException {
         assertThat(lines[5]).isEqualTo("  original relative offset of local header:         145 (0x00000091) bytes");
         assertThat(lines[6]).isEqualTo("  original part number of this part (0002):         2");
     }
+
 }
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/view/zip64/EndCentralDirectoryLocatorViewTest.java b/src/test/java/ru/olegcherednik/zip4jvm/view/zip64/EndCentralDirectoryLocatorViewTest.java
index f068f5976..5e7de2068 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/view/zip64/EndCentralDirectoryLocatorViewTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/view/zip64/EndCentralDirectoryLocatorViewTest.java
@@ -18,11 +18,12 @@
  */
 package ru.olegcherednik.zip4jvm.view.zip64;
 
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
 import ru.olegcherednik.zip4jvm.model.Zip64;
 import ru.olegcherednik.zip4jvm.model.block.Block;
 
+import org.testng.annotations.Test;
+
 import java.io.IOException;
 
 import static org.assertj.core.api.Assertions.assertThat;
@@ -50,10 +51,12 @@ public void shouldRetrieveAllLinesWhenLocatorExists() throws IOException {
         assertThat(lines).hasSize(7);
         assertThat(lines[0]).isEqualTo("(PK0607) ZIP64 End of Central directory locator");
         assertThat(lines[1]).isEqualTo("===============================================");
-        assertThat(lines[2]).isEqualTo("  - location:                                       11208273384 (0x29C10ADE8) bytes");
+        assertThat(lines[2])
+                .isEqualTo("  - location:                                       11208273384 (0x29C10ADE8) bytes");
         assertThat(lines[3]).isEqualTo("  - size:                                           20 bytes");
         assertThat(lines[4]).isEqualTo("  part number of new-end-of-central-dir (0001):     2");
-        assertThat(lines[5]).isEqualTo("  relative offset of new-end-of-central-dir:        11208273328 (0x29C10ADB0) bytes");
+        assertThat(lines[5])
+                .isEqualTo("  relative offset of new-end-of-central-dir:        11208273328 (0x29C10ADB0) bytes");
         assertThat(lines[6]).isEqualTo("  total number of parts in archive:                 5");
     }
 
@@ -74,10 +77,13 @@ public void shouldRetrieveAllLineWithDiskWhenSplitZip() throws IOException {
         assertThat(lines[0]).isEqualTo("(PK0607) ZIP64 End of Central directory locator");
         assertThat(lines[1]).isEqualTo("===============================================");
         assertThat(lines[2]).isEqualTo("  - disk (0005):                                    src.zip");
-        assertThat(lines[3]).isEqualTo("  - location:                                       11208273384 (0x29C10ADE8) bytes");
+        assertThat(lines[3])
+                .isEqualTo("  - location:                                       11208273384 (0x29C10ADE8) bytes");
         assertThat(lines[4]).isEqualTo("  - size:                                           20 bytes");
         assertThat(lines[5]).isEqualTo("  part number of new-end-of-central-dir (0001):     2");
-        assertThat(lines[6]).isEqualTo("  relative offset of new-end-of-central-dir:        11208273328 (0x29C10ADB0) bytes");
+        assertThat(lines[6])
+                .isEqualTo("  relative offset of new-end-of-central-dir:        11208273328 (0x29C10ADB0) bytes");
         assertThat(lines[7]).isEqualTo("  total number of parts in archive:                 5");
     }
+
 }
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/view/zip64/EndCentralDirectoryViewTest.java b/src/test/java/ru/olegcherednik/zip4jvm/view/zip64/EndCentralDirectoryViewTest.java
index 1ff1d4207..fe8e60310 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/view/zip64/EndCentralDirectoryViewTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/view/zip64/EndCentralDirectoryViewTest.java
@@ -18,17 +18,13 @@
  */
 package ru.olegcherednik.zip4jvm.view.zip64;
 
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
-import ru.olegcherednik.zip4jvm.crypto.aes.AesStrength;
-import ru.olegcherednik.zip4jvm.crypto.strong.EncryptionAlgorithm;
-import ru.olegcherednik.zip4jvm.crypto.strong.Flags;
-import ru.olegcherednik.zip4jvm.crypto.strong.HashAlgorithm;
-import ru.olegcherednik.zip4jvm.model.CompressionMethod;
 import ru.olegcherednik.zip4jvm.model.Version;
 import ru.olegcherednik.zip4jvm.model.Zip64;
 import ru.olegcherednik.zip4jvm.model.block.Block;
 
+import org.testng.annotations.Test;
+
 import java.io.IOException;
 import java.util.Arrays;
 
@@ -56,7 +52,8 @@ public void shouldRetrieveAllLinesWhenZip64EndCentralDirectoryExists() throws IO
         assertThat(lines).hasSize(15);
         assertThat(lines[0]).isEqualTo("(PK0606) ZIP64 End of Central directory record");
         assertThat(lines[1]).isEqualTo("==============================================");
-        assertThat(lines[2]).isEqualTo("  - location:                                       11208273328 (0x29C10ADB0) bytes");
+        assertThat(lines[2]).isEqualTo(
+                "  - location:                                       11208273328 (0x29C10ADB0) bytes");
         assertThat(lines[3]).isEqualTo("  - size:                                           56 bytes");
         assertThat(lines[4]).isEqualTo("  number of bytes in rest of record:                345 bytes");
         assertThat(lines[5]).isEqualTo("  version made by operating system (00):            MS-DOS, OS/2, NT FAT");
@@ -68,7 +65,8 @@ public void shouldRetrieveAllLinesWhenZip64EndCentralDirectoryExists() throws IO
         assertThat(lines[11]).isEqualTo("  number of entries in central dir in this part:    13");
         assertThat(lines[12]).isEqualTo("  total number of entries in central dir:           15");
         assertThat(lines[13]).isEqualTo("  size of central dir:                              115 bytes");
-        assertThat(lines[14]).isEqualTo("  relative offset of central dir:                   11208273213 (0x29C10AD3D) bytes");
+        assertThat(lines[14]).isEqualTo(
+                "  relative offset of central dir:                   11208273213 (0x29C10AD3D) bytes");
     }
 
     public void shouldRetrieveAllLinesWithDiskWhenSplitZip() throws IOException {
@@ -85,7 +83,8 @@ public void shouldRetrieveAllLinesWithDiskWhenSplitZip() throws IOException {
         assertThat(lines[0]).isEqualTo("(PK0606) ZIP64 End of Central directory record");
         assertThat(lines[1]).isEqualTo("==============================================");
         assertThat(lines[2]).isEqualTo("  - disk (0005):                                    src.zip");
-        assertThat(lines[3]).isEqualTo("  - location:                                       11208273328 (0x29C10ADB0) bytes");
+        assertThat(lines[3]).isEqualTo(
+                "  - location:                                       11208273328 (0x29C10ADB0) bytes");
         assertThat(lines[4]).isEqualTo("  - size:                                           56 bytes");
         assertThat(lines[5]).isEqualTo("  number of bytes in rest of record:                345 bytes");
         assertThat(lines[6]).isEqualTo("  version made by operating system (00):            MS-DOS, OS/2, NT FAT");
@@ -97,7 +96,8 @@ public void shouldRetrieveAllLinesWithDiskWhenSplitZip() throws IOException {
         assertThat(lines[12]).isEqualTo("  number of entries in central dir in this part:    13");
         assertThat(lines[13]).isEqualTo("  total number of entries in central dir:           15");
         assertThat(lines[14]).isEqualTo("  size of central dir:                              115 bytes");
-        assertThat(lines[15]).isEqualTo("  relative offset of central dir:                   11208273213 (0x29C10AD3D) bytes");
+        assertThat(lines[15]).isEqualTo(
+                "  relative offset of central dir:                   11208273213 (0x29C10AD3D) bytes");
     }
 
     private static Zip64.EndCentralDirectory createEndCentralDirectory() {
diff --git a/src/test/java/ru/olegcherednik/zip4jvm/view/zip64/ExtensibleDataSectorViewTest.java b/src/test/java/ru/olegcherednik/zip4jvm/view/zip64/ExtensibleDataSectorViewTest.java
index cb7275091..d255a3ed7 100644
--- a/src/test/java/ru/olegcherednik/zip4jvm/view/zip64/ExtensibleDataSectorViewTest.java
+++ b/src/test/java/ru/olegcherednik/zip4jvm/view/zip64/ExtensibleDataSectorViewTest.java
@@ -18,7 +18,6 @@
  */
 package ru.olegcherednik.zip4jvm.view.zip64;
 
-import org.testng.annotations.Test;
 import ru.olegcherednik.zip4jvm.Zip4jvmSuite;
 import ru.olegcherednik.zip4jvm.crypto.aes.AesStrength;
 import ru.olegcherednik.zip4jvm.crypto.strong.EncryptionAlgorithm;
@@ -28,8 +27,9 @@
 import ru.olegcherednik.zip4jvm.model.Zip64;
 import ru.olegcherednik.zip4jvm.model.block.Block;
 
+import org.testng.annotations.Test;
+
 import java.io.IOException;
-import java.util.Arrays;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.Mockito.mock;
@@ -53,7 +53,8 @@ public void shouldRetrieveAllLinesWhenZip64ExtensibleDataSectorExists() throws I
         assertThat(lines).hasSize(13);
         assertThat(lines[0]).isEqualTo("ZIP64 Extensible data sector");
         assertThat(lines[1]).isEqualTo("============================");
-        assertThat(lines[2]).isEqualTo("  - location:                                       11208273328 (0x29C10ADB0) bytes");
+        assertThat(lines[2]).isEqualTo(
+                "  - location:                                       11208273328 (0x29C10ADB0) bytes");
         assertThat(lines[3]).isEqualTo("  - size:                                           56 bytes");
         assertThat(lines[4]).isEqualTo("  compression method (99):                          AES encryption");
         assertThat(lines[5]).isEqualTo("  compressed size:                                  438 bytes");
diff --git a/store/solid/off/src.zip b/store/solid/off/src.zip
new file mode 100644
index 000000000..f04d13578
Binary files /dev/null and b/store/solid/off/src.zip differ
diff --git a/zip.png b/zip.png
deleted file mode 100644
index 154475572..000000000
Binary files a/zip.png and /dev/null differ