Class SimpleFileSystemProvider

  • All Implemented Interfaces:
    org.uberfire.java.nio.file.spi.FileSystemProvider

    public class SimpleFileSystemProvider
    extends Object
    implements org.uberfire.java.nio.file.spi.FileSystemProvider
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void checkAccess​(org.uberfire.java.nio.file.Path path, org.uberfire.java.nio.file.AccessMode... modes)  
      protected void checkFileExistsThenThrow​(org.uberfire.java.nio.file.Path path)  
      protected void checkFileNotExistThenThrow​(org.uberfire.java.nio.file.Path path, boolean isLink)  
      void copy​(org.uberfire.java.nio.file.Path source, org.uberfire.java.nio.file.Path target, org.uberfire.java.nio.file.CopyOption... options)  
      void createDirectory​(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>
      V
      createFileAttributeView​(org.uberfire.java.nio.base.GeneralPathImpl path, Class<V> type)  
      void createLink​(org.uberfire.java.nio.file.Path link, org.uberfire.java.nio.file.Path existing)  
      void createSymbolicLink​(org.uberfire.java.nio.file.Path link, org.uberfire.java.nio.file.Path target, org.uberfire.java.nio.file.attribute.FileAttribute<?>... attrs)  
      void delete​(org.uberfire.java.nio.file.Path path, org.uberfire.java.nio.file.DeleteOption... options)  
      boolean deleteIfExists​(org.uberfire.java.nio.file.Path path, org.uberfire.java.nio.file.DeleteOption... options)  
      void forceAsDefault()  
      protected org.uberfire.java.nio.file.FileSystem getDefaultFileSystem()  
      protected org.uberfire.java.nio.file.Path[] getDirectoryContent​(org.uberfire.java.nio.file.Path dir)  
      <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)  
      org.uberfire.java.nio.file.FileStore getFileStore​(org.uberfire.java.nio.file.Path path)  
      org.uberfire.java.nio.file.FileSystem getFileSystem​(URI uri)  
      org.uberfire.java.nio.file.Path getPath​(URI uri)  
      String getScheme()  
      boolean isDefault()  
      boolean isHidden​(org.uberfire.java.nio.file.Path path)  
      boolean isSameFile​(org.uberfire.java.nio.file.Path path, org.uberfire.java.nio.file.Path path2)  
      void move​(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.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)  
      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)  
      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)  
      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)  
      org.uberfire.java.nio.file.FileSystem newFileSystem​(URI uri, Map<String,​?> env)  
      org.uberfire.java.nio.file.FileSystem newFileSystem​(org.uberfire.java.nio.file.Path path, Map<String,​?> env)  
      InputStream newInputStream​(org.uberfire.java.nio.file.Path path, org.uberfire.java.nio.file.OpenOption... options)  
      OutputStream newOutputStream​(org.uberfire.java.nio.file.Path path, org.uberfire.java.nio.file.OpenOption... options)  
      <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)  
      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.Path readSymbolicLink​(org.uberfire.java.nio.file.Path link)  
      void setAttribute​(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.GeneralPathImpl toGeneralPathImpl​(org.uberfire.java.nio.file.Path path)  
    • Constructor Detail

      • SimpleFileSystemProvider

        public SimpleFileSystemProvider()
    • Method Detail

      • forceAsDefault

        public void forceAsDefault()
        Specified by:
        forceAsDefault in interface org.uberfire.java.nio.file.spi.FileSystemProvider
      • isDefault

        public boolean isDefault()
        Specified by:
        isDefault in interface org.uberfire.java.nio.file.spi.FileSystemProvider
      • getScheme

        public String getScheme()
        Specified by:
        getScheme in interface org.uberfire.java.nio.file.spi.FileSystemProvider
      • 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:
        newFileSystem in interface org.uberfire.java.nio.file.spi.FileSystemProvider
        Throws:
        IllegalArgumentException
        org.uberfire.java.nio.IOException
        SecurityException
        org.uberfire.java.nio.file.FileSystemAlreadyExistsException
      • 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:
        newInputStream in interface org.uberfire.java.nio.file.spi.FileSystemProvider
        Throws:
        IllegalArgumentException
        org.uberfire.java.nio.file.NoSuchFileException
        org.uberfire.java.nio.IOException
        SecurityException
      • 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:
        createDirectory in interface org.uberfire.java.nio.file.spi.FileSystemProvider
        Throws:
        UnsupportedOperationException
        org.uberfire.java.nio.file.FileAlreadyExistsException
        org.uberfire.java.nio.IOException
        SecurityException
      • 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:
        newDirectoryStream in interface org.uberfire.java.nio.file.spi.FileSystemProvider
        Throws:
        org.uberfire.java.nio.file.NotDirectoryException
        org.uberfire.java.nio.IOException
        SecurityException
      • 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:
        createSymbolicLink in interface org.uberfire.java.nio.file.spi.FileSystemProvider
        Throws:
        UnsupportedOperationException
        org.uberfire.java.nio.file.FileAlreadyExistsException
        org.uberfire.java.nio.IOException
        SecurityException
      • 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:
        createLink in interface org.uberfire.java.nio.file.spi.FileSystemProvider
        Throws:
        UnsupportedOperationException
        org.uberfire.java.nio.file.FileAlreadyExistsException
        org.uberfire.java.nio.IOException
        SecurityException
      • 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:
        delete in interface org.uberfire.java.nio.file.spi.FileSystemProvider
        Throws:
        org.uberfire.java.nio.file.NoSuchFileException
        org.uberfire.java.nio.file.DirectoryNotEmptyException
        org.uberfire.java.nio.IOException
        SecurityException
      • 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:
        deleteIfExists in interface org.uberfire.java.nio.file.spi.FileSystemProvider
        Throws:
        org.uberfire.java.nio.file.DirectoryNotEmptyException
        org.uberfire.java.nio.IOException
        SecurityException
      • 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:
        readSymbolicLink in interface org.uberfire.java.nio.file.spi.FileSystemProvider
        Throws:
        UnsupportedOperationException
        org.uberfire.java.nio.file.NotLinkException
        org.uberfire.java.nio.IOException
        SecurityException
      • 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:
        isSameFile in interface org.uberfire.java.nio.file.spi.FileSystemProvider
        Throws:
        org.uberfire.java.nio.IOException
        SecurityException
      • 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:
        checkAccess in interface org.uberfire.java.nio.file.spi.FileSystemProvider
        Throws:
        UnsupportedOperationException
        org.uberfire.java.nio.file.NoSuchFileException
        org.uberfire.java.nio.file.AccessDeniedException
        org.uberfire.java.nio.IOException
        SecurityException
      • 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:
        getFileStore in interface org.uberfire.java.nio.file.spi.FileSystemProvider
        Throws:
        org.uberfire.java.nio.IOException
        SecurityException
      • 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:
        getFileAttributeView in interface org.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:
        readAttributes in interface org.uberfire.java.nio.file.spi.FileSystemProvider
        Throws:
        org.uberfire.java.nio.file.NoSuchFileException
        UnsupportedOperationException
        org.uberfire.java.nio.IOException
        SecurityException
      • 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:
        copy in interface org.uberfire.java.nio.file.spi.FileSystemProvider
        Throws:
        UnsupportedOperationException
        org.uberfire.java.nio.file.FileAlreadyExistsException
        org.uberfire.java.nio.file.DirectoryNotEmptyException
        org.uberfire.java.nio.IOException
        SecurityException
      • 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:
        move in interface org.uberfire.java.nio.file.spi.FileSystemProvider
        Throws:
        org.uberfire.java.nio.file.DirectoryNotEmptyException
        org.uberfire.java.nio.file.AtomicMoveNotSupportedException
        org.uberfire.java.nio.IOException
        SecurityException
      • 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)