Class ShrinkWrapFileSystems
- java.lang.Object
-
- org.jboss.shrinkwrap.api.nio.file.ShrinkWrapFileSystems
-
public final class ShrinkWrapFileSystems extends Object
Convenience API bridge to the NIO.2FileSystems
support for ShrinkWrapArchive
s.- Author:
- Andrew Lee Rubinger
-
-
Field Summary
Fields Modifier and Type Field Description static String
FS_ENV_KEY_ARCHIVE
Map
key used to store aArchive
when creating a newFileSystem
viaFileSystems.newFileSystem(URI, Map)
static String
PROTOCOL
Protocol portion of aURI
to ShrinkWrapFileSystem
s
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static URI
getRootUri(Archive<?> archive)
Constructs a newURI
with the form:shrinkwrap://{archive.getId()}/
static FileSystem
newFileSystem(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 theURI
and the specified archive as a value in aMap
under the keyFS_ENV_KEY_ARCHIVE
-
-
-
Field Detail
-
PROTOCOL
public static final String PROTOCOL
Protocol portion of aURI
to ShrinkWrapFileSystem
s- See Also:
- Constant Field Values
-
FS_ENV_KEY_ARCHIVE
public static final String FS_ENV_KEY_ARCHIVE
Map
key used to store aArchive
when creating a newFileSystem
viaFileSystems.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 theURI
and the specified archive as a value in aMap
under 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 newFileSystem
viaFileSystems.newFileSystem(URI, Map)
-
getRootUri
public static URI getRootUri(Archive<?> archive) throws IllegalArgumentException
Constructs a newURI
with the form:shrinkwrap://{archive.getId()}/
- Parameters:
archive
-- Returns:
- Throws:
IllegalArgumentException
- If the archive is not specified
-
-