Package org.uberfire.java.nio.fs.file
Class SimpleFileSystemProvider
- java.lang.Object
-
- org.uberfire.java.nio.fs.file.SimpleFileSystemProvider
-
- All Implemented Interfaces:
org.uberfire.java.nio.file.spi.FileSystemProvider
public class SimpleFileSystemProvider extends Object implements org.uberfire.java.nio.file.spi.FileSystemProvider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSimpleFileSystemProvider.OSType
-
Field Summary
Fields Modifier and Type Field Description protected BaseSimpleFileSystemfileSystem
-
Constructor Summary
Constructors Modifier Constructor Description SimpleFileSystemProvider()protectedSimpleFileSystemProvider(File[] roots, SimpleFileSystemProvider.OSType osType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckAccess(org.uberfire.java.nio.file.Path path, org.uberfire.java.nio.file.AccessMode... modes)protected voidcheckFileExistsThenThrow(org.uberfire.java.nio.file.Path path)protected voidcheckFileNotExistThenThrow(org.uberfire.java.nio.file.Path path, boolean isLink)voidcopy(org.uberfire.java.nio.file.Path source, org.uberfire.java.nio.file.Path target, org.uberfire.java.nio.file.CopyOption... options)voidcreateDirectory(org.uberfire.java.nio.file.Path dir, org.uberfire.java.nio.file.attribute.FileAttribute<?>... attrs)protected <V extends org.uberfire.java.nio.file.attribute.FileAttributeView>
VcreateFileAttributeView(org.uberfire.java.nio.base.GeneralPathImpl path, Class<V> type)voidcreateLink(org.uberfire.java.nio.file.Path link, org.uberfire.java.nio.file.Path existing)voidcreateSymbolicLink(org.uberfire.java.nio.file.Path link, org.uberfire.java.nio.file.Path target, org.uberfire.java.nio.file.attribute.FileAttribute<?>... attrs)voiddelete(org.uberfire.java.nio.file.Path path, org.uberfire.java.nio.file.DeleteOption... options)booleandeleteIfExists(org.uberfire.java.nio.file.Path path, org.uberfire.java.nio.file.DeleteOption... options)voidforceAsDefault()protected org.uberfire.java.nio.file.FileSystemgetDefaultFileSystem()protected org.uberfire.java.nio.file.Path[]getDirectoryContent(org.uberfire.java.nio.file.Path dir)<V extends org.uberfire.java.nio.file.attribute.FileAttributeView>
VgetFileAttributeView(org.uberfire.java.nio.file.Path path, Class<V> type, org.uberfire.java.nio.file.LinkOption... options)org.uberfire.java.nio.file.FileStoregetFileStore(org.uberfire.java.nio.file.Path path)org.uberfire.java.nio.file.FileSystemgetFileSystem(URI uri)org.uberfire.java.nio.file.PathgetPath(URI uri)StringgetScheme()booleanisDefault()booleanisHidden(org.uberfire.java.nio.file.Path path)booleanisSameFile(org.uberfire.java.nio.file.Path path, org.uberfire.java.nio.file.Path path2)voidmove(org.uberfire.java.nio.file.Path source, org.uberfire.java.nio.file.Path target, org.uberfire.java.nio.file.CopyOption... options)org.uberfire.java.nio.channels.AsynchronousFileChannelnewAsynchronousFileChannel(org.uberfire.java.nio.file.Path path, Set<? extends org.uberfire.java.nio.file.OpenOption> options, ExecutorService executor, org.uberfire.java.nio.file.attribute.FileAttribute<?>... attrs)org.uberfire.java.nio.channels.SeekableByteChannelnewByteChannel(org.uberfire.java.nio.file.Path path, Set<? extends org.uberfire.java.nio.file.OpenOption> options, org.uberfire.java.nio.file.attribute.FileAttribute<?>... attrs)org.uberfire.java.nio.file.DirectoryStream<org.uberfire.java.nio.file.Path>newDirectoryStream(org.uberfire.java.nio.file.Path dir, org.uberfire.java.nio.file.DirectoryStream.Filter<org.uberfire.java.nio.file.Path> filter)FileChannelnewFileChannel(org.uberfire.java.nio.file.Path path, Set<? extends org.uberfire.java.nio.file.OpenOption> options, org.uberfire.java.nio.file.attribute.FileAttribute<?>... attrs)org.uberfire.java.nio.file.FileSystemnewFileSystem(URI uri, Map<String,?> env)org.uberfire.java.nio.file.FileSystemnewFileSystem(org.uberfire.java.nio.file.Path path, Map<String,?> env)InputStreamnewInputStream(org.uberfire.java.nio.file.Path path, org.uberfire.java.nio.file.OpenOption... options)OutputStreamnewOutputStream(org.uberfire.java.nio.file.Path path, org.uberfire.java.nio.file.OpenOption... options)<A extends org.uberfire.java.nio.file.attribute.BasicFileAttributes>
AreadAttributes(org.uberfire.java.nio.file.Path path, Class<A> type, org.uberfire.java.nio.file.LinkOption... options)Map<String,Object>readAttributes(org.uberfire.java.nio.file.Path path, String attributes, org.uberfire.java.nio.file.LinkOption... options)org.uberfire.java.nio.file.PathreadSymbolicLink(org.uberfire.java.nio.file.Path link)voidsetAttribute(org.uberfire.java.nio.file.Path path, String attribute, Object value, org.uberfire.java.nio.file.LinkOption... options)protected String[]split(String attribute)protected org.uberfire.java.nio.base.GeneralPathImpltoGeneralPathImpl(org.uberfire.java.nio.file.Path path)
-
-
-
Field Detail
-
fileSystem
protected BaseSimpleFileSystem fileSystem
-
-
Constructor Detail
-
SimpleFileSystemProvider
public SimpleFileSystemProvider()
-
SimpleFileSystemProvider
protected SimpleFileSystemProvider(File[] roots, SimpleFileSystemProvider.OSType osType)
-
-
Method Detail
-
forceAsDefault
public void forceAsDefault()
- Specified by:
forceAsDefaultin interfaceorg.uberfire.java.nio.file.spi.FileSystemProvider
-
isDefault
public boolean isDefault()
- Specified by:
isDefaultin interfaceorg.uberfire.java.nio.file.spi.FileSystemProvider
-
getScheme
public String getScheme()
- Specified by:
getSchemein interfaceorg.uberfire.java.nio.file.spi.FileSystemProvider
-
getFileSystem
public org.uberfire.java.nio.file.FileSystem getFileSystem(URI uri) throws IllegalArgumentException, org.uberfire.java.nio.file.FileSystemNotFoundException, SecurityException
- Specified by:
getFileSystemin interfaceorg.uberfire.java.nio.file.spi.FileSystemProvider- Throws:
IllegalArgumentExceptionorg.uberfire.java.nio.file.FileSystemNotFoundExceptionSecurityException
-
getPath
public org.uberfire.java.nio.file.Path getPath(URI uri) throws IllegalArgumentException, org.uberfire.java.nio.file.FileSystemNotFoundException, SecurityException
- Specified by:
getPathin interfaceorg.uberfire.java.nio.file.spi.FileSystemProvider- Throws:
IllegalArgumentExceptionorg.uberfire.java.nio.file.FileSystemNotFoundExceptionSecurityException
-
newFileSystem
public org.uberfire.java.nio.file.FileSystem newFileSystem(URI uri, Map<String,?> env) throws IllegalArgumentException, org.uberfire.java.nio.IOException, SecurityException, org.uberfire.java.nio.file.FileSystemAlreadyExistsException
- Specified by:
newFileSystemin interfaceorg.uberfire.java.nio.file.spi.FileSystemProvider- Throws:
IllegalArgumentExceptionorg.uberfire.java.nio.IOExceptionSecurityExceptionorg.uberfire.java.nio.file.FileSystemAlreadyExistsException
-
newFileSystem
public org.uberfire.java.nio.file.FileSystem newFileSystem(org.uberfire.java.nio.file.Path path, Map<String,?> env) throws IllegalArgumentException, UnsupportedOperationException, org.uberfire.java.nio.IOException, SecurityException- Specified by:
newFileSystemin interfaceorg.uberfire.java.nio.file.spi.FileSystemProvider- Throws:
IllegalArgumentExceptionUnsupportedOperationExceptionorg.uberfire.java.nio.IOExceptionSecurityException
-
newInputStream
public InputStream newInputStream(org.uberfire.java.nio.file.Path path, org.uberfire.java.nio.file.OpenOption... options) throws IllegalArgumentException, org.uberfire.java.nio.file.NoSuchFileException, org.uberfire.java.nio.IOException, SecurityException
- Specified by:
newInputStreamin interfaceorg.uberfire.java.nio.file.spi.FileSystemProvider- Throws:
IllegalArgumentExceptionorg.uberfire.java.nio.file.NoSuchFileExceptionorg.uberfire.java.nio.IOExceptionSecurityException
-
newOutputStream
public OutputStream newOutputStream(org.uberfire.java.nio.file.Path path, org.uberfire.java.nio.file.OpenOption... options) throws IllegalArgumentException, UnsupportedOperationException, org.uberfire.java.nio.IOException, SecurityException
- Specified by:
newOutputStreamin interfaceorg.uberfire.java.nio.file.spi.FileSystemProvider- Throws:
IllegalArgumentExceptionUnsupportedOperationExceptionorg.uberfire.java.nio.IOExceptionSecurityException
-
newFileChannel
public FileChannel newFileChannel(org.uberfire.java.nio.file.Path path, Set<? extends org.uberfire.java.nio.file.OpenOption> options, org.uberfire.java.nio.file.attribute.FileAttribute<?>... attrs) throws IllegalArgumentException, UnsupportedOperationException, org.uberfire.java.nio.IOException, SecurityException
- Specified by:
newFileChannelin interfaceorg.uberfire.java.nio.file.spi.FileSystemProvider- Throws:
IllegalArgumentExceptionUnsupportedOperationExceptionorg.uberfire.java.nio.IOExceptionSecurityException
-
newAsynchronousFileChannel
public org.uberfire.java.nio.channels.AsynchronousFileChannel newAsynchronousFileChannel(org.uberfire.java.nio.file.Path path, Set<? extends org.uberfire.java.nio.file.OpenOption> options, ExecutorService executor, org.uberfire.java.nio.file.attribute.FileAttribute<?>... attrs) throws IllegalArgumentException, UnsupportedOperationException, org.uberfire.java.nio.IOException, SecurityException- Specified by:
newAsynchronousFileChannelin interfaceorg.uberfire.java.nio.file.spi.FileSystemProvider- Throws:
IllegalArgumentExceptionUnsupportedOperationExceptionorg.uberfire.java.nio.IOExceptionSecurityException
-
newByteChannel
public org.uberfire.java.nio.channels.SeekableByteChannel newByteChannel(org.uberfire.java.nio.file.Path path, Set<? extends org.uberfire.java.nio.file.OpenOption> options, org.uberfire.java.nio.file.attribute.FileAttribute<?>... attrs) throws IllegalArgumentException, UnsupportedOperationException, org.uberfire.java.nio.file.FileAlreadyExistsException, org.uberfire.java.nio.IOException, SecurityException- Specified by:
newByteChannelin interfaceorg.uberfire.java.nio.file.spi.FileSystemProvider- Throws:
IllegalArgumentExceptionUnsupportedOperationExceptionorg.uberfire.java.nio.file.FileAlreadyExistsExceptionorg.uberfire.java.nio.IOExceptionSecurityException
-
createDirectory
public void createDirectory(org.uberfire.java.nio.file.Path dir, org.uberfire.java.nio.file.attribute.FileAttribute<?>... attrs) throws UnsupportedOperationException, org.uberfire.java.nio.file.FileAlreadyExistsException, org.uberfire.java.nio.IOException, SecurityException- Specified by:
createDirectoryin interfaceorg.uberfire.java.nio.file.spi.FileSystemProvider- Throws:
UnsupportedOperationExceptionorg.uberfire.java.nio.file.FileAlreadyExistsExceptionorg.uberfire.java.nio.IOExceptionSecurityException
-
newDirectoryStream
public org.uberfire.java.nio.file.DirectoryStream<org.uberfire.java.nio.file.Path> newDirectoryStream(org.uberfire.java.nio.file.Path dir, org.uberfire.java.nio.file.DirectoryStream.Filter<org.uberfire.java.nio.file.Path> filter) throws org.uberfire.java.nio.file.NotDirectoryException, org.uberfire.java.nio.IOException, SecurityException- Specified by:
newDirectoryStreamin interfaceorg.uberfire.java.nio.file.spi.FileSystemProvider- Throws:
org.uberfire.java.nio.file.NotDirectoryExceptionorg.uberfire.java.nio.IOExceptionSecurityException
-
getDirectoryContent
protected org.uberfire.java.nio.file.Path[] getDirectoryContent(org.uberfire.java.nio.file.Path dir)
-
createSymbolicLink
public void createSymbolicLink(org.uberfire.java.nio.file.Path link, org.uberfire.java.nio.file.Path target, org.uberfire.java.nio.file.attribute.FileAttribute<?>... attrs) throws UnsupportedOperationException, org.uberfire.java.nio.file.FileAlreadyExistsException, org.uberfire.java.nio.IOException, SecurityException- Specified by:
createSymbolicLinkin interfaceorg.uberfire.java.nio.file.spi.FileSystemProvider- Throws:
UnsupportedOperationExceptionorg.uberfire.java.nio.file.FileAlreadyExistsExceptionorg.uberfire.java.nio.IOExceptionSecurityException
-
createLink
public void createLink(org.uberfire.java.nio.file.Path link, org.uberfire.java.nio.file.Path existing) throws UnsupportedOperationException, org.uberfire.java.nio.file.FileAlreadyExistsException, org.uberfire.java.nio.IOException, SecurityException- Specified by:
createLinkin interfaceorg.uberfire.java.nio.file.spi.FileSystemProvider- Throws:
UnsupportedOperationExceptionorg.uberfire.java.nio.file.FileAlreadyExistsExceptionorg.uberfire.java.nio.IOExceptionSecurityException
-
delete
public void delete(org.uberfire.java.nio.file.Path path, org.uberfire.java.nio.file.DeleteOption... options) throws org.uberfire.java.nio.file.NoSuchFileException, org.uberfire.java.nio.file.DirectoryNotEmptyException, org.uberfire.java.nio.IOException, SecurityException- Specified by:
deletein interfaceorg.uberfire.java.nio.file.spi.FileSystemProvider- Throws:
org.uberfire.java.nio.file.NoSuchFileExceptionorg.uberfire.java.nio.file.DirectoryNotEmptyExceptionorg.uberfire.java.nio.IOExceptionSecurityException
-
deleteIfExists
public boolean deleteIfExists(org.uberfire.java.nio.file.Path path, org.uberfire.java.nio.file.DeleteOption... options) throws org.uberfire.java.nio.file.DirectoryNotEmptyException, org.uberfire.java.nio.IOException, SecurityException- Specified by:
deleteIfExistsin interfaceorg.uberfire.java.nio.file.spi.FileSystemProvider- Throws:
org.uberfire.java.nio.file.DirectoryNotEmptyExceptionorg.uberfire.java.nio.IOExceptionSecurityException
-
readSymbolicLink
public org.uberfire.java.nio.file.Path readSymbolicLink(org.uberfire.java.nio.file.Path link) throws UnsupportedOperationException, org.uberfire.java.nio.file.NotLinkException, org.uberfire.java.nio.IOException, SecurityException- Specified by:
readSymbolicLinkin interfaceorg.uberfire.java.nio.file.spi.FileSystemProvider- Throws:
UnsupportedOperationExceptionorg.uberfire.java.nio.file.NotLinkExceptionorg.uberfire.java.nio.IOExceptionSecurityException
-
isSameFile
public boolean isSameFile(org.uberfire.java.nio.file.Path path, org.uberfire.java.nio.file.Path path2) throws org.uberfire.java.nio.IOException, SecurityException- Specified by:
isSameFilein interfaceorg.uberfire.java.nio.file.spi.FileSystemProvider- Throws:
org.uberfire.java.nio.IOExceptionSecurityException
-
isHidden
public boolean isHidden(org.uberfire.java.nio.file.Path path) throws IllegalArgumentException, org.uberfire.java.nio.IOException, SecurityException- Specified by:
isHiddenin interfaceorg.uberfire.java.nio.file.spi.FileSystemProvider- Throws:
IllegalArgumentExceptionorg.uberfire.java.nio.IOExceptionSecurityException
-
checkAccess
public void checkAccess(org.uberfire.java.nio.file.Path path, org.uberfire.java.nio.file.AccessMode... modes) throws UnsupportedOperationException, org.uberfire.java.nio.file.NoSuchFileException, org.uberfire.java.nio.file.AccessDeniedException, org.uberfire.java.nio.IOException, SecurityException- Specified by:
checkAccessin interfaceorg.uberfire.java.nio.file.spi.FileSystemProvider- Throws:
UnsupportedOperationExceptionorg.uberfire.java.nio.file.NoSuchFileExceptionorg.uberfire.java.nio.file.AccessDeniedExceptionorg.uberfire.java.nio.IOExceptionSecurityException
-
getFileStore
public org.uberfire.java.nio.file.FileStore getFileStore(org.uberfire.java.nio.file.Path path) throws org.uberfire.java.nio.IOException, SecurityException- Specified by:
getFileStorein interfaceorg.uberfire.java.nio.file.spi.FileSystemProvider- Throws:
org.uberfire.java.nio.IOExceptionSecurityException
-
getFileAttributeView
public <V extends org.uberfire.java.nio.file.attribute.FileAttributeView> V getFileAttributeView(org.uberfire.java.nio.file.Path path, Class<V> type, org.uberfire.java.nio.file.LinkOption... options) throws org.uberfire.java.nio.file.NoSuchFileException- Specified by:
getFileAttributeViewin interfaceorg.uberfire.java.nio.file.spi.FileSystemProvider- Throws:
org.uberfire.java.nio.file.NoSuchFileException
-
createFileAttributeView
protected <V extends org.uberfire.java.nio.file.attribute.FileAttributeView> V createFileAttributeView(org.uberfire.java.nio.base.GeneralPathImpl path, Class<V> type)
-
readAttributes
public <A extends org.uberfire.java.nio.file.attribute.BasicFileAttributes> A readAttributes(org.uberfire.java.nio.file.Path path, Class<A> type, org.uberfire.java.nio.file.LinkOption... options) throws org.uberfire.java.nio.file.NoSuchFileException, UnsupportedOperationException, org.uberfire.java.nio.IOException, SecurityException- Specified by:
readAttributesin interfaceorg.uberfire.java.nio.file.spi.FileSystemProvider- Throws:
org.uberfire.java.nio.file.NoSuchFileExceptionUnsupportedOperationExceptionorg.uberfire.java.nio.IOExceptionSecurityException
-
readAttributes
public Map<String,Object> readAttributes(org.uberfire.java.nio.file.Path path, String attributes, org.uberfire.java.nio.file.LinkOption... options) throws UnsupportedOperationException, IllegalArgumentException, org.uberfire.java.nio.IOException, SecurityException
- Specified by:
readAttributesin interfaceorg.uberfire.java.nio.file.spi.FileSystemProvider- Throws:
UnsupportedOperationExceptionIllegalArgumentExceptionorg.uberfire.java.nio.IOExceptionSecurityException
-
setAttribute
public void setAttribute(org.uberfire.java.nio.file.Path path, String attribute, Object value, org.uberfire.java.nio.file.LinkOption... options) throws UnsupportedOperationException, IllegalArgumentException, ClassCastException, org.uberfire.java.nio.IOException, SecurityException- Specified by:
setAttributein interfaceorg.uberfire.java.nio.file.spi.FileSystemProvider- Throws:
UnsupportedOperationExceptionIllegalArgumentExceptionClassCastExceptionorg.uberfire.java.nio.IOExceptionSecurityException
-
copy
public void copy(org.uberfire.java.nio.file.Path source, org.uberfire.java.nio.file.Path target, org.uberfire.java.nio.file.CopyOption... options) throws UnsupportedOperationException, org.uberfire.java.nio.file.FileAlreadyExistsException, org.uberfire.java.nio.file.DirectoryNotEmptyException, org.uberfire.java.nio.IOException, SecurityException- Specified by:
copyin interfaceorg.uberfire.java.nio.file.spi.FileSystemProvider- Throws:
UnsupportedOperationExceptionorg.uberfire.java.nio.file.FileAlreadyExistsExceptionorg.uberfire.java.nio.file.DirectoryNotEmptyExceptionorg.uberfire.java.nio.IOExceptionSecurityException
-
move
public void move(org.uberfire.java.nio.file.Path source, org.uberfire.java.nio.file.Path target, org.uberfire.java.nio.file.CopyOption... options) throws org.uberfire.java.nio.file.DirectoryNotEmptyException, org.uberfire.java.nio.file.AtomicMoveNotSupportedException, org.uberfire.java.nio.IOException, SecurityException- Specified by:
movein interfaceorg.uberfire.java.nio.file.spi.FileSystemProvider- Throws:
org.uberfire.java.nio.file.DirectoryNotEmptyExceptionorg.uberfire.java.nio.file.AtomicMoveNotSupportedExceptionorg.uberfire.java.nio.IOExceptionSecurityException
-
getDefaultFileSystem
protected org.uberfire.java.nio.file.FileSystem getDefaultFileSystem()
-
toGeneralPathImpl
protected org.uberfire.java.nio.base.GeneralPathImpl toGeneralPathImpl(org.uberfire.java.nio.file.Path path)
-
checkFileNotExistThenThrow
protected void checkFileNotExistThenThrow(org.uberfire.java.nio.file.Path path, boolean isLink)
-
checkFileExistsThenThrow
protected void checkFileExistsThenThrow(org.uberfire.java.nio.file.Path path)
-
-