java.lang.Object
org.eclipse.jgit.util.FS.FileStoreAttributes
- Enclosing class:
- FS
Attributes of FileStores on this system
- Since:
- 5.1.9
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final FS.FileStoreAttributes
Fallback FileStore attributes used when we can't measure the filesystem timestamp resolution.static final Duration
Fallback filesystem timestamp resolution. -
Constructor Summary
ConstructorsConstructorDescriptionFileStoreAttributes
(Duration fsTimestampResolution) Construct a FileStoreAttributeCache entry for the given filesystem timestamp resolution -
Method Summary
Modifier and TypeMethodDescriptionstatic void
configureAttributesPathCache
(int maxSize, float purgeFactor) Configures size and purge factor of the path-based cache for file system attributes.static FS.FileStoreAttributes
Get the FileStoreAttributes for the given FileStoreGet the measured filesystem timestamp resolutionGet the minimal racy intervalstatic void
setBackground
(boolean async) Whether FileStore attributes should be determined asynchronouslytoString()
-
Field Details
-
FALLBACK_TIMESTAMP_RESOLUTION
Fallback filesystem timestamp resolution. The worst case timestamp resolution on FAT filesystems is 2 seconds.Must be at least 1 second.
-
FALLBACK_FILESTORE_ATTRIBUTES
Fallback FileStore attributes used when we can't measure the filesystem timestamp resolution. The last modified time granularity of FAT filesystems is 2 seconds.
-
-
Constructor Details
-
FileStoreAttributes
Construct a FileStoreAttributeCache entry for the given filesystem timestamp resolution- Parameters:
fsTimestampResolution
- resolution of filesystem timestamps
-
-
Method Details
-
setBackground
public static void setBackground(boolean async) Whether FileStore attributes should be determined asynchronously- Parameters:
async
- whether FileStore attributes should be determined asynchronously. If false access to cached attributes may block for some seconds for the first call per FileStore- Since:
- 5.6.2
-
configureAttributesPathCache
public static void configureAttributesPathCache(int maxSize, float purgeFactor) Configures size and purge factor of the path-based cache for file system attributes. Caching of file system attributes avoids recurring lookup of @{code FileStore} of files which may be expensive on some platforms.- Parameters:
maxSize
- maximum size of the cache, default is 100purgeFactor
- when the size of the map reaches maxSize the oldest entries will be purged to free up some space for new entries,purgeFactor
is the fraction ofmaxSize
to purge when this happens- Since:
- 5.1.9
-
get
Get the FileStoreAttributes for the given FileStore- Parameters:
path
- file residing in the FileStore to get attributes for- Returns:
- FileStoreAttributes for the given path.
-
getMinimalRacyInterval
Get the minimal racy interval- Returns:
- the measured minimal interval after a file has been modified in which we cannot rely on lastModified to detect modifications
-
getFsTimestampResolution
Get the measured filesystem timestamp resolution- Returns:
- the measured filesystem timestamp resolution
-
toString
-