Package io.guise.framework.platform.web
Class WebPlatformFile
java.lang.Object
io.guise.framework.platform.AbstractPlatformFile
io.guise.framework.platform.web.WebPlatformFile
- All Implemented Interfaces:
ProgressListenable<Long>
,PlatformFile
A local file represented by a Flash
flash.net.FileReference
on the web platform. Because Flash registers progress listeners on a per-file basis,
this file keeps track of a single listener, available only to web classes (as other upload implementations may not register listeners for individual files).- Author:
- Garret Wilson
-
Constructor Summary
ConstructorDescriptionWebPlatformFile
(PlatformFileCollector fileReferenceList, String id, String name, long size) File reference list, name and size constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
cancel()
Cancels the current upload or download.protected void
fireProgressed
(com.globalmentor.model.TaskState state, long transferred, long total) Fires a progress event to all registered progress listeners.getID()
protected PlatformFileCollector
void
Uploads the file from the platform.Methods inherited from class io.guise.framework.platform.AbstractPlatformFile
addProgressListener, fireProgressed, getEventListenerManager, getName, getSize, removeProgressListener, toString
-
Constructor Details
-
WebPlatformFile
File reference list, name and size constructor.- Parameters:
fileReferenceList
- The Flash file reference list that owns this platform file.id
- The ID given to the file by Flash.name
- The name of the file.size
- The size of the file, or -1 if the size is unknown.- Throws:
NullPointerException
- if the given ID, file reference list, and/or name isnull
.
-
-
Method Details
-
getPlatformFileCollector
- Returns:
- The platform file collector that owns this platform file.
-
getID
- Returns:
- The ID given to the file by Flash.
-
upload
Description copied from interface:PlatformFile
Uploads the file from the platform.- Parameters:
destinationURI
- The URI representing the destination of the platform file, either absolute or relative to the application.
-
cancel
public void cancel()Description copied from interface:PlatformFile
Cancels the current upload or download. -
fireProgressed
protected void fireProgressed(com.globalmentor.model.TaskState state, long transferred, long total) Description copied from class:AbstractPlatformFile
Fires a progress event to all registered progress listeners. This method delegates toAbstractPlatformFile.fireProgressed(ProgressEvent)
.- Overrides:
fireProgressed
in classAbstractPlatformFile
- Parameters:
state
- The state of the progress.transferred
- The current number of bytes transferred, or-1
if not known.total
- The total or estimated total bytes to transfer, or-1
if not known.- See Also:
-