
net.java.truevfs.driver.tar.gzip.TarGZipDriverMapModifier Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of truevfs-driver-tar-gzip Show documentation
Show all versions of truevfs-driver-tar-gzip Show documentation
Provides a file system driver for accessing the GZIP compressed TAR
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.
/*
* Copyright (C) 2005-2015 Schlichtherle IT Services.
* All rights reserved. Use is subject to license terms.
*/
package net.java.truevfs.driver.tar.gzip;
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.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 GZIP compressed TAR file format.
* The modified map will contain the following entries:
*
URI Schemes / Archive File Extensions
File System Driver Class
{@code tar.gz}, {@code tar.gzip}, {@code tgz}
{@link TarGZipDriver}
*
* @author Christian Schlichtherle
*/
@Immutable
@ServiceImplementation
public final class TarGZipDriverMapModifier extends FsDriverMapModifier {
@Override
public Map apply(final Map map) {
final FsDriver driver = new TarGZipDriver();
for (final String extension : new ExtensionSet("tar.gz|tar.gzip|tgz"))
map.put(FsScheme.create(extension), driver);
return map;
}
/** @return -100 */
@Override
public int getPriority() { return -100; }
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy