Platforms to show: All Mac Windows Linux Cross-Platform
NSFileVersionMBS class
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
class | iCloud | MBS MacCloud Plugin | 11.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Instances of NSFileVersionMBS for the same version of the same file are equal, and instances of NSFileVersionMBS for different versions of the same file are not equal, but the equality of NSFileVersionMBSs for different files is undefined. Repeated invocations of the methods that return NSFileVersionMBSs do not necessarily return the exact same instance of NSFileVersionMBS.
An NSFileVersion object represents a snapshot of a file at a specific point in time. You use the NSFileVersion class to access and create and manage file revisions in your application. Each instance of this class contains meta information about a single revision, such as the location of the file containing the revision data, the modification date of the revision, and whether the revision is discardable.
In Mac OS X applications, you can use file version objects to track changes to a local file over time and to prevent the loss of data during editing. When managing local versions, the document architecture creates versions at specific points in the lifetime of your application. Your application can also create versions explicitly at times that your application designates as appropriate.
In addition to managing local files, the system also uses this class to manage cloud-based files. For files in the cloud, there is usually only one version of the file at any given time. However, additional file versions may be created in cases where two different computers attempt to save the file to the cloud at the same time. In that case, one file is chosen as the current version and any other versions are tagged as being in conflict with the original. Conflict versions are reported to the appropriate file presenter objects and should be resolved as soon as possible so that the corresponding files can be removed from the cloud.
Available on Mac OS X 10.7 or later.
Please also check the documentation from Apple for the NSFileVersion class.
Works also well with files in backup (Time Machine) to find older versions.
This is an abstract class. You can't create an instance, but you can get one from various plugin functions.
- 3 properties
- property Handle as Integer
- property Discardable as boolean
- property Resolved as boolean
- 12 methods
- method Conflict as boolean
- method Constructor Private
- method File as folderitem
- method localizedName as string
- method localizedNameOfSavingComputer as string
- method modificationDate as date
- method modificationDateTime as dateTime
- method persistentIdentifier as Memoryblock
- method removeAndReturnError(byref error as NSErrorMBS) as boolean
- method replaceItemAtURL(file as folderitem, options as Integer, byref error as NSErrorMBS) as string
- method replaceItemAtURL(url as string, options as Integer, byref error as NSErrorMBS) as string
- method URL as string
- 13 shared methods
- shared method addVersionOfItemAtURL(url as string, withContentsOfURL as string, options as Integer, byref error as NSErrorMBS) as NSFileVersionMBS
- shared method currentVersionOfItemAtURL(file as folderitem) as NSFileVersionMBS
- shared method currentVersionOfItemAtURL(url as string) as NSFileVersionMBS
- shared method FileURL(file as folderitem) as string
- shared method otherVersionsOfItemAtURL(file as folderitem) as NSFileVersionMBS()
- shared method otherVersionsOfItemAtURL(url as string) as NSFileVersionMBS()
- shared method removeOtherVersionsOfItemAtURL(file as folderitem, byref error as NSErrorMBS) as boolean
- shared method removeOtherVersionsOfItemAtURL(url as string, byref error as NSErrorMBS) as boolean
- shared method temporaryDirectoryURLForNewVersionOfItemAtURL(url as string) as string
- shared method unresolvedConflictVersionsOfItemAtURL(file as folderitem) as NSFileVersionMBS()
- shared method unresolvedConflictVersionsOfItemAtURL(url as string) as NSFileVersionMBS()
- shared method versionOfItemAtURLforPersistentIdentifier(file as folderitem, PersistentIdentifier as Memoryblock) as NSFileVersionMBS
- shared method versionOfItemAtURLforPersistentIdentifier(URL as string, PersistentIdentifier as Memoryblock) as NSFileVersionMBS
- 2 constants
Constants
Constant | Value | Description |
---|---|---|
NSFileVersionAddingByMoving | 1 |
One of the constants for addVersionOfItemAtURL.
Whether addVersionOfItemAtURL can move the new version contents file into the version store instead of copying it. Moving is much faster. See the comment for temporaryDirectoryURLForNewVersionOfItemAtURL for an example of when this useful. |
NSFileVersionReplacingByMoving | 1 |
One of the constants for replaceItemAtURL.
Whether replaceItemAtURL must move the version's contents out of the version store instead of copying it. This is useful when you want to promote a version's contents to a separate file. You wouldn't use this to restore a version of a file. |
This class has no sub classes.
Some events using this class:
- NSFilePresenterMBS.presentedItemDidGainVersion(version as NSFileVersionMBS)
- NSFilePresenterMBS.presentedItemDidLoseVersion(version as NSFileVersionMBS)
- NSFilePresenterMBS.presentedItemDidResolveConflictVersion(version as NSFileVersionMBS)
- NSFilePresenterMBS.presentedSubitemAtURLdidGainVersion(URL as string, file as FolderItem, version as NSFileVersionMBS)
- NSFilePresenterMBS.presentedSubitemAtURLdidLoseVersion(URL as string, file as FolderItem, version as NSFileVersionMBS)
- NSFilePresenterMBS.presentedSubitemAtURLdidResolveConflictVersion(URL as string, file as FolderItem, version as NSFileVersionMBS)
Blog Entries
The items on this page are in the following plugins: MBS MacCloud Plugin.
NSFilePresenterMBS - NSFileWrapperMBS