net.chaosserver.jtunes.playlist.io
Class M3uPlayListManager

java.lang.Object
  |
  +--net.chaosserver.jtunes.playlist.io.M3uPlayListManager

public class M3uPlayListManager
extends Object

Manages the loading and exporting of playlists in the M3U format.


Nested Class Summary
protected  class M3uPlayListManager.ExporterRunnable
          Class used to export a playlist in a new thread.
 
Constructor Summary
M3uPlayListManager()
           
 
Method Summary
protected  void copyFile(File originalFile, File destinationFolder)
          Copies a file from one location to another.
 void export(File exportDirectory, PlayList playList)
          Exports the playlist to a new directory and copies all the songs into that directory.
protected  void exportCurrentThread(File exportDirectory, PlayList playList)
          Exports the playlist in the current thread.
 PlayList load(File playListFile)
          Loads a playlist from an M3U file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

M3uPlayListManager

public M3uPlayListManager()
Method Detail

load

public PlayList load(File playListFile)
Loads a playlist from an M3U file. Currently comment lines are ignored during the loading process.

Parameters:
playListFile - the file to load as an M3U PlayList
Returns:
a playlist loaded from the file

export

public void export(File exportDirectory,
                   PlayList playList)
Exports the playlist to a new directory and copies all the songs into that directory. This process is done in a background thread.

Parameters:
exportDirectory - directory to export the playlist and move songs into
playList - the playlist to export

exportCurrentThread

protected void exportCurrentThread(File exportDirectory,
                                   PlayList playList)
Exports the playlist in the current thread.

Parameters:
exportDirectory - directory to export the playlist and move songs into
playList - the playlist to export

copyFile

protected void copyFile(File originalFile,
                        File destinationFolder)
                 throws CopyException
Copies a file from one location to another.

Parameters:
originalFile - the original file to copy
destinationFolder - the destination folder to copy the file to
Throws:
CopyException - indicates an error copying the file between locations


Copyright ?? 20030801