Class BADownloadManager

  • All Implemented Interfaces:
    NSObject

    public class BADownloadManager
    extends NSObject
    API-Since: 16.1
    • Constructor Detail

      • BADownloadManager

        protected BADownloadManager​(org.moe.natj.general.Pointer peer)
    • Method Detail

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • allocWithZone

        public static BADownloadManager allocWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
      • automaticallyNotifiesObserversForKey

        public static boolean automaticallyNotifiesObserversForKey​(@NotNull
                                                                   @NotNull java.lang.String key)
      • cancelDownloadError

        public boolean cancelDownloadError​(@NotNull
                                           @NotNull BADownload download,
                                           @Nullable
                                           @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)
        Cancels a download. Attempts to cancel a BADownload. If the download has not been schduled or has already completed, NO is returned along with a NSError set to BAErrorDomain : BAErrorCodeDownloadNotScheduled.
        Returns:
        YES if the download is canceled. NO if the download could not be canceled, @c error will be set with a reason why. API-Since: 16.1
      • cancelPreviousPerformRequestsWithTarget

        public static void cancelPreviousPerformRequestsWithTarget​(@NotNull
                                                                   @NotNull java.lang.Object aTarget)
      • cancelPreviousPerformRequestsWithTargetSelectorObject

        public static void cancelPreviousPerformRequestsWithTargetSelectorObject​(@NotNull
                                                                                 @NotNull java.lang.Object aTarget,
                                                                                 @NotNull
                                                                                 @NotNull org.moe.natj.objc.SEL aSelector,
                                                                                 @Nullable
                                                                                 @Nullable java.lang.Object anArgument)
      • classFallbacksForKeyedArchiver

        @NotNull
        public static @NotNull NSArray<java.lang.String> classFallbacksForKeyedArchiver()
      • classForKeyedUnarchiver

        @NotNull
        public static @NotNull org.moe.natj.objc.Class classForKeyedUnarchiver()
      • debugDescription_static

        public static java.lang.String debugDescription_static()
      • delegate

        @Nullable
        public @Nullable BADownloadManagerDelegate delegate()
        A object confroming to BADownloadManagerDelegate to get notified when actions occur. API-Since: 16.1
      • description_static

        public static java.lang.String description_static()
      • fetchCurrentDownloads

        @Nullable
        public @Nullable NSArray<? extends BADownload> fetchCurrentDownloads​(@Nullable
                                                                             @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)
        Fetches current downloads. Fetches the current list of scheduled or in-flight downloads queued by your application or extension. [@warning] This method can block and should not be called from the main thread.
        Parameters:
        error - An error representing why the downloads could not be fetched.
        Returns:
        On success, returns a list of scheduled or in-flight downloads. On failure, returns nil and sets @c error.
      • fetchCurrentDownloadsWithCompletionHandler

        public void fetchCurrentDownloadsWithCompletionHandler​(@NotNull
                                                               @NotNull BADownloadManager.Block_fetchCurrentDownloadsWithCompletionHandler completionHandler)
        Fetches current downloads. Fetches the current list of scheduled or in-flight downloads queued by your application or extension.
        Parameters:
        completionHandler - A block to recieve the currently scheduled or in-flight downloads. The block is called on the same queue as all the other completion blocks in the class. API-Since: 16.1
      • hash_static

        public static long hash_static()
      • instanceMethodSignatureForSelector

        public static NSMethodSignature instanceMethodSignatureForSelector​(org.moe.natj.objc.SEL aSelector)
      • instancesRespondToSelector

        public static boolean instancesRespondToSelector​(org.moe.natj.objc.SEL aSelector)
      • isSubclassOfClass

        public static boolean isSubclassOfClass​(org.moe.natj.objc.Class aClass)
      • keyPathsForValuesAffectingValueForKey

        @NotNull
        public static @NotNull NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey​(@NotNull
                                                                                             @NotNull java.lang.String key)
      • performWithExclusiveControl

        public void performWithExclusiveControl​(@NotNull
                                                @NotNull BADownloadManager.Block_performWithExclusiveControl performHandler)
        Acquires exclusive access to the BADownloadManager across the app and application extension. Acquires exclusive access to the BADownloadManager across the app and application extension. This ensures that your extension and app do not perform operations at the same time. Both the extension and app must use this API to ensure exclusive access.
        Parameters:
        performHandler - A block that will be executed once exclusive control is acquired. If an error is non-nil then a problem occurred acquiring exclusive access. API-Since: 16.1
      • performWithExclusiveControlBeforeDatePerformHandler

        public void performWithExclusiveControlBeforeDatePerformHandler​(@NotNull
                                                                        @NotNull NSDate date,
                                                                        @NotNull
                                                                        @NotNull BADownloadManager.Block_performWithExclusiveControlBeforeDatePerformHandler performHandler)
        Acquires exclusive access to the BADownloadManager across the app and application extension. Acquires exclusive access to the BADownloadManager across the app and application extension. This ensures that your extension and app do not perform operations at the same time. Both the extension and app must use this API to ensure exclusive access.
        Parameters:
        date - A date by which you want exclusive control acquired. If you pass +[NSDate date], control will attempt to be acquired and if it can not be, it will fail instantly.
        performHandler - A block that will be executed once exclusive control is acquired. If an error is non-nil then a problem occurred acquiring exclusive access. API-Since: 16.1
      • resolveClassMethod

        public static boolean resolveClassMethod​(org.moe.natj.objc.SEL sel)
      • resolveInstanceMethod

        public static boolean resolveInstanceMethod​(org.moe.natj.objc.SEL sel)
      • scheduleDownloadError

        public boolean scheduleDownloadError​(@NotNull
                                             @NotNull BADownload download,
                                             @Nullable
                                             @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)
        Schedules a background download. Specifies a download to schedule at a given priority. The download will automatically start at the discretion of the system.
        Parameters:
        download - A BADownload object representing a URL to be downloaded.
        error - A NSError representing why the BADownload could not be scheduled.
        Returns:
        YES if @c download was scheduled. NO and @c error set if the download could not be scheduled. API-Since: 16.1
      • setDelegate_unsafe

        public void setDelegate_unsafe​(@Nullable
                                       @Nullable BADownloadManagerDelegate value)
        A object confroming to BADownloadManagerDelegate to get notified when actions occur. API-Since: 16.1
      • setDelegate

        public void setDelegate​(@Nullable
                                @Nullable BADownloadManagerDelegate value)
        A object confroming to BADownloadManagerDelegate to get notified when actions occur. API-Since: 16.1
      • setVersion_static

        public static void setVersion_static​(long aVersion)
      • sharedManager

        @NotNull
        public static @NotNull BADownloadManager sharedManager()
        Gets the singleton downloader object. API-Since: 16.1
      • startForegroundDownloadError

        public boolean startForegroundDownloadError​(@NotNull
                                                    @NotNull BADownload download,
                                                    @Nullable
                                                    @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)
        Attempts to schedule a BADownload in foreground mode. Attempts to schedule a BADownload in foreground mode. This download will start (if it has not been started) immediately regrardlesss of battery or network status. The download will remain in this foreground until the download manager is disconnected. This API only functions if the download manager is created in the application and not the download extension. If this API is called from the download extension, NO will be returned along with a NSError with the settings BAErrorDomain : BAErrorCodeCallFromExtensionNotAllowed. If this API is called from a app while it is in the background, NO will be returned along with a NSError with the settings BAErrorDomain : BAErrorCodeCallFromInactiveProcessNotAllowed. API-Since: 16.1
      • superclass_static

        public static org.moe.natj.objc.Class superclass_static()
      • useStoredAccessor

        @Deprecated
        public static boolean useStoredAccessor()
        Deprecated.
      • version_static

        public static long version_static()