All Packages This Package Class Hierarchy Class Search Index
java.lang.Object | +----COM.tolstoy.jconfig.FileRegistry
Summary |
public class FileRegistry extends java.lang.Object { // Fields 14 public static final int kGetAppsSearchLevel1; public static final int kGetAppsSearchLevel2; public static final int kGetAppsSearchLevel3; public static final int kGetProcessesIgnoreHidden; public static final int kGetProcessesIgnoreSystem; public static final int kInAndOutOnly; public static final int kInOnly; public static final int kMaximize; public static final int kMinimize; public static final int kMoveToBack; public static final int kMoveToFront; public static final int kOutOnly; public static final int kResolveAliasNoUI; public static final int kResolveAliasUI; // Methods 23 public static int createAlias(DiskObject, File, int, int) throws FileNotFoundException, DiskFileException; public static AppFile createAppFile(File) throws FileNotFoundException, DiskFileException; public static DiskObject createDiskObject(File, int) throws FileNotFoundException, DiskFileException; public static FileExtension[] findExtensions(FinderInfo, int); public static FinderInfo[] findFinderInfo(FileExtension, int); public static AppFile[] getApps(FileExtension, int, int); public static AppFile[] getApps(FinderInfo, int, int); public static AppFile[] getApps(String, int, int); public static FileRegistryI getDelegate(); public static int getDirection(); public static FileSystem[] getFileSystems(int, int); public static FileType getFileType(File) throws FileNotFoundException, DiskFileException; public static Monitor getMainMonitor(); public static Monitor[] getMonitors(); public static AppProcess[] getProcesses(int, int); public static DiskVolume[] getVolumes(); public static void initialize(File, int); public static boolean isInited(); public static int iterate(ConfigEntryVisitor); public static int launchURL(String, int, String[]); public static DiskObject resolveAlias(DiskAlias, int) throws FileNotFoundException, DiskFileException; public static void setDelegate(FileRegistryI); public static void setDirection(int); }
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 use this object to:
- launch a URL or file in a Web browser
- create and resolve aliases
- create AppFile's and DiskObject's
- enumerate the currently mounted volumes
- enumerate the user's active video monitors
- iterate over each record used to build the mappings database which maps
FileExtension's to FinderInfo's and both of those to applications.
Note: Before using any method of this class, you must call the initialize method, as illustrated
in the sample applications.
Fields |
· kInOnly | Summary | Top |
public static final int kInOnly
See the getDirection() method.
· kOutOnly | Summary | Top |
public static final int kOutOnly
See the getDirection() method.
· kInAndOutOnly | Summary | Top |
public static final int kInAndOutOnly
See the getDirection() method.
· kMoveToFront | Summary | Top |
public static final int kMoveToFront
See the launchURL method.
· kMoveToBack | Summary | Top |
public static final int kMoveToBack
See the launchURL method.
· kMinimize | Summary | Top |
public static final int kMinimize
See the launchURL method.
· kMaximize | Summary | Top |
public static final int kMaximize
See the launchURL method.
· kResolveAliasNoUI | Summary | Top |
public static final int kResolveAliasNoUI
See the createDiskObject and resolveAlias methods.
· kResolveAliasUI | Summary | Top |
public static final int kResolveAliasUI
See the createDiskObject and resolveAlias methods.
· kGetAppsSearchLevel1 | Summary | Top |
public static final int kGetAppsSearchLevel1
See the getApps() methods.
· kGetAppsSearchLevel2 | Summary | Top |
public static final int kGetAppsSearchLevel2
See the getApps() methods.
· kGetAppsSearchLevel3 | Summary | Top |
public static final int kGetAppsSearchLevel3
See the getApps() methods.
· kGetProcessesIgnoreSystem | Summary | Top |
public static final int kGetProcessesIgnoreSystem
· kGetProcessesIgnoreHidden | Summary | Top |
public static final int kGetProcessesIgnoreHidden
Methods |
· initialize | Summary | Top |
public static void initialize(File curDir, int creator)
This method must be called before using any other method of this class.
Parameter Description curDir this must be the directory which contains the files 'jconfig.cfg' and 'jcfactrz.txt', both of which are supplied with this distribution.
IMPORTANT:
If 'curDir' does not contain both 'jconfig.cfg' and 'jcfactrz.txt', JConfig will not be properly initialized, and only a limited set of functionality will be provided. In this case, JConfig will output a message saying that FileRegistryPlain has been loaded. If this occurs, check that the 'curDir' directory contains both these files. This directory must be writable; temporary files might be created in this directory.creator the creator value of the application using this package.
· setDelegate | Summary | Top |
public static void setDelegate(FileRegistryI fri)
Sets the object to which all other calls are delegated.
· getDelegate | Summary | Top |
public static FileRegistryI getDelegate()
Returns the object to which all other calls are delegated.
· isInited | Summary | Top |
public static boolean isInited()
Returns whether this class has been initialized. If initialization using the previous method failed, false is returned.
· findExtensions | Summary | Top |
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.
· findFinderInfo | Summary | Top |
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.
· getApps | Summary | Top |
public static AppFile[] getApps(String appName, int maxToReturn, int flags)
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. If no applications are found, null is returned.
Parameter Description appName the string to search for. maxToReturn indicates the maximum number of AppFiles to return. NOTE: this is used as a hint only; the actual array size may be greater or less than this. flags the lower two bits of this int indicate the level of searching which should be performed. 0 indicates only standard searching; the values 'kGetAppsSearchLevel1', 'kGetAppsSearchLevel2', and 'kGetAppsSearchLevel3' indicate increasing levels of searching should be performed. The remaining bits of this int are reserved, and should be set to zero.
· getApps | Summary | Top |
public static AppFile[] getApps(FinderInfo finfo, int maxToReturn, int flags)
Returns an array of applications which are associated with the given FinderInfo object. See the preceding method for details on the arguments.
· getApps | Summary | Top |
public static AppFile[] getApps(FileExtension ext, int maxToReturn, int flags)
Returns an array of applications which are associated with the given FileExtension object. See the preceding method for details on the arguments.
· iterate | Summary | Top |
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.
· launchURL | Summary | Top |
public static int launchURL(String url, int flags, String[] preferredBrowsers)
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 in quoted-printable form.
Parameter Description flags one of the following values: 0, kMoveToFront, kMoveToBack, kMinimize, or kMaximize preferredBrowsers a list of the browsers which should be tried to use to open the URL, in order of preference.
On Mac, each String should be exactly four characters long, and represents a creator code, i.e., { "MSIE", "MOS!" }. This argument will be ignored if Internet Config is installed and properly configured, because Internet Config is given first chance to launch the URL in the user-specified browser.
On Windows, each String represents the name of a DDE server which will be searched for, i.e., { "IEXPLORER", "NETSCAPE", "NSShell" }. This argument will be ignored if one of the indicated servers is not running ( i.e., with the previous example, if both IE and Netscape aren't running, this argument will be ignored. )
This argument may be null.
· getVolumes | Summary | Top |
public static DiskVolume[] getVolumes()
Returns an array containing the current disk volumes. Returns null if an error occurs.
· createAppFile | Summary | Top |
public static AppFile createAppFile(File fl) throws FileNotFoundException, DiskFileException
Returns an AppFile created from a disk file. The file must exist, and be an application.
Parameter Description fl the file from which to create the object.
· createDiskObject | Summary | Top |
public static DiskObject createDiskObject(File fl, int flags) throws FileNotFoundException, DiskFileException
Returns a DiskObject created from a java.io.File object. The returned DiskObject may represent a file, a directory, a drive, or an alias.
Parameter Description fl the file from which to create the object. flags if this is 0, aliases will not be resolved. Otherwise, set this to kResolveAliasUI if interaction with the user is permissible, or to kResolveAliasNoUI if interaction with the user is not permissible.
· createAlias | Summary | Top |
public static int createAlias(DiskObject target, File newAlias, int creator, int flags) throws FileNotFoundException, DiskFileException
Creates an alias. Returns zero if no error occured, non-zero otherwise. Note that both files must already exist; the newAlias argument will be overwritten with the new alias.
Parameter Description target the target to which the alias will point newAlias the new alias creator the creator value which will be given the new alias flags reserved; set to zero
· resolveAlias | Summary | Top |
public static DiskObject resolveAlias(DiskAlias da, int flags) throws FileNotFoundException, DiskFileException
Returns a DiskObject created from an alias. The returned DiskObject may be represent a file, a directory, or a drive.
Parameter Description da the alias from which to create the object. flags must be either kResolveAliasUI if interaction with the user is permissible, or kResolveAliasNoUI if interaction with the user is not permissible.
· getFileType | Summary | Top |
public static FileType getFileType(File fl) throws FileNotFoundException, DiskFileException
Returns a FileType object representing the file type of a disk file. The file must exist.
Parameter Description fl the file
· getDirection | Summary | Top |
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.
· setDirection | Summary | Top |
public static void setDirection(int dir)
Sets the direction flags. See the getDirection() method.
· getMonitors | Summary | Top |
public static Monitor[] getMonitors()
Returns a list of all the video monitors which are currently active.
· getMainMonitor | Summary | Top |
public static Monitor getMainMonitor()
Returns the main video monitor.
· getProcesses | Summary | Top |
public static AppProcess[] getProcesses(int maxToReturn, int flags)
Returns an array of all the currently running processes, whether created using JConfig or not.
· getFileSystems | Summary | Top |
public static FileSystem[] getFileSystems(int maxToReturn, int flags)
Returns an array of all the currently mounted FileSystems. If this information cannot be determined, returns null.
Parameter Description maxToReturn the maximum number of file system to return. The actual number returned may be more than this amount. flags reserved; set to zero
All Packages This Package Class Hierarchy Class Search IndexFreshly brewed Java API Documentation automatically generated with polardoc Version 1.0.7