Class ShrinkWrapFileSystems
java.lang.Object
org.jboss.shrinkwrap.api.nio.file.ShrinkWrapFileSystems
Convenience API bridge to the NIO.2
FileSystems support for ShrinkWrap Archives.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringMapkey used to store aArchivewhen creating a newFileSystemviaFileSystems.newFileSystem(URI, Map)static final StringProtocol portion of aURIto ShrinkWrapFileSystemsprivate static final StringProtocol suffix before ID portion of ShrinkWrapURIs -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic 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 Details
-
PROTOCOL
-
FS_ENV_KEY_ARCHIVE
Mapkey used to store aArchivewhen creating a newFileSystemviaFileSystems.newFileSystem(URI, Map)- See Also:
-
URI_PROTOCOL_SUFFIX
-
-
Constructor Details
-
ShrinkWrapFileSystems
private ShrinkWrapFileSystems()
-
-
Method Details
-
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
Constructs a newURIwith the form:shrinkwrap://{archive.getId()}/- Parameters:
archive-- Returns:
- Throws:
IllegalArgumentException- If the archive is not specified
-