sprylab Xar

A Java library for reading eXtensible ARchiver files.

License

License

GroupId

GroupId

io.takari
ArtifactId

ArtifactId

xar
Last Version

Last Version

0.8.8
Release Date

Release Date

Type

Type

takari-jar
Description

Description

sprylab Xar
A Java library for reading eXtensible ARchiver files.
Source Code Management

Source Code Management

https://github.com/sprylab/xar

Download xar

Dependencies

compile (9)

Group / Artifact Type Version
org.simpleframework : simple-xml jar 2.7.1
org.slf4j : slf4j-api jar 1.7.14
commons-io : commons-io jar 2.4
commons-codec : commons-codec jar 1.10
org.apache.commons : commons-lang3 jar 3.4
org.jooq : joou jar 0.9.1
commons-cli : commons-cli jar 1.2
com.jcabi : jcabi-manifests jar 0.7.19
org.slf4j : slf4j-nop jar 1.7.14

test (2)

Group / Artifact Type Version
org.slf4j : slf4j-simple jar 1.7.14
junit : junit jar 4.12

Project Modules

There are no modules declared in this project.

xar for Java

A Java library for reading and writing eXtensible ARchiver files by sprylab technologies GmbH.

Work-in-progress note

This is the public preview version. It works for us, but it still has some rough corners and thus lacks consistent code style, sufficient unit tests and complete documentation. Especially the writing support is still experimental.

Use with care! We work on a fully polished version 1.0.0 and will release it, when it's done.

Thanks for your patience!

Usage

Open a .xar file:

XarSource xar = new FileXarSource(new File("my-file.xar"));

Open a .xar file from URL (needs xar-http module):

XarSource xar = new HttpXarSource("https://example.com/files/my-file.xar");

Extract a .xar file:

xar.extractAll(new File("extract-directory"));

Get a list of all entries:

List<XarEntry> entries = xar.getEntries();

Get a specific entry:

XarEntry entry = xar.getEntry("directory/file.txt");

Stream, extract or get bytes of a entry:

InputStream inputStream = entry.getInputStream();
entry.extract(new File("extract-directory"));
byte[] bytes = entry.getBytes();

Create a .xar file from directory:

XarPacker xarPacker = new XarPacker(new File("my-file.xar"));
xarPacker.addDirectory(new File("directory"), false, null));
xarPacker.write();

Download

Download the latest JAR or grab via Maven:

<dependency>
  <groupId>com.sprylab.xar</groupId>
  <artifactId>xar</artifactId>
  <version>0.9.9</version>
</dependency>

or Gradle:

compile 'com.sprylab.xar:xar:0.9.9'

If you need to access files via HTTP, add the xar-http module as a dependency, too:

<dependency>
  <groupId>com.sprylab.xar</groupId>
  <artifactId>xar-http</artifactId>
  <version>0.9.9</version>
</dependency>

or Gradle:

compile 'com.sprylab.xar:xar-http:0.9.9'

There is also a CLI version, which mimics the behavior of the original C executable. Download the latest standalone-JAR (all dependencies included) for direct use at the command line.

License

Copyright 2013-2018 sprylab technologies GmbH

Licensed 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.

Related projects

Original C source: http://code.google.com/p/xar/

Fork/clone by @mackyle: https://github.com/mackyle/xar

JavaScript port by @finnp: https://github.com/finnp/xar

io.takari

sprylab technologies GmbH

Versions

Version
0.8.8
0.8.7
0.8.6