Package org.codelibs.fess.thumbnail
Class ThumbnailManager.FilePurgeVisitor
java.lang.Object
org.codelibs.fess.thumbnail.ThumbnailManager.FilePurgeVisitor
- All Implemented Interfaces:
FileVisitor<Path>
- Enclosing class:
ThumbnailManager
protected static class ThumbnailManager.FilePurgeVisitor
extends Object
implements FileVisitor<Path>
File visitor for purging old thumbnail files.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final PathBase path for thumbnail storage.protected longCount of processed files.List of files marked for deletion.protected final longExpiry time threshold for file deletion.protected final org.codelibs.fess.mylasta.direction.FessConfigFess configuration for settings.protected final StringImage file extension for filtering.protected final intMaximum number of files to purge in a single operation.protected final SearchEngineClientOpenSearch client for document validation. -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddeleteFile(Path path) Deletes a single file and any empty parent directories.protected voidDeletes files marked for deletion after checking if they exist in the search index.longgetCount()Gets the count of processed files.protected StringExtracts the document ID from a file path.postVisitDirectory(Path dir, IOException e) preVisitDirectory(Path dir, BasicFileAttributes attrs) visitFile(Path file, BasicFileAttributes attrs) visitFileFailed(Path file, IOException e)
-
Field Details
-
expiry
protected final long expiryExpiry time threshold for file deletion. -
count
protected long countCount of processed files. -
maxPurgeSize
protected final int maxPurgeSizeMaximum number of files to purge in a single operation. -
deletedFileList
List of files marked for deletion. -
basePath
Base path for thumbnail storage. -
imageExtention
Image file extension for filtering. -
searchEngineClient
OpenSearch client for document validation. -
fessConfig
protected final org.codelibs.fess.mylasta.direction.FessConfig fessConfigFess configuration for settings.
-
-
Method Details
-
deleteFiles
protected void deleteFiles()Deletes files marked for deletion after checking if they exist in the search index. -
deleteFile
Deletes a single file and any empty parent directories.- Parameters:
path- the file path to delete
-
getDocId
Extracts the document ID from a file path.- Parameters:
file- the file path- Returns:
- the extracted document ID
-
getCount
public long getCount()Gets the count of processed files.- Returns:
- the number of files processed
-
preVisitDirectory
- Specified by:
preVisitDirectoryin interfaceFileVisitor<Path>- Throws:
IOException
-
visitFile
- Specified by:
visitFilein interfaceFileVisitor<Path>- Throws:
IOException
-
visitFileFailed
- Specified by:
visitFileFailedin interfaceFileVisitor<Path>- Throws:
IOException
-
postVisitDirectory
- Specified by:
postVisitDirectoryin interfaceFileVisitor<Path>- Throws:
IOException
-