com.myjavaworld.jftp
Class FavoritesManager

java.lang.Object
  extended by com.myjavaworld.jftp.FavoritesManager

public class FavoritesManager
extends Object

A Class used to serialize/deserialize favourite FTP sites. This is the central point that contains all the IO logic required to retrieve/store/add/edit/delete favouritre FTP sites.

Version:
2.0
Author:
Sai Pullabhotla, psai [at] jMethods [dot] com

Constructor Summary
FavoritesManager()
           
 
Method Summary
static void addFavorite(RemoteHost host)
          Adds the given favourite to the list of previously stored favorites and saves them back to the favorites file.
static List getFavorites()
          Returns the list of favourite FTP sites.
static void saveFavorites(List favorites)
          Saves the given list of favourite FTP sites to the favorite file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FavoritesManager

public FavoritesManager()
Method Detail

getFavorites

public static List getFavorites()
                         throws IOException,
                                ClassNotFoundException,
                                IllegalBlockSizeException,
                                BadPaddingException
Returns the list of favourite FTP sites. The list is generated by reading the serialized file, FAV_FILE.

Returns:
List of favourite FTP sites.
Throws:
IOException - if an IO error occurs while reading the file
ClassNotFoundException - We should never get this exception. If we get this, it means that the software is not installed correctly.
IllegalBlockSizeException
BadPaddingException

saveFavorites

public static void saveFavorites(List favorites)
                          throws IOException,
                                 IllegalBlockSizeException
Saves the given list of favourite FTP sites to the favorite file.

Parameters:
favorites - List of favorites to be searialized
Throws:
IOException - if an IO error occurs
IllegalBlockSizeException

addFavorite

public static void addFavorite(RemoteHost host)
                        throws IOException,
                               ClassNotFoundException,
                               IllegalBlockSizeException,
                               BadPaddingException
Adds the given favourite to the list of previously stored favorites and saves them back to the favorites file.

Parameters:
host - Favorite FTP site
Throws:
IOException - if an IO error occurs
ClassNotFoundException
IllegalBlockSizeException
BadPaddingException


Copyright © 2000-2012 jMethods, Inc.. All Rights Reserved.