org.jaudiotagger.audio.generic
Interface AudioFileModificationListener

All Known Implementing Classes:
AudioFileModificationAdapter, ModificationHandler

public interface AudioFileModificationListener

Classes implementing this interface will be notified on audio file's modifications.

It will be notified on several occasions:

Author:
Christian Laireiter

Method Summary
 void fileModified(AudioFile original, java.io.File temporary)
          Notifies that original has been processed.
Because the audiolibrary allows format implementors to either change the original file or create a copy, it is possible that the real result is located in the original and temporary is of zero size or the original will be deleted and replaced by temporary.
 void fileOperationFinished(java.io.File result)
          Informs the listener that the process has been finished.
The given file is either the original file or the modified copy.
 void fileWillBeModified(AudioFile file, boolean delete)
          Notifies that the file is about to be modified.
 void vetoThrown(AudioFileModificationListener cause, AudioFile original, ModifyVetoException veto)
          This method notifies about a veto exception that has been thrown by another listener.
 

Method Detail

fileModified

void fileModified(AudioFile original,
                  java.io.File temporary)
                  throws ModifyVetoException
Notifies that original has been processed.
Because the audiolibrary allows format implementors to either change the original file or create a copy, it is possible that the real result is located in the original and temporary is of zero size or the original will be deleted and replaced by temporary.

Parameters:
original - The original file on which the operation was started.
temporary - The modified copy. (It may be of zero size if the original was modified)
Throws:
ModifyVetoException - If the Results doesn't fit the expectations of the listener, it can prevent the replacement of the original by temporary.
If the original is already modified, this exception results in nothing.

fileOperationFinished

void fileOperationFinished(java.io.File result)
Informs the listener that the process has been finished.
The given file is either the original file or the modified copy.

Parameters:
result - The remaining file. It's not of AudioFile since it may be possible that a new file was created. In that case the audiolibs would need to parse the file again, which leads to long and unnecessary operation time, if the tag data is not needed any more.

fileWillBeModified

void fileWillBeModified(AudioFile file,
                        boolean delete)
                        throws ModifyVetoException
Notifies that the file is about to be modified.

Parameters:
file - The file that will be modified.
delete - true if the deletion of tag data will be performed.
Throws:
ModifyVetoException - Thrown if the listener wants to prevent the process.

vetoThrown

void vetoThrown(AudioFileModificationListener cause,
                AudioFile original,
                ModifyVetoException veto)
This method notifies about a veto exception that has been thrown by another listener.

Parameters:
cause - The instance which caused the veto.
original - The original file, that was about to be modified.
veto - The thrown exception.