Class AbstractDownloadTask<T>

    • Constructor Detail

    • Method Detail

      • isCanceled

        public boolean isCanceled()
        Determines if the download task has been canceled.
        Returns:
        true if the download task has been canceled
      • setCanceled

        public void setCanceled​(boolean canceled)
        Marks this download task as canceled.
        Parameters:
        canceled - true to mark this download task as canceled
      • isFailed

        public boolean isFailed()
        Determines if the download task has failed.
        Returns:
        true if the download task has failed
      • setFailed

        public void setFailed​(boolean failed)
        Marks this download task as failed.
        Parameters:
        failed - true to mark this download task as failed
      • getDownloadedData

        public final T getDownloadedData()
        Replies the downloaded data.
        Returns:
        The downloaded data.
      • setZoomAfterDownload

        public final void setZoomAfterDownload​(boolean zoomAfterDownload)
        Description copied from interface: DownloadTask
        Sets whether the map view will zoom to download area after download
        Specified by:
        setZoomAfterDownload in interface DownloadTask
        Parameters:
        zoomAfterDownload - if true, the map view will zoom to download area after download
      • acceptsUrl

        public boolean acceptsUrl​(String url)
        Determines if the given URL is accepted by getPatterns(). Can be overridden for more complex checking logic.
        Parameters:
        url - URL to download
        Returns:
        true if this URL is accepted
      • isSafeForRemotecontrolRequests

        public boolean isSafeForRemotecontrolRequests()
        Check / decide if the task is safe for remotecontrol. Keep in mind that a potential attacker has full control over the content of the file that will be downloaded. If it is possible to run arbitrary code or write to the local file system, then the task is (obviously) not save for remote execution. The default value is false = unsafe. Override in a subclass to allow running the task via remotecontol.
        Returns:
        true if it is safe to download and open any file of the corresponding format, false otherwise
      • acceptsUrl

        public boolean acceptsUrl​(String url,
                                  boolean isRemotecontrol)
        Description copied from interface: DownloadTask
        Returns true if the task is able to open the given URL, false otherwise.
        Specified by:
        acceptsUrl in interface DownloadTask
        Parameters:
        url - the url to download from
        isRemotecontrol - True if download request comes from remotecontrol.
        Returns:
        True if the task is able to open the given URL, false otherwise. Return false, if the request comes from remotecontrol, but the task is not safe for remotecontrol. A task is not safe for remotecontrol if it is possible to prepare a file for download which does something unintended, e.g. gain access to the local file system.