Class ShrinkWrapFileSystems
- java.lang.Object
-
- org.jboss.shrinkwrap.api.nio.file.ShrinkWrapFileSystems
-
public final class ShrinkWrapFileSystems extends Object
Convenience API bridge to the NIO.2FileSystemssupport for ShrinkWrapArchives.- Author:
- Andrew Lee Rubinger
-
-
Field Summary
Fields Modifier and Type Field Description static StringFS_ENV_KEY_ARCHIVEMapkey used to store aArchivewhen creating a newFileSystemviaFileSystems.newFileSystem(URI, Map)static StringPROTOCOLProtocol portion of aURIto ShrinkWrapFileSystems
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static URIgetRootUri(Archive<?> archive)Constructs a newURIwith the form:shrinkwrap://{archive.getId()}/static FileSystemnewFileSystem(Archive<?> archive)Creates a new file system for the givenArchive; in effect invoking this method is equal to invokingFileSystems.newFileSystem(URI, Map), passing the value ofgetRootUri(Archive)as theURIand the specified archive as a value in aMapunder the keyFS_ENV_KEY_ARCHIVE
-
-
-
Field Detail
-
PROTOCOL
public static final String PROTOCOL
Protocol portion of aURIto ShrinkWrapFileSystems- See Also:
- Constant Field Values
-
FS_ENV_KEY_ARCHIVE
public static final String FS_ENV_KEY_ARCHIVE
Mapkey used to store aArchivewhen creating a newFileSystemviaFileSystems.newFileSystem(URI, Map)- See Also:
- Constant Field Values
-
-
Method Detail
-
newFileSystem
public static FileSystem newFileSystem(Archive<?> archive) throws IllegalArgumentException, IOException
Creates a new file system for the givenArchive; in effect invoking this method is equal to invokingFileSystems.newFileSystem(URI, Map), passing the value ofgetRootUri(Archive)as theURIand the specified archive as a value in aMapunder the keyFS_ENV_KEY_ARCHIVE- Parameters:
archive-- Returns:
- Throws:
IllegalArgumentException- If the archive is not specifiedIOException- If an error was encountered during creation of the newFileSystemviaFileSystems.newFileSystem(URI, Map)
-
getRootUri
public static URI getRootUri(Archive<?> archive) throws IllegalArgumentException
Constructs a newURIwith the form:shrinkwrap://{archive.getId()}/- Parameters:
archive-- Returns:
- Throws:
IllegalArgumentException- If the archive is not specified
-
-