net.sourceforge.rssowl.util.archive
Class ArchiveManager

java.lang.Object
  extended bynet.sourceforge.rssowl.util.archive.ArchiveManager

public class ArchiveManager
extends Object

The ArchiveManager handles loading and saving of the archive on startup and shutdown. Its the maincontroller of the whole archive and other objects from RSSOwl access the archive through this class.

Version:
1.1.3
Author:
Benjamin Pasero

Field Summary
private  Archive archive
           
private  org.jdom.input.SAXBuilder builder
           
(package private)  ArchiveIndex index
           
 
Constructor Summary
ArchiveManager()
          Instantiate a new ArchiveManager
 
Method Summary
 File createUniqueArchiveFile()
          Create a unique archive file to save an archive item
private  void deleteArchiveFile(String fileName)
          Delete a file from the archive
private  void deleteIndex()
          Delete the index file
 Archive getArchive()
           
private  boolean isArchiveFileExisting(String fileName)
          Check if the given archive file is existing
private  boolean isIndexExisting()
          Check if the index file is exsiting
 Archive loadArchive()
          Load the archive
private  ArchiveItem loadArchiveItem(String feedurl)
          Load an archive item from the archive
private  ArchiveIndex loadIndex()
          Load the archive index
 void saveArchive()
          Save all archive items
private  void saveArchiveItem(ArchiveItem archiveItem)
          Save an archiveitem to a unique file
private  void saveIndex()
          Save the archive index
 void shutdown()
          Shutdown process
 void startup()
          Startup process
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

archive

private Archive archive

builder

private org.jdom.input.SAXBuilder builder

index

ArchiveIndex index
Constructor Detail

ArchiveManager

public ArchiveManager()
Instantiate a new ArchiveManager

Method Detail

createUniqueArchiveFile

public File createUniqueArchiveFile()
                             throws IOException
Create a unique archive file to save an archive item

Returns:
File The unique file
Throws:
IOException - If an error occurs

getArchive

public Archive getArchive()
Returns:
Returns the archive.

loadArchive

public Archive loadArchive()
Load the archive

Returns:
Archive The archive

saveArchive

public void saveArchive()
Save all archive items


shutdown

public void shutdown()
Shutdown process


startup

public void startup()
Startup process


deleteArchiveFile

private void deleteArchiveFile(String fileName)
Delete a file from the archive

Parameters:
fileName - The file to delete

deleteIndex

private void deleteIndex()
Delete the index file


isArchiveFileExisting

private boolean isArchiveFileExisting(String fileName)
Check if the given archive file is existing

Parameters:
fileName - The name of the file
Returns:
TRUE if the file exists in the archive

isIndexExisting

private boolean isIndexExisting()
Check if the index file is exsiting

Returns:
TRUE if the archive index file exists

loadArchiveItem

private ArchiveItem loadArchiveItem(String feedurl)
Load an archive item from the archive

Parameters:
feedurl - The URL of the feed
Returns:
ArchiveItem The archive item from the archive

loadIndex

private ArchiveIndex loadIndex()
Load the archive index

Returns:
ArchiveIndex The archive index

saveArchiveItem

private void saveArchiveItem(ArchiveItem archiveItem)
Save an archiveitem to a unique file

Parameters:
archiveItem - An archive item that contains severyl archive entries

saveIndex

private void saveIndex()
Save the archive index



RSSOwl - RSS / RDF / Atom Newsreader

SourceForge.net Logo