Skip to content

Anabranch CoreMulti-Source Segmented Downloader for Java 8 & Android

Zero-dependency pure Java 8 core compatible with Android minSdk 21—parallel multi-mirror chunking, failover, resumable state, and per-chunk SHA-256 verification, plus an optional standalone aria2 JNI backend.

Capabilities & Explicit Limits ​

What Anabranch Core Delivers

  • Zero-Dep Pure Java 8 Multi-Mirror Scheduler: 19 AGPL-3.0-only source files (no android.*, compatible with Android minSdk 21 without desugaring) offering Policy.fastestFirst()/weighted(), .part + .meta v2 resume, and per-chunk SHA-256 verification.
  • Failure-Only Retry Budgets & Pluggable SPIs: Caps retries at 6 per chunk / 60s failure budget without penalizing healthy slow transfers, supporting custom Engine, Policy, and Source.Resolver.
  • GPL-Isolated Optional aria2 AAR: Separate anabranch-aria2 artifact enables drop-in Aria2Downloader switching without exposing pure Java users to GPL requirements.

Explicit Non-Goals & Hard Boundaries

  • Strictly Stateless Library: Never bundles mirror URLs, persisted preferences, archive unpacking, APK installation UI, or foreground Android services.
  • Known Bounds & Manual Publishing: Source.maxChunks is currently metadata-only; Aria2Downloader serializes globally under BUSY without Core Policy; Maven Central publication is manual (verify live coordinates before release use).

Architecture Overview ​

Multi-Source Chunk Scheduling & State Persistence Topology (pan / zoom / inspect)
Open Fullscreen ↗

Minimal Usage ​

java
Downloader dl = Downloader.newBuilder()
    .defaultChunks(8)
    .maxConcurrent(4)
    .chunkRetryBudgetMs(60_000)
    .build();

SourceSet sources = new SourceSet(Arrays.asList(
    Source.ofBase("cdn-a", "https://cdn-a.example.test/pkg/"),
    Source.ofBase("cdn-b", "https://cdn-b.example.test/pkg/")),
    Policy.fastestFirst());

Result res = dl.download(
    new Request("app.bin", new File("out/app.bin"), integrity, 8, true),
    sources, Listener.NONE, Cancellation.NONE);

Documentation Guide ​

Quick Navigation by Role & Goal