public static void cleanMp3Songs(File directory)
   {
      for(File file : directory.listFiles())
      {
         // if this is a sub-directory, then go examine .mp3 files in it
         if (file.isDirectory())
         {
            cleanMp3Songs(file);
         }
         else if (file.getName().endsWith(".mp3"))
         {
            MP3 mp3 = null;
            try
            {
               mp3 = new MP3(file);
               if (mp3.hasErrors())
               {
                  mp3.displayErrors(System.out);      // display the errors that were found
                  mp3.save();                         // save the valid frames back to the .mp3 file, discarding the invalid frames
               }
               else
               {
                  System.out.println(mp3.getPath());
               }
            }
            catch (IOException ex)
            {
               // an error occurred reading/saving the .mp3 file.
               // you may try to read it again to see if the error still occurs.
               System.err.println("Error occurred while reading/saving ID3 tags from " + file.getPath() + ".");
               if (mp3 != null)
                   System.out.println(mp3);
               ex.printStackTrace();
            }
         }
      }
   }