Applicet Framework for Applets and Applications v2.03

be.arci.applet
Interface HFile


public interface HFile

Defines some common primitive constants for Applicet.

Tip: If you refer to them as HFile.CONSTANT their values will be inlined by the compiler and the file HFile.class need not be included when distributing your software. You do have to include the .class file if you choose to specify implements HFile in one of your classes for referring to the defined constants without the HFile. prefix.


Field Summary
static int CONTEXT_CLASS
          The context for finding resources through the applet's classloader by constructing an url for the resource as in getClass().getResource(String).
static int CONTEXT_CLASSSTREAM
          The context for finding resources by opening an InputStream on the resource, as in ClassLoader.getResourceAsStream(String).
static int CONTEXT_CODEBASE
          The context for constructing resource URLs based on the applet's codebase (i.e. the file-system) as new URL(getCodeBase(), String).
static int CONTEXT_SYSTEM
          The context for finding resources as a system resource, i.e. by constructing an url for the resource as in ClassLoader.getSystemResource(String).
static int CONTEXT_SYSTEMSTREAM
          The context for finding resources by opening an InputStream on the resource, as in ClassLoader.getSystemResourceAsStream(String).
 

Field Detail

CONTEXT_CODEBASE

public static final int CONTEXT_CODEBASE
The context for constructing resource URLs based on the applet's codebase (i.e. the file-system) as new URL(getCodeBase(), String). This context does not check for the existence of a resource referred to by the url. The Applicet Framework uses this resource context mainly as fallback for the others, so that Applicets can retrieve resources from the user directory (for Applicet applications) or website base directory (for Applicet applets), even if these are not on the classpath.
See Also:
getResource, getResourceAsStream, getImage, getAudioClip, play

CONTEXT_CLASS

public static final int CONTEXT_CLASS
The context for finding resources through the applet's classloader by constructing an url for the resource as in getClass().getResource(String). This context is usefull for applets loaded from a .jar or .zip archive. This context returns null if it cannot locate the resource.
See Also:
getResource, getResourceAsStream, getImage, getAudioClip, play

CONTEXT_SYSTEM

public static final int CONTEXT_SYSTEM
The context for finding resources as a system resource, i.e. by constructing an url for the resource as in ClassLoader.getSystemResource(String). This context is usefull for applet's loaded from a .jar or .zip archive. This context returns null if it cannot locate the resource.
See Also:
getResource, getResourceAsStream, getImage, getAudioClip, play

CONTEXT_CLASSSTREAM

public static final int CONTEXT_CLASSSTREAM
The context for finding resources by opening an InputStream on the resource, as in ClassLoader.getResourceAsStream(String). This context is usefull for Applicet applets in a Netscape JVM loaded from a .jar or .zip archive. This context returns null if it cannot locate the resource.

NOTE:
For most cases, you can just rely on Applicet's plain getResource(), getImage() and getAudioClip() methods without worrying about Netscape or anything else.

See Also:
getResource, getResourceAsStream, getImage, getAudioClip, play

CONTEXT_SYSTEMSTREAM

public static final int CONTEXT_SYSTEMSTREAM
The context for finding resources by opening an InputStream on the resource, as in ClassLoader.getSystemResourceAsStream(String). This context is usefull for Applicet applets in a Netscape JVM loaded from a .jar or .zip archive. This context returns null if it cannot locate the resource.

NOTE:
For most cases, you can just rely on Applicet's plain getResource(), getImage() and getAudioClip() methods without worrying about Netscape or anything else.

See Also:
getResource, getResourceAsStream, getImage, getAudioClip, play

Applicet Framework for Applets and Applications v2.03