medi.db.util
Class Dir2Db

java.lang.Object
  |
  +--medi.db.util.Dir2Db

public class Dir2Db
extends java.lang.Object

Captures directory information to put in the database.


Constructor Summary
Dir2Db()
          Creates new Dir2Db
Dir2Db(Provider pPrv, int pMountPointLength, DirectoryGetter inDirget, java.lang.Integer pVolumeID, java.lang.Integer pSuperSessionID)
          Creates new Dir2Db.
Dir2Db(Provider pPrv, int pMountPointLength, java.io.File inDir, java.lang.Integer pVolumeID, java.lang.Integer pSuperSessionID)
          Creates a new Dir2Db.
 
Method Summary
static void file2Db(Provider pPrv, java.lang.Long dataID, java.io.File tempFile)
          Gets information from a file and stores it in the database.
 void scan()
          Scans directory and puts information in the database.
 void scan(boolean onlyDir)
          Scans directory and puts information in the database.
 void setDirectory(java.io.File inDir)
          Sets the starting directory.
 void setDirectoryGetter(DirectoryGetter inDirget)
          Sets the starting DirectoryGetter.
 void setDispatcher(File2DbDispatcher pDispatcher)
          Sets the dispatcher to be used when analyzing different file types.
 void setMountPointLength(int pMountPointLength)
          Sets the length of the prefix of starting mount point.
 void setProvider(Provider pPrv)
          Sets the provider to use.
 void setStatusFrame(Volume2DbStatus pStatus)
          Sets the status frame to display information into.
 void setSuperSessionID(java.lang.Integer pSuperSessionID)
          Sets the starting session ID.
 void setVolumeID(java.lang.Integer pVolumeID)
          Sets the starting volume ID.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Dir2Db

public Dir2Db()
Creates new Dir2Db


Dir2Db

public Dir2Db(Provider pPrv,
              int pMountPointLength,
              java.io.File inDir,
              java.lang.Integer pVolumeID,
              java.lang.Integer pSuperSessionID)
Creates a new Dir2Db.

Parameters:
pPrv - The provider to use.
pMountPointLength - The length of the prefix of starting mount point.
inDir - The starting directory.
pVolumeID - The starting volume ID.
pSuperSessionID - The starting session ID.

Dir2Db

public Dir2Db(Provider pPrv,
              int pMountPointLength,
              DirectoryGetter inDirget,
              java.lang.Integer pVolumeID,
              java.lang.Integer pSuperSessionID)
Creates new Dir2Db.

Parameters:
pPrv - The provider to use.
pMountPointLength - The length of the prefix of starting mount point.
inDirget - The starting DirectoryGetter to start from.
pVolumeID - The volume ID to start from.
pSuperSessionID - The session ID to start from.
Method Detail

file2Db

public static void file2Db(Provider pPrv,
                           java.lang.Long dataID,
                           java.io.File tempFile)
                    throws DbException
Gets information from a file and stores it in the database.

Parameters:
pPrv - The provider to use.
dataID - The data ID to use.
tempFile - The file to get information from.
Throws:
DbException - If something goes wrong.

setProvider

public void setProvider(Provider pPrv)
Sets the provider to use.

Parameters:
pPrv - The provider.

setStatusFrame

public void setStatusFrame(Volume2DbStatus pStatus)
Sets the status frame to display information into.

Parameters:
pStatus - The status frame to use.

setDispatcher

public void setDispatcher(File2DbDispatcher pDispatcher)
Sets the dispatcher to be used when analyzing different file types.

Parameters:
pDispatcher - The dispatcher to use.

setMountPointLength

public void setMountPointLength(int pMountPointLength)
Sets the length of the prefix of starting mount point.

Parameters:
pMountPointLength - The length of the prefix of starting mount point.

setDirectory

public void setDirectory(java.io.File inDir)
Sets the starting directory.

Parameters:
inDir - The starting directory.

setDirectoryGetter

public void setDirectoryGetter(DirectoryGetter inDirget)
Sets the starting DirectoryGetter.

Parameters:
inDirget - The starting DirectoryGetter.

setVolumeID

public void setVolumeID(java.lang.Integer pVolumeID)
Sets the starting volume ID.

Parameters:
pVolumeID - The starting volume ID.

setSuperSessionID

public void setSuperSessionID(java.lang.Integer pSuperSessionID)
Sets the starting session ID.

Parameters:
pSuperSessionID - The starting session ID.

scan

public void scan(boolean onlyDir)
          throws java.io.IOException,
                 DbException
Scans directory and puts information in the database.

Parameters:
onlyDir - true: only directories are going to be scanned; false: also files are going to be scanned.
Throws:
java.io.IOException - If some I/O error occurred.
DbException - If some database error occurred.

scan

public void scan()
          throws java.io.IOException,
                 DbException
Scans directory and puts information in the database.

Throws:
java.io.IOException - If some I/O error occurred.
DbException - If some database error occurred.