Class FileProvider


  • public class FileProvider
    extends java.lang.Object
    Provides resource management for files - only limited amount of files may be opened in one moment, and opened file should not be deleted. Also allows to generate file indexes.
    Author:
    Radim Vansa <rvansa@redhat.com>
    • Constructor Detail

      • FileProvider

        public FileProvider​(java.nio.file.Path dataDir,
                            int openFileLimit)
    • Method Detail

      • getFile

        public FileProvider.Handle getFile​(int fileId)
                                    throws java.io.IOException
        Throws:
        java.io.IOException
      • getFileSize

        public long getFileSize​(int file)
      • openChannel

        protected java.nio.channels.FileChannel openChannel​(int fileId)
                                                     throws java.io.FileNotFoundException
        Throws:
        java.io.FileNotFoundException
      • getFileForLog

        public FileProvider.Log getFileForLog()
                                       throws java.io.IOException
        Throws:
        java.io.IOException
      • clear

        public void clear()
                   throws java.io.IOException
        Throws:
        java.io.IOException
      • deleteFile

        public void deleteFile​(int fileId)
      • stop

        public void stop()