xar (Parent)

A Java library for reading and writing eXtensible ARchiver files.

License

License

GroupId

GroupId

com.sprylab.xar
ArtifactId

ArtifactId

parent
Last Version

Last Version

0.9.9
Release Date

Release Date

Type

Type

pom
Description

Description

xar (Parent)
A Java library for reading and writing eXtensible ARchiver files.
Project URL

Project URL

https://github.com/sprylab/xar
Project Organization

Project Organization

sprylab technologies GmbH
Source Code Management

Source Code Management

https://github.com/sprylab/xar

Download parent

Filename Size
parent-0.9.9.pom 5 KB
Browse

How to add to project

<!-- https://jarcasting.com/artifacts/com.sprylab.xar/parent/ -->
<dependency>
    <groupId>com.sprylab.xar</groupId>
    <artifactId>parent</artifactId>
    <version>0.9.9</version>
    <type>pom</type>
</dependency>
// https://jarcasting.com/artifacts/com.sprylab.xar/parent/
implementation 'com.sprylab.xar:parent:0.9.9'
// https://jarcasting.com/artifacts/com.sprylab.xar/parent/
implementation ("com.sprylab.xar:parent:0.9.9")
'com.sprylab.xar:parent:pom:0.9.9'
<dependency org="com.sprylab.xar" name="parent" rev="0.9.9">
  <artifact name="parent" type="pom" />
</dependency>
@Grapes(
@Grab(group='com.sprylab.xar', module='parent', version='0.9.9')
)
libraryDependencies += "com.sprylab.xar" % "parent" % "0.9.9"
[com.sprylab.xar/parent "0.9.9"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

  • xar
  • xar-http
  • xar-cli

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

com.sprylab.xar

sprylab technologies GmbH

Versions

Version
0.9.9
0.9.8
0.9.7
0.9.6
0.9.5
0.9.4
0.9.3
0.9.2
0.9.1