Skip to content

Repository files navigation

FT-TNG

FT-TNG is FileTransformer: The Next Generation, a Java 21 command-line utility for safely splitting, verifying, and joining file chunks.

FT-TNG modernizes a Java file-splitting utility originally built for moving large data extracts through a constrained enterprise and SAP environment. The original ran on Java 1.4 and relied on perimeter controls and trusted infrastructure. This version rebuilds the idea as a cross-platform Java 21 CLI with streamed I/O, deterministic chunks, SHA-256 manifests, verification, and safe reconstruction.

This repository contains the v0.1.0 implementation of FT-TNG: a Java 21 command-line tool that can split files into deterministic chunks, verify chunk integrity through a JSON manifest, and safely reconstruct the original file.

Requirements

  • Java 21
  • No global Maven install is required. Use the project Maven wrapper.

Build

On Windows:

mvnw.cmd clean verify

On Linux or macOS:

./mvnw clean verify

The first run downloads a pinned Maven distribution into .mvn/wrapper/ inside this project. Maven dependencies are cached in .mvn/repository/ for this project instead of your global Maven cache.

The executable JAR is produced under target/.

CLI Help

java -jar target/ft-tng-0.1.0.jar --help
java -jar target/ft-tng-0.1.0.jar split --help
java -jar target/ft-tng-0.1.0.jar verify --help
java -jar target/ft-tng-0.1.0.jar join --help

CLI Usage

java -jar target/ft-tng-0.1.0.jar split database-export.bin --chunk-size 100MiB --output database-export-parts
java -jar target/ft-tng-0.1.0.jar verify database-export-parts/manifest.json
java -jar target/ft-tng-0.1.0.jar join database-export-parts/manifest.json --output restored/database-export.bin

All three commands accept optional operational JSON Lines logging:

java -jar target/ft-tng-0.1.0.jar verify database-export-parts/manifest.json --log-json verify.jsonl

Exit Codes

0   Success
2   Invalid command-line input
3   Source, manifest, or requested path invalid
4   Required chunk missing
5   Integrity verification failed
6   Output already exists
7   Filesystem or general I/O failure
8   Unsupported manifest format
9   Internal application failure

Implemented Core Rules

  • Binary sizes accept positive whole numbers with B, KiB, MiB, or GiB.
  • Bare numbers, decimal values, SI units such as MB, zero, and negative sizes are rejected.
  • Chunk filenames use <original-name>.part<sequence> with a six-digit sequence.
  • Splits requiring more than 999999 chunks are rejected.
  • Manifests can be written and read as stable, pretty-printed JSON.
  • SHA-256 digests use the Java standard library and lowercase hexadecimal output.
  • The core splitter streams source bytes into deterministic chunks and writes a manifest.
  • The core verifier validates manifest semantics, safe chunk names, chunk existence, sizes, hashes, and total bytes.
  • The core assembler verifies chunks first, reconstructs through a temporary file, refuses overwrite, and validates final size/hash before moving output into place.
  • The CLI maps expected failures to documented process exit codes.
  • Optional --log-json writes one JSON object per line for command start, completion, and failure events.

Verify Chunk Integrity

SHA-256 verifies chunk integrity relative to the manifest. It does not authenticate the manifest or prove who created it. An attacker able to replace both the chunks and manifest is outside the v0.1.0 trust model.

Scope

v0.1.0 provides a complete split -> verify -> join vertical slice with deterministic chunk names, SHA-256 integrity checks, a versioned JSON manifest, safe reconstruction, and optional JSON Lines operational logging.

Historical Archive

The archive/ directory contains recovered historical source for project context only. It is not compiled, supported, or treated as the implementation basis for FT-TNG.

License

FT-TNG is licensed under the Apache License, Version 2.0. See LICENSE.

About

ft-tng is a java tool to split and then reassemble large files into user defined 'chunk' sizes. can only upload 5mb files? split that 100mb archive into 5mb chunks and upload away!

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages