Class ShrinkWrapFileSystems
- java.lang.Object
-
- org.jboss.shrinkwrap.api.nio.file.ShrinkWrapFileSystems
-
public final class ShrinkWrapFileSystems extends java.lang.Object
Convenience API bridge to the NIO.2FileSystems
support for ShrinkWrapArchive
s.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
FS_ENV_KEY_ARCHIVE
Map
key used to store aArchive
when creating a newFileSystem
viaFileSystems.newFileSystem(URI, Map)
static java.lang.String
PROTOCOL
Protocol portion of aURI
to ShrinkWrapFileSystem
sprivate static java.lang.String
URI_PROTOCOL_SUFFIX
Protocol suffix before ID portion of ShrinkWrapURI
s
-
Constructor Summary
Constructors Modifier Constructor Description private
ShrinkWrapFileSystems()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.net.URI
getRootUri(Archive<?> archive)
Constructs a newURI
with the form:shrinkwrap://{archive.getId()}/
static java.nio.file.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 java.lang.String PROTOCOL
Protocol portion of aURI
to ShrinkWrapFileSystem
s- See Also:
- Constant Field Values
-
FS_ENV_KEY_ARCHIVE
public static final java.lang.String FS_ENV_KEY_ARCHIVE
Map
key used to store aArchive
when creating a newFileSystem
viaFileSystems.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 ShrinkWrapURI
s- See Also:
- Constant Field Values
-
-
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 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:
java.lang.IllegalArgumentException
- If the archive is not specifiedjava.io.IOException
- If an error was encountered during creation of the newFileSystem
viaFileSystems.newFileSystem(URI, Map)
-
getRootUri
public static java.net.URI getRootUri(Archive<?> archive) throws java.lang.IllegalArgumentException
Constructs a newURI
with the form:shrinkwrap://{archive.getId()}/
- Parameters:
archive
-- Returns:
- Throws:
java.lang.IllegalArgumentException
- If the archive is not specified
-
-