Class ShrinkWrapFileSystems
- java.lang.Object
-
- org.jboss.shrinkwrap.api.nio.file.ShrinkWrapFileSystems
-
public final class ShrinkWrapFileSystems extends java.lang.ObjectConvenience API bridge to the NIO.2FileSystemssupport for ShrinkWrapArchives.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringFS_ENV_KEY_ARCHIVEMapkey used to store aArchivewhen creating a newFileSystemviaFileSystems.newFileSystem(URI, Map)static java.lang.StringPROTOCOLProtocol portion of aURIto ShrinkWrapFileSystemsprivate static java.lang.StringURI_PROTOCOL_SUFFIXProtocol suffix before ID portion of ShrinkWrapURIs
-
Constructor Summary
Constructors Modifier Constructor Description privateShrinkWrapFileSystems()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.net.URIgetRootUri(Archive<?> archive)Constructs a newURIwith the form:shrinkwrap://{archive.getId()}/static java.nio.file.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 java.lang.String PROTOCOL
Protocol portion of aURIto ShrinkWrapFileSystems- See Also:
- Constant Field Values
-
FS_ENV_KEY_ARCHIVE
public static final java.lang.String FS_ENV_KEY_ARCHIVE
Mapkey used to store aArchivewhen creating a newFileSystemviaFileSystems.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 ShrinkWrapURIs- 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 theURIand the specified archive as a value in aMapunder 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 newFileSystemviaFileSystems.newFileSystem(URI, Map)
-
getRootUri
public static java.net.URI getRootUri(Archive<?> archive) throws java.lang.IllegalArgumentException
Constructs a newURIwith the form:shrinkwrap://{archive.getId()}/- Parameters:
archive-- Returns:
- Throws:
java.lang.IllegalArgumentException- If the archive is not specified
-
-