AbstractDownloader class abstract
Abstract base class for downloading Minecraft game assets and libraries.
Provides common functionality for downloading files, managing directories, and reporting progress during download operations.
- Implementers
Constructors
- AbstractDownloader.new({required String gameDir, DownloadProgressCallback? onDownloadProgress, OperationProgressCallback? onOperationProgress, int progressReportRate = 10})
- Creates a new downloader instance.
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
-
downloadFile(
String url, String filePath, {int? expectedSize, String? resourceName}) → Future< File> - Downloads a file from a URL to a specified path.
-
ensureDirectory(
String path) → Future< Directory> - Ensures a directory exists, creating it if necessary.
-
getAssetsDir(
) → String - Gets the directory for storing game assets.
-
getGameDir(
) → String - Gets the base game directory.
-
getLibrariesDir(
) → String - Gets the directory for storing game libraries.
-
normalizePath(
String path) → String - Normalizes a file path to an absolute path with correct separators.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
reportOperationProgress(
String operationName, int completed, int total, double percentage) → void - Reports progress of a batch operation.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited