org.PingOO.DLAI.lib.util
Class Manager

java.lang.Object
  |
  +--org.PingOO.DLAI.lib.util.Manager
Direct Known Subclasses:
CursorManager, HelpManager, IconManager, ImageManager, SoundManager

public abstract class Manager
extends java.lang.Object

Basic shared class for all managers.
Uses special ClassLoader when accessing JAR file.
When DLAI is expended uses the system's default ClassLoader.

Since:
PingOO 2.0
Version:
2.0
Author:
Fabrice Bouyé (bouye@cur-archamps.fr)
See Also:
ClassLoader, DLAILoader

Field Summary
private static java.lang.ClassLoader classLoader
          The resource loader.
 
Constructor Summary
protected Manager()
          constructs a new manager.
 
Method Summary
protected static java.net.URL findFile(java.lang.String fileName)
          Find a file ad return the correct URL that will be used to load this file.
protected static java.net.URL findFile(java.lang.String baseDirectory, java.lang.String fileName)
          Find a file ad return the correct URL that will be used to load this file.
protected static java.net.URL findFile(java.lang.String baseDirectory, java.lang.String module, java.lang.String fileName)
          Find a file ad return the correct URL that will be used to load this file.
protected static java.net.URL findFile(java.lang.String baseDirectory, java.lang.String module, java.lang.String fileName, java.lang.String extension)
          Find a file ad return the correct URL that will be used to load this file.
private static void initialize()
          Initilizes the resource loader.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

classLoader

private static java.lang.ClassLoader classLoader
The resource loader.
Constructor Detail

Manager

protected Manager()
constructs a new manager.
Method Detail

initialize

private static void initialize()
Initilizes the resource loader.

findFile

protected static java.net.URL findFile(java.lang.String baseDirectory,
                                       java.lang.String module,
                                       java.lang.String fileName,
                                       java.lang.String extension)
Find a file ad return the correct URL that will be used to load this file.
Parameters:
baseDirectory - The directory where to search.
module - The module where the researched file belongs.
fileName - The name of the file to be found
extension - The extension of the researched file.
Returns:
The correct URL to this file or null if this file was not found.

findFile

protected static java.net.URL findFile(java.lang.String baseDirectory,
                                       java.lang.String module,
                                       java.lang.String fileName)
Find a file ad return the correct URL that will be used to load this file.
This method will first search for the file inside the module, then it will search without the module.
Parameters:
baseDirectory - The directory where to search.
module - The module where the researched file belongs.
fileName - The name of the file to be found
Returns:
The correct URL to this file or null if this file was not found.

findFile

protected static java.net.URL findFile(java.lang.String baseDirectory,
                                       java.lang.String fileName)
Find a file ad return the correct URL that will be used to load this file.
Parameters:
baseDirectory - The directory where to search.
fileName - The name of the file to be found
Returns:
The correct URL to this file or null if this file was not found.

findFile

protected static java.net.URL findFile(java.lang.String fileName)
Find a file ad return the correct URL that will be used to load this file.
Parameters:
fileName - The name of the file to be found
Returns:
The correct URL to this file or null if this file was not found.