org.apache.maven.archiva.transaction
Class AbstractTransactionEvent

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

public abstract class AbstractTransactionEvent
extends java.lang.Object
implements TransactionEvent

Abstract class for the TransactionEvents


Constructor Summary
protected AbstractTransactionEvent()
           
protected AbstractTransactionEvent(java.util.List digesters)
           
 
Method Summary
protected  void createBackup(java.io.File file)
           
protected  void createChecksums(java.io.File file, boolean force)
          Create checksums of file using all digesters defined at construction time.
protected  java.lang.String getDigesterFileExtension(org.codehaus.plexus.digest.Digester digester)
          File extension for checksums TODO should be moved to plexus-digester ?
protected  java.util.List getDigesters()
           
protected  void mkDirs(java.io.File dir)
          Method that creates a directory as well as all the parent directories needed
protected  void restoreBackup(java.io.File file)
           
protected  void restoreBackups()
           
protected  void revertFilesCreated()
           
protected  void revertMkDirs()
           
protected  void writeStringToFile(java.io.File file, java.lang.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.maven.archiva.transaction.TransactionEvent
commit, rollback
 

Constructor Detail

AbstractTransactionEvent

protected AbstractTransactionEvent()

AbstractTransactionEvent

protected AbstractTransactionEvent(java.util.List digesters)
Method Detail

getDigesters

protected java.util.List getDigesters()

mkDirs

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

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

revertMkDirs

protected void revertMkDirs()
                     throws java.io.IOException
Throws:
java.io.IOException

revertFilesCreated

protected void revertFilesCreated()
                           throws java.io.IOException
Throws:
java.io.IOException

createBackup

protected void createBackup(java.io.File file)
                     throws java.io.IOException
Throws:
java.io.IOException

restoreBackups

protected void restoreBackups()
                       throws java.io.IOException
Throws:
java.io.IOException

restoreBackup

protected void restoreBackup(java.io.File file)
                      throws java.io.IOException
Throws:
java.io.IOException

createChecksums

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

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

writeStringToFile

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

Throws:
java.io.IOException

getDigesterFileExtension

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