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. API-Since: 2.0
    • Constructor Detail

      • NSHTTPCookieStorage

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

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • allocWithZone

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

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

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

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

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

        @NotNull
        public static @NotNull 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

        @NotNull
        public static @NotNull NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey​(@NotNull
                                                                                             @NotNull java.lang.String key)
      • 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

        @NotNull
        public static @NotNull NSHTTPCookieStorage sharedCookieStorageForGroupContainerIdentifier​(@NotNull
                                                                                                  @NotNull 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. API-Since: 9.0
        Parameters:
        identifier - The application group identifier
        Returns:
        A cookie storage with a persistent store in the application group container
      • sharedHTTPCookieStorage

        @NotNull
        public static @NotNull 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

        @Nullable
        public @Nullable NSArray<? extends NSHTTPCookie> cookies()
        Get all the cookies
        Returns:
        An NSArray of NSHTTPCookies
      • cookiesForURL

        @Nullable
        public @Nullable NSArray<? extends NSHTTPCookie> cookiesForURL​(@NotNull
                                                                       @NotNull 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​(@NotNull
                                 @NotNull NSHTTPCookie cookie)
        deleteCookie: Delete the specified cookie
      • removeCookiesSinceDate

        public void removeCookiesSinceDate​(@NotNull
                                           @NotNull NSDate date)
        removeCookiesSince: Delete all cookies from the cookie storage since the provided date. API-Since: 8.0
      • setCookie

        public void setCookie​(@NotNull
                              @NotNull 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​(@NotNull
                                                    @NotNull NSArray<? extends NSHTTPCookie> cookies,
                                                    @Nullable
                                                    @Nullable NSURL URL,
                                                    @Nullable
                                                    @Nullable 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

        @NotNull
        public @NotNull NSArray<? extends NSHTTPCookie> sortedCookiesUsingDescriptors​(@NotNull
                                                                                      @NotNull 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. API-Since: 5.0
        Parameters:
        sortOrder - an array of NSSortDescriptors which represent the preferred sort order of the resulting array.
      • storeCookiesForTask

        public void storeCookiesForTask​(@NotNull
                                        @NotNull NSArray<? extends NSHTTPCookie> cookies,
                                        @NotNull
                                        @NotNull NSURLSessionTask task)
        API-Since: 8.0
      • useStoredAccessor

        @Deprecated
        public static boolean useStoredAccessor()
        Deprecated.