Class WebPlatformFile

java.lang.Object
io.guise.framework.platform.AbstractPlatformFile
io.guise.framework.platform.web.WebPlatformFile
All Implemented Interfaces:
ProgressListenable<Long>, PlatformFile

public class WebPlatformFile extends AbstractPlatformFile
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 Details

    • WebPlatformFile

      public WebPlatformFile(PlatformFileCollector fileReferenceList, String id, String name, long size)
      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 is null.
  • Method Details

    • getPlatformFileCollector

      protected PlatformFileCollector getPlatformFileCollector()
      Returns:
      The platform file collector that owns this platform file.
    • getID

      public String getID()
      Returns:
      The ID given to the file by Flash.
    • upload

      public void upload(URI destinationURI)
      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 to AbstractPlatformFile.fireProgressed(ProgressEvent).
      Overrides:
      fireProgressed in class AbstractPlatformFile
      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: