Juneloop

Introduction

JNLP stands for Java Network Launching protocol, an format for XML files which describe how to launch Java Web Start applications.

This project focuses on programmatic manipulation of JNLP files. With Juneloop you can:

Juneloop is built with JAXB 2, it compiles JNLP 1.5 and JNLP 6.0 DTDs.

Future versions will introduce version-independent interfaces to ensure cross-version portability of client code.

Adding Juneloop dependencies

Juneloop is built with Maven and distributed via the central Maven repository.

If you're using Maven you'll only need to add the org.hisrc.juneloop:juneloop-core dependency:

<dependency>
	<groupId>org.hisrc.juneloop</groupId>
	<artifactId>juneloop-core</artifactId>
	<version>${juneloop.version}</version>
</dependency>

If you're not using Maven, here's a list of JARs (and where to get them):

Using Juneloop

Here's a very simple unit test which demonstrates how to work with Juneloop:

JAXBContext context = JAXBContext
		.newInstance(JNLP_V_1_5_Constants.CONTEXT_PATH);

final URL resourceURL = getClass().getResource(resourceName);

// Create an unmarshaller
Unmarshaller unmarshaller = context.createUnmarshaller();

// Unmarshal the JNLP resource
final Jnlp alpha = (Jnlp) unmarshaller.unmarshal(resourceURL);

// Access JNLP object structure
assertNotNull(alpha.getSecurity().getAllPermissions());

// Create a marshaller
Marshaller marshaller = context.createMarshaller();
// Output the doctype declaration
marshaller.setProperty("com.sun.xml.bind.xmlHeaders",
		JNLP_V_1_5_Constants.DOCTYPE);
// Format output
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);

// Marshal into the System.out
marshaller.marshal(alpha, System.out);

// Make a roundtrip
// Marshall, unmarshall, make sure original and resulting objects are
// equal
final ByteArrayOutputStream bos = new ByteArrayOutputStream();
marshaller.marshal(alpha, bos);

Jnlp omega = (Jnlp) unmarshaller.unmarshal(new ByteArrayInputStream(bos
		.toByteArray()));

assertEquals(alpha, omega);

Developing Juneloop

Juneloop is hosted and developen on Sourceforge.net:


Browse Space

- Pages
- News
- Labels
- Attachments
- Bookmarks
- Mail
- Activity
- Advanced

Explore Confluence

- Popular Labels
- Notation Guide
- Impressum

Your Account

Log In

 

Other Features

Add Content