XAR Project Root

A Java library for working with XAR archives.

Лицензия

Лицензия

Группа

Группа

com.github.gino0631
Идентификатор

Идентификатор

xar-root
Последняя версия

Последняя версия

1.1
Дата

Дата

Тип

Тип

pom
Описание

Описание

XAR Project Root
A Java library for working with XAR archives.
Ссылка на сайт

Ссылка на сайт

https://github.com/gino0631/xar
Система контроля версий

Система контроля версий

https://github.com/gino0631/xar

Скачать xar-root

Имя Файла Размер
xar-root-1.1.pom 5 KB
Обзор

Как подключить последнюю версию

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

Зависимости

test (1)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.12

Модули Проекта

  • xar-api
  • xar-core

XAR

Build Status Maven Central

A Java library for working with XAR archives. It supports both reading and creation of archives, with optional signing and time stamping.

Requirements

  • Java 8

Usage

The first step is to add a dependency on com.github.gino0631:xar-core to your project, for example, if using Maven:

<dependency>
  <groupId>com.github.gino0631</groupId>
  <artifactId>xar-core</artifactId>
  <version>...</version>
</dependency>

Interfaces for public use are contained in com.github.gino0631.xar and its subpackages, except for impl and spi.

To read an archive, load it using XarArchive.load():

try (XarArchive xar = XarArchive.load(...) {
  XarArchive.Header header = xar.getHeader();
  ...

  List<XarArchive.Entry> entries = xar.getEntries();
  ...
}

To create an archive, use XarBuilder:

try (XarBuilder xarBuilder = XarBuilder.getInstance()) {
  XarBuilder.Container root = xarBuilder.getRoot();
  XarBuilder.File file = root.addFile("file.txt", EncodingAlgorithm.ZLIB, Files.newInputStream(...));
  
  XarBuilder.Directory dir = root.addDirectory("dir");
  dir.addFile(...);
  ...

  try (XarArchive xar = xarBuilder.build()) {
    xar.writeTo(...);
  }
}

If signing is required, set private key, certificates, and provider (if required) before building:

xarBuilder.setSigning(privateKey, certificates, provider);

or, to sign and then to time stamp the signature:

xarBuilder.setSigning(privateKey, certificates, provider, tsa);

Версии библиотеки

Версия
1.1
1.0