Class 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.
    • Constructor Detail

      • NSHTTPCookieStorage

        protected NSHTTPCookieStorage​(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)
      • 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
      • 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.