Class ShrinkWrapFileSystemProvider
- java.lang.Object
-
- java.nio.file.spi.FileSystemProvider
-
- org.jboss.shrinkwrap.impl.nio.file.ShrinkWrapFileSystemProvider
-
public class ShrinkWrapFileSystemProvider extends java.nio.file.spi.FileSystemProviderFileSystemProviderimplementation for ShrinkWrapArchives.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.concurrent.ConcurrentMap<java.lang.String,ShrinkWrapFileSystem>createdFileSystemsOpen file systems, keyed by theArchive.getId()private java.util.concurrent.locks.ReentrantLockcreateNewFsLockLock for creation of a new filesystem and other tasks which should block until this op has completedprivate static java.lang.StringENV_KEY_ARCHIVEEnvironment key for creating a newFileSystemdenoting the archiveprivate static java.util.logging.LoggerlogLoggerprivate static java.lang.StringSCHEMEScheme
-
Constructor Summary
Constructors Constructor Description ShrinkWrapFileSystemProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckAccess(java.nio.file.Path path, java.nio.file.AccessMode... modes)private voidcopy(java.io.InputStream in, java.nio.channels.SeekableByteChannel out)Writes the contents of theInputStreamto theSeekableByteChannelvoidcopy(java.nio.file.Path source, java.nio.file.Path target, java.nio.file.CopyOption... options)voidcreateDirectory(java.nio.file.Path dir, java.nio.file.attribute.FileAttribute<?>... attrs)voiddelete(java.nio.file.Path path)private Archive<?>getArchive(java.nio.file.Path path)Obtains the underlying archive associated with the specified Path<V extends java.nio.file.attribute.FileAttributeView>
VgetFileAttributeView(java.nio.file.Path path, java.lang.Class<V> type, java.nio.file.LinkOption... options)java.nio.file.FileStoregetFileStore(java.nio.file.Path path)java.nio.file.FileSystemgetFileSystem(java.net.URI uri)java.nio.file.PathgetPath(java.net.URI uri)java.lang.StringgetScheme()booleanisHidden(java.nio.file.Path path)booleanisSameFile(java.nio.file.Path path1, java.nio.file.Path path2)voidmove(java.nio.file.Path source, java.nio.file.Path target, java.nio.file.CopyOption... options)java.nio.channels.SeekableByteChannelnewByteChannel(java.nio.file.Path path, java.util.Set<? extends java.nio.file.OpenOption> options, java.nio.file.attribute.FileAttribute<?>... attrs)java.nio.file.DirectoryStream<java.nio.file.Path>newDirectoryStream(java.nio.file.Path dir, java.nio.file.DirectoryStream.Filter<? super java.nio.file.Path> filter)java.nio.channels.FileChannelnewFileChannel(java.nio.file.Path path, java.util.Set<? extends java.nio.file.OpenOption> options, java.nio.file.attribute.FileAttribute<?>... attrs)java.nio.file.FileSystemnewFileSystem(java.net.URI uri, java.util.Map<java.lang.String,?> env)<A extends java.nio.file.attribute.BasicFileAttributes>
AreadAttributes(java.nio.file.Path path, java.lang.Class<A> type, java.nio.file.LinkOption... options)java.util.Map<java.lang.String,java.lang.Object>readAttributes(java.nio.file.Path path, java.lang.String attributes, java.nio.file.LinkOption... options)voidsetAttribute(java.nio.file.Path path, java.lang.String attribute, java.lang.Object value, java.nio.file.LinkOption... options)
-
-
-
Field Detail
-
log
private static final java.util.logging.Logger log
Logger
-
SCHEME
private static final java.lang.String SCHEME
Scheme- See Also:
- Constant Field Values
-
ENV_KEY_ARCHIVE
private static final java.lang.String ENV_KEY_ARCHIVE
Environment key for creating a newFileSystemdenoting the archive- See Also:
- Constant Field Values
-
createdFileSystems
private final java.util.concurrent.ConcurrentMap<java.lang.String,ShrinkWrapFileSystem> createdFileSystems
Open file systems, keyed by theArchive.getId()
-
createNewFsLock
private final java.util.concurrent.locks.ReentrantLock createNewFsLock
Lock for creation of a new filesystem and other tasks which should block until this op has completed
-
-
Method Detail
-
getScheme
public java.lang.String getScheme()
- Specified by:
getSchemein classjava.nio.file.spi.FileSystemProvider- See Also:
FileSystemProvider.getScheme()
-
newFileSystem
public java.nio.file.FileSystem newFileSystem(java.net.URI uri, java.util.Map<java.lang.String,?> env) throws java.io.IOException- Specified by:
newFileSystemin classjava.nio.file.spi.FileSystemProvider- Throws:
java.io.IOException- See Also:
FileSystemProvider.newFileSystem(java.net.URI, java.util.Map)
-
getFileSystem
public java.nio.file.FileSystem getFileSystem(java.net.URI uri)
- Specified by:
getFileSystemin classjava.nio.file.spi.FileSystemProvider- See Also:
FileSystemProvider.getFileSystem(java.net.URI)
-
getPath
public java.nio.file.Path getPath(java.net.URI uri)
- Specified by:
getPathin classjava.nio.file.spi.FileSystemProvider- See Also:
FileSystemProvider.getPath(java.net.URI)
-
newFileChannel
public java.nio.channels.FileChannel newFileChannel(java.nio.file.Path path, java.util.Set<? extends java.nio.file.OpenOption> options, java.nio.file.attribute.FileAttribute<?>... attrs) throws java.io.IOException- Overrides:
newFileChannelin classjava.nio.file.spi.FileSystemProvider- Throws:
java.io.IOException- See Also:
java.nio.file.spi.FileSystemProvider#newFileChannel(java.nio.file.Path, java.util.Set, java.nio.file.attribute.FileAttribute>[])
-
newByteChannel
public java.nio.channels.SeekableByteChannel newByteChannel(java.nio.file.Path path, java.util.Set<? extends java.nio.file.OpenOption> options, java.nio.file.attribute.FileAttribute<?>... attrs) throws java.io.IOException- Specified by:
newByteChannelin classjava.nio.file.spi.FileSystemProvider- Throws:
java.io.IOException- See Also:
java.nio.file.spi.FileSystemProvider#newByteChannel(java.nio.file.Path, java.util.Set, java.nio.file.attribute.FileAttribute>[])
-
newDirectoryStream
public java.nio.file.DirectoryStream<java.nio.file.Path> newDirectoryStream(java.nio.file.Path dir, java.nio.file.DirectoryStream.Filter<? super java.nio.file.Path> filter) throws java.io.IOException- Specified by:
newDirectoryStreamin classjava.nio.file.spi.FileSystemProvider- Throws:
java.io.IOException- See Also:
FileSystemProvider.newDirectoryStream(java.nio.file.Path, java.nio.file.DirectoryStream.Filter)
-
createDirectory
public void createDirectory(java.nio.file.Path dir, java.nio.file.attribute.FileAttribute<?>... attrs) throws java.io.IOException- Specified by:
createDirectoryin classjava.nio.file.spi.FileSystemProvider- Throws:
java.io.IOException- See Also:
java.nio.file.spi.FileSystemProvider#createDirectory(java.nio.file.Path, java.nio.file.attribute.FileAttribute>[])
-
delete
public void delete(java.nio.file.Path path) throws java.io.IOException- Specified by:
deletein classjava.nio.file.spi.FileSystemProvider- Throws:
java.io.IOException- See Also:
FileSystemProvider.delete(java.nio.file.Path)
-
getArchive
private Archive<?> getArchive(java.nio.file.Path path)
Obtains the underlying archive associated with the specified Path- Parameters:
path-- Returns:
-
copy
public void copy(java.nio.file.Path source, java.nio.file.Path target, java.nio.file.CopyOption... options) throws java.io.IOException- Specified by:
copyin classjava.nio.file.spi.FileSystemProvider- Throws:
java.io.IOException
-
move
public void move(java.nio.file.Path source, java.nio.file.Path target, java.nio.file.CopyOption... options) throws java.io.IOException- Specified by:
movein classjava.nio.file.spi.FileSystemProvider- Throws:
java.io.IOException- See Also:
FileSystemProvider.move(java.nio.file.Path, java.nio.file.Path, java.nio.file.CopyOption[])
-
isSameFile
public boolean isSameFile(java.nio.file.Path path1, java.nio.file.Path path2) throws java.io.IOException- Specified by:
isSameFilein classjava.nio.file.spi.FileSystemProvider- Throws:
java.io.IOException- See Also:
FileSystemProvider.isSameFile(java.nio.file.Path, java.nio.file.Path)
-
isHidden
public boolean isHidden(java.nio.file.Path path) throws java.io.IOException- Specified by:
isHiddenin classjava.nio.file.spi.FileSystemProvider- Throws:
java.io.IOException- See Also:
FileSystemProvider.isHidden(java.nio.file.Path)
-
getFileStore
public java.nio.file.FileStore getFileStore(java.nio.file.Path path) throws java.io.IOException- Specified by:
getFileStorein classjava.nio.file.spi.FileSystemProvider- Throws:
java.io.IOException- See Also:
FileSystemProvider.getFileStore(java.nio.file.Path)
-
checkAccess
public void checkAccess(java.nio.file.Path path, java.nio.file.AccessMode... modes) throws java.io.IOException- Specified by:
checkAccessin classjava.nio.file.spi.FileSystemProvider- Throws:
java.io.IOException- See Also:
FileSystemProvider.checkAccess(java.nio.file.Path, java.nio.file.AccessMode[])
-
getFileAttributeView
public <V extends java.nio.file.attribute.FileAttributeView> V getFileAttributeView(java.nio.file.Path path, java.lang.Class<V> type, java.nio.file.LinkOption... options)- Specified by:
getFileAttributeViewin classjava.nio.file.spi.FileSystemProvider- See Also:
FileSystemProvider.getFileAttributeView(java.nio.file.Path, java.lang.Class, java.nio.file.LinkOption[])
-
readAttributes
public <A extends java.nio.file.attribute.BasicFileAttributes> A readAttributes(java.nio.file.Path path, java.lang.Class<A> type, java.nio.file.LinkOption... options) throws java.io.IOException- Specified by:
readAttributesin classjava.nio.file.spi.FileSystemProvider- Throws:
java.io.IOException- See Also:
FileSystemProvider.readAttributes(java.nio.file.Path, java.lang.Class, java.nio.file.LinkOption[])
-
readAttributes
public java.util.Map<java.lang.String,java.lang.Object> readAttributes(java.nio.file.Path path, java.lang.String attributes, java.nio.file.LinkOption... options) throws java.io.IOException- Specified by:
readAttributesin classjava.nio.file.spi.FileSystemProvider- Throws:
java.io.IOException- See Also:
FileSystemProvider.readAttributes(java.nio.file.Path, java.lang.String, java.nio.file.LinkOption[])
-
setAttribute
public void setAttribute(java.nio.file.Path path, java.lang.String attribute, java.lang.Object value, java.nio.file.LinkOption... options) throws java.io.IOException- Specified by:
setAttributein classjava.nio.file.spi.FileSystemProvider- Throws:
java.io.IOException- See Also:
FileSystemProvider.setAttribute(java.nio.file.Path, java.lang.String, java.lang.Object, java.nio.file.LinkOption[])
-
copy
private void copy(java.io.InputStream in, java.nio.channels.SeekableByteChannel out) throws java.io.IOExceptionWrites the contents of theInputStreamto theSeekableByteChannel- Parameters:
in-out-- Throws:
java.io.IOException
-
-