public class NSFileProviderManager extends NSObject
NSFileProviderManager can be used from the following processes: - the extension - the main app containing the extension - sibling extensions to the extension - executables contained in the main app bundle (on macOS only)
Executables contained in the main app bundle need to have a bundle identifier that is prefixed by the bundle identifier of the main app (note that this is generally required for extensions). They must also have access to the document group defined for the provider (via its `NSExtensionFileProviderDocumentGroup` key).
The file provider framework will invoke your file provider extension in response to those calls if appropriate.
The class also provides methods to manage provider domains. Each domain has a corresponding manager.
| Modifier and Type | Class and Description |
|---|---|
static interface |
NSFileProviderManager.Block_addDomainCompletionHandler |
static interface |
NSFileProviderManager.Block_getDomainsWithCompletionHandler |
static interface |
NSFileProviderManager.Block_registerURLSessionTaskForItemWithIdentifierCompletionHandler |
static interface |
NSFileProviderManager.Block_removeAllDomainsWithCompletionHandler |
static interface |
NSFileProviderManager.Block_removeDomainCompletionHandler |
static interface |
NSFileProviderManager.Block_signalEnumeratorForContainerItemIdentifierCompletionHandler |
NSObject.Function_instanceMethodForSelector_ret, NSObject.Function_methodForSelector_ret| Modifier | Constructor and Description |
|---|---|
protected |
NSFileProviderManager(org.moe.natj.general.Pointer peer) |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
accessInstanceVariablesDirectly() |
static void |
addDomainCompletionHandler(NSFileProviderDomain domain,
NSFileProviderManager.Block_addDomainCompletionHandler completionHandler)
Register a domain in which items can be stored.
|
static NSFileProviderManager |
alloc() |
static NSFileProviderManager |
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() |
static java.lang.String |
debugDescription_static() |
static NSFileProviderManager |
defaultManager()
Return the manager responsible for the default domain.
|
static java.lang.String |
description_static() |
NSURL |
documentStorageURL()
The root URL for provided documents.
|
static void |
getDomainsWithCompletionHandler(NSFileProviderManager.Block_getDomainsWithCompletionHandler completionHandler)
Get all registered domains.
|
static long |
hash_static() |
NSFileProviderManager |
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 NSFileProviderManager |
managerForDomain(NSFileProviderDomain domain)
Return the manager for the specified domain.
|
static NSFileProviderManager |
new_objc() |
static NSURL |
placeholderURLForURL(NSURL url)
Returns the designated placeholder URL for a given file URL.
|
java.lang.String |
providerIdentifier()
The purpose identifier of your file provider extension.
|
void |
registerURLSessionTaskForItemWithIdentifierCompletionHandler(NSURLSessionTask task,
java.lang.String identifier,
NSFileProviderManager.Block_registerURLSessionTaskForItemWithIdentifierCompletionHandler completion)
Registers the given NSURLSessionTask to be responsible for the specified item.
|
static void |
removeAllDomainsWithCompletionHandler(NSFileProviderManager.Block_removeAllDomainsWithCompletionHandler completionHandler)
Remove all registered domains.
|
static void |
removeDomainCompletionHandler(NSFileProviderDomain domain,
NSFileProviderManager.Block_removeDomainCompletionHandler completionHandler)
Remove a domain.
|
static boolean |
resolveClassMethod(org.moe.natj.objc.SEL sel) |
static boolean |
resolveInstanceMethod(org.moe.natj.objc.SEL sel) |
static void |
setVersion_static(long aVersion) |
void |
signalEnumeratorForContainerItemIdentifierCompletionHandler(java.lang.String containerItemIdentifier,
NSFileProviderManager.Block_signalEnumeratorForContainerItemIdentifierCompletionHandler completion)
Call this method either in the app or in the extension to trigger an
enumeration, typically in response to a push.
|
static org.moe.natj.objc.Class |
superclass_static() |
static long |
version_static() |
static boolean |
writePlaceholderAtURLWithMetadataError(NSURL placeholderURL,
NSFileProviderItem metadata,
org.moe.natj.general.ptr.Ptr<NSError> error)
Writes out a placeholder at the specified URL.
|
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 NSFileProviderManager(org.moe.natj.general.Pointer peer)
public static boolean accessInstanceVariablesDirectly()
public static void addDomainCompletionHandler(NSFileProviderDomain domain, NSFileProviderManager.Block_addDomainCompletionHandler completionHandler)
If a domain with the same identifier already exists, `addDomain` will update the display name and hidden state of the domain and succeed.
When the domain is backed by a NSFileProviderReplicatedExtension, the system will create a disk location where the domain will be replicated. If that location already exists on disk this call will fail with the code NSFileWriteFileExistsError.
public static NSFileProviderManager alloc()
public static NSFileProviderManager 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 NSFileProviderManager defaultManager()
public static java.lang.String description_static()
public NSURL documentStorageURL()
If the NSExtensionFileProviderDocumentGroup property is not set, calling this method will result in an error.
public static void getDomainsWithCompletionHandler(NSFileProviderManager.Block_getDomainsWithCompletionHandler completionHandler)
public static long hash_static()
public NSFileProviderManager init()
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 NSFileProviderManager managerForDomain(NSFileProviderDomain domain)
public static NSFileProviderManager new_objc()
public static NSURL placeholderURLForURL(NSURL url)
public java.lang.String providerIdentifier()
public void registerURLSessionTaskForItemWithIdentifierCompletionHandler(NSURLSessionTask task, java.lang.String identifier, NSFileProviderManager.Block_registerURLSessionTaskForItemWithIdentifierCompletionHandler completion)
public static void removeAllDomainsWithCompletionHandler(NSFileProviderManager.Block_removeAllDomainsWithCompletionHandler completionHandler)
public static void removeDomainCompletionHandler(NSFileProviderDomain domain, NSFileProviderManager.Block_removeDomainCompletionHandler completionHandler)
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 void signalEnumeratorForContainerItemIdentifierCompletionHandler(java.lang.String containerItemIdentifier,
NSFileProviderManager.Block_signalEnumeratorForContainerItemIdentifierCompletionHandler completion)
Set the containerItemIdentifier to the identifier of the enumerated container that was specified in -[NSFileProviderExtension enumeratorForContainerItemIdentifier:error:]
This will trigger another call to -[NSFileProviderEnumerator enumerateChangesForObserver:fromSyncAnchor:] and the UI will be refreshed, giving the user live updates on the presented enumeration.
If you have a change in the working set, call this method with containerItemIdentifier set to NSFileProviderWorkingSetContainerItemIdentifier, even if there is no live enumeration for this item. The working set is cached on the device and it's important to keep the cache in sync.
In addition to using this method, your application/extension can register for
pushes using the PKPushTypeFileProvider push type. Pushes of the form
{
container-identifier = "
public static org.moe.natj.objc.Class superclass_static()
public static long version_static()
public static boolean writePlaceholderAtURLWithMetadataError(NSURL placeholderURL, NSFileProviderItem metadata, org.moe.natj.general.ptr.Ptr<NSError> error)
Your extension should provide placeholders by implementing the providePlaceholderAtURL: method, but your application may choose to proactively write out placeholders to facilitate access to files. This is especially useful if your application wants to actively hand out a file URL, e.g. using UIActivityViewController, in which case it should ensure that either the file or a placeholder is present on disk first.
The path of the placeholder is fixed and must be determined in advance by calling the placeholderURLForURL: method.