Skip to content

Commit

Permalink
0.14.6 (#15)
Browse files Browse the repository at this point in the history
* use libchdr instead of aaru

* use jpl instead of jul

* follow ide advices

* update settings

* bump version
  • Loading branch information
umjammer authored May 26, 2024
1 parent 1a8692b commit 268f7e4
Show file tree
Hide file tree
Showing 219 changed files with 4,987 additions and 6,888 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
Expand All @@ -30,11 +34,11 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -43,15 +47,15 @@ jobs:
# queries: ./path/to/local/query, your-org/your-repo/queries@main

- name: Setup Java JDK
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'

# 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
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -65,4 +69,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
4 changes: 2 additions & 2 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Check w/o SNAPSHOT when "bump version"
if: ${{ contains(github.event.head_commit.message, 'bump version') }}
run: grep "<version>" pom.xml | head -1 | grep -v SNAPSHOT

- name: Set up JDK 17
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
Expand Down
71 changes: 39 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[![Release](https://jitpack.io/v/umjammer/vavi-nio-file-discutils.svg)](https://jitpack.io/#umjammer/vavi-nio-file-discutils)
[![Actions Status](https://github.com/umjammer/vavi-nio-file-discutils/workflows/Java%20CI/badge.svg)](https://github.com/umjammer/vavi-nio-file-discutils/actions)
[![Java CI](https://github.com/umjammer/vavi-nio-file-discutils/actions/workflows/maven.yml/badge.svg)](https://github.com/umjammer/vavi-nio-file-discutils/actions/workflows/maven.yml)
[![CodeQL](https://github.com/umjammer/vavi-nio-file-discutils/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/umjammer/vavi-nio-file-discutils/actions/workflows/codeql-analysis.yml)
![Java](https://img.shields.io/badge/Java-8-b07219)
![Java](https://img.shields.io/badge/Java-17-b07219)
[![Parent](https://img.shields.io/badge/Parent-vavi--apps--fuse-pink)](https://github.com/umjammer/vavi-apps-fuse)

# vavi-nio-file-discutils
Expand All @@ -10,22 +10,7 @@ A Java NIO FileSystem implementation over [DiscUtils](https://github.com/DiscUti

all formats are mounted by fuse also!

## Install

https://jitpack.io/#umjammer/vavi-nio-file-discutils

## Usage

```Java
URI uri = URI.create("discutils:file:/Users/foo/bar.vdi");
FileSystem fs = FileSystems.newFileSystem(uri, Collections.emptyMap());
// use java nio file system
Files.list(fs.getRootDirectories().iterator().next()).forEach(System.err::println);
// mount as fuse
Fuse.getFuse().mount(fs, "/your/mountPoint", Collections.emptyMap());
```

## Status
### Status

| fs | list | upload | download | copy | move | rm | mkdir | cache | watch | create | comment |
|----------|----------------|--------|-----------|------|------|----|-------|-------|-------|--------|---------------------------------------------------------------------------------------------------------------------------------------|
Expand All @@ -47,20 +32,21 @@ https://jitpack.io/#umjammer/vavi-nio-file-discutils
| NFS | 🚫 | | | | | | | | | - | server [nfs4j](https://github.com/dcache/nfs4j) |
| ODS | 🚫 | | | | | | | | | - | server [vavi-net-ods](https://github.com/umjammer/vavi-net-ods) |
| EMU | ✅ (nhd) | | | | | | | - | | - | [vavi-nio-file-emu](https://github.com/umjammer/vavi-nio-file-emu) [vavi-nio-file-fat](https://github.com/umjammer/vavi-nio-file-Fat) |
| CHD | | | | | | | | | | - | [jpcsp](https://github.com/jpcsp/jpcsp) |

## Project Description
### Project Description

vavi-nio-file-discutils is a Java library to read and write ISO files and Virtual Machine disk files (VHD, VDI, XVA, VMDK, etc). DiscUtils is developed in Java with no native code.

Implementation of the ISO, UDF, FAT and NTFS file systems is now fairly stable. VHD, XVA, VMDK and VDI disk formats are implemented, as well as read/write Registry support. The library also includes a simple iSCSI initiator, for accessing disks via iSCSI and an NFS client implementation.

Note: this is a fork of https://github.com/DiscUtils/DiscUtils, which itself is a fork of https://github.com/quamotion/DiscUtils, which itself is a fork of https://discutils.codeplex.com/.

### Wiki (at original site)
#### Wiki (at original site)

See more up to date documentation at the [Wiki](https://github.com/DiscUtils/DiscUtils/wiki)

### Implementation in this repository
#### Implementation in this repository

This repository has performed a few changes to the core DiscUtils library. For starters, all projects have been converted to Java, and are targeting Java 8.

Expand All @@ -83,17 +69,35 @@ For this to work, you must register your filesystem providers with the discUtils

Where `class name` is the classes you wish to register.:

META-INF/services/discUtils.core.internal.VirtualDiskFactory // From complete
META-INF/services/discUtils.core.internal.LogicalVolumeFactory // From containers
META-INF/services/discUtils.core.vfs.VfsFileSystemFactory // From fileSystems
META-INF/services/discUtils.core.internal.VirtualDiskTransport // From transports
META-INF/services/discUtils.core.partitions.PartitionTableFactory // From partitions
```properties
META-INF/services/discUtils.core.internal.LogicalVolumeFactory # From containers
META-INF/services/discUtils.core.vfs.VfsFileSystemFactory # From fileSystems
META-INF/services/discUtils.core.internal.VirtualDiskTransport # From transports
META-INF/services/discUtils.core.partitions.PartitionTableFactory # From partitions
```

## Install

* https://jitpack.io/#umjammer/vavi-nio-file-discutils

## Usage

as a java nio filesystem spi

```Java
URI uri = URI.create("discutils:file:/Users/foo/bar.vdi");
FileSystem fs = FileSystems.newFileSystem(uri, Collections.emptyMap());
// use java nio file system
Files.list(fs.getRootDirectories().iterator().next()).forEach(System.err::println);
// mount as fuse
Fuse.getFuse().mount(fs, "/your/mountPoint", Collections.emptyMap());
```

## How to use the Library
### How to use the Library

Here's a few really simple examples.

### How to create a new ISO:
#### How to create a new ISO:

```Java
CDBuilder builder = new CDBuilder();
Expand All @@ -106,7 +110,7 @@ Here's a few really simple examples.
You can add files as byte arrays (shown above), as files from the Windows filesystem, or as a Stream. By using a different form of Build, you can get a Stream to the ISO file, rather than writing it to the Windows filesystem.


### How to extract a file from an ISO:
#### How to extract a file from an ISO:

```Java
try (FileStream isoStream = File.open("/tmp/sample.iso")) {
Expand All @@ -118,7 +122,7 @@ You can add files as byte arrays (shown above), as files from the Windows filesy

You can also browse through the directory hierarchy, starting at cd.Root.

### How to create a virtual hard disk:
#### How to create a virtual hard disk:

```Java
long diskSize = 30 * 1024 * 1024; // 30MB
Expand All @@ -135,7 +139,7 @@ You can also browse through the directory hierarchy, starting at cd.Root.
As with ISOs, you can browse the file system, starting at fs.Root.


### How to create a virtual floppy disk:
#### How to create a virtual floppy disk:

```Java
try (FileStream fs = File.create("myfloppy.vfd");
Expand All @@ -155,7 +159,7 @@ Again, start browsing the file system at floppy.Root.

## TODO

* compile by jdk8
* ~~compile by jdk8~~
* ~~https://github.com/AssafTzurEl/discUtils/commit/3853944811a16d6220dcb6e8d408561e05569e43~~
* img ... https://github.com/hessu/bchunk
* ~~file separator~~
Expand All @@ -166,7 +170,10 @@ Again, start browsing the file system at floppy.Root.
* chd (wip, see aaru)
* qlgenerator (wip, see vavi.apps.qlgenerator package)
* https://mamedev.emulab.it/haze/2012/02/16/chd-v5/
* https://github.com/rtissera/libchdr
* [pscx2](https://github.com/PCSX2/pcsx2) has already chd code!
* iso9660
* `CommonVolumeDescriptor` as `user:attributes`
* https://github.com/Janix520/java-iso-tools
* ~~registry~~
* ~~🐛 vdi check sector length?~~ -> Util#SeekableByteChannel*
3 changes: 0 additions & 3 deletions jitpack.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
jdk:
- openjdk17
before_install:
- sdk install java 17.0.1-open
- sdk use java 17.0.1-open
3 changes: 2 additions & 1 deletion local.properties.sample
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
discImage=/somewhere/your.vdi
mountPoint=/Users/you/mnt/fuse
mountPoint=/Users/you/mnt/fuse
#chd=/somewhere/Games/PS2/ps2-game.chd
Loading

0 comments on commit 268f7e4

Please sign in to comment.