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
Nested ClassesModifier and TypeClassDescriptionstatic final classfinal class -
Constructor Summary
ConstructorsConstructorDescriptionFileProvider(Path fileDirectory, int openFileLimit, String prefix, int maxFileSize) -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()voiddeleteFile(int fileId) getFile(int fileId) getFileIfOpen(int fileId) longgetFileSize(int file) booleanhasFiles()booleanisLogFile(int fileId) protected FileChannelopenChannel(int fileId) protected FileChannelopenChannel(File file, boolean create, boolean readSharedMeadata) voidstop()
-
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()
-