Interface ISynchronizedFileSystem<FD>
- Type Parameters:
FD- The type of the file descriptor.
- All Superinterfaces:
AutoCloseable, ICommonFileSystem<FD>
A
file system that is synchronized. Provides a few additional method related to
synchronization.
All operations are thread-safe and atomic. However, executing multiple operations in sequence is not atomic. You
need to apply the appropriate synchronization yourself if you need to ensure atomicity across multiple operations.
You can do so by acquiring a lock using one of the lock methods.
- Since:
- 8.3.0
- Author:
- XIMA MEDIA GmbH
-
Method Summary
Modifier and TypeMethodDescriptionLocks access to the specified file.Locks access to the specified files.Locks access to the specified files.lockAll()Locks access to the entire file system.Methods inherited from interface AutoCloseable
closeMethods inherited from interface ICommonFileSystem
copy, delete, exists, getFileLastModifiedAt, getFileLastModifiedBy, getFiles, getFileSize, hasPendingChanges, isOpen, listFolder, listFolderRecursively, makeFile, makeFolder, openFileInput, openFileInputMarkable, openFileOutput, refresh, refresh, rename, unwrap
-
Method Details
-
lock
Locks access to the specified file. The lock is released when the returnedAutoCloseableis closed. Until the lock is released, no other thread can access the file.- Parameters:
file- The file to lock.- Returns:
- An
AutoCloseablethat releases the lock when closed.
-
lock
Locks access to the specified files. The lock is released when the returnedAutoCloseableis closed. Until the lock is released, no other thread can access the files.- Parameters:
files- The files to lock.- Returns:
- An
AutoCloseablethat releases the lock when closed.
-
lock
Locks access to the specified files. The lock is released when the returnedAutoCloseableis closed. Until the lock is released, no other thread can access the files.- Parameters:
files- The files to lock.- Returns:
- An
AutoCloseablethat releases the lock when closed.
-
lockAll
QuietAutoCloseable lockAll()Locks access to the entire file system. The lock is released when the returnedAutoCloseableis closed. Until the lock is released, no other thread can access the file system.- Returns:
- An
AutoCloseablethat releases the lock when closed.
-