Class NSURLCache

    • Constructor Detail

      • NSURLCache

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

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • allocWithZone

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

        public static boolean automaticallyNotifiesObserversForKey​(java.lang.String key)
      • cancelPreviousPerformRequestsWithTarget

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

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

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

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

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

        public static java.lang.String description_static()
      • 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

        public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey​(java.lang.String key)
      • new_objc

        public static java.lang.Object new_objc()
      • resolveClassMethod

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

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

        public static void setSharedURLCache​(NSURLCache value)
        [@property] sharedURLCache Returns the shared NSURLCache instance or sets the NSURLCache instance shared by all clients of the current process. This will be the new object returned when calls to the sharedURLCache method are made. Unless set explicitly through a call to +setSharedURLCache:, this method returns an NSURLCache instance created with the following default values:
        • Memory capacity: 4 megabytes (4 * 1024 * 1024 bytes)
        • Disk capacity: 20 megabytes (20 * 1024 * 1024 bytes)
        • Disk path: (user home directory)/Library/Caches/(application bundle id)

        Users who do not have special caching requirements or constraints should find the default shared cache instance acceptable. If this default shared cache instance is not acceptable, +setSharedURLCache: can be called to set a different NSURLCache instance to be returned from this method. Callers should take care to ensure that the setter is called at a time when no other caller has a reference to the previously-set shared URL cache. This is to prevent storing cache data from becoming unexpectedly unretrievable.

      • setVersion_static

        public static void setVersion_static​(long aVersion)
      • sharedURLCache

        public static NSURLCache sharedURLCache()
        [@property] sharedURLCache Returns the shared NSURLCache instance or sets the NSURLCache instance shared by all clients of the current process. This will be the new object returned when calls to the sharedURLCache method are made. Unless set explicitly through a call to +setSharedURLCache:, this method returns an NSURLCache instance created with the following default values:
        • Memory capacity: 4 megabytes (4 * 1024 * 1024 bytes)
        • Disk capacity: 20 megabytes (20 * 1024 * 1024 bytes)
        • Disk path: (user home directory)/Library/Caches/(application bundle id)

        Users who do not have special caching requirements or constraints should find the default shared cache instance acceptable. If this default shared cache instance is not acceptable, +setSharedURLCache: can be called to set a different NSURLCache instance to be returned from this method. Callers should take care to ensure that the setter is called at a time when no other caller has a reference to the previously-set shared URL cache. This is to prevent storing cache data from becoming unexpectedly unretrievable.

        Returns:
        the shared NSURLCache instance.
      • superclass_static

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

        public static long version_static()
      • cachedResponseForRequest

        public NSCachedURLResponse cachedResponseForRequest​(NSURLRequest request)
        cachedResponseForRequest: Returns the NSCachedURLResponse stored in the cache with the given request. The method returns nil if there is no NSCachedURLResponse stored using the given request.
        Parameters:
        request - the NSURLRequest to use as a key for the lookup.
        Returns:
        The NSCachedURLResponse stored in the cache with the given request, or nil if there is no NSCachedURLResponse stored with the given request.
      • currentDiskUsage

        public long currentDiskUsage()
        Returns the current amount of space consumed by the on-disk cache of the receiver. This size, measured in bytes, indicates the current usage of the on-disk cache.
        Returns:
        the current usage of the on-disk cache of the receiver.
      • currentMemoryUsage

        public long currentMemoryUsage()
        Returns the current amount of space consumed by the in-memory cache of the receiver. This size, measured in bytes, indicates the current usage of the in-memory cache.
        Returns:
        the current usage of the in-memory cache of the receiver.
      • diskCapacity

        public long diskCapacity()
        The on-disk capacity of the receiver. The on-disk capacity, measured in bytes, for the receiver. On mutation the on-disk cache will truncate its contents to the size given, if necessary.
      • initWithMemoryCapacityDiskCapacityDiskPath

        public NSURLCache initWithMemoryCapacityDiskCapacityDiskPath​(long memoryCapacity,
                                                                     long diskCapacity,
                                                                     java.lang.String path)
        initWithMemoryCapacity:diskCapacity:diskPath: Initializes an NSURLCache with the given capacity and path. The returned NSURLCache is backed by disk, so developers can be more liberal with space when choosing the capacity for this kind of cache. A disk cache measured in the tens of megabytes should be acceptable in most cases.
        Parameters:
        memoryCapacity - the capacity, measured in bytes, for the cache in memory.
        diskCapacity - the capacity, measured in bytes, for the cache on disk.
        path - the path on disk where the cache data is stored.
        Returns:
        an initialized NSURLCache, with the given capacity, backed by disk.
      • memoryCapacity

        public long memoryCapacity()
        In-memory capacity of the receiver. At the time this call is made, the in-memory cache will truncate its contents to the size given, if necessary.
        Returns:
        The in-memory capacity, measured in bytes, for the receiver.
      • removeAllCachedResponses

        public void removeAllCachedResponses()
        removeAllCachedResponses Clears the given cache, removing all NSCachedURLResponse objects that it stores.
      • removeCachedResponseForDataTask

        public void removeCachedResponseForDataTask​(NSURLSessionDataTask dataTask)
      • removeCachedResponseForRequest

        public void removeCachedResponseForRequest​(NSURLRequest request)
        removeCachedResponseForRequest: Removes the NSCachedURLResponse from the cache that is stored using the given request. No action is taken if there is no NSCachedURLResponse stored with the given request.
        Parameters:
        request - the NSURLRequest to use as a key for the lookup.
      • removeCachedResponsesSinceDate

        public void removeCachedResponsesSinceDate​(NSDate date)
        removeCachedResponsesSince: Clears the given cache of any cached responses since the provided date.
      • setDiskCapacity

        public void setDiskCapacity​(long value)
        The on-disk capacity of the receiver. The on-disk capacity, measured in bytes, for the receiver. On mutation the on-disk cache will truncate its contents to the size given, if necessary.
      • setMemoryCapacity

        public void setMemoryCapacity​(long value)
        In-memory capacity of the receiver. At the time this call is made, the in-memory cache will truncate its contents to the size given, if necessary.
      • storeCachedResponseForRequest

        public void storeCachedResponseForRequest​(NSCachedURLResponse cachedResponse,
                                                  NSURLRequest request)
        storeCachedResponse:forRequest: Stores the given NSCachedURLResponse in the cache using the given request.
        Parameters:
        cachedResponse - The cached response to store.
        request - the NSURLRequest to use as a key for the storage.
      • initWithMemoryCapacityDiskCapacityDirectoryURL

        public NSURLCache initWithMemoryCapacityDiskCapacityDirectoryURL​(long memoryCapacity,
                                                                         long diskCapacity,
                                                                         NSURL directoryURL)
        initWithMemoryCapacity:diskCapacity:directoryURL: Initializes an NSURLCache with the given capacity and directory.
        Parameters:
        memoryCapacity - the capacity, measured in bytes, for the cache in memory. Or 0 to disable memory cache.
        diskCapacity - the capacity, measured in bytes, for the cache on disk. Or 0 to disable disk cache.
        directoryURL - the path to a directory on disk where the cache data is stored. Or nil for default directory.
        Returns:
        an initialized NSURLCache, with the given capacity, optionally backed by disk.