All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.java.truevfs.driver.jar.JarDriverMapModifier Maven / Gradle / Ivy

Go to download

Provides a file system driver for accessing the JAR file format. Add the JAR artifact of this module to the run time class path to make its file system drivers available for service location in the client API modules.

There is a newer version: 0.14.0
Show newest version
/*
 * Copyright (C) 2005-2015 Schlichtherle IT Services.
 * All rights reserved. Use is subject to license terms.
 */
package net.java.truevfs.driver.jar;

import java.util.Map;
import javax.annotation.concurrent.Immutable;
import net.java.truecommons.annotations.ServiceImplementation;
import net.java.truecommons.shed.ExtensionSet;
import net.java.truevfs.comp.zipdriver.JarDriver;
import net.java.truevfs.kernel.spec.FsDriver;
import net.java.truevfs.kernel.spec.FsScheme;
import net.java.truevfs.kernel.spec.spi.FsDriverMapModifier;

/**
 * Maps a file system driver for accessing the JAR file format.
 * The modified map will contain the following entries:
 * 

URI Schemes / Archive File Extensions File System Driver Class
{@code ear}, {@code jar}, {@code war} {@link JarDriver}
* * @see Open Document Format for Office Applications (OpenDocument) Version 1.2; Part 1: OpenDocument Schema; Appendix C: MIME Types and File Name Extensions (Non Normative) * @author Christian Schlichtherle */ @Immutable @ServiceImplementation public final class JarDriverMapModifier extends FsDriverMapModifier { @Override public Map apply(final Map map) { final FsDriver driver = new JarDriver(); for (final String extension : new ExtensionSet("ear|jar|war")) map.put(FsScheme.create(extension), driver); return map; } /** @return -100 */ @Override public int getPriority() { return -100; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy