net.sourceforge.atunes.kernel.modules.repository
Class RepositoryLoader

java.lang.Object
  extended by java.lang.Thread
      extended by net.sourceforge.atunes.kernel.modules.repository.RepositoryLoader
All Implemented Interfaces:
java.lang.Runnable

public class RepositoryLoader
extends java.lang.Thread

Class for loading audiofiles into repository.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
RepositoryLoader(java.util.List<java.io.File> folders, boolean refresh)
          Instantiates a new repository loader.
 
Method Summary
 void addRepositoryLoaderListener(LoaderListener l)
          Adds the repository loader listener.
static void addToRepository(Repository rep, java.util.List<java.io.File> files, java.io.File folder)
          Add files of a folder to repository.
static int countFilesInRepository(Repository rep)
          Count files in repository.
static void fillStats(Repository repository, AudioFile song)
          Fill stats.
 Repository getRepository()
          Gets the repository.
static java.util.List<AudioFile> getSongsForDir(java.io.File dir)
          Gets the songs for dir.
 void interruptLoad()
          Interrupt load.
static void refreshFile(Repository repository, AudioFile file)
          Refresh navigator views.
 void run()
           
 void setOldRepository(Repository oldRepository)
          Sets the old repository.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RepositoryLoader

public RepositoryLoader(java.util.List<java.io.File> folders,
                        boolean refresh)
Instantiates a new repository loader.

Parameters:
folders - the folders
refresh - the refresh
Method Detail

addToRepository

public static void addToRepository(Repository rep,
                                   java.util.List<java.io.File> files,
                                   java.io.File folder)
Add files of a folder to repository.

Parameters:
rep - Repository to which files should be added
files - Files to add
folder - Folder in which the files are located

countFilesInRepository

public static int countFilesInRepository(Repository rep)
Count files in repository.

Parameters:
rep - the rep
Returns:
the int

fillStats

public static void fillStats(Repository repository,
                             AudioFile song)
Fill stats.

Parameters:
repository - the repository
song - the song

getSongsForDir

public static java.util.List<AudioFile> getSongsForDir(java.io.File dir)
Gets the songs for dir.

Parameters:
dir - the dir
Returns:
the songs for dir

refreshFile

public static void refreshFile(Repository repository,
                               AudioFile file)
Refresh navigator views.

Parameters:
repository - the repository
file - the file

addRepositoryLoaderListener

public void addRepositoryLoaderListener(LoaderListener l)
Adds the repository loader listener.

Parameters:
l - the l

getRepository

public Repository getRepository()
Gets the repository.

Returns:
the repository

interruptLoad

public void interruptLoad()
Interrupt load.


run

public void run()
Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

setOldRepository

public void setOldRepository(Repository oldRepository)
Sets the old repository.

Parameters:
oldRepository - the oldRepository to set


Copyright © 2006-2008 The aTunes Team. All Rights Reserved.