net.sourceforge.rssowl.util.archive
Class ArchiveManager

java.lang.Object
  extended by net.sourceforge.rssowl.util.archive.ArchiveManager

public class ArchiveManager
extends java.lang.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.2.4
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
 java.io.File createUniqueArchiveFile()
          Create a unique archive file to save an archive item
private  void deleteArchiveFile(java.lang.String fileName)
          Delete a file from the archive
 void flush()
          Sync all changes to the Archive with the File-System.
 Archive getArchive()
           
private  boolean isArchiveFileExisting(java.lang.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(java.lang.String feedurl)
          Load an archive item from the archive
private  ArchiveIndex loadIndex()
          Load the archive index
private  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 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 java.io.File createUniqueArchiveFile()
                                     throws java.io.IOException
Create a unique archive file to save an archive item

Returns:
File The unique file
Throws:
java.io.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

private void saveArchive()
Save all archive items


flush

public void flush()
Sync all changes to the Archive with the File-System.


startup

public void startup()
Startup process


deleteArchiveFile

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

Parameters:
fileName - The file to delete

isArchiveFileExisting

private boolean isArchiveFileExisting(java.lang.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(java.lang.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