Class COM.tolstoy.jconfig.FileRegistry
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class COM.tolstoy.jconfig.FileRegistry

java.lang.Object
   |
   +----COM.tolstoy.jconfig.FileRegistry

public class FileRegistry
extends Object
This singleton returns the following information:
- the FileExtension's corresponding to a given FinderInfo
- the FinderInfo's corresponding to a given FileExtension
- applications whose name contain a given string
- applications associated with a given FileExtension
- applications associated with a given FinderInfo
You can also iterate over each record used to build the mappings database which maps FileExtension's to FinderInfo's and both of those to applications.
Before using any method of this class, you must call the initialize method.

Variable Index

 o kInAndOutOnly
See the getDirection() method.
 o kInOnly
See the getDirection() method.
 o kOutOnly
See the getDirection() method.

Method Index

 o createAppFile(File)
Returns an AppFile created from a disk file.
 o findExtensions(FinderInfo, int)
Return an array containing FileExtension objects which correspond to the given FinderInfo object.
 o findFinderInfo(FileExtension, int)
Return an array containing FinderInfo objects which correspond to the given FileExtension object.
 o getApps(FileExtension, int)
Returns an array of applications which are associated with the given FileExtension object.
 o getApps(FinderInfo, int)
Returns an array of applications which are associated with the given FinderInfo object.
 o getApps(String, int)
Returns an array of applications whose name contains the string 'appName'.
 o getDirection()
Returns the direction flags.
 o getFileType(File)
Returns a FileType object representing the file type of a disk file.
 o initialize(File, int)
This method must be called before using any other method of this class.
 o isInited()
Returns whether this class has been initialized.
 o iterate(ConfigEntryVisitor)
For each entry in the mappings database, the 'visit()' method of the 'cev' argument is called.
 o launchURL(String)
Launch the indicated URL.
 o setDirection(int)
Sets the direction flags.

Variables

 o kInOnly
  public final static int kInOnly
See the getDirection() method.
 o kOutOnly
  public final static int kOutOnly
See the getDirection() method.
 o kInAndOutOnly
  public final static int kInAndOutOnly
See the getDirection() method.

Methods

 o initialize
  public static void initialize(File curDir,
                                int creator)
This method must be called before using any other method of this class.
Parameters:
curDir - this must be the directory which contains the file 'jconfig.cfg', which contains configuration information.
creator - the creator value of the application using this package.
 o isInited
  public static boolean isInited()
Returns whether this class has been initialized. If initialization using the previous method failed, false is returned.
 o findExtensions
  public static FileExtension[] findExtensions(FinderInfo finfo,
                                               int maxToReturn)
Return an array containing FileExtension objects which correspond to the given FinderInfo object. The 'maxToReturn' argument is used as a hint only; the actual array size may be greater or less than this. If no extensions were found, null is returned.
 o findFinderInfo
  public static FinderInfo[] findFinderInfo(FileExtension ext,
                                            int maxToReturn)
Return an array containing FinderInfo objects which correspond to the given FileExtension object. The 'maxToReturn' argument is used as a hint only; the actual array size may be greater or less than this. If no FinderInfo objects were found, null is returned.
 o getApps
  public static AppFile[] getApps(String appName,
                                  int maxToReturn)
Returns an array of applications whose name contains the string 'appName'. Case is ignored; whether the argument matches a whole word or not is ignored. The 'maxToReturn' argument is used as a hint only; the actual array size may be greater or less than this. If no applications are found, null is returned.
 o getApps
  public static AppFile[] getApps(FinderInfo finfo,
                                  int maxToReturn)
Returns an array of applications which are associated with the given FinderInfo object. The 'maxToReturn' argument is used as a hint only; the actual array size may be greater or less than this. If no applications are found, null is returned.
 o getApps
  public static AppFile[] getApps(FileExtension ext,
                                  int maxToReturn)
Returns an array of applications which are associated with the given FileExtension object. The 'maxToReturn' argument is used as a hint only; the actual array size may be greater or less than this. If no applications are found, null is returned.
 o iterate
  public static int iterate(ConfigEntryVisitor cev)
For each entry in the mappings database, the 'visit()' method of the 'cev' argument is called. Returns 0 if no error occured.
 o launchURL
  public static int launchURL(String url)
Launch the indicated URL. See the Internet Config documentation for more information. Returns 0 if no error occured. 'url' must be a fully qualified URL.
 o createAppFile
  public static AppFile createAppFile(File fl) throws FileNotFoundException
Returns an AppFile created from a disk file. The file must exist, and be an application.
Parameters:
fl - the file from which to create the object.
 o getFileType
  public static FileType getFileType(File fl) throws FileNotFoundException
Returns a FileType object representing the file type of a disk file. The file must exist.
Parameters:
the - file
 o getDirection
  public static int getDirection()
Returns the direction flags. This is one of four values: 0, kInOnly, kOutOnly, and kInAndOutOnly; these correspond to the check boxes in 'inbound only' and 'outbound only' in the dialog used to edit the Internet Config file mapping database. The default value is 0: no flags are set.
 o setDirection
  public static void setDirection(int dir)
Sets the direction flags. See the getDirection() method.

All Packages  Class Hierarchy  This Package  Previous  Next  Index