diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 997886a..ee6ba29 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -44,8 +44,12 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v2 + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + cache: maven # ℹī¸ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -57,6 +61,8 @@ jobs: #- run: | # make bootstrap # make release + - name: Build with Maven + run: mvn -B package --file pom.xml -Dmaven.test.skip=true - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index d3d4294..ecc8078 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -1,7 +1,7 @@ # This workflow will build a Java project with Maven # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven -name: Java CI with Maven +name: Java CI on: push: @@ -22,10 +22,10 @@ jobs: if: ${{ contains(github.event.head_commit.message, 'bump version') }} run: grep "" pom.xml | head -1 | grep -v SNAPSHOT - - name: Set up JDK 1.8 + - name: Set up JDK 17 uses: actions/setup-java@v3 with: - java-version: 1.8 + java-version: '17' distribution: 'temurin' cache: maven diff --git a/README.md b/README.md index 9d2d642..b60f821 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ [![](https://jitpack.io/v/umjammer/vavi-util-archive.svg)](https://jitpack.io/#umjammer/vavi-util-archive) [![Java CI with Maven](https://github.com/umjammer/vavi-util-archive-sandbox/workflows/Java%20CI%20with%20Maven/badge.svg)](https://github.com/umjammer/vavi-util-archive-sandbox/actions) [![CodeQL](https://github.com/umjammer/vavi-util-archive/workflows/CodeQL/badge.svg)](https://github.com/umjammer/vavi-util-archive-sandbox/actions) -![Java](https://img.shields.io/badge/Java-8-b07219) +![Java](https://img.shields.io/badge/Java-17-b07219) # vavi-util-archive @@ -42,15 +42,23 @@ and [vavi-net-fuse](https://github.com/umjammer/vavi-apps-fuse/tree/master/vavi- ## Usage +### archive extraction + ```java - Path inZip = Paths.get("foo/bar.zip"); + Archive archive = Archives.getArchive(Paths.get("foo/bar.rar").toFile()); Path outDir = Paths.get("foo/bar"); - Archive archive = Archives.getArchive(inZip.toFile()); for (Entry entry : archive.entries()) { Files.copy(archive.getInputStream(entry), outDir.resolve(entry.getName())); } ``` +### archive decompression + +```java + InputStream compressed = Archives.getInputStream(Paths.get("foo/bar.tar.bz").toFile()); + Files.copy(compressed, Paths.get("foo/bar.tar")); +``` + ## License * [Giant Java Tree/cpio](http://www.gjt.org/servlets/JCVSlet/list/gjt/org/gjt/archive/cpio) ... Unknown @@ -60,17 +68,22 @@ and [vavi-net-fuse](https://github.com/umjammer/vavi-apps-fuse/tree/master/vavi- ## TODO + * registory like IIORegistory * [commons-vfs](https://commons.apache.org/proper/commons-vfs/) * [truevfs](https://github.com/christian-schlichtherle/truevfs) * ~~apache commons-compress~~ * https://github.com/ZIPmagic/ZIPmagic/tree/master/StuffIt%20SDK * ~~https://github.com/cstroe/SevenZip-Java~~ (use 7zip-jbinding) * write! - * ~~jar5~~ (done by 7zip-jbinding) + * ~~rar5~~ (done by 7zip-jbinding) * ~~[@marcusvoltolim]((https://github.com/marcusvoltolim/file-processor#readme)) says [sevenzipjbinding](https://github.com/borisbrodski/sevenzipjbinding) can deal rar5 ???~~ * it's [true](https://github.com/borisbrodski/sevenzipjbinding/issues/19#issuecomment-578636772) * unar v1.10.7 ... ok * 7zip 17.04 ... ok * https://github.com/prog-ai/ArchivR (wip) * ~~https://github.com/Diab1o/java-7z-archiver ... yet another pure java 7zip implementation?~~ (done) - * where is my jna 7z implementation? (in the crashed hdd?) \ No newline at end of file + * where is my jna 7z implementation? (in the crashed hdd?) + * binary things ... gca.exe -> dll -> 64bit -> mach-O + winelib -> dylib + * https://github.com/gitGNU/objconv + * https://github.com/jakeajames/dylibify + * https://github.com/hasherezade/exe_to_dll \ No newline at end of file diff --git a/jitpack.yml b/jitpack.yml new file mode 100644 index 0000000..efde7bf --- /dev/null +++ b/jitpack.yml @@ -0,0 +1,2 @@ +jdk: + - openjdk17 diff --git a/local.properties.sample b/local.properties.sample new file mode 100644 index 0000000..00c5df8 --- /dev/null +++ b/local.properties.sample @@ -0,0 +1,2 @@ +#archive.zip.file1=/foo/bar.zip +#archive.rar.file=/foo/bar.rar diff --git a/pom.xml b/pom.xml index 42f35d4..2736114 100644 --- a/pom.xml +++ b/pom.xml @@ -10,13 +10,9 @@ vavi-util-archive 1.1.1 - Vavi Archiving API + Vavi Archiving SPI https://github.com/umjammer/vavi-util-archive - -TOOD - - jni on maven - registory like IIORegistory + Vavi Archiving SPI and implementations https://github.com/umjammer/vavi-util-archive @@ -29,11 +25,9 @@ TOOD org.apache.maven.plugins maven-compiler-plugin - 3.10.1 + 3.11.0 - 1.8 - 1.8 - UTF-8 + 17 @@ -56,7 +50,7 @@ TOOD org.apache.maven.plugins maven-surefire-plugin - 3.0.0-M7 + 3.2.2 -Djava.util.logging.config.file=src/test/resources/logging.properties false @@ -77,7 +71,7 @@ TOOD org.junit junit-bom - 5.9.1 + 5.10.1 pom import @@ -88,7 +82,7 @@ TOOD com.github.umjammer vavi-commons - 1.1.8 + 1.1.10 com.github.umjammer @@ -111,8 +105,7 @@ TOOD 1.9 - - com.github.umjammer + com.github.umjammer java-unrar 1.7.1 @@ -129,7 +122,7 @@ TOOD org.apache.ant ant - 1.10.12 + 1.10.13 @@ -160,4 +153,36 @@ TOOD test + + + + + list + + + + + org.apache.maven.plugins + maven-antrun-plugin + 3.1.0 + + run + + + + + + + + + + + + + + + + + +