public class BBUtils extends Object
Modifier and Type | Field and Description |
---|---|
static BBjNumber |
BUFFER_SIZE
A constant to define the maximum buffer size when copying files to the Web Server
|
static BBjNumber |
MAX_FILE_SIZE
A constant to define the maximum file size when copying files to the Web Server
|
static BBjString |
MIME_TYPE_CSS$
A constant to define CSS text mime type
|
static BBjString |
MIME_TYPE_GIF$
A constant to define GIF image mime type
|
static BBjString |
MIME_TYPE_JPG$
A constant to define JPG image mime type
|
static BBjString |
MIME_TYPE_PNG$
A constant to define PNG image mime type
|
Constructor and Description |
---|
BBUtils() |
Modifier and Type | Method and Description |
---|---|
static BBjResourceUrl |
addAppServerResource(BBjString p_file$,
BBjString p_mimetype$)
Adds the contents of the file represented by p_file$, with the MIME type p_mimetype$, to the set of static resources in the BBjAppServer.
|
static BBjResourceUrl |
applyCss(BBjString p_app$,
BBjString p_cssFile$,
BBjNumber p_overwrite)
Sets the custom CSS for the specified BUI app.
|
static BBjString |
copyFileToWebServer(BBjString p_srcFile$) |
static BBjString |
copyFileToWebServer(BBjString p_srcFile$,
BBjNumber p_requireSSL) |
static BBjString |
copyFileToWebServer(BBjString p_srcFile$,
BBjString p_destSubDir$) |
static BBjString |
copyFileToWebServer(BBjString p_srcFile$,
BBjString p_destSubDir$,
BBjNumber p_requireSSL) |
static BBjString |
copyFileToWebServer(BBjString p_srcFile$,
BBjString p_destSubDir$,
BBjString p_destFile$) |
static BBjString |
copyFileToWebServer(BBjString p_srcFile$,
BBjString p_destSubDir$,
BBjString p_destFile$,
BBjNumber p_requireSSL) |
static BBjString |
copyFileToWebServer(BBjString p_srcFile$,
BBjString p_destSubDir$,
BBjString p_destFile$,
BBjNumber p_requireSSL,
BBjNumber p_obfuscatePath) |
static void |
deleteFromWebServer(BBjString p_url!) |
static void |
deleteWebServerFilesOlderThanNDays(BBjString p_destSubDir$,
BBjNumber p_numDaysOld) |
static BBjString |
getBuiIosMajorVersion()
Get the major iOS version if running in a BUI environment in iOS (5, 6, 7, etc.) as determined by the client browser's user agent string.
|
static BBjString |
getBuiIosVersion()
Get the iOS version if running in a BUI environment in iOS (7, 7.1, etc.) as determined by the client browser's user agent string.
|
static BBjString |
getWebServerAppsURL()
Get the URL of the Jetty Web Server's apps directory.
|
static BBjString |
getWebServerAppsURL(BBjNumber p_requireSSL)
Get the URL of the Jetty Web Server's apps directory, specifying whether an SSL connection is required or not.
|
static BBjString |
getWebServerFilesURL()
Get the URL of the Jetty Web Server's files directory.
|
static BBjString |
getWebServerFilesURL(BBjNumber p_requireSSL)
Get the URL of the Jetty Web Server's files directory, specifying whether an SSL connection is required or not.
|
static BBjString |
getWebServerFileURL(BBjString p_file$,
BBjString p_subDir$,
BBjNumber p_requireSSL) |
static BBjString |
getWebServerHost()
Get the host of the Jetty Web Server.
|
static BBjString |
getWebServerHttpPort()
Get the port of the Jetty Web Server.
|
static BBjString |
getWebServerPort()
Get the port of the Jetty Web Server.
|
static BBjString |
getWebServerPort(BBjNumber p_requireSSL)
Get the port of the Jetty Web Server, specifying whether an SSL connection is required or not.
|
static BBjString |
getWebServerProtocol() |
static BBjString |
getWebServerProtocol(BBjNumber p_requireSSL) |
static BBjString |
getWebServerSSLPort()
Get the SSL port of the Jetty Web Server.
|
static BBjString |
getWebServerURL()
Get the URL of the Jetty Web Server's root directory.
|
static BBjString |
getWebServerURL(BBjNumber p_requireSSL)
Get the URL of the Jetty Web Server's root directory, specifying whether an SSL connection is required or not.
|
static BBjNumber |
isBuiAndroidDevice()
Indicates if BBj is running in a BUI environment in Android as determined by the client browser's user agent string.
|
static BBjNumber |
isBuiIosDevice()
Indicates if BBj is running in a BUI environment in iOS as determined by the client browser's user agent string.
|
static BBjNumber |
isBuiTouchSupported()
Indicates if BBj is running in a touch-enabled environment or not as determined by the BBjBuiManager.
|
static BBjNumber |
isWebServerEnabled()
Returns a number indicating whether the Web Server is enabled or not
|
static BBjNumber |
isWebServerHttpEnabled()
Returns a number indicating whether the Web Server has enabled the HTTP protocol or not
|
static BBjNumber |
isWebServerSSLEnabled()
Returns a number indicating whether the Web Server has enabled the SSL protocol or not
|
static void |
loadAppServer() |
static void |
publishBUIApp(BBjString p_appName!,
BBjAppConfig p_config!) |
static void |
registerBUIApp(BBjString p_prog$)
Registers a BUI app given the provided parameters.
|
static void |
registerBUIApp(BBjString p_prog$,
BBjString p_app$)
Registers a BUI app given the provided parameters.
|
static void |
registerBUIApp(BBjString p_prog$,
BBjString p_app$,
BBjString p_configFile$,
BBjString p_workingDir$,
BBjString p_InterpUser$)
Registers a BUI app given the provided parameters.
|
static void |
registerBUIApp(BBjString p_prog$,
BBjString p_app$,
BBjString p_configFile$,
BBjString p_workingDir$,
BBjString p_InterpUser$,
BBjVector p_args!)
Registers a BUI app given the provided parameters.
|
static void |
registerBUIApp(BBjString p_prog$,
BBjString p_app$,
BBjString p_configFile$,
BBjString p_workingDir$,
BBjString p_InterpUser$,
BBjVector p_args!,
BBjNumber p_quiet)
Registers a BUI app given the provided parameters.
|
static void |
registerBUIApp(BBjString p_prog$,
BBjString p_app$,
BBjString p_configFile$,
BBjString p_workingDir$,
BBjString p_InterpUser$,
BBjVector p_args!,
BBjNumber p_quiet,
BBjString p_cpName$)
Registers a BUI app given the provided parameters.
|
static void |
registerBUIApp(BBjString p_prog$,
BBjString p_app$,
BBjString p_configFile$,
BBjString p_workingDir$,
BBjString p_InterpUser$,
BBjVector p_args!,
BBjNumber p_quiet,
BBjString p_cpName$,
BBjString p_bbjAppName$,
BBjString p_userName$,
BBjString p_term$)
Registers a BUI app given the provided parameters.
|
static void |
setAppServer(BBjAppServer p_appServer!) |
static BBjResourceUrl |
setBUIAppIcon(BBjString p_app$,
BBjString p_iconFile$,
BBjNumber p_overwrite)
Sets the application icon for the specified BUI app.
|
static BBjResourceUrl |
setBUICSS(BBjString p_app$,
BBjString p_cssFile$,
BBjNumber p_overwrite)
Sets the custom CSS for the specified BUI app.
|
static BBjResourceUrl |
setBUISplash(BBjString p_app$,
BBjString p_imageFile$,
BBjNumber p_overwrite)
Sets the splash screen or loading image for the specified BUI app.
|
static void |
setShowBrowserWarning(BBjString p_app$,
BBjNumber p_show) |
static void |
setShowClientConfirmationDialog(BBjString p_app$,
BBjNumber p_show) |
public static BBjNumber MAX_FILE_SIZE
public static BBjNumber BUFFER_SIZE
public static BBjString MIME_TYPE_CSS$
public static BBjString MIME_TYPE_PNG$
public static BBjString MIME_TYPE_JPG$
public static BBjString MIME_TYPE_GIF$
public static BBjNumber isWebServerEnabled()
public static BBjNumber isWebServerHttpEnabled()
public static BBjNumber isWebServerSSLEnabled()
public static BBjString getWebServerProtocol()
public static BBjString getWebServerProtocol(BBjNumber p_requireSSL)
public static BBjString getWebServerHost()
public static BBjString getWebServerHttpPort()
public static BBjString getWebServerSSLPort()
public static BBjString getWebServerPort()
public static BBjString getWebServerPort(BBjNumber p_requireSSL)
p_requireSSL
- A number that indicates whether the port should require an SSL connection or not.public static BBjString getWebServerURL()
public static BBjString getWebServerURL(BBjNumber p_requireSSL)
p_requireSSL
- A number that indicates whether the URL should require an SSL connection or not.public static BBjString getWebServerFilesURL()
public static BBjString getWebServerFilesURL(BBjNumber p_requireSSL)
p_requireSSL
- A number that indicates whether the URL should require an SSL connection or not.public static BBjString getWebServerAppsURL()
public static BBjString getWebServerAppsURL(BBjNumber p_requireSSL)
p_requireSSL
- A number that indicates whether the URL should require an SSL connection or not.public static BBjString copyFileToWebServer(BBjString p_srcFile$)
public static BBjString copyFileToWebServer(BBjString p_srcFile$, BBjNumber p_requireSSL)
public static BBjString copyFileToWebServer(BBjString p_srcFile$, BBjString p_destSubDir$)
public static BBjString copyFileToWebServer(BBjString p_srcFile$, BBjString p_destSubDir$, BBjNumber p_requireSSL)
public static BBjString copyFileToWebServer(BBjString p_srcFile$, BBjString p_destSubDir$, BBjString p_destFile$)
public static BBjString copyFileToWebServer(BBjString p_srcFile$, BBjString p_destSubDir$, BBjString p_destFile$, BBjNumber p_requireSSL)
public static BBjString copyFileToWebServer(BBjString p_srcFile$, BBjString p_destSubDir$, BBjString p_destFile$, BBjNumber p_requireSSL, BBjNumber p_obfuscatePath)
public static BBjString getWebServerFileURL(BBjString p_file$, BBjString p_subDir$, BBjNumber p_requireSSL)
public static void deleteFromWebServer(BBjString p_url!)
public static void deleteWebServerFilesOlderThanNDays(BBjString p_destSubDir$, BBjNumber p_numDaysOld)
public static void registerBUIApp(BBjString p_prog$)
p_prog$
- The path to the BBj programpublic static void registerBUIApp(BBjString p_prog$, BBjString p_app$)
p_prog$
- The path to the BBj programp_app$
- Optional registered name of the BUI app (defaults to a built name based on the program name)public static void registerBUIApp(BBjString p_prog$, BBjString p_app$, BBjString p_configFile$, BBjString p_workingDir$, BBjString p_InterpUser$)
p_prog$
- The path to the BBj programp_app$
- Optional registered name of the BUI app (defaults to a built name based on the program name)p_configFile$
- Optional path to the configuration file (-c arg)p_workingDir$
- Optional path to the working directory for the app (-WD arg)p_InterpUser$
- Optioanl interpreter user to run as (-u arg (defaults to INFO(3, 2)))public static void registerBUIApp(BBjString p_prog$, BBjString p_app$, BBjString p_configFile$, BBjString p_workingDir$, BBjString p_InterpUser$, BBjVector p_args!)
p_prog$
- The path to the BBj programp_app$
- Optional registered name of the BUI app (defaults to a built name based on the program name)p_configFile$
- Optional path to the configuration file (-c arg)p_workingDir$
- Optional path to the working directory for the app (-WD arg)p_InterpUser$
- Optioanl interpreter user to run as (-u arg (defaults to INFO(3, 2)))p_args!
- Optional BBjVector filled with runtime arguments for the BBj program being invokedpublic static void registerBUIApp(BBjString p_prog$, BBjString p_app$, BBjString p_configFile$, BBjString p_workingDir$, BBjString p_InterpUser$, BBjVector p_args!, BBjNumber p_quiet)
p_prog$
- The path to the BBj programp_app$
- Optional registered name of the BUI app (defaults to a built name based on the program name)p_configFile$
- Optional path to the configuration file (-c arg)p_workingDir$
- Optional path to the working directory for the app (-WD arg)p_InterpUser$
- Optioanl interpreter user to run as (-u arg (defaults to INFO(3, 2)))p_args!
- Optional BBjVector filled with runtime arguments for the BBj program being invokedp_quiet
- A BBj boolean indicating whether to launch quietly or not (0 = Not Quiet, 1 = Quiet) (-q arg)public static void registerBUIApp(BBjString p_prog$, BBjString p_app$, BBjString p_configFile$, BBjString p_workingDir$, BBjString p_InterpUser$, BBjVector p_args!, BBjNumber p_quiet, BBjString p_cpName$)
p_prog$
- The path to the BBj programp_app$
- Optional registered name of the BUI app (defaults to a built name based on the program name)p_configFile$
- Optional path to the configuration file (-c arg)p_workingDir$
- Optional path to the working directory for the app (-WD arg)p_InterpUser$
- Optioanl interpreter user to run as (-u arg (defaults to INFO(3, 2)))p_args!
- Optional BBjVector filled with runtime arguments for the BBj program being invokedp_quiet
- A BBj boolean indicating whether to launch quietly or not (0 = Not Quiet, 1 = Quiet) (-q arg)p_cpName$
- Optional session classpath name to use when launching the app (-CP arg)public static void registerBUIApp(BBjString p_prog$, BBjString p_app$, BBjString p_configFile$, BBjString p_workingDir$, BBjString p_InterpUser$, BBjVector p_args!, BBjNumber p_quiet, BBjString p_cpName$, BBjString p_bbjAppName$, BBjString p_userName$, BBjString p_term$)
p_prog$
- The path to the BBj programp_app$
- Optional registered name of the BUI app (defaults to a built name based on the program name)p_configFile$
- Optional path to the configuration file (-c arg)p_workingDir$
- Optional path to the working directory for the app (-WD arg)p_InterpUser$
- Optioanl interpreter user to run as (-u arg (defaults to INFO(3, 2)))p_args!
- Optional BBjVector filled with runtime arguments for the BBj program being invokedp_quiet
- A BBj boolean indicating whether to launch quietly or not (0 = Not Quiet, 1 = Quiet) (-q arg)p_cpName$
- Optional session classpath name to use when launching the app (-CP arg)p_bbjAppName$
- Optional application name (-a arg)p_userName$
- Optional application user name (-n arg)p_term$
- Optional name of a terminal alias of type MINI (may also be "MINI") (-t arg)public static BBjResourceUrl applyCss(BBjString p_app$, BBjString p_cssFile$, BBjNumber p_overwrite)
This is similar to the setBUICSS() method.
p_app$
- The registered name of the BUI appp_iconFile$
- The path to the CSS filep_overwrite
- A number that indicates whether to overwrite an existing CSS definition if one already exists for the specified BUI app. (0 = Do not overwrite, 1 = Overwrite).public static BBjResourceUrl setBUIAppIcon(BBjString p_app$, BBjString p_iconFile$, BBjNumber p_overwrite)
The application will be shown in the browser's tab and will be used as the default icon on a mobile device when saving the BUI app to the home screen.
p_app$
- The registered name of the BUI appp_iconFile$
- The path to the icon filep_overwrite
- A number that indicates whether to overwrite an existing application icon if one already exists for the specified BUI app. (0 = Do not overwrite, 1 = Overwrite).public static BBjResourceUrl setBUISplash(BBjString p_app$, BBjString p_imageFile$, BBjNumber p_overwrite)
The image can be a static image, such as a PNG file, or an animated GIF image.
p_app$
- The registered name of the BUI appp_imageFile$
- The path to the image filep_overwrite
- A number that indicates whether to overwrite an existing splash image if one already exists for the specified BUI app. (0 = Do not overwrite, 1 = Overwrite).public static BBjResourceUrl setBUICSS(BBjString p_app$, BBjString p_cssFile$, BBjNumber p_overwrite)
This is similar to the applyCss() method.
p_app$
- The registered name of the BUI appp_iconFile$
- The path to the CSS filep_overwrite
- A number that indicates whether to overwrite an existing CSS definition if one already exists for the specified BUI app. (0 = Do not overwrite, 1 = Overwrite).public static void setShowBrowserWarning(BBjString p_app$, BBjNumber p_show)
public static void setShowClientConfirmationDialog(BBjString p_app$, BBjNumber p_show)
public static void publishBUIApp(BBjString p_appName!, BBjAppConfig p_config!)
public static void loadAppServer()
public static void setAppServer(BBjAppServer p_appServer!)
public static BBjResourceUrl addAppServerResource(BBjString p_file$, BBjString p_mimetype$)
If the resource already exists, the existing version will be returned.
This method allows you to add various resources, including the following mime types which are defined as constants:
BBUtils.addAppServerResource(myPngFilePath$, BBUtils.getMIME_TYPE_PNG())
public static BBjNumber isBuiTouchSupported()
public static BBjNumber isBuiAndroidDevice()
public static BBjNumber isBuiIosDevice()
public static BBjString getBuiIosMajorVersion()
public static BBjString getBuiIosVersion()