public class JNLPBundler extends AbstractBundler
Modifier and Type | Class and Description |
---|---|
private static class |
JNLPBundler.Mode |
Modifier and Type | Field and Description |
---|---|
static StandardBundlerParam<java.lang.Boolean> |
ALL_PERMISSIONS |
static StandardBundlerParam<java.util.Map<java.lang.String,java.lang.String>> |
APP_PARAMS |
static StandardBundlerParam<java.util.Map<java.lang.String,java.lang.String>> |
APPLET_PARAMS |
static StandardBundlerParam<java.lang.String> |
CODEBASE |
private static java.lang.String |
dtFX |
static StandardBundlerParam<java.lang.Boolean> |
EMBED_JNLP |
private static java.lang.String |
EMBEDDED_DT |
static StandardBundlerParam<java.lang.String> |
EMBEDDED_HEIGHT |
static StandardBundlerParam<java.lang.String> |
EMBEDDED_WIDTH |
static StandardBundlerParam<java.util.Map<java.lang.String,java.lang.String>> |
ESCAPED_APPLET_PARAMS |
static StandardBundlerParam<java.lang.Boolean> |
EXTENSION |
static StandardBundlerParam<java.lang.String> |
FALLBACK_APP |
static StandardBundlerParam<java.lang.String> |
FX_PLATFORM |
static StandardBundlerParam<java.lang.Integer> |
HEIGHT |
private static java.util.ResourceBundle |
I18N |
static StandardBundlerParam<java.util.List<java.util.Map<java.lang.String,? super java.lang.Object>>> |
ICONS |
static StandardBundlerParam<java.lang.String> |
ICONS_DEPTH |
static StandardBundlerParam<java.lang.String> |
ICONS_HEIGHT |
static StandardBundlerParam<java.lang.String> |
ICONS_HREF |
static StandardBundlerParam<java.lang.String> |
ICONS_KIND |
static StandardBundlerParam<java.lang.String> |
ICONS_WIDTH |
static StandardBundlerParam<java.lang.Boolean> |
INCLUDE_DT |
static StandardBundlerParam<java.lang.String> |
JRE_PLATFORM |
static StandardBundlerParam<java.util.Map<java.lang.String,java.lang.String>> |
JS_CALLBACKS |
static StandardBundlerParam<java.lang.Boolean> |
OFFLINE_ALLOWED |
static StandardBundlerParam<java.lang.String> |
OUT_FILE |
static StandardBundlerParam<java.lang.String> |
PLACEHOLDER |
private static java.lang.String |
prefixWebFiles |
private static java.lang.String |
PUBLIC_DT |
static StandardBundlerParam<java.lang.Boolean> |
SWING_APP |
static StandardBundlerParam<java.util.Map<java.io.File,java.io.File>> |
TEMPLATES |
static StandardBundlerParam<java.lang.String> |
UPDATE_MODE |
private static java.lang.String[] |
webFiles |
private static java.lang.String |
webfilesDir |
static StandardBundlerParam<java.lang.Integer> |
WIDTH |
baseResourceLoader, BUNDLER_PREFIX, IMAGES_ROOT
Constructor and Description |
---|
JNLPBundler() |
Modifier and Type | Method and Description |
---|---|
private void |
addToList(java.util.List<java.lang.String> l,
java.lang.String name,
java.lang.String value,
boolean isString) |
private static void |
copyFiles(RelativeFileSet resources,
java.io.File outdir) |
private static void |
copyFileToOutDir(java.io.InputStream isa,
java.io.File fout) |
private boolean |
doExtractWebFiles(java.lang.String[] lst,
java.io.File outDir,
java.lang.String webFilesDir) |
private java.lang.String |
encodeAsBase64(byte[] inp) |
java.io.File |
execute(java.util.Map<java.lang.String,? super java.lang.Object> params,
java.io.File outputParentDir)
Creates a bundle from existing content.
|
private boolean |
extractWebFiles(java.io.File outDir) |
private void |
generateHTML(java.util.Map<java.lang.String,? super java.lang.Object> params,
java.io.PrintStream out,
byte[] jnlp_bytes_browser,
java.lang.String jnlpfile_browser,
byte[] jnlp_bytes_webstart,
java.lang.String jnlpfile_webstart,
java.util.Map<TemplatePlaceholders,java.lang.String> templateStrings,
boolean swingMode) |
private void |
generateJNLP(java.util.Map<java.lang.String,? super java.lang.Object> params,
java.io.PrintStream out,
java.lang.String jnlp_filename,
JNLPBundler.Mode m) |
private java.lang.String |
getAppletParameters(java.util.Map<java.lang.String,? super java.lang.Object> params) |
java.util.Collection<BundlerParamInfo<?>> |
getBundleParameters()
The parameters that this bundler uses to generate it's bundle.
|
java.lang.String |
getBundleType() |
java.lang.String |
getDescription() |
java.lang.String |
getID() |
private java.lang.String |
getJvmArguments(java.util.Map<java.lang.String,? super java.lang.Object> params,
boolean includeProperties) |
java.lang.String |
getName() |
private java.lang.String |
listToString(java.util.List<java.lang.String> lst,
java.lang.String offset) |
private java.lang.String |
processTemplate(java.util.Map<java.lang.String,? super java.lang.Object> params,
java.lang.String inpText,
java.util.Map<TemplatePlaceholders,java.lang.String> templateStrings) |
(package private) java.lang.String |
quoteEscape(java.lang.String s) |
private java.lang.String |
readTextFile(java.io.File in) |
private void |
save(java.io.File f,
byte[] content) |
private void |
save(java.io.File outdir,
java.lang.String fname,
byte[] content) |
boolean |
validate(java.util.Map<java.lang.String,? super java.lang.Object> params)
Determines if this bundler will execute with the given parameters.
|
fetchResource, fetchResource, preprocessTextResource, toString
private static final java.util.ResourceBundle I18N
private static final java.lang.String dtFX
private static final java.lang.String webfilesDir
private static final java.lang.String EMBEDDED_DT
private static final java.lang.String PUBLIC_DT
public static final StandardBundlerParam<java.lang.String> OUT_FILE
public static final StandardBundlerParam<java.lang.Boolean> SWING_APP
public static final StandardBundlerParam<java.lang.Boolean> INCLUDE_DT
public static final StandardBundlerParam<java.lang.Boolean> EMBED_JNLP
public static final StandardBundlerParam<java.lang.Boolean> EXTENSION
public static final StandardBundlerParam<java.util.Map<java.io.File,java.io.File>> TEMPLATES
public static final StandardBundlerParam<java.lang.String> CODEBASE
public static final StandardBundlerParam<java.lang.String> PLACEHOLDER
public static final StandardBundlerParam<java.lang.Boolean> OFFLINE_ALLOWED
public static final StandardBundlerParam<java.lang.Boolean> ALL_PERMISSIONS
public static final StandardBundlerParam<java.lang.Integer> WIDTH
public static final StandardBundlerParam<java.lang.Integer> HEIGHT
public static final StandardBundlerParam<java.lang.String> EMBEDDED_WIDTH
public static final StandardBundlerParam<java.lang.String> EMBEDDED_HEIGHT
public static final StandardBundlerParam<java.lang.String> FALLBACK_APP
public static final StandardBundlerParam<java.lang.String> UPDATE_MODE
public static final StandardBundlerParam<java.lang.String> FX_PLATFORM
public static final StandardBundlerParam<java.lang.String> JRE_PLATFORM
public static final StandardBundlerParam<java.util.List<java.util.Map<java.lang.String,? super java.lang.Object>>> ICONS
public static final StandardBundlerParam<java.util.Map<java.lang.String,java.lang.String>> APP_PARAMS
public static final StandardBundlerParam<java.util.Map<java.lang.String,java.lang.String>> ESCAPED_APPLET_PARAMS
public static final StandardBundlerParam<java.util.Map<java.lang.String,java.lang.String>> APPLET_PARAMS
public static final StandardBundlerParam<java.util.Map<java.lang.String,java.lang.String>> JS_CALLBACKS
public static final StandardBundlerParam<java.lang.String> ICONS_HREF
public static final StandardBundlerParam<java.lang.String> ICONS_KIND
public static final StandardBundlerParam<java.lang.String> ICONS_WIDTH
public static final StandardBundlerParam<java.lang.String> ICONS_HEIGHT
public static final StandardBundlerParam<java.lang.String> ICONS_DEPTH
private static java.lang.String[] webFiles
private static java.lang.String prefixWebFiles
public java.lang.String getName()
public java.lang.String getDescription()
public java.lang.String getID()
public java.lang.String getBundleType()
public java.util.Collection<BundlerParamInfo<?>> getBundleParameters()
Bundler
public boolean validate(java.util.Map<java.lang.String,? super java.lang.Object> params) throws UnsupportedPlatformException, ConfigException
Bundler
params
- The parameters to be validate. Validation may modify
the map, so if you are going to be using the same map
across multiple bundlers you should pass in a deep copy.UnsupportedPlatformException
- If the bundler cannot run on this
platform (i.e. creating mac apps on windows)ConfigException
- If the configuration params are incorrect. The
exception may contain advice on how to modify the params map
to make it valid.private java.lang.String readTextFile(java.io.File in) throws PackagerException
PackagerException
private java.lang.String processTemplate(java.util.Map<java.lang.String,? super java.lang.Object> params, java.lang.String inpText, java.util.Map<TemplatePlaceholders,java.lang.String> templateStrings)
public java.io.File execute(java.util.Map<java.lang.String,? super java.lang.Object> params, java.io.File outputParentDir)
Bundler
Bundler.validate(java.util.Map)
date} returns true with the
parameters map, then you can expect a valid output. However if an exception
was thrown out of validate or it returned false then you should not
expect sensible results from this call. It may or may not return a value,
and it may or may not throw an exception. But any output should not
be considered valid or sane.params
- The parameters as specified by getBundleParameters.
Keyed by the id from the ParamInfo. Execution may
modify the map, so if you are going to be using the
same map across multiple bundlers you should pass
in a deep copy.outputParentDir
- The parent dir that the returned bundle will be placed in.private static void copyFiles(RelativeFileSet resources, java.io.File outdir) throws java.io.IOException, PackagerException
java.io.IOException
PackagerException
private java.lang.String getJvmArguments(java.util.Map<java.lang.String,? super java.lang.Object> params, boolean includeProperties)
private void generateJNLP(java.util.Map<java.lang.String,? super java.lang.Object> params, java.io.PrintStream out, java.lang.String jnlp_filename, JNLPBundler.Mode m) throws java.io.IOException, java.security.cert.CertificateEncodingException
java.io.IOException
java.security.cert.CertificateEncodingException
private void addToList(java.util.List<java.lang.String> l, java.lang.String name, java.lang.String value, boolean isString)
private java.lang.String listToString(java.util.List<java.lang.String> lst, java.lang.String offset)
private java.lang.String encodeAsBase64(byte[] inp)
private void generateHTML(java.util.Map<java.lang.String,? super java.lang.Object> params, java.io.PrintStream out, byte[] jnlp_bytes_browser, java.lang.String jnlpfile_browser, byte[] jnlp_bytes_webstart, java.lang.String jnlpfile_webstart, java.util.Map<TemplatePlaceholders,java.lang.String> templateStrings, boolean swingMode)
private void save(java.io.File outdir, java.lang.String fname, byte[] content) throws java.io.IOException
java.io.IOException
private void save(java.io.File f, byte[] content) throws java.io.IOException
java.io.IOException
private static void copyFileToOutDir(java.io.InputStream isa, java.io.File fout) throws PackagerException
PackagerException
private java.lang.String getAppletParameters(java.util.Map<java.lang.String,? super java.lang.Object> params)
java.lang.String quoteEscape(java.lang.String s)
private boolean extractWebFiles(java.io.File outDir) throws PackagerException
PackagerException
private boolean doExtractWebFiles(java.lang.String[] lst, java.io.File outDir, java.lang.String webFilesDir) throws PackagerException
PackagerException