ModelFileSystemManager class

Unified file system operations for model management (Mobile only)

This class delegates filename utilities to FileNameUtils for platform-agnostic string operations, and provides mobile-specific file system operations.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

extensionRegexPattern String
Creates regex pattern for matching extensions (delegates to FileNameUtils)
no setter

Static Methods

cleanupFailedDownload(ModelSpec spec) Future<void>
Cleans up failed download files for a model specification
cleanupOrphanedFiles({required List<String> protectedFiles, List<String>? supportedExtensions, bool enableResumeDetection = true}) Future<int>
Cleans up orphaned files
deleteModelFile(String filename) Future<void>
Safely deletes a model file
ensureDirectoryExists(String dirPath) Future<void>
Ensures a directory exists, creating it if necessary
getBaseName(String filename) String
Removes all supported extensions from filename (delegates to FileNameUtils)
getCorrectedPath(String originalPath, String filename) String
Corrects Android path from /data/user/0/ to /data/data/ for proper file access
getFileSize(String filePath) Future<int>
Gets file size in bytes, returns 0 if file doesn't exist
getMinimumSize(String extension) int
Gets minimum file size based on extension (delegates to FileNameUtils)
getModelFilePath(String filename) Future<String>
Gets the full file path for a model file with Android path correction
getOrphanedFiles({List<String>? protectedFiles, List<String>? supportedExtensions}) Future<List<OrphanedFileInfo>>
Get information about orphaned files without deleting them
getStorageInfo({List<String>? protectedFiles}) Future<StorageStats>
Get storage statistics
isFileValid(String filePath, {int minSizeBytes = _defaultMinSizeBytes}) Future<bool>
Validates if a file exists and meets minimum size requirements
isSmallFile(String extension) bool
Checks if file extension requires smaller minimum size (delegates to FileNameUtils)
validateModelFiles(ModelSpec spec) Future<bool>
Validates all files in a model specification

Constants

smallFileExtensions → const List<String>
Small file extensions (configs, tokenizers) - use smaller minimum size
supportedExtensions → const List<String>
Supported model file extensions (delegates to FileNameUtils)