Class NSURLCache
- java.lang.Object
-
- org.moe.natj.general.NativeObject
-
- org.moe.natj.objc.ObjCObject
-
- apple.NSObject
-
- apple.foundation.NSURLCache
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceNSURLCache.Block_getCachedResponseForDataTaskCompletionHandler-
Nested classes/interfaces inherited from class apple.NSObject
NSObject.Function_instanceMethodForSelector_ret, NSObject.Function_methodForSelector_ret
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedNSURLCache(org.moe.natj.general.Pointer peer)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static booleanaccessInstanceVariablesDirectly()static NSURLCachealloc()static java.lang.ObjectallocWithZone(org.moe.natj.general.ptr.VoidPtr zone)static booleanautomaticallyNotifiesObserversForKey(java.lang.String key)NSCachedURLResponsecachedResponseForRequest(NSURLRequest request)cachedResponseForRequest: Returns the NSCachedURLResponse stored in the cache with the given request.static voidcancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)static voidcancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget, org.moe.natj.objc.SEL aSelector, java.lang.Object anArgument)static NSArray<java.lang.String>classFallbacksForKeyedArchiver()static org.moe.natj.objc.ClassclassForKeyedUnarchiver()longcurrentDiskUsage()Returns the current amount of space consumed by the on-disk cache of the receiver.longcurrentMemoryUsage()Returns the current amount of space consumed by the in-memory cache of the receiver.static java.lang.StringdebugDescription_static()static java.lang.Stringdescription_static()longdiskCapacity()The on-disk capacity of the receiver.voidgetCachedResponseForDataTaskCompletionHandler(NSURLSessionDataTask dataTask, NSURLCache.Block_getCachedResponseForDataTaskCompletionHandler completionHandler)static longhash_static()NSURLCacheinit()NSURLCacheinitWithMemoryCapacityDiskCapacityDirectoryURL(long memoryCapacity, long diskCapacity, NSURL directoryURL)initWithMemoryCapacity:diskCapacity:directoryURL: Initializes an NSURLCache with the given capacity and directory.NSURLCacheinitWithMemoryCapacityDiskCapacityDiskPath(long memoryCapacity, long diskCapacity, java.lang.String path)initWithMemoryCapacity:diskCapacity:diskPath: Initializes an NSURLCache with the given capacity and path.static NSObject.Function_instanceMethodForSelector_retinstanceMethodForSelector(org.moe.natj.objc.SEL aSelector)static NSMethodSignatureinstanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)static booleaninstancesRespondToSelector(org.moe.natj.objc.SEL aSelector)static booleanisSubclassOfClass(org.moe.natj.objc.Class aClass)static NSSet<java.lang.String>keyPathsForValuesAffectingValueForKey(java.lang.String key)longmemoryCapacity()In-memory capacity of the receiver.static java.lang.Objectnew_objc()voidremoveAllCachedResponses()removeAllCachedResponses Clears the given cache, removing all NSCachedURLResponse objects that it stores.voidremoveCachedResponseForDataTask(NSURLSessionDataTask dataTask)voidremoveCachedResponseForRequest(NSURLRequest request)removeCachedResponseForRequest: Removes the NSCachedURLResponse from the cache that is stored using the given request.voidremoveCachedResponsesSinceDate(NSDate date)removeCachedResponsesSince: Clears the given cache of any cached responses since the provided date.static booleanresolveClassMethod(org.moe.natj.objc.SEL sel)static booleanresolveInstanceMethod(org.moe.natj.objc.SEL sel)voidsetDiskCapacity(long value)The on-disk capacity of the receiver.voidsetMemoryCapacity(long value)In-memory capacity of the receiver.static voidsetSharedURLCache(NSURLCache value)[@property] sharedURLCache Returns the shared NSURLCache instance or sets the NSURLCache instance shared by all clients of the current process.static voidsetVersion_static(long aVersion)static NSURLCachesharedURLCache()[@property] sharedURLCache Returns the shared NSURLCache instance or sets the NSURLCache instance shared by all clients of the current process.voidstoreCachedResponseForDataTask(NSCachedURLResponse cachedResponse, NSURLSessionDataTask dataTask)voidstoreCachedResponseForRequest(NSCachedURLResponse cachedResponse, NSURLRequest request)storeCachedResponse:forRequest: Stores the given NSCachedURLResponse in the cache using the given request.static org.moe.natj.objc.Classsuperclass_static()static longversion_static()-
Methods inherited from class apple.NSObject
accessibilityActivate, accessibilityActivationPoint, accessibilityAssistiveTechnologyFocusedIdentifiers, accessibilityAttributedHint, accessibilityAttributedLabel, accessibilityAttributedUserInputLabels, accessibilityAttributedValue, accessibilityContainerType, accessibilityCustomActions, accessibilityCustomRotors, accessibilityDecrement, accessibilityDragSourceDescriptors, accessibilityDropPointDescriptors, accessibilityElementAtIndex, accessibilityElementCount, accessibilityElementDidBecomeFocused, accessibilityElementDidLoseFocus, accessibilityElementIsFocused, accessibilityElements, accessibilityElementsHidden, accessibilityFrame, accessibilityHint, accessibilityIncrement, accessibilityLabel, accessibilityLanguage, accessibilityNavigationStyle, accessibilityPath, accessibilityPerformEscape, accessibilityPerformMagicTap, accessibilityRespondsToUserInteraction, accessibilityScroll, accessibilityTextualContext, accessibilityTraits, accessibilityUserInputLabels, accessibilityValue, accessibilityViewIsModal, addObserverForKeyPathOptionsContext, attemptRecoveryFromErrorOptionIndex, attemptRecoveryFromErrorOptionIndexDelegateDidRecoverSelectorContextInfo, autoContentAccessingProxy, awakeAfterUsingCoder, awakeFromNib, class_objc, classForCoder, classForKeyedArchiver, copy, dealloc, debugDescription, description, dictionaryWithValuesForKeys, didChangeValueForKey, didChangeValueForKeyWithSetMutationUsingObjects, didChangeValuesAtIndexesForKey, doesNotRecognizeSelector, fileManagerShouldProceedAfterError, fileManagerWillProcessPath, finalize_objc, forwardingTargetForSelector, forwardInvocation, hash, indexOfAccessibilityElement, isAccessibilityElement, isEqual, isKindOfClass, isMemberOfClass, isProxy, methodForSelector, methodSignatureForSelector, mutableArrayValueForKey, mutableArrayValueForKeyPath, mutableCopy, mutableOrderedSetValueForKey, mutableOrderedSetValueForKeyPath, mutableSetValueForKey, mutableSetValueForKeyPath, observationInfo, observeValueForKeyPathOfObjectChangeContext, performSelector, performSelectorInBackgroundWithObject, performSelectorOnMainThreadWithObjectWaitUntilDone, performSelectorOnMainThreadWithObjectWaitUntilDoneModes, performSelectorOnThreadWithObjectWaitUntilDone, performSelectorOnThreadWithObjectWaitUntilDoneModes, performSelectorWithObject, performSelectorWithObjectAfterDelay, performSelectorWithObjectAfterDelayInModes, performSelectorWithObjectWithObject, prepareForInterfaceBuilder, provideImageDataBytesPerRowOrigin_Size_UserInfo, removeObserverForKeyPath, removeObserverForKeyPathContext, replacementObjectForCoder, replacementObjectForKeyedArchiver, respondsToSelector, self, setAccessibilityActivationPoint, setAccessibilityAttributedHint, setAccessibilityAttributedLabel, setAccessibilityAttributedUserInputLabels, setAccessibilityAttributedValue, setAccessibilityContainerType, setAccessibilityCustomActions, setAccessibilityCustomRotors, setAccessibilityDragSourceDescriptors, setAccessibilityDropPointDescriptors, setAccessibilityElements, setAccessibilityElementsHidden, setAccessibilityFrame, setAccessibilityHint, setAccessibilityLabel, setAccessibilityLanguage, setAccessibilityNavigationStyle, setAccessibilityPath, setAccessibilityRespondsToUserInteraction, setAccessibilityTextualContext, setAccessibilityTraits, setAccessibilityUserInputLabels, setAccessibilityValue, setAccessibilityViewIsModal, setIsAccessibilityElement, setNilValueForKey, setObservationInfo, setShouldGroupAccessibilityChildren, setValueForKey, setValueForKeyPath, setValueForUndefinedKey, setValuesForKeysWithDictionary, shouldGroupAccessibilityChildren, superclass, validateValueForKeyError, validateValueForKeyPathError, valueForKey, valueForKeyPath, valueForUndefinedKey, willChangeValueForKey, willChangeValueForKeyWithSetMutationUsingObjects, willChangeValuesAtIndexesForKey
-
-
-
-
Method Detail
-
accessInstanceVariablesDirectly
public static boolean accessInstanceVariablesDirectly()
-
alloc
public static NSURLCache alloc()
-
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()
-
instanceMethodForSelector
public static NSObject.Function_instanceMethodForSelector_ret instanceMethodForSelector(org.moe.natj.objc.SEL aSelector)
-
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.
-
getCachedResponseForDataTaskCompletionHandler
public void getCachedResponseForDataTaskCompletionHandler(NSURLSessionDataTask dataTask, NSURLCache.Block_getCachedResponseForDataTaskCompletionHandler completionHandler)
-
init
public NSURLCache init()
-
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.
-
storeCachedResponseForDataTask
public void storeCachedResponseForDataTask(NSCachedURLResponse cachedResponse, NSURLSessionDataTask dataTask)
-
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.
-
-