Class WebPlatformFile

  • All Implemented Interfaces:
    ProgressListenable<java.lang.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 Detail

      • WebPlatformFile

        public WebPlatformFile​(PlatformFileCollector fileReferenceList,
                               java.lang.String id,
                               java.lang.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:
        java.lang.NullPointerException - if the given ID, file reference list, and/or name is null.
    • Method Detail

      • getPlatformFileCollector

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

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

        public void upload​(java.net.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.