Package apple.fileprovider.protocol
Interface NSFileProviderItem
-
- All Known Subinterfaces:
NSFileProviderItemDecorating
public interface NSFileProviderItem
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default longcapabilities()The capabilities of the item.default NSNumberchildItemCount()default NSDatecontentModificationDate()default UTTypecontentType()ContentType (UTType) for the item.default NSDatecreationDate()default NSNumberdocumentSize()default NSErrordownloadingError()default NSNumberfavoriteRank()The presence of a favorite rank indicates that a directory is a favorite.java.lang.Stringfilename()The file or directory name, complete with its file extension.default booleanisDownloaded()default booleanisDownloading()default booleanisMostRecentVersionDownloaded()default booleanisShared()default booleanisSharedByCurrentUser()default booleanisTrashed()Set on a directory or a document if it should appear in the trash.default booleanisUploaded()The download and upload properties below determine which of the cloud badges (uploading, downloading, pending) will be shown on the item.default booleanisUploading()java.lang.StringitemIdentifier()default NSDatelastUsedDate()The date this item was last used.default NSPersonNameComponentsmostRecentEditorNameComponents()default NSPersonNameComponentsownerNameComponents()ownerNameComponents should be nil when sharedByCurrentUser is equal to YES or when the item is not shared.java.lang.StringparentItemIdentifier()The parent identifier specifies the parent of the item in the hierarchy.default NSDatatagData()An abstract data blob reprenting the tags associated with the item.default java.lang.StringtypeIdentifier()Uniform type identifier (UTI) for the item.default NSErroruploadingError()An error that occurred while uploading to your remote server.default NSDictionary<?,?>userInfo()Use this dictionary to add state information to the item.default NSDataversionIdentifier()The versionIdentifier is used to invalidate the thumbnail in the thumbnail cache.
-
-
-
Method Detail
-
capabilities
default long capabilities()
The capabilities of the item. This controls the list of actions that the UI will allow for the item.
-
childItemCount
default NSNumber childItemCount()
-
contentModificationDate
default NSDate contentModificationDate()
-
creationDate
default NSDate creationDate()
-
documentSize
default NSNumber documentSize()
-
downloadingError
default NSError downloadingError()
-
favoriteRank
default NSNumber favoriteRank()
The presence of a favorite rank indicates that a directory is a favorite. Favorite ranks are 64-bit unsigned integers. The initial value for the first item is the time since the unix epoch in milliseconds, but subsequent items are simply placed relative to that. Favorite ranks are modified when the user reorders favorites. When favoriting folders on other platforms, set the rank to the time since the unix epoch in milliseconds. Special value @(NSFileProviderFavoriteRankUnranked) may be used if no rank is available: the system will then figure out the best rank and set it. Please persist and sync the new value. This property must not be shared between users, even if the item is.
-
filename
java.lang.String filename()
The file or directory name, complete with its file extension.
-
isDownloaded
default boolean isDownloaded()
-
isDownloading
default boolean isDownloading()
-
isMostRecentVersionDownloaded
default boolean isMostRecentVersionDownloaded()
-
isShared
default boolean isShared()
-
isSharedByCurrentUser
default boolean isSharedByCurrentUser()
-
isTrashed
default boolean isTrashed()
Set on a directory or a document if it should appear in the trash. This flag should only be set on the top-level item: trashing a directory sets this flag on the directory itself, but not on its children. Trashed items should remain in the working set; however, children of trashed directories should be removed from the working set.
-
isUploaded
default boolean isUploaded()
The download and upload properties below determine which of the cloud badges (uploading, downloading, pending) will be shown on the item.
-
isUploading
default boolean isUploading()
-
itemIdentifier
java.lang.String itemIdentifier()
-
lastUsedDate
default NSDate lastUsedDate()
The date this item was last used. This is neither the modification date nor the last access date exposed in traditional file system APIs, and indicates a very clear user intent to use the document. For example, this is set when the document is open full screen on a device. This is the system's cue that the document is recent and should appear in the recent list of the UIDocumentBrowserViewController. This property must not be shared between users, even if the item is.
-
mostRecentEditorNameComponents
default NSPersonNameComponents mostRecentEditorNameComponents()
-
ownerNameComponents
default NSPersonNameComponents ownerNameComponents()
ownerNameComponents should be nil when sharedByCurrentUser is equal to YES or when the item is not shared.
-
parentItemIdentifier
java.lang.String parentItemIdentifier()
The parent identifier specifies the parent of the item in the hierarchy. Set to NSFileProviderRootContainerItemIdentifier for an item at the root of the user's storage. Set to the itemIdentifier of the item's parent otherwise. When enumerating the root container or a generic container, the parentItemIdentifier of the enumerated items is expected to match the enumerated item's identifier. When enumerating the working set, the parentItemIdentifier is expected to match the actual parent of the item in the hierarchy (ie. it is not NSFileProviderWorkingSetContainerItemIdentifier). The parents of trashed items and of the root item are ignored.
-
tagData
default NSData tagData()
An abstract data blob reprenting the tags associated with the item. The same tags that are available via -[NSURL getResourceValue:forKey:error:] with key NSURLTagNamesKey on macOS, except that this data blob may transport more information than just the tag names. This property must not be shared between users, even if the item is.
-
typeIdentifier
default java.lang.String typeIdentifier()
Uniform type identifier (UTI) for the item. An item should implement at least one of typeIdentifier and contentType. Note that typeIdentifier is required on iOS 13 and earlier.
-
uploadingError
default NSError uploadingError()
An error that occurred while uploading to your remote server. \note Typical uploading errors include: - NSFileProviderErrorInsufficientQuota - NSFileProviderErrorServerUnreachable \seealso NSFileProviderErrorInsufficientQuota \seealso NSFileProviderErrorServerUnreachable
-
userInfo
default NSDictionary<?,?> userInfo()
Use this dictionary to add state information to the item. It is accessible to FileProviderUI action predicates and user interaction predicates [1]. All values for this dictionary must be of type String, Number, Bool or Date. [1] UserInteraction can be defined when a user level action occurs with a file. - `NSFileProviderUserInteractions` *array* - `ActivationRule ` *string*, the predicate. [@parameters] predicates - `destinationItem`: the destination item for an action (only present for Move/Import) - `destinationItemHierarchy` : represents destinationItem and all its parent chain to allow for search on first item in hierarchy that has a given value. (only present for Move/ImportHere) - `action` : the action that is being performed 'Move' : moving items within the same provider 'Export' : moving items out of the provider 'ImportHere' : importing item(s) into a folder/root of the provider 'Trash' : trashing item(s) 'Delete' : deleting item(s) - `sourceItem` : current item that the predicate is evaluating (only present for Move/Export) - `sourceItemHierarchy` : represents sourceItem and all its parent chain to allow for search on first item in hierarchy that has a given value. (only present for Move/Export) - `sourceItemsCount` : - In userInteraction, represents the count of sourceItems of an action operation - In subUserInteraction: represents the count of items that matched the previous predicate - `Alert` *dictionary* - `LocalizedTitle` *string*, title of the alert - `LocalizedSubTitle` *string*, sub title of the alert - @parameters for LocalizedTitle/LocalizedSubTitle - `matchingItemsCount`: count of source items that matched the predicate (only present if matchingItemsCount > 0) - `matchingItemsCountMinusOne`: matchingItemsCount minus one (only present if matchingItemsCount > 1) - `matchingItemsCountMinusTwo`: matchingItemsCount minus two (only present if matchingItemsCount > 2) - `firstMatchingItem`: first sourceItem that matched the predicate (only present if matchingItemsCount > 1) - `secondMatchingItem`: second sourceItem that matched the predicate (only present if matchingItemsCount > 2) - `LocalizedRecoveryOptions` - `Continue` *string*, the string for the continue button - default value if not specified - `Cancel` *string*, the string for the cancel button - default value if not specified - `RecoveryOptions` (optional) - `Continue` *bool*, the boolean for whether to have a continue button - default value is YES if not specified - `Destructive` *bool*, the boolean for whether continuing is a destructive action - default value is NO if not specified - `SubInteractions `: *dictionary* (same as `NSFileProviderUserInteractions`) For each interaction, either Alert or SubInteractions must be specified. SubInteractions will be evaluated if the main ActivationRule evaluates to YES for at least once. This allows you to match a general pattern via the top-level activation rule and then select a specialized error message from a list of subpatterns. Here is a sample extension Info.plist: ```NSExtension ...NSFileProviderUserInteractions ```ActivationRule action == Move SubInteractions ActivationRule sourceItem.isShared == NO AND destinationItem.isShared == YES AND destinationItem.isSharedByCurrentUser == YES SubInteractions ActivationRule sourceItemsCount == 1 Alert LocalizedTitle NSStringFormat Are you sure you want to move %@ into %@? NSStringFormatValues firstMatchingItem.filename destinationItem.filename LocalizedSubTitle NSStringFormat If you move it, people added to the shared folder “%@” will be able to access it NSStringFormatValues destinationItem.filename LocalizedRecoveryOptions Continue Save to shared folder ActivationRule sourceItem.isShared == YES AND sourceItem.isSharedByCurrentUser == NO AND destinationItem.isSharedByCurrentUser == YES SubInteractions ActivationRule sourceItemsCount == 1 Alert LocalizedTitle NSStringFormat This shared item can't be moved. LocalizedSubTitle NSStringFormat Items shared with you can’t be moved to shared folders RecoveryOptions Continue
-
versionIdentifier
default NSData versionIdentifier()
The versionIdentifier is used to invalidate the thumbnail in the thumbnail cache. A content hash would be a reasonable choice. Version identifiers are limited to 1000 bytes.
-
contentType
default UTType contentType()
ContentType (UTType) for the item. An item should implement at least one of typeIdentifier and contentType. Note that typeIdentifier is required on iOS 13 and earlier.
-
-