org.sourcejammer.project.model.filesys
Class FileSysArchiveGetter

java.lang.Object
  |
  +--org.sourcejammer.project.model.filesys.FileSysArchiveGetter
All Implemented Interfaces:
ArchiveGetter

public class FileSysArchiveGetter
extends java.lang.Object
implements ArchiveGetter

Title: $FileName: FileSysArchiveGetter.java$

Version:
$VerNum: 4$
Author:
$AuthorName: Rob MacGrogan$

$Description: $
$KeyWordsOff: $

Singleton implementation of ArchiveGetter for file system. This object is able to return information about all the archives stored on the file system for this installation of Source Jammer. It can also return the Archive object for a given archive.

Field Summary
static java.lang.String ARCHIVE_LIST_FILE_NAME
           
private static FileSysArchiveGetter instance
           
private  java.util.Hashtable mhshArchiveInfoFilePaths
           
 
Constructor Summary
private FileSysArchiveGetter()
           
 
Method Summary
 void addArchive(java.lang.String name, java.lang.String pathToArchiveRoot)
           
private  ArchiveInfoFlexFS convertLegacyArchiveInfo(java.lang.String name)
           
private  void deleteAllContents(java.io.File fl)
           
 void deleteArchive(ArchiveInfoFlex archive)
           
 Archive getArchive(ArchiveInfoFlex archive)
           
 ArchiveInfoFlex getArchiveInfo(java.lang.String name)
           
 java.util.Enumeration getArchiveNames()
           
 java.lang.String getFullPathToArchiveInfoObject(java.lang.String name)
           
static FileSysArchiveGetter getInstance()
           
private  void refreshArchiveInfoCache()
           
 void saveArchiveInfo(ArchiveInfo info)
          Does nothing.
 void saveArchiveInfo(ArchiveInfoFlex info)
           
private  void saveArchivesList()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ARCHIVE_LIST_FILE_NAME

public static final java.lang.String ARCHIVE_LIST_FILE_NAME
See Also:
Constant Field Values

mhshArchiveInfoFilePaths

private java.util.Hashtable mhshArchiveInfoFilePaths

instance

private static FileSysArchiveGetter instance
Constructor Detail

FileSysArchiveGetter

private FileSysArchiveGetter()
Method Detail

refreshArchiveInfoCache

private void refreshArchiveInfoCache()

getInstance

public static FileSysArchiveGetter getInstance()

getArchiveNames

public java.util.Enumeration getArchiveNames()
                                      throws FileAccessException
Specified by:
getArchiveNames in interface ArchiveGetter
FileAccessException

getFullPathToArchiveInfoObject

public java.lang.String getFullPathToArchiveInfoObject(java.lang.String name)
                                                throws FileAccessException
FileAccessException

getArchiveInfo

public ArchiveInfoFlex getArchiveInfo(java.lang.String name)
                               throws FileAccessException
Specified by:
getArchiveInfo in interface ArchiveGetter
FileAccessException

getArchive

public Archive getArchive(ArchiveInfoFlex archive)
                   throws FileAccessException
Specified by:
getArchive in interface ArchiveGetter
FileAccessException

saveArchiveInfo

public void saveArchiveInfo(ArchiveInfoFlex info)
                     throws FileAccessException
Specified by:
saveArchiveInfo in interface ArchiveGetter
FileAccessException

saveArchiveInfo

public void saveArchiveInfo(ArchiveInfo info)
                     throws FileAccessException
Does nothing. Just left in to maintain compatibility with ArchiveInfoFS2.

FileAccessException

addArchive

public void addArchive(java.lang.String name,
                       java.lang.String pathToArchiveRoot)
                throws FileAccessException
Specified by:
addArchive in interface ArchiveGetter
FileAccessException

deleteArchive

public void deleteArchive(ArchiveInfoFlex archive)
                   throws FileAccessException
Specified by:
deleteArchive in interface ArchiveGetter
FileAccessException

deleteAllContents

private void deleteAllContents(java.io.File fl)

saveArchivesList

private void saveArchivesList()
                       throws java.io.IOException
java.io.IOException

convertLegacyArchiveInfo

private ArchiveInfoFlexFS convertLegacyArchiveInfo(java.lang.String name)
                                            throws FileAccessException
FileAccessException


Copyright 2003 Soucejammer project.