Coverage Report - org.jaudiotagger.audio.mp3.MP3FileWriter
 
Classes in this File Line Coverage Branch Coverage Complexity
MP3FileWriter
45%
5/11
N/A
1.4
 
 1  
 package org.jaudiotagger.audio.mp3;
 2  
 
 3  
 import org.jaudiotagger.audio.AudioFile;
 4  
 import org.jaudiotagger.audio.exceptions.CannotWriteException;
 5  
 import org.jaudiotagger.audio.exceptions.CannotReadException;
 6  
 import org.jaudiotagger.audio.generic.AudioFileWriter;
 7  
 import org.jaudiotagger.tag.Tag;
 8  
 
 9  
 import java.io.IOException;
 10  
 import java.io.RandomAccessFile;
 11  
 
 12  
 /**
 13  
  * Write Mp3 Info (retrofitted to entagged ,done differently to entagged which is why some methods throw RuntimeException)
 14  
  * because done elsewhere
 15  
  */
 16  4
 public class MP3FileWriter extends AudioFileWriter
 17  
 {
 18  
     public void deleteTag(AudioFile f) throws CannotWriteException
 19  
     {
 20  
         //Because audio file is an instanceof MP3File this directs it to save
 21  
         //taking into account if the tag has been sent to null in which case it will be deleted
 22  0
         f.commit();
 23  0
     }
 24  
 
 25  
     public void writeFile(AudioFile f) throws CannotWriteException
 26  
     {
 27  
         //Because audio file is an instanceof MP3File this directs it to save
 28  0
         f.commit();
 29  0
     }
 30  
 
 31  
     /**
 32  
      * Delete the Id3v1 and ID3v2 tags from file
 33  
      *
 34  
      * @param af
 35  
      * @throws CannotReadException
 36  
      * @throws CannotWriteException
 37  
      */
 38  
     @Override
 39  
     public synchronized void delete(AudioFile af) throws CannotReadException, CannotWriteException
 40  
     {
 41  1
         ((MP3File)af).setID3v1Tag(null);
 42  1
         ((MP3File)af).setID3v2Tag(null);                
 43  1
         af.commit();
 44  1
     }
 45  
 
 46  
     protected void writeTag(Tag tag, RandomAccessFile raf, RandomAccessFile rafTemp) throws CannotWriteException, IOException
 47  
     {
 48  0
         throw new RuntimeException("MP3FileReaderwriteTag should not be called");
 49  
     }
 50  
 
 51  
     protected void deleteTag(RandomAccessFile raf, RandomAccessFile tempRaf) throws CannotWriteException, IOException
 52  
     {
 53  0
         throw new RuntimeException("MP3FileReader.getEncodingInfo should be called");
 54  
     }
 55  
 }
 56  
 
 57