org.apache.archiva.transaction
Class AbstractTransactionEvent

java.lang.Object
  extended by org.apache.archiva.transaction.AbstractTransactionEvent
All Implemented Interfaces:
TransactionEvent
Direct Known Subclasses:
CopyFileEvent, CreateFileEvent

public abstract class AbstractTransactionEvent
extends Object
implements TransactionEvent

Abstract class for the TransactionEvents

Version:
$Id: AbstractTransactionEvent.java 1164829 2011-09-03 08:27:41Z olamy $

Constructor Summary
protected AbstractTransactionEvent()
           
protected AbstractTransactionEvent(List<? extends org.codehaus.plexus.digest.Digester> digesters)
           
 
Method Summary
protected  void createBackup(File file)
           
protected  void createChecksums(File file, boolean force)
          Create checksums of file using all digesters defined at construction time.
protected  String getDigesterFileExtension(org.codehaus.plexus.digest.Digester digester)
          File extension for checksums TODO should be moved to plexus-digester ?
protected  List<? extends org.codehaus.plexus.digest.Digester> getDigesters()
           
protected  void mkDirs(File dir)
          Method that creates a directory as well as all the parent directories needed
protected  void restoreBackup(File file)
           
protected  void restoreBackups()
           
protected  void revertFilesCreated()
           
protected  void revertMkDirs()
           
protected  void writeStringToFile(File file, String content)
          TODO: Remove in favor of using FileUtils directly.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.archiva.transaction.TransactionEvent
commit, rollback
 

Constructor Detail

AbstractTransactionEvent

protected AbstractTransactionEvent()

AbstractTransactionEvent

protected AbstractTransactionEvent(List<? extends org.codehaus.plexus.digest.Digester> digesters)
Method Detail

getDigesters

protected List<? extends org.codehaus.plexus.digest.Digester> getDigesters()

mkDirs

protected void mkDirs(File dir)
               throws IOException
Method that creates a directory as well as all the parent directories needed

Parameters:
dir - The File directory to be created
Throws:
IOException - when an unrecoverable error occurred

revertMkDirs

protected void revertMkDirs()
                     throws IOException
Throws:
IOException

revertFilesCreated

protected void revertFilesCreated()
                           throws IOException
Throws:
IOException

createBackup

protected void createBackup(File file)
                     throws IOException
Throws:
IOException

restoreBackups

protected void restoreBackups()
                       throws IOException
Throws:
IOException

restoreBackup

protected void restoreBackup(File file)
                      throws IOException
Throws:
IOException

createChecksums

protected void createChecksums(File file,
                               boolean force)
                        throws IOException
Create checksums of file using all digesters defined at construction time.

Parameters:
file -
force - whether existing checksums should be overwritten or not
Throws:
IOException

writeStringToFile

protected void writeStringToFile(File file,
                                 String content)
                          throws IOException
TODO: Remove in favor of using FileUtils directly.

Throws:
IOException

getDigesterFileExtension

protected String getDigesterFileExtension(org.codehaus.plexus.digest.Digester digester)
File extension for checksums TODO should be moved to plexus-digester ?



Copyright © 2006-2011 The Apache Software Foundation. All Rights Reserved.