Class ShrinkWrapFileSystems


  • public final class ShrinkWrapFileSystems
    extends java.lang.Object
    Convenience API bridge to the NIO.2 FileSystems support for ShrinkWrap Archives.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String FS_ENV_KEY_ARCHIVE
      Map key used to store a Archive when creating a new FileSystem via FileSystems.newFileSystem(URI, Map)
      static java.lang.String PROTOCOL
      Protocol portion of a URI to ShrinkWrap FileSystems
      private static java.lang.String URI_PROTOCOL_SUFFIX
      Protocol suffix before ID portion of ShrinkWrap URIs
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.net.URI getRootUri​(Archive<?> archive)
      Constructs a new URI with the form: shrinkwrap://{archive.getId()}/
      static java.nio.file.FileSystem newFileSystem​(Archive<?> archive)
      Creates a new file system for the given Archive; in effect invoking this method is equal to invoking FileSystems.newFileSystem(URI, Map), passing the value of getRootUri(Archive) as the URI and the specified archive as a value in a Map under the key FS_ENV_KEY_ARCHIVE
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • PROTOCOL

        public static final java.lang.String PROTOCOL
        Protocol portion of a URI to ShrinkWrap FileSystems
        See Also:
        Constant Field Values
      • FS_ENV_KEY_ARCHIVE

        public static final java.lang.String FS_ENV_KEY_ARCHIVE
        Map key used to store a Archive when creating a new FileSystem via FileSystems.newFileSystem(URI, Map)
        See Also:
        Constant Field Values
      • URI_PROTOCOL_SUFFIX

        private static final java.lang.String URI_PROTOCOL_SUFFIX
        Protocol suffix before ID portion of ShrinkWrap URIs
        See Also:
        Constant Field Values
    • Constructor Detail

      • ShrinkWrapFileSystems

        private ShrinkWrapFileSystems()
    • Method Detail

      • newFileSystem

        public static java.nio.file.FileSystem newFileSystem​(Archive<?> archive)
                                                      throws java.lang.IllegalArgumentException,
                                                             java.io.IOException
        Creates a new file system for the given Archive; in effect invoking this method is equal to invoking FileSystems.newFileSystem(URI, Map), passing the value of getRootUri(Archive) as the URI and the specified archive as a value in a Map under the key FS_ENV_KEY_ARCHIVE
        Parameters:
        archive -
        Returns:
        Throws:
        java.lang.IllegalArgumentException - If the archive is not specified
        java.io.IOException - If an error was encountered during creation of the new FileSystem via FileSystems.newFileSystem(URI, Map)
      • getRootUri

        public static java.net.URI getRootUri​(Archive<?> archive)
                                       throws java.lang.IllegalArgumentException
        Constructs a new URI with the form: shrinkwrap://{archive.getId()}/
        Parameters:
        archive -
        Returns:
        Throws:
        java.lang.IllegalArgumentException - If the archive is not specified