Package apple.foundation
Class NSHTTPCookieStorage
- java.lang.Object
-
- org.moe.natj.general.NativeObject
-
- org.moe.natj.objc.ObjCObject
-
- apple.NSObject
-
- apple.foundation.NSHTTPCookieStorage
-
- All Implemented Interfaces:
NSObject
public class NSHTTPCookieStorage extends NSObject
NSHTTPCookieStorage NSHTTPCookieStorage implements a singleton object (shared instance) which manages the shared cookie store. It has methods to allow clients to set and remove cookies, and get the current set of cookies. It also has convenience methods to parse and generate cookie-related HTTP header fields.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceNSHTTPCookieStorage.Block_getCookiesForTaskCompletionHandler-
Nested classes/interfaces inherited from class apple.NSObject
NSObject.Function_instanceMethodForSelector_ret, NSObject.Function_methodForSelector_ret
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedNSHTTPCookieStorage(org.moe.natj.general.Pointer peer)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static booleanaccessInstanceVariablesDirectly()static NSHTTPCookieStoragealloc()static java.lang.ObjectallocWithZone(org.moe.natj.general.ptr.VoidPtr zone)static booleanautomaticallyNotifiesObserversForKey(java.lang.String key)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()longcookieAcceptPolicy()The cookie accept policy preference of the receiver.NSArray<? extends NSHTTPCookie>cookies()Get all the cookiesNSArray<? extends NSHTTPCookie>cookiesForURL(NSURL URL)cookiesForURL: Returns an array of cookies to send to the given URL.static java.lang.StringdebugDescription_static()voiddeleteCookie(NSHTTPCookie cookie)deleteCookie: Delete the specified cookiestatic java.lang.Stringdescription_static()voidgetCookiesForTaskCompletionHandler(NSURLSessionTask task, NSHTTPCookieStorage.Block_getCookiesForTaskCompletionHandler completionHandler)static longhash_static()NSHTTPCookieStorageinit()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)static java.lang.Objectnew_objc()voidremoveCookiesSinceDate(NSDate date)removeCookiesSince: Delete all cookies from the cookie storage since the provided date.static booleanresolveClassMethod(org.moe.natj.objc.SEL sel)static booleanresolveInstanceMethod(org.moe.natj.objc.SEL sel)voidsetCookie(NSHTTPCookie cookie)setCookie: Set a cookie The cookie will override an existing cookie with the same name, domain and path, if any.voidsetCookieAcceptPolicy(long value)The cookie accept policy preference of the receiver.voidsetCookiesForURLMainDocumentURL(NSArray<? extends NSHTTPCookie> cookies, NSURL URL, NSURL mainDocumentURL)setCookies:forURL:mainDocumentURL: Adds an array cookies to the cookie store, following the cookie accept policy.static voidsetVersion_static(long aVersion)static NSHTTPCookieStoragesharedCookieStorageForGroupContainerIdentifier(java.lang.String identifier)sharedCookieStorageForGroupContainerIdentifier: Get the cookie storage for the container associated with the specified application group identifier By default, applications and associated app extensions have different data containers, which means that the sharedHTTPCookieStorage singleton will refer to different persistent cookie stores in an application and any app extensions that it contains.static NSHTTPCookieStoragesharedHTTPCookieStorage()[@property] sharedHTTPCookieStorage Get the shared cookie storage in the default location.NSArray<? extends NSHTTPCookie>sortedCookiesUsingDescriptors(NSArray<? extends NSSortDescriptor> sortOrder)sortedCookiesUsingDescriptors: Returns an array of all cookies in the store, sorted according to the key value and sorting direction of the NSSortDescriptors specified in the parameter.voidstoreCookiesForTask(NSArray<? extends NSHTTPCookie> cookies, NSURLSessionTask task)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 NSHTTPCookieStorage 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)
-
setVersion_static
public static void setVersion_static(long aVersion)
-
sharedCookieStorageForGroupContainerIdentifier
public static NSHTTPCookieStorage sharedCookieStorageForGroupContainerIdentifier(java.lang.String identifier)
sharedCookieStorageForGroupContainerIdentifier: Get the cookie storage for the container associated with the specified application group identifier By default, applications and associated app extensions have different data containers, which means that the sharedHTTPCookieStorage singleton will refer to different persistent cookie stores in an application and any app extensions that it contains. This method allows clients to create a persistent cookie storage that can be shared among all applications and extensions with access to the same application group. Subsequent calls to this method with the same identifier will return the same cookie storage instance.- Parameters:
identifier- The application group identifier- Returns:
- A cookie storage with a persistent store in the application group container
-
sharedHTTPCookieStorage
public static NSHTTPCookieStorage sharedHTTPCookieStorage()
[@property] sharedHTTPCookieStorage Get the shared cookie storage in the default location. Starting in OS X 10.11, each app has its own sharedHTTPCookieStorage singleton, which will not be shared with other applications.- Returns:
- The shared cookie storage
-
superclass_static
public static org.moe.natj.objc.Class superclass_static()
-
version_static
public static long version_static()
-
cookieAcceptPolicy
public long cookieAcceptPolicy()
The cookie accept policy preference of the receiver.
-
cookies
public NSArray<? extends NSHTTPCookie> cookies()
Get all the cookies- Returns:
- An NSArray of NSHTTPCookies
-
cookiesForURL
public NSArray<? extends NSHTTPCookie> cookiesForURL(NSURL URL)
cookiesForURL: Returns an array of cookies to send to the given URL. The cookie manager examines the cookies it stores and includes those which should be sent to the given URL. You can use +[NSCookie requestHeaderFieldsWithCookies:] to turn this array into a set of header fields to add to a request.- Parameters:
URL- The URL for which to get cookies.- Returns:
- an NSArray of NSHTTPCookie objects.
-
deleteCookie
public void deleteCookie(NSHTTPCookie cookie)
deleteCookie: Delete the specified cookie
-
getCookiesForTaskCompletionHandler
public void getCookiesForTaskCompletionHandler(NSURLSessionTask task, NSHTTPCookieStorage.Block_getCookiesForTaskCompletionHandler completionHandler)
-
init
public NSHTTPCookieStorage init()
-
removeCookiesSinceDate
public void removeCookiesSinceDate(NSDate date)
removeCookiesSince: Delete all cookies from the cookie storage since the provided date.
-
setCookie
public void setCookie(NSHTTPCookie cookie)
setCookie: Set a cookie The cookie will override an existing cookie with the same name, domain and path, if any.
-
setCookieAcceptPolicy
public void setCookieAcceptPolicy(long value)
The cookie accept policy preference of the receiver.
-
setCookiesForURLMainDocumentURL
public void setCookiesForURLMainDocumentURL(NSArray<? extends NSHTTPCookie> cookies, NSURL URL, NSURL mainDocumentURL)
setCookies:forURL:mainDocumentURL: Adds an array cookies to the cookie store, following the cookie accept policy. For mainDocumentURL, the caller should pass the URL for an appropriate main document, if known. For example, when loading a web page, the URL of the main html document for the top-level frame should be passed. To save cookies based on a set of response headers, you can use +[NSCookie cookiesWithResponseHeaderFields:forURL:] on a header field dictionary and then use this method to store the resulting cookies in accordance with policy settings.- Parameters:
cookies- The cookies to set.URL- The URL from which the cookies were sent.mainDocumentURL- The main document URL to be used as a base for the "same domain as main document" policy.
-
sortedCookiesUsingDescriptors
public NSArray<? extends NSHTTPCookie> sortedCookiesUsingDescriptors(NSArray<? extends NSSortDescriptor> sortOrder)
sortedCookiesUsingDescriptors: Returns an array of all cookies in the store, sorted according to the key value and sorting direction of the NSSortDescriptors specified in the parameter. proper sorting of cookies may require extensive string conversion, which can be avoided by allowing the system to perform the sorting. This API is to be preferred over the more generic -[NSHTTPCookieStorage cookies] API, if sorting is going to be performed.- Parameters:
sortOrder- an array of NSSortDescriptors which represent the preferred sort order of the resulting array.
-
storeCookiesForTask
public void storeCookiesForTask(NSArray<? extends NSHTTPCookie> cookies, NSURLSessionTask task)
-
-