Package org.infinispan.persistence.sifs
Class FileProvider
java.lang.Object
org.infinispan.persistence.sifs.FileProvider
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>
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
final class
-
Constructor Summary
ConstructorDescriptionFileProvider
(Path fileDirectory, int openFileLimit, String prefix, int maxFileSize) -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
void
deleteFile
(int fileId) getFile
(int fileId) getFileIfOpen
(int fileId) long
getFileSize
(int file) boolean
hasFiles()
boolean
isLogFile
(int fileId) protected FileChannel
openChannel
(int fileId) protected FileChannel
openChannel
(File file, boolean create, boolean readSharedMeadata) void
stop()
-
Constructor Details
-
FileProvider
-
-
Method Details
-
isLogFile
public boolean isLogFile(int fileId) -
getFileIfOpen
-
getFile
- Throws:
IOException
-
getFileSize
public long getFileSize(int file) -
openChannel
- Throws:
FileNotFoundException
-
openChannel
protected FileChannel openChannel(File file, boolean create, boolean readSharedMeadata) throws FileNotFoundException - Throws:
FileNotFoundException
-
getFileForLog
- Throws:
IOException
-
getFileIterator
-
hasFiles
public boolean hasFiles() -
clear
- Throws:
IOException
-
deleteFile
public void deleteFile(int fileId) -
stop
public void stop()
-