Class ShrinkWrapFileSystemProvider
java.lang.Object
java.nio.file.spi.FileSystemProvider
org.jboss.shrinkwrap.impl.nio.file.ShrinkWrapFileSystemProvider
FileSystemProvider implementation for ShrinkWrap Archives.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ConcurrentMap<String, ShrinkWrapFileSystem> Open file systems, keyed by theArchive.getId()private final ReentrantLockLock for creation of a new filesystem and other tasks which should block until this op has completedprivate static final StringEnvironment key for creating a newFileSystemdenoting the archiveprivate static final LoggerLoggerprivate static final StringScheme -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckAccess(Path path, AccessMode... modes) private voidcopy(InputStream in, SeekableByteChannel out) Writes the contents of theInputStreamto theSeekableByteChannelvoidcopy(Path source, Path target, CopyOption... options) voidcreateDirectory(Path dir, FileAttribute<?>... attrs) voidprivate 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) booleanbooleanisSameFile(Path path1, Path path2) voidmove(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) voidsetAttribute(Path path, String attribute, Object value, LinkOption... options) Methods inherited from class FileSystemProvider
createLink, createSymbolicLink, deleteIfExists, installedProviders, newAsynchronousFileChannel, newFileSystem, newInputStream, newOutputStream, readSymbolicLink
-
Field Details
-
log
Logger -
SCHEME
-
ENV_KEY_ARCHIVE
Environment key for creating a newFileSystemdenoting 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:
getSchemein classFileSystemProvider- See Also:
-
newFileSystem
- Specified by:
newFileSystemin classFileSystemProvider- Throws:
IOException- See Also:
-
getFileSystem
- Specified by:
getFileSystemin classFileSystemProvider- See Also:
-
getPath
- Specified by:
getPathin classFileSystemProvider- See Also:
-
newFileChannel
public FileChannel newFileChannel(Path path, Set<? extends OpenOption> options, FileAttribute<?>... attrs) throws IOException - Overrides:
newFileChannelin classFileSystemProvider- Throws:
IOException- See Also:
-
newByteChannel
public SeekableByteChannel newByteChannel(Path path, Set<? extends OpenOption> options, FileAttribute<?>... attrs) throws IOException - Specified by:
newByteChannelin classFileSystemProvider- Throws:
IOException- See Also:
-
newDirectoryStream
public DirectoryStream<Path> newDirectoryStream(Path dir, DirectoryStream.Filter<? super Path> filter) throws IOException - Specified by:
newDirectoryStreamin classFileSystemProvider- Throws:
IOException- See Also:
-
createDirectory
- Specified by:
createDirectoryin classFileSystemProvider- Throws:
IOException- See Also:
-
delete
- Specified by:
deletein classFileSystemProvider- Throws:
IOException- See Also:
-
getArchive
-
copy
- Specified by:
copyin classFileSystemProvider- Throws:
IOException
-
move
- Specified by:
movein classFileSystemProvider- Throws:
IOException- See Also:
-
isSameFile
- Specified by:
isSameFilein classFileSystemProvider- Throws:
IOException- See Also:
-
isHidden
- Specified by:
isHiddenin classFileSystemProvider- Throws:
IOException- See Also:
-
getFileStore
- Specified by:
getFileStorein classFileSystemProvider- Throws:
IOException- See Also:
-
checkAccess
- Specified by:
checkAccessin classFileSystemProvider- Throws:
IOException- See Also:
-
getFileAttributeView
public <V extends FileAttributeView> V getFileAttributeView(Path path, Class<V> type, LinkOption... options) - Specified by:
getFileAttributeViewin classFileSystemProvider- See Also:
-
readAttributes
public <A extends BasicFileAttributes> A readAttributes(Path path, Class<A> type, LinkOption... options) throws IOException - Specified by:
readAttributesin classFileSystemProvider- Throws:
IOException- See Also:
-
readAttributes
public Map<String,Object> readAttributes(Path path, String attributes, LinkOption... options) throws IOException - Specified by:
readAttributesin classFileSystemProvider- Throws:
IOException- See Also:
-
setAttribute
public void setAttribute(Path path, String attribute, Object value, LinkOption... options) throws IOException - Specified by:
setAttributein classFileSystemProvider- Throws:
IOException- See Also:
-
copy
Writes the contents of theInputStreamto theSeekableByteChannel- Parameters:
in-out-- Throws:
IOException
-