saveIfModified

abstract fun saveIfModified(): Boolean

Saves the document to original location if it has been changed. If there were no changes to the document, the document file will not be modified. Note that this may take a while and should not be called on the main thread.

Return

true if the file was modified and changes were saved. false if there was nothing to save.


abstract fun saveIfModified(@NonNull saveOptions: DocumentSaveOptions): Boolean

Saves the document to original location if it has been changed. If there were no changes to the document, the document file will not be modified. Note that this may take a while and should not be called on the main thread.

Return

true if the file was modified and changes were saved, false if there was nothing to save.

Parameters

saveOptions

Save options for the document.


abstract fun saveIfModified(@NonNull path: String): Boolean

Saves the document to passed location if it has been changed. If there were no changes to the document, the output file won't be modified. Note that this may take a while and should not be called on the main thread. This will not clear the wasModified flag on this document instance, and will not replace the source of this document either (i.e. subsequent calls to saveIfModified will still save the document back to the original file).

Return

true if the file was modified and changes were saved, false if there was nothing to save.

Parameters

path

Absolute filepath to which to save the document.


abstract fun saveIfModified(@NonNull path: String, @NonNull saveOptions: DocumentSaveOptions): Boolean

Saves the document to passed location if it has been changed. If there were no changes to the document, the output file won't be modified. Note that this may take a while and should not be called on the main thread. This will not clear the wasModified flag on this document instance, and will not replace the source of this document either (i.e. subsequent calls to saveIfModified will still save the document back to the original file).

Return

true if the file was modified and changes were saved, false if there was nothing to save.

Parameters

path

Absolute filepath to which to save the document.

saveOptions

Save options for the document.