jautil
Class JAEnv

java.lang.Object
  extended by jautil.JAEnv

public final class JAEnv
extends java.lang.Object

A small collection of facilities defining the execution environment of a JA app or applet, including URLs for the JA Home directory, the user's home directory and the app/applet's working directory or codebase.


Constructor Summary
JAEnv(java.lang.String basedir, boolean appexpected, boolean isapp)
          Constructor, using the given base directory, with the context expected to be as indicated by appexpected.
JAEnv(java.net.URL baseurl, boolean appexpected, boolean isapp)
          Constructor, using the given base URL, with the context expected to be as indicated by appexpected.
 
Method Summary
 java.net.URL getAppBaseURL()
          Returns the app/applet base URL.
 java.lang.String getClassBaseURLString(java.lang.Class<?> clss, java.lang.String clssname)
          Returns the base URL for the given class, identified by both its Class object and its name.
static java.net.URL getJAHomeURL()
          Returns this JVM's JA Home Base URL.
 java.lang.String getPackageBaseURLString(java.lang.Class<?> clss, java.lang.String clssname, int pkgheight)
          Returns the base URL for the package at the given height above the given class, identified by both its Class object and its name.
static java.net.URL getUserHomeURL()
          Returns this JVM's User Home Base URL.
 boolean isOwnedByApp()
          Indicates whether the current execution context is for a full Java application rather than for an applet.
static JAEnv makeAppJAEnv()
          Factory method delivering a JA environment for an app.
static JAEnv makeAppletJAEnv(java.net.URL codebase)
          Factory method delivering a JA environment for an applet, with the given codebase.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JAEnv

public JAEnv(java.lang.String basedir,
             boolean appexpected,
             boolean isapp)
Constructor, using the given base directory, with the context expected to be as indicated by appexpected.


JAEnv

public JAEnv(java.net.URL baseurl,
             boolean appexpected,
             boolean isapp)
Constructor, using the given base URL, with the context expected to be as indicated by appexpected.

Method Detail

getJAHomeURL

public static java.net.URL getJAHomeURL()
Returns this JVM's JA Home Base URL.


getUserHomeURL

public static java.net.URL getUserHomeURL()
Returns this JVM's User Home Base URL.


makeAppJAEnv

public static JAEnv makeAppJAEnv()
Factory method delivering a JA environment for an app.


makeAppletJAEnv

public static JAEnv makeAppletJAEnv(java.net.URL codebase)
Factory method delivering a JA environment for an applet, with the given codebase.


isOwnedByApp

public boolean isOwnedByApp()
Indicates whether the current execution context is for a full Java application rather than for an applet.


getAppBaseURL

public java.net.URL getAppBaseURL()
Returns the app/applet base URL.


getClassBaseURLString

public java.lang.String getClassBaseURLString(java.lang.Class<?> clss,
                                              java.lang.String clssname)
Returns the base URL for the given class, identified by both its Class object and its name.


getPackageBaseURLString

public java.lang.String getPackageBaseURLString(java.lang.Class<?> clss,
                                                java.lang.String clssname,
                                                int pkgheight)
Returns the base URL for the package at the given height above the given class, identified by both its Class object and its name.