net.sf.dc.processes.cdimport
Class ImportCDProcess

java.lang.Object
  extended byjava.lang.Thread
      extended bynet.sf.dc.processes.cdimport.ImportCDProcess
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
ImportMovieCD, ImportMusicFilesCD, ImportSoftwareCD

public abstract class ImportCDProcess
extends java.lang.Thread

Imports data from a CD (or harddisk) location into the insert table of the owner module

Since:
1.4
Version:
1.9
Author:
Robert Jan van der Waals

Field Summary
protected  java.lang.String cdName
           
protected  boolean confirmDirs
           
protected  boolean recursiveDirs
           
protected  java.lang.String sourceDir
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
ImportCDProcess(ImportCDDialog ui, java.lang.String sourceDir, boolean confirmDirs, boolean recursiveDirs, java.lang.String cdName)
          Initializes (but does not run) the CD import process
 
Method Summary
 void cancel()
           
abstract  java.lang.String[] getExtensions()
           
protected  int getFileSize(java.lang.String path)
           
protected abstract  int getModule()
          The UI class which will be updated with the results of the import
protected  java.lang.String getName(java.lang.String file)
           
protected abstract  DcObject parseInformation(java.lang.String sFilename)
          Parses the file for its information.
 void run()
          Starts the CD Import process
 void writeOutput(java.util.Collection filenames)
          Parses the source files for information and adds the parsed information to the insert table of the owner module.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, 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
 

Field Detail

sourceDir

protected java.lang.String sourceDir

confirmDirs

protected boolean confirmDirs

recursiveDirs

protected boolean recursiveDirs

cdName

protected java.lang.String cdName
Constructor Detail

ImportCDProcess

public ImportCDProcess(ImportCDDialog ui,
                       java.lang.String sourceDir,
                       boolean confirmDirs,
                       boolean recursiveDirs,
                       java.lang.String cdName)
Initializes (but does not run) the CD import process

Parameters:
ui - used for displaying the progress
sourceDir - directory which is used as source for the import
confirmDirs - indicates whether for each directory confirmation should be asked if the underlying data of this directory should be read or not.
Method Detail

run

public void run()
Starts the CD Import process


getExtensions

public abstract java.lang.String[] getExtensions()

getFileSize

protected int getFileSize(java.lang.String path)

cancel

public void cancel()

writeOutput

public void writeOutput(java.util.Collection filenames)
Parses the source files for information and adds the parsed information to the insert table of the owner module.

Parameters:
filenames - files to be parsed

getName

protected java.lang.String getName(java.lang.String file)

parseInformation

protected abstract DcObject parseInformation(java.lang.String sFilename)
Parses the file for its information. Needs to be implemented by the extending classes

Parameters:
sFilename - file to be parsed

getModule

protected abstract int getModule()
The UI class which will be updated with the results of the import