View Javadoc
1   /*
2    * Copyright (C) 2005-2015 Schlichtherle IT Services.
3    * All rights reserved. Use is subject to license terms.
4    */
5   package net.java.truevfs.driver.tar;
6   
7   import java.util.Map;
8   import javax.annotation.concurrent.Immutable;
9   import net.java.truecommons.annotations.ServiceImplementation;
10  import net.java.truevfs.comp.tardriver.TarDriver;
11  import net.java.truevfs.kernel.spec.FsDriver;
12  import net.java.truevfs.kernel.spec.FsScheme;
13  import net.java.truevfs.kernel.spec.spi.FsDriverMapModifier;
14  
15  /**
16   * Maps a file system driver for accessing the TAR file format.
17   * The modified map will contain the following entries:
18   * <p>
19  <table border=1 cellpadding=5 summary="">
20  <thead>
21  <tr>
22  <th>URI Schemes / Archive File Extensions</th>
23  <th>File System Driver Class</th>
24  </tr>
25  </thead>
26  <tbody>
27  <tr>
28  <td>{@code tar}</td>
29  <td>{@link TarDriver}</td>
30  </tr>
31  </tbody>
32  </table>
33   *
34   * @author Christian Schlichtherle
35   */
36  @Immutable
37  @ServiceImplementation
38  public final class TarDriverMapModifier extends FsDriverMapModifier {
39  
40      @Override
41      public Map<FsScheme, FsDriver> apply(final Map<FsScheme, FsDriver> map) {
42          map.put(FsScheme.create("tar"), new TarDriver());
43          return map;
44      }
45  
46      /** @return -100 */
47      @Override
48      public int getPriority() { return -100; }
49  }