public class NSHTTPCookieStorage extends NSObject
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.
| Modifier and Type | Class and Description |
|---|---|
static interface |
NSHTTPCookieStorage.Block_getCookiesForTaskCompletionHandler |
NSObject.Function_instanceMethodForSelector_ret, NSObject.Function_methodForSelector_ret| Modifier | Constructor and Description |
|---|---|
protected |
NSHTTPCookieStorage(org.moe.natj.general.Pointer peer) |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
accessInstanceVariablesDirectly() |
static NSHTTPCookieStorage |
alloc() |
static NSHTTPCookieStorage |
allocWithZone(org.moe.natj.general.ptr.VoidPtr zone) |
static boolean |
automaticallyNotifiesObserversForKey(java.lang.String key) |
static void |
cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget) |
static void |
cancelPreviousPerformRequestsWithTargetSelectorObject(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.Class |
classForKeyedUnarchiver() |
long |
cookieAcceptPolicy()
The cookie accept policy preference of the
receiver.
|
NSArray<? extends NSHTTPCookie> |
cookies()
Get all the cookies
|
NSArray<? extends NSHTTPCookie> |
cookiesForURL(NSURL URL)
cookiesForURL:
|
static java.lang.String |
debugDescription_static() |
void |
deleteCookie(NSHTTPCookie cookie)
deleteCookie:
|
static java.lang.String |
description_static() |
void |
getCookiesForTaskCompletionHandler(NSURLSessionTask task,
NSHTTPCookieStorage.Block_getCookiesForTaskCompletionHandler completionHandler) |
static long |
hash_static() |
NSHTTPCookieStorage |
init() |
static NSObject.Function_instanceMethodForSelector_ret |
instanceMethodForSelector(org.moe.natj.objc.SEL aSelector) |
static NSMethodSignature |
instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector) |
static boolean |
instancesRespondToSelector(org.moe.natj.objc.SEL aSelector) |
static boolean |
isSubclassOfClass(org.moe.natj.objc.Class aClass) |
static NSSet<java.lang.String> |
keyPathsForValuesAffectingValueForKey(java.lang.String key) |
static NSHTTPCookieStorage |
new_objc() |
void |
removeCookiesSinceDate(NSDate date)
removeCookiesSince:
|
static boolean |
resolveClassMethod(org.moe.natj.objc.SEL sel) |
static boolean |
resolveInstanceMethod(org.moe.natj.objc.SEL sel) |
void |
setCookie(NSHTTPCookie cookie)
setCookie:
|
void |
setCookieAcceptPolicy(long value)
The cookie accept policy preference of the
receiver.
|
void |
setCookiesForURLMainDocumentURL(NSArray<? extends NSHTTPCookie> cookies,
NSURL URL,
NSURL mainDocumentURL)
setCookies:forURL:mainDocumentURL:
|
static void |
setVersion_static(long aVersion) |
static NSHTTPCookieStorage |
sharedCookieStorageForGroupContainerIdentifier(java.lang.String identifier)
sharedCookieStorageForGroupContainerIdentifier:
|
static NSHTTPCookieStorage |
sharedHTTPCookieStorage()
[@property] sharedHTTPCookieStorage
|
NSArray<? extends NSHTTPCookie> |
sortedCookiesUsingDescriptors(NSArray<? extends NSSortDescriptor> sortOrder)
sortedCookiesUsingDescriptors:
|
void |
storeCookiesForTask(NSArray<? extends NSHTTPCookie> cookies,
NSURLSessionTask task) |
static org.moe.natj.objc.Class |
superclass_static() |
static long |
version_static() |
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, willChangeValuesAtIndexesForKeyprotected NSHTTPCookieStorage(org.moe.natj.general.Pointer peer)
public static boolean accessInstanceVariablesDirectly()
public static NSHTTPCookieStorage alloc()
public static NSHTTPCookieStorage allocWithZone(org.moe.natj.general.ptr.VoidPtr zone)
public static boolean automaticallyNotifiesObserversForKey(java.lang.String key)
public static void cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)
public static void cancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget,
org.moe.natj.objc.SEL aSelector,
java.lang.Object anArgument)
public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
public static org.moe.natj.objc.Class classForKeyedUnarchiver()
public static java.lang.String debugDescription_static()
public static java.lang.String description_static()
public static long hash_static()
public static NSObject.Function_instanceMethodForSelector_ret instanceMethodForSelector(org.moe.natj.objc.SEL aSelector)
public static NSMethodSignature instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)
public static boolean instancesRespondToSelector(org.moe.natj.objc.SEL aSelector)
public static boolean isSubclassOfClass(org.moe.natj.objc.Class aClass)
public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey(java.lang.String key)
public static NSHTTPCookieStorage new_objc()
public static boolean resolveClassMethod(org.moe.natj.objc.SEL sel)
public static boolean resolveInstanceMethod(org.moe.natj.objc.SEL sel)
public static void setVersion_static(long aVersion)
public static NSHTTPCookieStorage sharedCookieStorageForGroupContainerIdentifier(java.lang.String identifier)
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.
identifier - The application group identifierpublic static NSHTTPCookieStorage 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.
public static org.moe.natj.objc.Class superclass_static()
public static long version_static()
public long cookieAcceptPolicy()
public NSArray<? extends NSHTTPCookie> cookies()
public NSArray<? extends NSHTTPCookie> cookiesForURL(NSURL URL)
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.
URL - The URL for which to get cookies.public void deleteCookie(NSHTTPCookie cookie)
Delete the specified cookie
public void getCookiesForTaskCompletionHandler(NSURLSessionTask task, NSHTTPCookieStorage.Block_getCookiesForTaskCompletionHandler completionHandler)
public NSHTTPCookieStorage init()
public void removeCookiesSinceDate(NSDate date)
Delete all cookies from the cookie storage since the provided date.
public void setCookie(NSHTTPCookie cookie)
Set a cookie
The cookie will override an existing cookie with the same name, domain and path, if any.
public void setCookieAcceptPolicy(long value)
public void setCookiesForURLMainDocumentURL(NSArray<? extends NSHTTPCookie> cookies, NSURL URL, NSURL 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.
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.public NSArray<? extends NSHTTPCookie> sortedCookiesUsingDescriptors(NSArray<? extends NSSortDescriptor> sortOrder)
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.
sortOrder - an array of NSSortDescriptors which represent the preferred sort order of the resulting array.public void storeCookiesForTask(NSArray<? extends NSHTTPCookie> cookies, NSURLSessionTask task)