Class UTType

  • All Implemented Interfaces:
    NSCoding, NSCopying, NSSecureCoding, NSObject

    public class UTType
    extends NSObject
    implements NSCopying, NSSecureCoding
    \brief A class representing a type in a type hierarchy. Types may represent files on disk, abstract data types with no on-disk representation, or even entirely unrelated hierarchical classification systems such as hardware. Older API that does not use \c UTType typically uses an untyped \c NSString or \c CFStringRef to refer to a type by its identifier. To get the identifier of a type for use with these APIs, use the \c identifier property of this class. \sa https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/understanding_utis/ API-Since: 14.0
    • Constructor Detail

      • UTType

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

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • alloc

        public static UTType alloc()
      • allocWithZone

        public static UTType 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()
      • conformsToType

        public boolean conformsToType​(@NotNull
                                      @NotNull UTType type)
        \brief Tests for a conformance relationship between the receiver and another type. \param type The type against which conformance should be tested. \result If the two types are equal, returns \c YES. If the receiver conforms, directly or indirectly, to \a type, returns \c YES. Otherwise, returns \c NO. \sa -isSupertypeOfType: \sa -isSubtypeOfType: API-Since: 14.0
      • copyWithZone

        @NotNull
        public @NotNull java.lang.Object copyWithZone​(@Nullable
                                                      @Nullable org.moe.natj.general.ptr.VoidPtr zone)
        Specified by:
        copyWithZone in interface NSCopying
      • debugDescription_static

        public static java.lang.String debugDescription_static()
      • description_static

        public static java.lang.String description_static()
      • exportedTypeWithIdentifier

        @NotNull
        public static @NotNull UTType exportedTypeWithIdentifier​(@NotNull
                                                                 @NotNull java.lang.String identifier)
        \brief Gets an active \c UTType corresponding to a type that is declared as "exported" by the current process. \param identifier The type identifier for which a type is desired. \result A type. Use this method to get types that are exported by your application. If \a identifier does not correspond to any type known to the system, the result is undefined. Conformance to either \c UTTypeData or \c UTTypePackage is assumed. You would generally use this method with \c dispatch_once(): \code UTType *GetMyFileFormat(void) { static UTType *result = nil; static dispatch_once_t once; dispatch_once(&once, ^ { result = [UTType exportedTypeWithIdentifier:@"com.example.myfileformat"]; }); return result; } \endcode API-Since: 14.0
      • exportedTypeWithIdentifierConformingToType

        @NotNull
        public static @NotNull UTType exportedTypeWithIdentifierConformingToType​(@NotNull
                                                                                 @NotNull java.lang.String identifier,
                                                                                 @NotNull
                                                                                 @NotNull UTType parentType)
        \brief Gets an active \c UTType corresponding to a type that is declared as "exported" by the current process. \param identifier The type identifier for which a type is desired. \param parentType A parent type that the resulting type is expected to conform to. \result A type. Use this method to get types that are exported by your application. If \a identifier does not correspond to any type known to the system, the result is undefined. You would generally use this method with \c dispatch_once(): \code UTType *GetMyFileFormat(void) { static UTType *result = nil; static dispatch_once_t once; dispatch_once(&once, ^ { result = [UTType exportedTypeWithIdentifier:@"com.example.myfileformat" conformingToType:UTTypeData]; }); return result; } \endcode API-Since: 14.0
      • hash_static

        public static long hash_static()
      • identifier

        @NotNull
        public @NotNull java.lang.String identifier()
        \brief The receiver's identifier. A type is \em identified \em by its Uniform Type Identifier (UTI), a reverse-DNS string such as \c "public.jpeg" or \c "com.adobe.pdf". The type itself \em has a UTI, but is not itself the UTI. This terminology is not consistently used across Apple's documentation. API-Since: 14.0
      • importedTypeWithIdentifier

        @NotNull
        public static @NotNull UTType importedTypeWithIdentifier​(@NotNull
                                                                 @NotNull java.lang.String identifier)
        \brief Gets an active \c UTType corresponding to a type that is declared as "imported" by the current process. \param identifier The type identifier for which a type is desired. \result A type whose identifier may or may not be equal to \a identifier, but which is functionally equivalent. Use this method to get types that are imported by your application. If \a identifier does not correspond to any type known to the system, the result is undefined. Conformance to either \c UTTypeData or \c UTTypePackage is assumed. You would generally use this method in the body of a funcion or method and would \em not use \c dispatch_once() as the type can change over time: \code UTType *GetCompetitorFileFormat(void) { return [UTType importedTypeWithIdentifier:@"com.example.competitorfileformat"]; } \endcode In the general case, this method returns a type with the same identifier, but if that type has a preferred filename extension and \em another type is the preferred type for that extension, then that \em other type is substituted. API-Since: 14.0
      • importedTypeWithIdentifierConformingToType

        @NotNull
        public static @NotNull UTType importedTypeWithIdentifierConformingToType​(@NotNull
                                                                                 @NotNull java.lang.String identifier,
                                                                                 @NotNull
                                                                                 @NotNull UTType parentType)
        \brief Gets an active \c UTType corresponding to a type that is declared as "imported" by the current process. \param identifier The type identifier for which a type is desired. \param parentType A parent type that the resulting type is expected to conform to. \result A type whose identifier may or may not be equal to \a identifier, but which is functionally equivalent. Use this method to get types that are imported by your application. If \a identifier does not correspond to any type known to the system, the result is undefined. You would generally use this method in the body of a funcion or method and would \em not use \c dispatch_once() as the type can change over time: \code UTType *GetCompetitorFileFormat(void) { return [UTType importedTypeWithIdentifier:@"com.example.competitorfileformat" conformingToType:UTTypeData]; } \endcode In the general case, this method returns a type with the same identifier, but if that type has a preferred filename extension and \em another type is the preferred type for that extension, then that \em other type is substituted. API-Since: 14.0
      • instanceMethodSignatureForSelector

        public static NSMethodSignature instanceMethodSignatureForSelector​(org.moe.natj.objc.SEL aSelector)
      • instancesRespondToSelector

        public static boolean instancesRespondToSelector​(org.moe.natj.objc.SEL aSelector)
      • isDeclared

        public boolean isDeclared()
        \brief Whether or not the receiver is a type known to the system. A type cannot be both declared \em and dynamic. API-Since: 14.0
      • isDynamic

        public boolean isDynamic()
        \brief Whether or not the receiver is a dynamically generated type. Dynamic types are recognized by the system, but may not be directly declared or claimed by an application. They are used when a file is encountered whose metadata has no corresponding type known to the system. A type cannot be both declared \em and dynamic. API-Since: 14.0
      • isPublicType

        public boolean isPublicType()
        \brief Whether or not the type is in the public domain. Types in the public domain have identifiers starting with \c "public." and are generally defined by a standards body or by convention. They are never dynamic. API-Since: 14.0
      • isSubclassOfClass

        public static boolean isSubclassOfClass​(org.moe.natj.objc.Class aClass)
      • isSubtypeOfType

        public boolean isSubtypeOfType​(@NotNull
                                       @NotNull UTType type)
        \brief Tests if the receiver is a subtype of another type. \param type The type against which conformance should be tested. \result If the receiver conforms, directly or indirectly, to \a type and is not equal to it, returns \c YES. Otherwise, returns \c NO. \sa -conformsToType: \sa -isSupertypeOfType: API-Since: 14.0
      • isSupertypeOfType

        public boolean isSupertypeOfType​(@NotNull
                                         @NotNull UTType type)
        \brief Tests if the receiver is a supertype of another type. \param type The type against which conformance should be tested. \result If \a type conforms, directly or indirectly, to the receiver and is not equal to it, returns \c YES. Otherwise, returns \c NO. \sa -conformsToType: \sa -isSubtypeOfType: API-Since: 14.0
      • keyPathsForValuesAffectingValueForKey

        @NotNull
        public static @NotNull NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey​(@NotNull
                                                                                             @NotNull java.lang.String key)
      • localizedDescription

        @Nullable
        public @Nullable java.lang.String localizedDescription()
        \brief The localized description of the type. If the type does not provide a description, the system may search its supertypes for one. Dynamic types never have localized descriptions even if their supertypes do. API-Since: 14.0
      • new_objc

        public static UTType new_objc()
      • preferredFilenameExtension

        @Nullable
        public @Nullable java.lang.String preferredFilenameExtension()
        \brief If available, the preferred (first available) tag of class \c UTTagClassFilenameExtension. Many uses of types require the generation of a filename (e.g. when saving a file to disk.) If not \c nil, the value of this property is the best available filename extension for the given type. The value of this property is equivalent to, but more efficient than: \code type.tags[UTTagClassFilenameExtension].firstObject \endcode API-Since: 14.0
      • preferredMIMEType

        @Nullable
        public @Nullable java.lang.String preferredMIMEType()
        \brief If available, the preferred (first available) tag of class \c UTTagClassMIMEType. If not \c nil, the value of this property is the best available MIME type for the given type, according to its declaration. The value of this property is equivalent to, but more efficient than: \code type.tags[UTTagClassMIMEType].firstObject \endcode API-Since: 14.0
      • referenceURL

        @Nullable
        public @Nullable NSURL referenceURL()
        \brief The reference URL of the type. A reference URL is a human-readable document describing a type. Most types do not specify reference URLs. \warning This URL is not validated in any way by the system, nor is its scheme or structure guaranteed in any way. API-Since: 14.0
      • 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)
      • superclass_static

        public static org.moe.natj.objc.Class superclass_static()
      • supertypes

        @NotNull
        public @NotNull NSSet<? extends UTType> supertypes()
        \brief The set of types to which the receiving type conforms, directly or indirectly. If you are just interested in checking if one type conforms to another, it is more efficient to use \c -conformsToType: than this property. API-Since: 14.0
      • supportsSecureCoding

        public static boolean supportsSecureCoding()
      • _supportsSecureCoding

        public boolean _supportsSecureCoding()
        Description copied from interface: NSSecureCoding
        This property must return YES on all classes that allow secure coding. Subclasses of classes that adopt NSSecureCoding and override initWithCoder: must also override this method and return YES. The Secure Coding Guide should be consulted when writing methods that decode data.
        Specified by:
        _supportsSecureCoding in interface NSSecureCoding
      • tags

        @NotNull
        public @NotNull NSDictionary<java.lang.String,​? extends NSArray<java.lang.String>> tags()
        \brief The tag specification dictionary of the type. The system does not store tag information for non-standard tag classes. It normalizes string values into arrays containing those strings. For instance, a value of: \code { "public.mime-type": "x/y", "nonstandard-tag-class": "abc", } \endcode Is normalized to: \code { "public.mime-type": [ "x/y" ] } \endcode If you are simply looking for the preferred filename extension or MIME type of a type, it is more efficient for you to use the \c preferredFilenameExtension and \c preferredMIMEType properties respectively. API-Since: 14.0
      • typeWithFilenameExtension

        public static UTType typeWithFilenameExtension​(@NotNull
                                                       @NotNull java.lang.String filenameExtension)
        \brief Create a type given a filename extension that conforms to \c UTTypeData. \param filenameExtension The filename extension for which a type is desired. \result A type. If no types are known to the system with the specified filename extension and conformance but the inputs were otherwise valid, a dynamic type may be provided. If the inputs were not valid, returns \c nil. This method is equivalent to: \code [UTType typeWithTag:filenameExtension tagClass:UTTagClassFilenameExtension conformingToType:UTTypeData] \endcode To get the type of a file on disk, use the \c NSURLContentTypeKey property. You should not attempt to derive the type of a file system object based solely on its path extension. API-Since: 14.0
      • typeWithFilenameExtensionConformingToType

        public static UTType typeWithFilenameExtensionConformingToType​(@NotNull
                                                                       @NotNull java.lang.String filenameExtension,
                                                                       @NotNull
                                                                       @NotNull UTType supertype)
        \brief Create a type given a filename extension. \param filenameExtension The filename extension for which a type is desired. \param supertype Another type that the resulting type must conform to. Typically, you would pass \c UTTypeData or \c UTTypePackage. \result A type. If no types are known to the system with the specified filename extension and conformance but the inputs were otherwise valid, a dynamic type may be provided. If the inputs were not valid, returns \c nil. This method is equivalent to: \code [UTType typeWithTag:filenameExtension tagClass:UTTagClassFilenameExtension conformingToType:supertype] \endcode To get the type of a file on disk, use the \c NSURLContentTypeKey property. You should not attempt to derive the type of a file system object based solely on its path extension. API-Since: 14.0
      • typeWithIdentifier

        public static UTType typeWithIdentifier​(@NotNull
                                                @NotNull java.lang.String identifier)
        \brief Create a type given a type identifier. \param identifier The type identifier. \result A type, or \c nil if the type identifier is not known to the system. API-Since: 14.0
      • typeWithMIMEType

        public static UTType typeWithMIMEType​(@NotNull
                                              @NotNull java.lang.String mimeType)
        \brief Create a type given a MIME type that conforms to \c UTTypeData. \param mimeType The MIME type for which a type is desired. \result A type. If no types are known to the system with the specified MIME type and conformance but the inputs were otherwise valid, a dynamic type may be provided. If the inputs were not valid, returns \c nil. This method is equivalent to: \code [UTType typeWithTag:mimeType tagClass:UTTagClassMIMEType conformingToType:UTTypeData] \endcode API-Since: 14.0
      • typeWithMIMETypeConformingToType

        public static UTType typeWithMIMETypeConformingToType​(@NotNull
                                                              @NotNull java.lang.String mimeType,
                                                              @NotNull
                                                              @NotNull UTType supertype)
        \brief Create a type given a MIME type. \param mimeType The MIME type for which a type is desired. \param supertype Another type that the resulting type must conform to. Typically, you would pass \c UTTypeData. \result A type. If no types are known to the system with the specified MIME type and conformance but the inputs were otherwise valid, a dynamic type may be provided. If the inputs were not valid, returns \c nil. This method is equivalent to: \code [UTType typeWithTag:mimeType tagClass:UTTagClassMIMEType conformingToType:supertype] \endcode API-Since: 14.0
      • typeWithTagTagClassConformingToType

        public static UTType typeWithTagTagClassConformingToType​(@NotNull
                                                                 @NotNull java.lang.String tag,
                                                                 @NotNull
                                                                 @NotNull java.lang.String tagClass,
                                                                 @Nullable
                                                                 @Nullable UTType supertype)
        \brief Create a type given a type tag. \param tag The tag, such as the path extension, for which a type is desired. \param tagClass The class of the tag, such as \c UTTagClassFilenameExtension. \param supertype Another type that the resulting type must conform to. If \c nil, no conformance is required. \result A type. If no types are known to the system with the specified tag but the inputs were otherwise valid, a dynamic type may be provided. If the inputs were not valid, returns \c nil. API-Since: 14.0
      • typesWithTagTagClassConformingToType

        @NotNull
        public static @NotNull NSArray<? extends UTType> typesWithTagTagClassConformingToType​(@NotNull
                                                                                              @NotNull java.lang.String tag,
                                                                                              @NotNull
                                                                                              @NotNull java.lang.String tagClass,
                                                                                              @Nullable
                                                                                              @Nullable UTType supertype)
        \brief Create an array of types given a type tag. \param tag The tag, such as the path extension, for which a set of types is desired. \param tagClass The class of the tag, such as \c UTTagClassFilenameExtension. \param supertype Another type that the resulting types must conform to. If \c nil, no conformance is required. \result An array of types, or the empty array if no such types were available. If no types are known to the system with the specified tag but the inputs were otherwise valid, a dynamic type may be provided. API-Since: 14.0
      • version

        @Nullable
        public @Nullable NSNumber version()
        \brief The type's version. Most types do not specify a version. API-Since: 14.0
      • SHCustomCatalogContentType

        @NotNull
        public static @NotNull UTType SHCustomCatalogContentType()
        A type representing the @c SHCustomCatalog file format with the .shazamcatalog extension
      • SHSignatureContentType

        @NotNull
        public static @NotNull UTType SHSignatureContentType()
        A type representing the @c SHSignature file format with the .shazamsignature extension
      • useStoredAccessor

        @Deprecated
        public static boolean useStoredAccessor()
        Deprecated.