Difference between revisions of "Documentation/DevGuide/UCB/Deleting"
From Apache OpenOffice Wiki
< Documentation | DevGuide
(Initial author Sun Microsystems, Inc.) |
m (1 revision(s)) |
(No difference)
|
Revision as of 13:07, 15 February 2008
Executing the command "delete
" on a UCB content destroys the resource it represents. This command takes a boolean parameter. If it is set to true, the resource is immediately, destroyed physically.
If false
is passed to this command, the caller wants to delete the resource "logically". This means that the resource is restored or physically destroyed later. A soft-deleted content needs to support the command "undelete
". This command brings it back to life. The implementation of the delete command can ignore the parameter and may opt to always destroy the resource physically.
Deleting a resource:
import com.sun.star.ucb.*; { XContent xContent = ... ///////////////////////////////////////////////////////////////////// // Destroy a resource physically... ///////////////////////////////////////////////////////////////////// try { Boolean bDeletePhysically = new Boolean(true); // Execute command "delete". // using helper method executeCommand (see [CHAPTER:UCB.Using.Commands]) executeCommand(xContent, "delete", bDeletePhysically); } catch (com.sun.star.ucb.CommandAbortedException e) { ... error ... } catch (com.sun.star.uno.Exception e) { ... error ... } }
Content on this page is licensed under the Public Documentation License (PDL). |