Class UploadManager
java.lang.Object
com.wontlost.ckeditor.internal.UploadManager
Internal class for managing file uploads.
Handles upload queuing, progress tracking, and result callbacks with thread safety.
This class is an internal API and should not be used directly by external code.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceUpload result callback interfacestatic enumUpload task statusstatic classUpload task information -
Constructor Summary
ConstructorsConstructorDescriptionUploadManager(UploadHandler uploadHandler, UploadHandler.UploadConfig uploadConfig, UploadManager.UploadResultCallback resultCallback) Create an upload manager with default timeoutUploadManager(UploadHandler uploadHandler, UploadHandler.UploadConfig uploadConfig, UploadManager.UploadResultCallback resultCallback, long uploadTimeoutSeconds) Create an upload manager with custom timeout -
Method Summary
Modifier and TypeMethodDescriptionbooleancancelUpload(String uploadId) Cancel an upload taskvoidcleanup()Clean up all pending upload tasksintGet the number of active uploadsgetUploadTask(String uploadId) Get upload task statusvoidhandleUpload(String uploadId, String fileName, String mimeType, String base64Data) Handle a file upload requestbooleanCheck whether there are any active uploads
-
Constructor Details
-
UploadManager
public UploadManager(UploadHandler uploadHandler, UploadHandler.UploadConfig uploadConfig, UploadManager.UploadResultCallback resultCallback) Create an upload manager with default timeout- Parameters:
uploadHandler- upload handleruploadConfig- upload configuration, uses default if nullresultCallback- result callback
-
UploadManager
public UploadManager(UploadHandler uploadHandler, UploadHandler.UploadConfig uploadConfig, UploadManager.UploadResultCallback resultCallback, long uploadTimeoutSeconds) Create an upload manager with custom timeout- Parameters:
uploadHandler- upload handleruploadConfig- upload configuration, uses default if nullresultCallback- result callbackuploadTimeoutSeconds- upload timeout in seconds, 0 means no timeout
-
-
Method Details
-
handleUpload
-
cancelUpload
Cancel an upload task- Parameters:
uploadId- upload ID- Returns:
- whether the cancellation succeeded
-
getActiveUploadCount
public int getActiveUploadCount()Get the number of active uploads- Returns:
- active upload task count
-
hasActiveUploads
public boolean hasActiveUploads()Check whether there are any active uploads- Returns:
- true if there are active uploads
-
getUploadTask
Get upload task status- Parameters:
uploadId- upload ID- Returns:
- upload task, or null if not found
-
cleanup
public void cleanup()Clean up all pending upload tasks
-