You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by an...@apache.org on 2004/02/11 14:51:55 UTC
cvs commit: cocoon-lenya/src/java/org/apache/lenya/workflow/impl History.java
andreas 2004/02/11 05:51:55
Modified: src/java/org/apache/lenya/workflow/impl History.java
Log:
added deleteHistory() method
Revision Changes Path
1.17 +19 -1 cocoon-lenya/src/java/org/apache/lenya/workflow/impl/History.java
Index: History.java
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/workflow/impl/History.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- History.java 2 Feb 2004 02:50:38 -0000 1.16
+++ History.java 11 Feb 2004 13:51:54 -0000 1.17
@@ -480,5 +480,23 @@
}
return (Version[]) versions.toArray(new Version[versions.size()]);
}
+
+ /**
+ * Deletes the history.
+ * @throws WorkflowException when something went wrong.
+ */
+ public void delete() throws WorkflowException {
+ System.out.println("Deleting file [" + getHistoryFile() + "]");
+ if (!isInitialized()) {
+ throw new WorkflowException("The workflow history is not initialized!");
+ }
+
+ boolean deleted = getHistoryFile().delete();
+
+ if (!deleted) {
+ throw new WorkflowException("The workflow history could not be deleted!");
+ }
+
+ }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-cvs-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-cvs-help@cocoon.apache.org