public final class NSFileCoordinatorWritingOptions
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static long |
ContentIndependentMetadataOnly
Whether the writing to be done will change the item's metadata only and not its contents.
|
static long |
ForDeleting
Whether the writing to be done is actually the deletion of the item.
|
static long |
ForMerging
Whether coordinated writing triggers sending of -savePresentedItemChangesWithCompletionHandler: to certain NSFilePresenters in the system and waiting for those NSFilePresenters to respond.
|
static long |
ForMoving
Whether the writing to be done is actually the moving or renaming of the item.
|
static long |
ForReplacing
Whether the writing to be done is actually the replacement of the item with a different item.
|
public static final long ForDeleting
For example, Finder uses this when it's emptying the trash to give NSFilePresenters a chance to close documents before their files disappear, or would disappear if the files weren't still open.
public static final long ForMoving
For example, Finder uses this when it's moving items that the user has dragged and dropped so as not to yank files contained by moved folders out from underneath applications that are reading or writing those files.
public static final long ForMerging
public static final long ForReplacing
For example, NSDocument uses this for NSSaveAsOperation and NSSaveToOperation to announce that it is possibly overwriting an item with a brand new file or file package. This gives any NSFilePresenter of the overwritten item, including perhaps a different instance of NSDocument, perhaps in the same application, a chance to close itself before the item is overwritten.
For another example, the most accurate and safe way to coordinate a move is to invoke -coordinateWritingItemAtURL:options:writingItemAtURL:options:error:byAccessor: using the NSFileCoordinatorWritingForMoving option with the source URL and NSFileCoordinatorWritingForReplacing with the destination URL.
public static final long ContentIndependentMetadataOnly