Class ShrinkWrapFileSystemProvider
java.lang.Object
java.nio.file.spi.FileSystemProvider
org.jboss.shrinkwrap.impl.nio.file.ShrinkWrapFileSystemProvider
FileSystemProvider
implementation for ShrinkWrap Archive
s.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ConcurrentMap
<String, ShrinkWrapFileSystem> Open file systems, keyed by theArchive.getId()
private final ReentrantLock
Lock for creation of a new filesystem and other tasks which should block until this op has completedprivate static final String
Environment key for creating a newFileSystem
denoting the archiveprivate static final Logger
Loggerprivate static final String
Scheme -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
checkAccess
(Path path, AccessMode... modes) private void
copy
(InputStream in, SeekableByteChannel out) Writes the contents of theInputStream
to theSeekableByteChannel
void
copy
(Path source, Path target, CopyOption... options) void
createDirectory
(Path dir, FileAttribute<?>... attrs) void
private Archive
<?> getArchive
(Path path) Obtains the underlying archive associated with the specified Path<V extends FileAttributeView>
VgetFileAttributeView
(Path path, Class<V> type, LinkOption... options) getFileStore
(Path path) getFileSystem
(URI uri) boolean
boolean
isSameFile
(Path path1, Path path2) void
move
(Path source, Path target, CopyOption... options) newByteChannel
(Path path, Set<? extends OpenOption> options, FileAttribute<?>... attrs) newDirectoryStream
(Path dir, DirectoryStream.Filter<? super Path> filter) newFileChannel
(Path path, Set<? extends OpenOption> options, FileAttribute<?>... attrs) newFileSystem
(URI uri, Map<String, ?> env) <A extends BasicFileAttributes>
AreadAttributes
(Path path, Class<A> type, LinkOption... options) readAttributes
(Path path, String attributes, LinkOption... options) void
setAttribute
(Path path, String attribute, Object value, LinkOption... options) Methods inherited from class java.nio.file.spi.FileSystemProvider
createLink, createSymbolicLink, deleteIfExists, installedProviders, newAsynchronousFileChannel, newFileSystem, newInputStream, newOutputStream, readSymbolicLink
-
Field Details
-
log
Logger -
SCHEME
Scheme- See Also:
-
ENV_KEY_ARCHIVE
Environment key for creating a newFileSystem
denoting the archive- See Also:
-
createdFileSystems
Open file systems, keyed by theArchive.getId()
-
createNewFsLock
Lock for creation of a new filesystem and other tasks which should block until this op has completed
-
-
Constructor Details
-
ShrinkWrapFileSystemProvider
public ShrinkWrapFileSystemProvider()
-
-
Method Details
-
getScheme
- Specified by:
getScheme
in classFileSystemProvider
- See Also:
-
newFileSystem
- Specified by:
newFileSystem
in classFileSystemProvider
- Throws:
IOException
- See Also:
-
getFileSystem
- Specified by:
getFileSystem
in classFileSystemProvider
- See Also:
-
getPath
- Specified by:
getPath
in classFileSystemProvider
- See Also:
-
newFileChannel
public FileChannel newFileChannel(Path path, Set<? extends OpenOption> options, FileAttribute<?>... attrs) throws IOException - Overrides:
newFileChannel
in classFileSystemProvider
- Throws:
IOException
- See Also:
-
newByteChannel
public SeekableByteChannel newByteChannel(Path path, Set<? extends OpenOption> options, FileAttribute<?>... attrs) throws IOException - Specified by:
newByteChannel
in classFileSystemProvider
- Throws:
IOException
- See Also:
-
newDirectoryStream
public DirectoryStream<Path> newDirectoryStream(Path dir, DirectoryStream.Filter<? super Path> filter) throws IOException - Specified by:
newDirectoryStream
in classFileSystemProvider
- Throws:
IOException
- See Also:
-
createDirectory
- Specified by:
createDirectory
in classFileSystemProvider
- Throws:
IOException
- See Also:
-
delete
- Specified by:
delete
in classFileSystemProvider
- Throws:
IOException
- See Also:
-
getArchive
Obtains the underlying archive associated with the specified Path- Parameters:
path
-- Returns:
-
copy
- Specified by:
copy
in classFileSystemProvider
- Throws:
IOException
-
move
- Specified by:
move
in classFileSystemProvider
- Throws:
IOException
- See Also:
-
isSameFile
- Specified by:
isSameFile
in classFileSystemProvider
- Throws:
IOException
- See Also:
-
isHidden
- Specified by:
isHidden
in classFileSystemProvider
- Throws:
IOException
- See Also:
-
getFileStore
- Specified by:
getFileStore
in classFileSystemProvider
- Throws:
IOException
- See Also:
-
checkAccess
- Specified by:
checkAccess
in classFileSystemProvider
- Throws:
IOException
- See Also:
-
getFileAttributeView
public <V extends FileAttributeView> V getFileAttributeView(Path path, Class<V> type, LinkOption... options) - Specified by:
getFileAttributeView
in classFileSystemProvider
- See Also:
-
readAttributes
public <A extends BasicFileAttributes> A readAttributes(Path path, Class<A> type, LinkOption... options) throws IOException - Specified by:
readAttributes
in classFileSystemProvider
- Throws:
IOException
- See Also:
-
readAttributes
public Map<String,Object> readAttributes(Path path, String attributes, LinkOption... options) throws IOException - Specified by:
readAttributes
in classFileSystemProvider
- Throws:
IOException
- See Also:
-
setAttribute
public void setAttribute(Path path, String attribute, Object value, LinkOption... options) throws IOException - Specified by:
setAttribute
in classFileSystemProvider
- Throws:
IOException
- See Also:
-
copy
Writes the contents of theInputStream
to theSeekableByteChannel
- Parameters:
in
-out
-- Throws:
IOException
-