diff -r efa527f74184 netx/net/sourceforge/jnlp/InformationDesc.java --- a/netx/net/sourceforge/jnlp/InformationDesc.java +++ b/netx/net/sourceforge/jnlp/InformationDesc.java @@ -21,7 +21,7 @@ import java.util.*; /** - * The information element.

+ * The information element. * * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.9 $ diff -r efa527f74184 netx/net/sourceforge/jnlp/JNLPFile.java --- a/netx/net/sourceforge/jnlp/JNLPFile.java +++ b/netx/net/sourceforge/jnlp/JNLPFile.java @@ -36,18 +36,21 @@ import net.sourceforge.jnlp.util.logging.OutputController; /** + *

* Provides methods to access the information in a Java Network * Launching Protocol (JNLP) file. The Java Network Launching * Protocol specifies in an XML file the information needed to * load, cache, and run Java code over the network and in a secure - * environment.

- * + * environment. + *

+ *

* This class represents the overall information about a JNLP file * from the jnlp element. Other information is accessed through * objects that represent the elements of a JNLP file * (information, resources, application-desc, etc). References to * these objects are obtained by calling the getInformation, - * getResources, getSecurity, etc methods.

+ * getResources, getSecurity, etc methods. + *

* * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.21 $ @@ -205,7 +208,7 @@ * @throws ParseException if the JNLP file was invalid */ public JNLPFile(URL location, Version version, ParserSettings settings, UpdatePolicy policy) throws IOException, ParseException { - this(location, version, settings, policy, null); + this(location, version, settings, policy, null); } /** @@ -264,6 +267,7 @@ /** * Create a JNLPFile from an input stream. * + * @throws IOException if an IO exception occurred * @throws ParseException if the JNLP file was invalid */ public JNLPFile(InputStream input, ParserSettings settings) throws ParseException { @@ -277,6 +281,7 @@ * @param input input stream of JNLP file. * @param codebase codebase to use if not specified in JNLP file.. * @param settings the {@link ParserSettings} to use when parsing + * @throws IOException if an IO exception occurred * @throws ParseException if the JNLP file was invalid */ public JNLPFile(InputStream input, URL codebase, ParserSettings settings) throws ParseException { @@ -657,17 +662,19 @@ /** * Returns whether a locale is matched by one of more other - * locales. Only the non-empty language, country, and variant + * locales. Only the non-empty language, country, and variant * codes are compared; for example, a requested locale of * Locale("","","") would always return true. * - * @param requested the local + * @param requested the requested locale * @param available the available locales - * @param matchLevel the detail with which to match locales. - * @return true if requested matches any of available, or if - * available is empty or null. + * @param matchLevel the depth with which to match locales. + * @return {@code true} if {@code requested} matches any of {@code available}, or if + * {@code available} is empty or {@code null}. + * @see Locale + * @see Match */ - public boolean localeMatches(Locale requested, Locale available[], Match matchLevel) { + public boolean localeMatches(Locale requested, Locale[] available, Match matchLevel) { if (matchLevel == Match.GENERALIZED) return available == null || available.length == 0; @@ -730,9 +737,7 @@ * Initialize the JNLPFile fields. Private because it's called * from the constructor. * - * @param root the root node - * @param settings the parser settings to use while parsing the file - * @param location the file location or null + * @param location the file location or {@code null} */ private void parse(InputStream input, URL location, URL forceCodebase) throws ParseException { try { diff -r efa527f74184 netx/net/sourceforge/jnlp/JNLPMatcher.java --- a/netx/net/sourceforge/jnlp/JNLPMatcher.java +++ b/netx/net/sourceforge/jnlp/JNLPMatcher.java @@ -203,14 +203,12 @@ } /** - * Compares attributes of two Nodes regardless of order + * Compares attributes of two {@link Node Nodes} regardless of order * - * @param appTemplateNode - * signed application or template's Node with attributes - * @param launchJNLPNode - * launching JNLP file's Node with attributes + * @param templateNode signed application or template's {@link Node} with attributes + * @param launchNode launching JNLP file's {@link Node} with attributes * - * @return true if both Nodes have 'matched' attributes, otherwise false + * @return {@code true} if both {@link Node Nodes} have 'matched' attributes, otherwise {@code false} */ private boolean matchAttributes(Node templateNode, Node launchNode) { diff -r efa527f74184 netx/net/sourceforge/jnlp/Launcher.java --- a/netx/net/sourceforge/jnlp/Launcher.java +++ b/netx/net/sourceforge/jnlp/Launcher.java @@ -50,13 +50,14 @@ import sun.awt.SunToolkit; /** - * Launches JNLPFiles either in the foreground or background.

- * + * Launches JNLPFiles either in the foreground or background. + *

* An optional LaunchHandler can be specified that is notified of * warning and error condition while launching and that indicates * whether a launch may proceed after a warning has occurred. If * specified, the LaunchHandler is notified regardless of whether - * the file is launched in the foreground or background.

+ * the file is launched in the foreground or background. + *

* * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.22 $ @@ -597,15 +598,16 @@ /** * Launches a JNLP applet. This method should be called from a - * thread in the application's thread group.

- * + * thread in the application's thread group. + *

* The enableCodeBase parameter adds the applet's codebase to * the locations searched for resources and classes. This can * slow down the applet loading but allows browser-style applets * that don't use JAR files exclusively to be run from a applet * JNLP file. If the applet JNLP file does not specify any * resources then the code base will be enabled regardless of - * the specified value.

+ * the specified value. + *

* * @param file the JNLP file * @param enableCodeBase whether to add the codebase URL to the classloader diff -r efa527f74184 netx/net/sourceforge/jnlp/Parser.java --- a/netx/net/sourceforge/jnlp/Parser.java +++ b/netx/net/sourceforge/jnlp/Parser.java @@ -94,14 +94,14 @@ private boolean allowExtensions; // true if extensions to JNLP spec are ok /** - * Create a parser for the JNLP file. If the location + * Create a parser for the JNLP file. If the location * parameters is not null it is used as the default codebase * (does not override value of jnlp element's href - * attribute).

- * + * attribute). + *

* The root node may be normalized as a side effect of this * constructor. - * + *

* @param file the (uninitialized) file reference * @param base if codebase is not specified, a default base for relative URLs * @param root the root node @@ -113,14 +113,14 @@ } /** - * Create a parser for the JNLP file. If the location + * Create a parser for the JNLP file. If the location * parameters is not null it is used as the default codebase * (does not override value of jnlp element's href - * attribute).

- * + * attribute). + *

* The root node may be normalized as a side effect of this * constructor. - * + *

* @param file the (uninitialized) file reference * @param base if codebase is not specified, a default base for relative URLs * @param root the root node @@ -914,9 +914,9 @@ } /** - * Returns a Locale from a single locale. + * Returns a {@link Locale} from a single locale. * - * @param locale the locale string + * @param localeStr the locale string */ public Locale getLocale(String localeStr) { if (localeStr.length() < 2) @@ -1048,9 +1048,9 @@ /** * Returns a URL object from a href string relative to the - * code base. If the href denotes a relative URL, it must + * code base. If the href denotes a relative URL, it must * reference a location that is a subdirectory of the - * codebase.

+ * codebase. * * @param node the node * @param name the attribute containing an href diff -r efa527f74184 netx/net/sourceforge/jnlp/PluginParameters.java --- a/netx/net/sourceforge/jnlp/PluginParameters.java +++ b/netx/net/sourceforge/jnlp/PluginParameters.java @@ -192,8 +192,7 @@ * Creates the underlying hash table with the proper overrides. Ensure all * keys are lowercase consistently. * - * @param params - * the properties, before parameter aliasing rules. + * @param rawParams the properties, before parameter aliasing rules. * @return the resulting parameter table */ static Hashtable createParameterTable( @@ -235,4 +234,4 @@ public String toString() { return parameters.toString(); } -} \ No newline at end of file +} diff -r efa527f74184 netx/net/sourceforge/jnlp/ResourcesDesc.java --- a/netx/net/sourceforge/jnlp/ResourcesDesc.java +++ b/netx/net/sourceforge/jnlp/ResourcesDesc.java @@ -19,7 +19,7 @@ import java.util.*; /** - * The resources element.

+ * The resources element. * * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.7 $ diff -r efa527f74184 netx/net/sourceforge/jnlp/Version.java --- a/netx/net/sourceforge/jnlp/Version.java +++ b/netx/net/sourceforge/jnlp/Version.java @@ -19,18 +19,21 @@ import java.util.*; /** + *

* A JNLP Version string in the form "1.2-3_abc" followed by an * optional + (includes all later versions) or * (matches any * suffixes on versions). More than one version can be included - * in a string by separating them with spaces.

- * + * in a string by separating them with spaces. + *

+ *

* Version strings are divided by "._-" charecters into parts. * These parts are compared numerically if they can be parsed as * integers or lexographically as strings otherwise. If the * number of parts is different between two version strings then * the smaller one is padded with zero or the empty string. Note * that the padding in this version means that 1.2+ matches - * 1.4.0-beta1, but may not in future versions.

+ * 1.4.0-beta1, but may not in future versions. + *

* * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.5 $ diff -r efa527f74184 netx/net/sourceforge/jnlp/browser/BrowserAwareProxySelector.java --- a/netx/net/sourceforge/jnlp/browser/BrowserAwareProxySelector.java +++ b/netx/net/sourceforge/jnlp/browser/BrowserAwareProxySelector.java @@ -170,12 +170,15 @@ } /** + *

* The main entry point for {@link BrowserAwareProxySelector}. Based on * the browser settings, determines proxy information for a given URI. + *

*

* The appropriate proxy may be determined by reading static information * from the browser's preferences file, or it may be computed dynamically, * by, for example, running javascript code. + *

*/ @Override protected List getFromBrowser(URI uri) { diff -r efa527f74184 netx/net/sourceforge/jnlp/browser/FirefoxPreferencesParser.java --- a/netx/net/sourceforge/jnlp/browser/FirefoxPreferencesParser.java +++ b/netx/net/sourceforge/jnlp/browser/FirefoxPreferencesParser.java @@ -48,16 +48,17 @@ import net.sourceforge.jnlp.util.logging.OutputController; /** + *

* A parser for Firefox's preferences file. It can 'parse' Firefox's * preferences file and expose the prefrences in a simple to use format. - *

+ *

* Sample usage: - *
+ * 

  * FirefoxPreferencesParser p = new FirefoxPreferencesParser(prefsFile);
  * p.parse();
  * Map<String,String> prefs = p.getPreferences();
  * System.out.println("blink allowed: " + prefs.get("browser.blink_allowed"));
- * 
+ *
*/ public final class FirefoxPreferencesParser { diff -r efa527f74184 netx/net/sourceforge/jnlp/cache/CacheEntry.java --- a/netx/net/sourceforge/jnlp/cache/CacheEntry.java +++ b/netx/net/sourceforge/jnlp/cache/CacheEntry.java @@ -27,7 +27,7 @@ import net.sourceforge.jnlp.util.*; /** - * Describes an entry in the cache.

+ * Describes an entry in the cache. * * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.10 $ diff -r efa527f74184 netx/net/sourceforge/jnlp/cache/CacheLRUWrapper.java --- a/netx/net/sourceforge/jnlp/cache/CacheLRUWrapper.java +++ b/netx/net/sourceforge/jnlp/cache/CacheLRUWrapper.java @@ -60,7 +60,7 @@ * This class helps maintain the ordering of most recently use items across * multiple jvm instances. * - * @author Andrew Su (asu@redhat.com, andrew.su@utoronto.ca) + * @author Andrew Su (asu@redhat.com, andrew.su@utoronto.ca) * */ public enum CacheLRUWrapper { @@ -98,6 +98,8 @@ /** * Returns an instance of the policy. + * + * @return an instance of the policy */ public static CacheLRUWrapper getInstance() { return INSTANCE; diff -r efa527f74184 netx/net/sourceforge/jnlp/cache/CacheUtil.java --- a/netx/net/sourceforge/jnlp/cache/CacheUtil.java +++ b/netx/net/sourceforge/jnlp/cache/CacheUtil.java @@ -54,7 +54,7 @@ /** * Provides static methods to interact with the cache, download - * indicator, and other utility methods.

+ * indicator, and other utility methods. * * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.17 $ @@ -68,7 +68,7 @@ /** * Compares a URL using string compare of its protocol, host, - * port, path, query, and anchor. This method avoids the host + * port, path, query, and anchor. This method avoids the host * name lookup that URL.equals does for http: protocol URLs. * It may not return the same value as the URL.equals method * (different hostnames that resolve to the same IP address, @@ -111,12 +111,12 @@ } /** * Caches a resource and returns a URL for it in the cache; - * blocks until resource is cached. If the resource location is + * blocks until resource is cached. If the resource location is * not cacheable (points to a local file, etc) then the original - * URL is returned.

+ * URL is returned. * * @param location location of the resource - * @param version the version, or null + * @param version the version, or {@code null} * @return either the location in the cache or the original location */ public static URL getCachedResource(URL location, Version version, UpdatePolicy policy) { @@ -132,7 +132,7 @@ } /** - * Compare strings that can be null. + * Compare strings that can be {@code null}. */ private static boolean compare(String s1, String s2, boolean ignore) { if (s1 == s2) @@ -148,7 +148,7 @@ /** * Returns the Permission object necessary to access the - * resource, or null if no permission is needed. + * resource, or {@code null} if no permission is needed. */ public static Permission getReadPermission(URL location, Version version) { if (CacheUtil.isCacheable(location, version)) { @@ -230,9 +230,9 @@ * cache and it is up to date. This method may not return * immediately. * - * @param source the source URL + * @param source the source {@link URL} * @param version the versions to check for - * @param connection a connection to the URL, or null + * @param connection a connection to the {@link URL}, or {@code null} * @return whether the cache contains the version * @throws IllegalArgumentException if the source is not cacheable */ @@ -304,9 +304,9 @@ * not download the resource. The latest version of the * resource that matches the specified version will be returned. * - * @param source the source URL + * @param source the source {@link URL} * @param version the version id of the local file - * @return the file location in the cache, or null if no versions cached + * @return the file location in the cache, or {@code null} if no versions cached * @throws IllegalArgumentException if the source is not cacheable */ public static File getCacheFile(URL source, Version version) { @@ -336,7 +336,7 @@ * This will return a File pointing to the location of cache item. * * @param urlPath Path of cache item within cache directory. - * @return File if we have searched before, null otherwise. + * @return File if we have searched before, {@code null} otherwise. */ private static File getCacheFileIfExist(File urlPath) { synchronized (lruHandler) { diff -r efa527f74184 netx/net/sourceforge/jnlp/cache/DownloadIndicator.java --- a/netx/net/sourceforge/jnlp/cache/DownloadIndicator.java +++ b/netx/net/sourceforge/jnlp/cache/DownloadIndicator.java @@ -32,13 +32,14 @@ /** * Return a download service listener that displays the progress - * of downloading resources. Update messages may be reported - * for URLs that are not included initially.

- * + * of downloading resources. Update messages may be reported + * for URLs that are not included initially. + *

* Progress messages are sent as if the DownloadServiceListener - * were listening to a DownloadService request. The listener + * were listening to a DownloadService request. The listener * will receive progress messages from time to time during the - * download.

+ * download. + *

* * @param app JNLP application downloading the files, or null if not applicable * @param downloadName name identifying the download to the user diff -r efa527f74184 netx/net/sourceforge/jnlp/cache/IllegalResourceDescriptorException.java --- a/netx/net/sourceforge/jnlp/cache/IllegalResourceDescriptorException.java +++ b/netx/net/sourceforge/jnlp/cache/IllegalResourceDescriptorException.java @@ -40,7 +40,7 @@ @SuppressWarnings("serial") public class IllegalResourceDescriptorException extends IllegalArgumentException { /** - * Constructs a IllegalResourceDescriptorException with the + * Constructs a {@code IllegalResourceDescriptorException} with the * specified detail message. * @param msg the detail message. */ diff -r efa527f74184 netx/net/sourceforge/jnlp/cache/Resource.java --- a/netx/net/sourceforge/jnlp/cache/Resource.java +++ b/netx/net/sourceforge/jnlp/cache/Resource.java @@ -26,17 +26,20 @@ import net.sourceforge.jnlp.util.*; /** + *

* Information about a single resource to download. * This class tracks the downloading of various resources of a * JNLP file to local files. It can be used to download icons, * jnlp and extension files, jars, and jardiff files using the * version based protocol or any file using the basic download - * protocol.

- * + * protocol. + *

+ *

* Resources can be put into download groups by specifying a part * name for the resource. The resource tracker can also be * configured to prefetch resources, which are downloaded in the - * order added to the media tracker.

+ * order added to the media tracker. + *

* * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.9 $ diff -r efa527f74184 netx/net/sourceforge/jnlp/cache/ResourceTracker.java --- a/netx/net/sourceforge/jnlp/cache/ResourceTracker.java +++ b/netx/net/sourceforge/jnlp/cache/ResourceTracker.java @@ -52,16 +52,17 @@ /** * This class tracks the downloading of various resources of a - * JNLP file to local files in the cache. It can be used to + * JNLP file to local files in the cache. It can be used to * download icons, jnlp and extension files, jars, and jardiff * files using the version based protocol or any file using the * basic download protocol (jardiff and version not implemented - * yet).

- * + * yet). + *

* The resource tracker can be configured to prefetch resources, * which are downloaded in the order added to the media - * tracker.

- * + * tracker. + *

+ *

* Multiple threads are used to download and cache resources that * are actively being waited for (blocking a caller) or those that * have been started downloading by calling the startDownload @@ -69,7 +70,8 @@ * time and only if no other trackers have requested downloads. * This allows the tracker to start downloading many items without * using many system resources, but still quickly download items - * as needed.

+ * as needed. + *

* * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.22 $ @@ -238,7 +240,7 @@ /** * Check the cache for a resource, and initialize the resource - * as already downloaded if found.

+ * as already downloaded if found. * * @param updatePolicy whether to check for updates if already in cache * @return whether the resource are already downloaded @@ -285,7 +287,7 @@ /** * Adds the listener to the list of objects interested in - * receivind DownloadEvents.

+ * receivind DownloadEvents. * * @param listener the listener to add. */ @@ -339,10 +341,11 @@ /** * Returns a URL pointing to the cached location of the * resource, or the resource itself if it is a non-cacheable - * resource.

- * + * resource. + *

* If the resource has not downloaded yet, the method will block - * until it has been transferred to the cache.

+ * until it has been transferred to the cache. + *

* * @param location the resource location * @return the resource, or null if it could not be downloaded @@ -365,10 +368,11 @@ /** * Returns a file containing the downloaded resource. If the * resource is non-cacheable then null is returned unless the - * resource is a local file (the original file is returned).

- * + * resource is a local file (the original file is returned). + *

* If the resource has not downloaded yet, the method will block - * until it has been transferred to the cache.

+ * until it has been transferred to the cache. + *

* * @param location the resource location * @return a local file containing the resource, or null @@ -404,10 +408,11 @@ * Returns an input stream that reads the contents of the * resource. For non-cacheable resources, an InputStream that * reads from the source location is returned. Otherwise the - * InputStream reads the cached resource.

- * + * InputStream reads the cached resource. + *

* This method will block while the resource is downloaded to * the cache. + *

* * @throws IOException if there was an error opening the stream * @throws IllegalResourceDescriptorException if the resource is not being tracked @@ -550,9 +555,10 @@ /** * Start a new download thread if there are not too many threads - * already running.

- * + * already running. + *

* Calls to this method should be synchronized on lock. + *

*/ protected void startThread() { if (threads < maxThreads) { @@ -564,9 +570,10 @@ } /** - * A thread is ending, called by the thread itself.

- * + * A thread is ending, called by the thread itself. + *

* Calls to this method should be synchronized. + *

*/ private void endThread() { threads--; @@ -917,16 +924,18 @@ } /** - * Pick the next resource to download or initialize. If there + * Pick the next resource to download or initialize. If there * are no more resources requested then one is taken from a - * resource tracker with prefetch enabled.

+ * resource tracker with prefetch enabled. + *

+ * The resource state is advanced before it is returned + * (CONNECT->CONNECTING). + *

+ *

+ * Calls to this method should be synchronized on lock. + *

* - * The resource state is advanced before it is returned - * (CONNECT->CONNECTING).

- * - * Calls to this method should be synchronized on lock.

- * - * @return the resource to initialize or download, or null + * @return the resource to initialize or download, or {@code null} */ private static Resource selectNextResource() { Resource result; @@ -964,9 +973,10 @@ /** * Returns the next resource to be prefetched before - * requested.

- * - * Calls to this method should be synchronized on lock.

+ * requested. + *

+ * Calls to this method should be synchronized on lock. + *

*/ private static Resource getPrefetch() { Resource result = null; @@ -1012,10 +1022,11 @@ /** * Selects a resource from the source list that has the - * specified flag set.

- * + * specified flag set. + *

* Calls to this method should be synchronized on lock and - * source list.

+ * source list. + *

*/ private static Resource selectByFlag(List source, int flag, int notflag) { @@ -1070,12 +1081,12 @@ * Wait for some resources. * * @param resources the resources to wait for - * @param timeout the timeout, or 0 to wait until completed - * @returns true if the resources were downloaded or had errors, - * false if the timeout was reached + * @param timeout the timeout, or {@code 0} to wait until completed + * @return {@code true} if the resources were downloaded or had errors, + * {@code false} if the timeout was reached * @throws InterruptedException if another thread interrupted the wait */ - private boolean wait(Resource resources[], long timeout) throws InterruptedException { + private boolean wait(Resource[] resources, long timeout) throws InterruptedException { long startTime = System.currentTimeMillis(); // start them downloading / connecting in background diff -r efa527f74184 netx/net/sourceforge/jnlp/cache/UpdatePolicy.java --- a/netx/net/sourceforge/jnlp/cache/UpdatePolicy.java +++ b/netx/net/sourceforge/jnlp/cache/UpdatePolicy.java @@ -18,7 +18,7 @@ /** * A policy that determines when a resource should be checked for - * an updated version.

+ * an updated version. * * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.3 $ diff -r efa527f74184 netx/net/sourceforge/jnlp/cache/package-info.java --- /dev/null +++ b/netx/net/sourceforge/jnlp/cache/package-info.java @@ -0,0 +1,36 @@ +/* package-info.java + Copyright (C) 2014 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or modify it under the +terms of the GNU General Public License as published by the Free Software +Foundation, version 2. + +IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A +PARTICULAR PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along with +IcedTea; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is making a +combined work based on this library. Thus, the terms and conditions of the GNU +General Public License cover the whole combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent modules, and +to copy and distribute the resulting executable under terms of your choice, +provided that you also meet, for each linked independent module, the terms and +conditions of the license of that module. An independent module is a module +which is not derived from or based on this library. If you modify this library, +you may extend this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this exception +statement from your version.*/ +/** + * This package contains the JNLP cache. + */ +package netx.sourceforge.jnlp.cache; diff -r efa527f74184 netx/net/sourceforge/jnlp/cache/package.html --- a/netx/net/sourceforge/jnlp/cache/package.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - -This package contains the JNLP cache. - -

Package Specification

- - - -

Related Documentation

- -For overviews, tutorials, examples, guides, and tool documentation, please see: - - - - - - - - diff -r efa527f74184 netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java --- a/netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java +++ b/netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java @@ -624,7 +624,6 @@ * Reads a properties file and returns a map representing the properties * * @param propertiesFile the file to read Properties from - * @param destination the map to which all the properties should be added * @throws IOException if an IO problem occurs */ private Map> parsePropertiesFile(File propertiesFile) throws IOException { diff -r efa527f74184 netx/net/sourceforge/jnlp/config/DirectoryValidator.java --- a/netx/net/sourceforge/jnlp/config/DirectoryValidator.java +++ b/netx/net/sourceforge/jnlp/config/DirectoryValidator.java @@ -14,17 +14,17 @@ import net.sourceforge.jnlp.util.logging.OutputController; /** - * - * @author jvanek + * @author Jiri Vanek */ public class DirectoryValidator { /** * This class is holding results of directory validation. - * Various errors like can not read, write create dir can apeear + * Various errors like can not read, write create dir can apeear * For sumaries of results are here getPasses, getFailures methods - * - * Individual results can be read from results field, or converted to string + *

+ * Individual results can be read from results field, or converted to string + *

*/ public static class DirectoryCheckResults { public final List results; @@ -38,7 +38,6 @@ } /** - * * @return sum of passed checks, 0-3 per result */ public int getPasses() { @@ -50,7 +49,6 @@ } /** - * * @return sum of failed checks, 0-3 per results */ public int getFailures() { @@ -67,13 +65,13 @@ * * @return all results connected. */ - public String getMessage(){ + public String getMessage() { return resultsToString(results); } /** * using getMessage - * @return + * @return a text representation of a {@code DirectoryValidator} object */ @Override public String toString() { @@ -83,15 +81,14 @@ public static String resultsToString(List results) { - StringBuilder sb = new StringBuilder(); - for (DirectoryCheckResult r : results) { - if (r.getFailures() >0 ){ - sb.append(r.getMessage()); + StringBuilder sb = new StringBuilder(); + for (DirectoryCheckResult r : results) { + if (r.getFailures() > 0) { + sb.append(r.getMessage()); + } } + return sb.toString(); } - return sb.toString(); - } - } /** @@ -154,7 +151,7 @@ + subdirs; } - /* + /** * count failures of this result (0-3, both inclusive). */ public int getFailures() { @@ -214,15 +211,15 @@ /** - * Creates DirectoryValidator to ensure directories read from - * user (if any - default otherwise ) settings via keys: + * Creates DirectoryValidator to ensure directories read from + * user (if any - default otherwise) settings via keys: *
    - *
  • KEY_USER_CACHE_DIR
  • - *
  • KEY_USER_PERSISTENCE_CACHE_DIR
  • - *
  • KEY_SYSTEM_CACHE_DIR
  • - *
  • KEY_USER_LOG_DIR
  • - *
  • KEY_USER_TMP_DIR
  • - *
  • KEY_USER_LOCKS_DIR
  • + *
  • {@link DeploymentConfiguration#KEY_USER_CACHE_DIR}
  • + *
  • {@link DeploymentConfiguration#KEY_USER_PERSISTENCE_CACHE_DIR}
  • + *
  • {@link DeploymentConfiguration#KEY_SYSTEM_CACHE_DIR}
  • + *
  • {@link DeploymentConfiguration#KEY_USER_LOG_DIR}
  • + *
  • {@link DeploymentConfiguration#KEY_USER_TMP_DIR}
  • + *
  • {@link DeploymentConfiguration#KEY_USER_LOCKS_DIR}
  • *
*/ public DirectoryValidator() { @@ -255,13 +252,14 @@ /** * This method is ensuring, that specified directories will exists after * call and will have enough permissions. - * + *

* This methods is trying to create the directories if they are not present * and is testing if can be written inside. All checks are done in bulk. If * one or more defect is found, user is warned via dialogue in gui mode * (again in bulk). In headless mode stdout/stderr is enough, as application * (both gui and headless) should not stop to work, but continue to run with * hope that corrupted dirs will not be necessary + *

*/ public DirectoryCheckResults ensureDirs() { return ensureDirs(dirsToCheck); @@ -278,7 +276,7 @@ if (!f.mkdirs()) { OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, "ERROR: Directory " + f.getAbsolutePath() + " does not exist and has not been created"); } else { - OutputController.getLogger().log(OutputController.Level.MESSAGE_DEBUG,"OK: Directory " + f.getAbsolutePath() + " did not exist but has been created"); + OutputController.getLogger().log(OutputController.Level.MESSAGE_DEBUG, "OK: Directory " + f.getAbsolutePath() + " did not exist but has been created"); } DirectoryCheckResult r = testDir(f, true, true); result.add(r); @@ -288,15 +286,17 @@ /** * This method is package private for testing purposes only. - * + *

* This method verify that directory exists, is directory, file and * directory can be created, file can be written into, and subdirectory can * be written into. - * + *

+ *

* Some steps may looks like redundant, but some permission settings really * alow to create file but not directory and vice versa. Also some settings * can allow to create file or directory which can not be written into. (eg * ACL or network disks) + *

*/ static DirectoryCheckResult testDir(File f, boolean verbose, boolean testSubdir) { DirectoryCheckResult result = new DirectoryCheckResult(f); @@ -376,6 +376,5 @@ result.correctPermissions = false; } return result; - } } diff -r efa527f74184 netx/net/sourceforge/jnlp/controlpanel/AdvancedProxySettingsPane.java --- a/netx/net/sourceforge/jnlp/controlpanel/AdvancedProxySettingsPane.java +++ b/netx/net/sourceforge/jnlp/controlpanel/AdvancedProxySettingsPane.java @@ -240,7 +240,8 @@ /** * Make the button panel. * - * @return + * @return the button panel created + * @see JPanel */ private JPanel createButtonPanel() { JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.TRAILING)); diff -r efa527f74184 netx/net/sourceforge/jnlp/controlpanel/CacheViewer.java --- a/netx/net/sourceforge/jnlp/controlpanel/CacheViewer.java +++ b/netx/net/sourceforge/jnlp/controlpanel/CacheViewer.java @@ -97,8 +97,8 @@ final CacheViewer cacheViewer = this; KeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventDispatcher(new KeyEventDispatcher() { /** - * Dispatches mainly the VK_ESCAPE key event to close - * the CacheViewer dialog. + * Dispatches mainly the {@code KeyEvent.VK_ESCAPE} key event to + * close the {@code CacheViewer} dialog. * @return {@code true} after an {@link KeyEvent#VK_ESCAPE * VK_ESCAPE} has been processed, otherwise {@code false} * @see KeyEventDispatcher diff -r efa527f74184 netx/net/sourceforge/jnlp/controlpanel/CommandLine.java --- a/netx/net/sourceforge/jnlp/controlpanel/CommandLine.java +++ b/netx/net/sourceforge/jnlp/controlpanel/CommandLine.java @@ -44,9 +44,9 @@ * printCOMMANDHelp method also exists, and prints out the help message for * that specific command. For example, see {@link #handleListCommand(List)} * and {@link #printListHelp()}. - *

+ *

* Sample usage: - *
+ * 

  * CommandLine cli = new CommandLine();
  * // the string array represents input using the command line
  * int retVal = cli.handle(new String[] { "help" });
@@ -55,9 +55,9 @@
  * } else {
  *    // bad!
  * }
- * 
+ *
* - * @author Omair Majid (omajid@redhat.com) + * @author Omair Majid */ public class CommandLine { diff -r efa527f74184 netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java --- a/netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java +++ b/netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java @@ -168,8 +168,8 @@ || validationResult.id == JvmValidationResult.STATE.NOT_VALID_DIR || validationResult.id == JvmValidationResult.STATE.NOT_VALID_JDK) { return JOptionPane.showConfirmDialog(ControlPanel.this, - ""+Translator.R("CPJVMNotokMessage1", s)+"
" - + validationResult.formattedText+"
" + ""+Translator.R("CPJVMNotokMessage1", s)+"
" + + validationResult.formattedText+"
" + Translator.R("CPJVMNotokMessage2", DeploymentConfiguration.KEY_JRE_DIR, DeploymentConfiguration.USER_DEPLOYMENT_PROPERTIES_FILE)+"", Translator.R("CPJVMconfirmInvalidJdkTitle"),JOptionPane.OK_CANCEL_OPTION); } @@ -369,7 +369,8 @@ /** * This is a placeholder panel. * - * @return + * @return a placeholder panel + * @see JPanel */ private JPanel createNotImplementedPanel() { diff -r efa527f74184 netx/net/sourceforge/jnlp/event/package.html --- a/netx/net/sourceforge/jnlp/event/package.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - -This package contains the JNLP events. - -

Package Specification

- - - -

Related Documentation

- -For overviews, tutorials, examples, guides, and tool documentation, please see: - - - - - - - - diff -r efa527f74184 netx/net/sourceforge/jnlp/package-info.java --- /dev/null +++ b/netx/net/sourceforge/jnlp/package-info.java @@ -0,0 +1,48 @@ +/* package-info.java + Copyright (C) 2014 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or modify it under the +terms of the GNU General Public License as published by the Free Software +Foundation, version 2. + +IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A +PARTICULAR PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along with +IcedTea; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is making a +combined work based on this library. Thus, the terms and conditions of the GNU +General Public License cover the whole combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent modules, and +to copy and distribute the resulting executable under terms of your choice, +provided that you also meet, for each linked independent module, the terms and +conditions of the license of that module. An independent module is a module +which is not derived from or based on this library. If you modify this library, +you may extend this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this exception +statement from your version.*/ +/** + * This package contains the classes that represent the parts of a Java Network + * Launching Protocol (JNLP) file as objects, and a way to launch a JNLP file + * as an application, applet, or installer. + * + *

Package Specification

+ * + *

Related Documentation

+ * For overviews, tutorials, examples, guides, and tool documentation, please see: + * @see JSR56: Java Network Launching Protocol and API + * @see Netx JNLP Client + * @see Java Web Start JNLP Client + */ +package net.sourceforge.jnlp; diff -r efa527f74184 netx/net/sourceforge/jnlp/package.html --- a/netx/net/sourceforge/jnlp/package.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - -This package contains the classes that represent the parts of a -Java Network Launching Protocol (JNLP) file as objects, and a way -to launch a JNLP file as an application, applet, or installer. - -

Package Specification

- - - -

Related Documentation

- -For overviews, tutorials, examples, guides, and tool documentation, please see: - - - - - - - - diff -r efa527f74184 netx/net/sourceforge/jnlp/resources/Messages.properties --- a/netx/net/sourceforge/jnlp/resources/Messages.properties +++ b/netx/net/sourceforge/jnlp/resources/Messages.properties @@ -246,7 +246,7 @@ SRememberAppletOnly=For applet SRememberCodebase=For site {0} SUnsignedSummary=An unsigned Java application wants to run -SUnsignedDetail=An unsigned application from the following location wants to run:
  {0}
The page which made the request was:
  {1}

It is recommended you only run applications from sites you trust. +SUnsignedDetail=An unsigned application from the following location wants to run:
  {0}
The page which made the request was:
  {1}

It is recommended you only run applications from sites you trust. SUnsignedAllowedBefore=You have accepted this applet previously. SUnsignedRejectedBefore=You have rejected this applet previously. SUnsignedQuestion=Allow the applet to run? @@ -355,7 +355,7 @@ CPJVMrtJar=Ok, the directory you chose contains lib/rt.jar. CPJVMPluginAllowTTValidation=Validate JRE immediately CPJVMNotokMessage1=You have entered invalid JDK value ({0}) with following error message: -CPJVMNotokMessage2=You might be seeing this message because:
* Some validity tests have not been passed
* Non-OpenJDK is detected
With invalid JDK IcedTea-Web will probably not be able to start.
You will have to modify or remove {0} property in your configuration file {1}.
You should try to search for OpenJDK in your system or be sure you know what you are doing. +CPJVMNotokMessage2=You might be seeing this message because:
* Some validity tests have not been passed
* Non-OpenJDK is detected
With invalid JDK IcedTea-Web will probably not be able to start.
You will have to modify or remove {0} property in your configuration file {1}.
You should try to search for OpenJDK in your system or be sure you know what you are doing. CPJVMconfirmInvalidJdkTitle=Confirm invalid JDK CPJVMconfirmReset=Reset to default? CPPolicyDetail=View or edit your user-level Java Policy File. This allows you to grant or deny runtime permissions to applets regardless of the standard security sandboxing rules. diff -r efa527f74184 netx/net/sourceforge/jnlp/resources/Messages_cs.properties --- a/netx/net/sourceforge/jnlp/resources/Messages_cs.properties +++ b/netx/net/sourceforge/jnlp/resources/Messages_cs.properties @@ -228,7 +228,7 @@ SRememberAppletOnly=Pro applet SRememberCodebase=Pro web {0} SUnsignedSummary=Do\u0161lo k pokusu o spu\u0161t\u011bn\u00ed nepodepsan\u00e9 aplikace Java. -SUnsignedDetail=Do\u0161lo k pokusu o spu\u0161t\u011bn\u00ed nepodepsan\u00e9 aplikace z n\u00e1sleduj\u00edc\u00edho um\u00edst\u011bn\u00ed:
\u00a0\u00a0{0}
Str\u00e1nka, kter\u00e1 p\u0159edala tento po\u017eadavek:
\u00a0\u00a0{1}

Doporu\u010dujeme, abyste spou\u0161t\u011bli aplikace pouze z web\u016f, kter\u00fdm d\u016fv\u011b\u0159ujete. +SUnsignedDetail=Do\u0161lo k pokusu o spu\u0161t\u011bn\u00ed nepodepsan\u00e9 aplikace z n\u00e1sleduj\u00edc\u00edho um\u00edst\u011bn\u00ed:
\u00a0\u00a0{0}
Str\u00e1nka, kter\u00e1 p\u0159edala tento po\u017eadavek:
\u00a0\u00a0{1}

Doporu\u010dujeme, abyste spou\u0161t\u011bli aplikace pouze z web\u016f, kter\u00fdm d\u016fv\u011b\u0159ujete. SUnsignedAllowedBefore=Tento applet jste ji\u017e d\u0159\u00edve povolili. SUnsignedRejectedBefore=Tento applet jste ji\u017e d\u0159\u00edve odm\u00edtli. SUnsignedQuestion=Povolit spu\u0161t\u011bn\u00ed appletu? @@ -247,7 +247,7 @@ SNotYetValidCert=Zdroje obsahuj\u00ed polo\u017eky, u nich\u017e je\u0161t\u011b nen\u00ed platn\u00fd certifik\u00e1t podepisovatele. SUntrustedCertificate=Digit\u00e1ln\u00ed podpis byl vytvo\u0159en pomoc\u00ed ned\u016fv\u011bryhodn\u00e9ho certifik\u00e1tu. STrustedCertificate=Digit\u00e1ln\u00ed podpis byl vytvo\u0159en pomoc\u00ed d\u016fv\u011bryhodn\u00e9ho certifik\u00e1tu. -SCNMisMatch=O\u010dek\u00e1van\u00fd n\u00e1zev hostitele pro tento certifik\u00e1t je: {0}.
Adresa, ke kter\u00e9 se navazuje p\u0159ipojen\u00ed: {1}. +SCNMisMatch=O\u010dek\u00e1van\u00fd n\u00e1zev hostitele pro tento certifik\u00e1t je: {0}.
Adresa, ke kter\u00e9 se navazuje p\u0159ipojen\u00ed: {1}. SRunWithoutRestrictions=Tato aplikace bude spu\u0161t\u011bna bez obvykl\u00fdch bezpe\u010dnostn\u00edch omezen\u00ed aplikovan\u00fdch platformou Java. SCertificateDetails=Podrobnosti certifik\u00e1tu @@ -334,7 +334,7 @@ CPJVMrtJar=OK, adres\u00e1\u0159, kter\u00fd jste vybrali, obsahuje podadres\u00e1\u0159 a soubor \u201elib/rt.jar\u201c. CPJVMPluginAllowTTValidation=Povolit ov\u011b\u0159ov\u00e1n\u00ed v pr\u016fb\u011bhu psan\u00ed CPJVMNotokMessage1=Zadali jste neplatnou hodnotu ({0}) prost\u0159ed\u00ed JDK. Chybov\u00e1 zpr\u00e1va: -CPJVMNotokMessage2=Tuto zpr\u00e1vu vid\u00edte pravd\u011bpodobn\u011b proto\u017ee:
* V\u00e1\u0161 syst\u00e9m nepro\u0161el n\u011bkter\u00fdm z ov\u011b\u0159ovac\u00edch test\u016f
* Bylo detekov\u00e1no jin\u00e9 prost\u0159ed\u00ed ne\u017e OpenJDK
S neplatn\u00fdm prost\u0159ed\u00edm JDK nebude se pravd\u011bpodobn\u011b nebude aplikace IcedTea-Web schopna spustit.
Budete muset upravit nebo odstranit vlastnost {0} ve va\u0161em konfigura\u010dn\u00edm souboru {1}.
M\u011bli byste ve sv\u00e9m syst\u00e9mu nal\u00e9zt prost\u0159ed\u00ed OpenJDK, nebo byste m\u011bli dob\u0159e v\u011bd\u011bt, co d\u011bl\u00e1te. +CPJVMNotokMessage2=Tuto zpr\u00e1vu vid\u00edte pravd\u011bpodobn\u011b proto\u017ee:
* V\u00e1\u0161 syst\u00e9m nepro\u0161el n\u011bkter\u00fdm z ov\u011b\u0159ovac\u00edch test\u016f
* Bylo detekov\u00e1no jin\u00e9 prost\u0159ed\u00ed ne\u017e OpenJDK
S neplatn\u00fdm prost\u0159ed\u00edm JDK nebude se pravd\u011bpodobn\u011b nebude aplikace IcedTea-Web schopna spustit.
Budete muset upravit nebo odstranit vlastnost {0} ve va\u0161em konfigura\u010dn\u00edm souboru {1}.
M\u011bli byste ve sv\u00e9m syst\u00e9mu nal\u00e9zt prost\u0159ed\u00ed OpenJDK, nebo byste m\u011bli dob\u0159e v\u011bd\u011bt, co d\u011bl\u00e1te. CPJVMconfirmInvalidJdkTitle=Potvrzen\u00ed neplatn\u00e9ho prost\u0159ed\u00ed JDK CPJVMconfirmReset=Obnovit v\u00fdchoz\u00ed nastaven\u00ed? @@ -571,4 +571,4 @@ APPEXTSECguiPanelShowOnlyPermanentN=Zobrazit pouze zak\u00e1zan\u00e9 trval\u00e9 z\u00e1znamy APPEXTSECguiPanelShowOnlyTemporalY=Zobrazit pouze d\u0159\u00edve povolen\u00e9 z\u00e1znamy applet\u016f APPEXTSECguiPanelShowOnlyTemporalN=Zobrazit pouze d\u0159\u00edve zak\u00e1zan\u00e9 z\u00e1znamy applet\u016f -APPEXTSEChelpHomeDialogue=Odstavec o dialogu \ No newline at end of file +APPEXTSEChelpHomeDialogue=Odstavec o dialogu diff -r efa527f74184 netx/net/sourceforge/jnlp/resources/Messages_de.properties --- a/netx/net/sourceforge/jnlp/resources/Messages_de.properties +++ b/netx/net/sourceforge/jnlp/resources/Messages_de.properties @@ -236,7 +236,7 @@ SRememberAppletOnly=F\u00fcr Applet SRememberCodebase=F\u00fcr Website {0} SUnsignedSummary=Eine nicht signierte Java Anwendung m\u00f6chte zur Ausf\u00fchrung gebracht werden. -SUnsignedDetail=Eine nicht signierte Anwendung am folgenden Ort m\u00f6chte zur Ausf\u00fchrung gebracht werden:
  {0}
Seite, welche die Anforderung gestellt hat:
  {1}

Es wird empfohlen ausschlie\u00dflich Anwendungen zur Ausf\u00fchrung zu bringen, die von vertrauensw\u00fcrdigen Websites stammen. +SUnsignedDetail=Eine nicht signierte Anwendung am folgenden Ort m\u00f6chte zur Ausf\u00fchrung gebracht werden:
  {0}
Seite, welche die Anforderung gestellt hat:
  {1}

Es wird empfohlen ausschlie\u00dflich Anwendungen zur Ausf\u00fchrung zu bringen, die von vertrauensw\u00fcrdigen Websites stammen. SUnsignedAllowedBefore=Dieses Applet wurde bereits akzeptiert. SUnsignedRejectedBefore=Dieses Applet wurde bereits abgelehnt. SUnsignedQuestion=Soll dem Applet die Ausf\u00fchrung erlaubt werden? diff -r efa527f74184 netx/net/sourceforge/jnlp/resources/Messages_pl.properties --- a/netx/net/sourceforge/jnlp/resources/Messages_pl.properties +++ b/netx/net/sourceforge/jnlp/resources/Messages_pl.properties @@ -236,7 +236,7 @@ SRememberAppletOnly=Dla applet-u SRememberCodebase=Dla witryny {0} SUnsignedSummary=Niepodpisana aplikacja Java domaga si\u0119 uruchomienia. -SUnsignedDetail=Niepodpisana aplikacja z nast\u0119puj\u0105cej lokalizacji domaga si\u0119 uruchomienia:
  {0}
Strona, kt\u00f3ra postawi\u0142a \u017c\u0105danie:
  {1}

Zaleca si\u0119 uruchamia\u0107 wy\u0142\u0105cznie aplikacje z zaufanych witryn. +SUnsignedDetail=Niepodpisana aplikacja z nast\u0119puj\u0105cej lokalizacji domaga si\u0119 uruchomienia:
  {0}
Strona, kt\u00f3ra postawi\u0142a \u017c\u0105danie:
  {1}

Zaleca si\u0119 uruchamia\u0107 wy\u0142\u0105cznie aplikacje z zaufanych witryn. SUnsignedAllowedBefore=Zaakceptowa\u0142e\u015b ten applet poprzednio. SUnsignedRejectedBefore=Odrzuci\u0142e\u015b ten applet poprzednio. SUnsignedQuestion=Czy chcesz zezwoli\u0107 temu applet-owi na uruchomienie? diff -r efa527f74184 netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java --- a/netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java +++ b/netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java @@ -44,8 +44,8 @@ /** * Represents a running instance of an application described in a - * JNLPFile. This class provides a way to track the application's - * resources and destroy the application.

+ * JNLPFile. This class provides a way to track the application's + * resources and destroy the application. * * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.15 $ @@ -65,12 +65,15 @@ private ClassLoader loader; /** + *

* Every application/applet gets its own AppContext. This allows us to do * things like have two different look and feels for two different applets * (running in the same VM), allows untrusted programs to manipulate the - * event queue (safely) and (possibly) more.

- * + * event queue (safely) and (possibly) more. + *

+ *

* It is set to the AppContext which created this ApplicationInstance + *

*/ private AppContext appContext; diff -r efa527f74184 netx/net/sourceforge/jnlp/runtime/Boot.java --- a/netx/net/sourceforge/jnlp/runtime/Boot.java +++ b/netx/net/sourceforge/jnlp/runtime/Boot.java @@ -42,12 +42,12 @@ import sun.awt.SunToolkit; /** - * This is the main entry point for the JNLP client. The main + * This is the main entry point for the JNLP client. The main * method parses the command line parameters and loads a JNLP - * file into the secure runtime environment. This class is meant + * file into the secure runtime environment. This class is meant * to be called from the command line or file association; to * initialize the netx engine from other code invoke the - * JNLPRuntime.initialize method after configuring + * {@link JNLPRuntime#initialize} method after configuring * the runtime. * * @author Jon A. Maxwell (JAM) - initial author diff -r efa527f74184 netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java --- a/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java +++ b/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java @@ -94,9 +94,9 @@ import sun.misc.JarIndex; /** - * Classloader that takes it's resources from a JNLP file. If the + * Classloader that takes it's resources from a JNLP file. If the * JNLP file defines extensions, separate classloaders for these - * will be created automatically. Classes are loaded with the + * will be created automatically. Classes are loaded with the * security context when the classloader was created. * * @author Jon A. Maxwell (JAM) - initial author @@ -358,7 +358,7 @@ * Gets the lock for a given unique key, creating one if it does not yet exist. * This operation is atomic & thread-safe. * - * @param file the file whose unique key should be used + * @param uniqueKey the file whose unique key should be used * @return the lock */ private static ReentrantLock getUniqueKeyLock(String uniqueKey) { @@ -1583,6 +1583,7 @@ *

* This will add the JARDesc into the resourceTracker and block until it * is downloaded. + *

* @param desc the JARDesc for the new jar */ private void addNewJar(final JARDesc desc) { @@ -1750,7 +1751,7 @@ * Finds the resource in this, the parent, or the extension * class loaders. * - * @return a URL for the resource, or null + * @return a {@link URL} for the resource, or {@code null} * if the resource could not be found. */ @Override @@ -2003,7 +2004,7 @@ /** * Adds the given path to the path loader * - * @param URL the path to add + * @param u the path to add * @throws IllegalArgumentException If the given url is not a path */ private void addToCodeBaseLoader(URL u) { diff -r efa527f74184 netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java --- a/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java +++ b/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java @@ -66,17 +66,20 @@ import sun.net.www.protocol.jar.URLJarFile; /** + *

* Configure and access the runtime environment. This class * stores global jnlp properties such as default download * indicators, the install/base directory, the default resource * update policy, etc. Some settings, such as the base directory, - * cannot be changed once the runtime has been initialized.

- * + * cannot be changed once the runtime has been initialized. + *

+ *

* The JNLP runtime can be locked to prevent further changes to * the runtime environment except by a specified class. If set, * only instances of the exit class can exit the JVM or * change the JNLP runtime settings once the runtime has been - * initialized.

+ * initialized. + *

* * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.19 $ @@ -122,12 +125,13 @@ /** whether debug mode is on */ private static boolean debug = false; + /** * whether plugin debug mode is on */ private static Boolean pluginDebug = null; - /** mutex to wait on, for initialization */ + /** mutex to wait on, for initialization */ public static Object initMutex = new Object(); /** set to true if this is a webstart application. */ @@ -138,12 +142,12 @@ /** all security dialogs will be consumed and pretented as being verified by user and allowed.*/ private static boolean trustAll=false; + /** * Header is not checked and so eg. gifar exploit is possible - * @see http://en.wikipedia.org/wiki/Gifar for this kind of attack. + * @see Gifar for this kind of attack. * However if jar file is a bit corrupted, then it sometimes can work so * this switch can disable the header check. - * */ private static boolean ignoreHeaders=false; @@ -153,13 +157,10 @@ /** a lock which is held to indicate that an instance of netx is running */ private static FileLock fileLock; - - - /** * Returns whether the JNLP runtime environment has been - * initialized. Once initialized, some properties such as the - * base directory cannot be changed. Before + * initialized. Once initialized, some properties such as the + * base directory cannot be changed. Before */ public static boolean isInitialized() { return initialized; @@ -168,16 +169,18 @@ /** * Initialize the JNLP runtime environment by installing the * security manager and security policy, initializing the JNLP - * standard services, etc.

+ * standard services, etc. + *

+ * This method should be called from the main AppContext/Thread. + *

+ *

+ * This method cannot be called more than once. Once + * initialized, methods that alter the runtime can only be + * called by the exit class. + *

* - * This method should be called from the main AppContext/Thread.

- * - * This method cannot be called more than once. Once - * initialized, methods that alter the runtime can only be - * called by the exit class.

- * - * @param isApplication is true if a webstart application is being initialized - * + * @param isApplication is {@code true} if a webstart application is being + * initialized * @throws IllegalStateException if the runtime was previously initialized */ public static void initialize(boolean isApplication) throws IllegalStateException { @@ -349,9 +352,9 @@ /** - * see https://en.wikipedia.org/wiki/Double-checked_locking#Usage_in_Java + * see Double-checked locking in Java * for cases how not to do lazy initialization - * and https://en.wikipedia.org/wiki/Initialization_on_demand_holder_idiom + * and Initialization on demand holder idiom * for ITW approach */ private static class DeploymentConfigurationHolder { @@ -411,7 +414,7 @@ * Sets whether the JNLP client will use any AWT/Swing * components. In headless mode, client features that use the * AWT are disabled such that the client can be used in - * headless mode (java.awt.headless=true). + * headless mode ({@code java.awt.headless=true}). * * @throws IllegalStateException if the runtime was previously initialized */ @@ -441,10 +444,11 @@ * Disabling security can increase performance for some * applications, and can be used to use netx with other code * that uses its own security manager or policy. - * + *

* Disabling security is not recommended and should only be - * used if the JNLP files opened are trusted. This method can - * only be called before initalizing the runtime.

+ * used if the JNLP files opened are trusted. This method can + * only be called before initalizing the runtime. + *

* * @param enabled whether security should be enabled * @throws IllegalStateException if the runtime is already initialized @@ -570,7 +574,7 @@ /** * Returns the localized resource string identified by the - * specified key. If the message is empty, a null is + * specified key. If the message is empty, a null is * returned. */ public static String getMessage(String key) { @@ -589,8 +593,7 @@ } /** - * Returns the localized resource string using the specified - * arguments. + * Returns the localized resource string using the specified arguments. * * @param args the formatting arguments to the resource string */ @@ -599,7 +602,7 @@ } /** - * Returns true if the current runtime will fork + * Returns {@code true} if the current runtime will fork */ public static boolean getForksAllowed() { return forksAllowed; @@ -611,8 +614,7 @@ } /** - * Throws an exception if called when the runtime is - * already initialized. + * Throws an exception if called when the runtime is already initialized. */ private static void checkInitialized() { if (initialized) @@ -620,9 +622,8 @@ } /** - * Throws an exception if called with security enabled but - * a caller is not the exit class and the runtime has been - * initialized. + * Throws an exception if called with security enabled but a caller is not + * the exit class and the runtime has been initialized. */ private static void checkExitClass() { if (securityEnabled && initialized) @@ -655,7 +656,7 @@ } /** - * @return true if running on Windows + * @return {@code true} if running on Windows */ public static boolean isWindows() { String os = System.getProperty("os.name"); @@ -663,8 +664,8 @@ } /** - * @return true if running on a Unix or Unix-like system (including Linux - * and *BSD) + * @return {@code true} if running on a Unix or Unix-like system (including + * Linux and *BSD) */ public static boolean isUnix() { String sep = System.getProperty("file.separator"); @@ -684,7 +685,7 @@ } /** - * Indicate that netx is running by creating the file corresponding to + * Indicate that netx is running by creating the * {@link DeploymentConfiguration#KEY_USER_NETX_RUNNING_FILE} and * acquiring a shared lock on it */ @@ -735,8 +736,8 @@ } /** - * Indicate that netx is stopped by releasing the shared lock on the file - * corresponding to {@link DeploymentConfiguration#KEY_USER_NETX_RUNNING_FILE}. + * Indicate that netx is stopped by releasing the shared lock on + * {@link DeploymentConfiguration#KEY_USER_NETX_RUNNING_FILE}. */ private static void markNetxStopped() { if (fileLock == null) { @@ -787,5 +788,4 @@ OutputController.getLogger().close(); System.exit(i); } - } diff -r efa527f74184 netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java --- a/netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java +++ b/netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java @@ -33,15 +33,16 @@ import sun.awt.AppContext; /** - * Security manager for JNLP environment. This security manager + * Security manager for JNLP environment. This security manager * cannot be replaced as it always denies attempts to replace the - * security manager or policy.

- * + * security manager or policy. + *

* The JNLP security manager tracks windows created by an * application, allowing those windows to be disposed when the - * application exits but the JVM does not. If security is not + * application exits but the JVM does not. If security is not * enabled then the first application to call System.exit will - * halt the JVM.

+ * halt the JVM. + *

* * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.17 $ @@ -366,17 +367,18 @@ } /** - * Checks whether the caller can exit the system. This method + * Checks whether the caller can exit the system. This method * identifies whether the caller is a real call to Runtime.exec * and has special behavior when returning from this method * would exit the JVM and an exit class is set: if the caller is * not the exit class then the calling application will be * stopped and its resources destroyed (when possible), and an * exception will be thrown to prevent the JVM from shutting - * down.

- * + * down. + *

* Calls not from Runtime.exit or with no exit class set will * behave normally, and the exit class can always exit the JVM. + *

*/ @Override public void checkExit(int status) { @@ -426,11 +428,12 @@ * check if the current {@link SecurityManager} is an instance of * AWTSecurityManager and if so, call this method to give it a chance to * return the appropriate appContext based on the application that is - * running.

- * + * running. + *

* This can be called from any thread (possibly a swing thread) to find out * the AppContext for the thread (which may correspond to a particular * applet). + *

*/ @Override public AppContext getAppContext() { diff -r efa527f74184 netx/net/sourceforge/jnlp/runtime/LocateJnlpClassLoader.java --- a/netx/net/sourceforge/jnlp/runtime/LocateJnlpClassLoader.java +++ b/netx/net/sourceforge/jnlp/runtime/LocateJnlpClassLoader.java @@ -48,7 +48,7 @@ /** * Locates the JNLPClassLoader of the JNLP file. * @param rootClassLoader Root JNLPClassLoader of the application. - * @param urlToJnlpFile Path of the JNLP file. If null, main JNLP's file location + * @param urlToJnlpFile Path of the JNLP file. If {@code null}, main JNLP file's location * be used instead * @return the JNLPClassLoader of the JNLP file. */ @@ -79,8 +79,8 @@ /** * Locates the JNLPClassLoader of the JNLP file's resource. * @param rootClassLoader Root JNLPClassLoader of the application. - * @param urlToJnlpFile Path of the launch or extension JNLP File. If null, - * main JNLP's file location will be used instead. + * @param ref Path of the launch or extension JNLP File. If {@code null}, + * main JNLP file's location will be used instead. * @param version The version of resource. Is null if no version is specified * @return the JNLPClassLoader of the JNLP file's resource. */ diff -r efa527f74184 netx/net/sourceforge/jnlp/runtime/ManageJnlpResources.java --- a/netx/net/sourceforge/jnlp/runtime/ManageJnlpResources.java +++ b/netx/net/sourceforge/jnlp/runtime/ManageJnlpResources.java @@ -126,12 +126,12 @@ } /** - * Returns true if the resource (not mentioned in the jnlp file) is cached, otherwise false + * Returns {@code true} if the resource (not mentioned in the jnlp file) is cached, otherwise {@code false} * Used by DownloadService. - * @param rootClassLoader Root JNLPClassLoader of the application. + * @param rootClassLoader Root {@link JNLPClassLoader} of the application. * @param ref Path to the resource. - * @param version The version of resource. If null, no version is specified. - * @return + * @param version The version of resource. If {@code null}, no version is specified. + * @return {@code true} if the external resource is cached, otherwise {@code false} */ public static boolean isExternalResourceCached(final JNLPClassLoader rootClassLoader, final URL ref, final String version) { return rootClassLoader.manageExternalJars(ref, version, DownloadAction.CHECK_CACHE); diff -r efa527f74184 netx/net/sourceforge/jnlp/runtime/package-info.java --- /dev/null +++ b/netx/net/sourceforge/jnlp/runtime/package-info.java @@ -0,0 +1,37 @@ +/* package-info.java + Copyright (C) 2014 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or modify it under the +terms of the GNU General Public License as published by the Free Software +Foundation, version 2. + +IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A +PARTICULAR PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along with +IcedTea; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is making a +combined work based on this library. Thus, the terms and conditions of the GNU +General Public License cover the whole combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent modules, and +to copy and distribute the resulting executable under terms of your choice, +provided that you also meet, for each linked independent module, the terms and +conditions of the license of that module. An independent module is a module +which is not derived from or based on this library. If you modify this library, +you may extend this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this exception +statement from your version.*/ +/** + * This package contains the classes that manage the secure runtime environment + * for JNLP apps. + */ +package netx.sourceforge.jnlp.runtime; diff -r efa527f74184 netx/net/sourceforge/jnlp/runtime/package.html --- a/netx/net/sourceforge/jnlp/runtime/package.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - -This package contains the classes that manage the secure runtime -environment for JNLP apps. - -

Package Specification

- - - -

Related Documentation

- -For overviews, tutorials, examples, guides, and tool documentation, please see: - - - - - - - - diff -r efa527f74184 netx/net/sourceforge/jnlp/security/AppVerifier.java --- a/netx/net/sourceforge/jnlp/security/AppVerifier.java +++ b/netx/net/sourceforge/jnlp/security/AppVerifier.java @@ -77,7 +77,6 @@ * @param certs Any possible signer and their respective information regarding this app. * @param signedJars A map of all the jars of this app and the number of * signed entries each one has. - * @return */ public boolean isFullySigned(Map certs, Map signedJars); diff -r efa527f74184 netx/net/sourceforge/jnlp/security/KeyStores.java --- a/netx/net/sourceforge/jnlp/security/KeyStores.java +++ b/netx/net/sourceforge/jnlp/security/KeyStores.java @@ -58,7 +58,7 @@ import net.sourceforge.jnlp.util.logging.OutputController; /** - * The KeyStores class allows easily accessing the various KeyStores + * The {@code KeyStores} class allows easily accessing the various KeyStores * used. */ public final class KeyStores { diff -r efa527f74184 netx/net/sourceforge/jnlp/security/SecurityDialogMessageHandler.java --- a/netx/net/sourceforge/jnlp/security/SecurityDialogMessageHandler.java +++ b/netx/net/sourceforge/jnlp/security/SecurityDialogMessageHandler.java @@ -56,11 +56,13 @@ * security prompt. This ensures that all security prompts are isolated and * their Look and Feel is not affected by the Look and Feel of the * applet/application. + *

*

* This class contains allows a client application to post a * {@link SecurityDialogMessage}. When this class finds a security message in * the queue, it shows a security warning to the user, and sets * {@link SecurityDialogMessage#userResponse} to the appropriate value. + *

*/ public final class SecurityDialogMessageHandler implements Runnable { @@ -90,6 +92,7 @@ * Once the user has made a choice the * {@link SecurityDialogMessage#toDispose} (if not null) is disposed and * {@link SecurityDialogMessage#lock} (in not null) is released. + *

* * @param message the message indicating what type of security dialog to * show @@ -126,6 +129,7 @@ * Once the user has made a choice the * {@link SecurityDialogMessage#toDispose} (if not null) is disposed and * {@link SecurityDialogMessage#lock} (in not null) is released. + *

* * @param message indicates the type of security dialog to show */ diff -r efa527f74184 netx/net/sourceforge/jnlp/security/SecurityDialogs.java --- a/netx/net/sourceforge/jnlp/security/SecurityDialogs.java +++ b/netx/net/sourceforge/jnlp/security/SecurityDialogs.java @@ -56,13 +56,17 @@ import net.sourceforge.jnlp.runtime.JNLPRuntime; /** - * A factory for showing many possible types of security warning to the user.

- * + *

+ * A factory for showing many possible types of security warning to the user. + *

+ *

* This contains all the public methods that classes outside this package should * use instead of using {@link SecurityDialog} directly. - * + *

+ *

* All of these methods post a message to the * {@link SecurityDialogMessageHandler} and block waiting for a response. + *

*/ public class SecurityDialogs { /** Types of dialogs we can create */ @@ -180,9 +184,9 @@ /** * Shows a security warning dialog according to the specified type of - * access. If type is one of AccessType.VERIFIED or - * AccessType.UNVERIFIED, extra details will be available with regards - * to code signing and signing certificates. + * access. If {@code accessType} is one of {@link AccessType#VERIFIED} or + * {@link AccessType#UNVERIFIED}, extra details will be available with + * regards to code signing and signing certificates. * * @param accessType the type of warning dialog to show * @param file the JNLPFile associated with this warning diff -r efa527f74184 netx/net/sourceforge/jnlp/security/UnsignedAppletTrustWarningPanel.java --- a/netx/net/sourceforge/jnlp/security/UnsignedAppletTrustWarningPanel.java +++ b/netx/net/sourceforge/jnlp/security/UnsignedAppletTrustWarningPanel.java @@ -160,10 +160,10 @@ ExecuteUnsignedApplet rememberedAction = UnsignedAppletTrustConfirmation.getStoredAction(file); int panelHeight = INFO_PANEL_HEIGHT; if (rememberedAction == ExecuteUnsignedApplet.YES) { - infoLabelText += "
" + R("SUnsignedAllowedBefore"); + infoLabelText += "
" + R("SUnsignedAllowedBefore"); panelHeight += INFO_PANEL_HINT_HEIGHT; } else if (rememberedAction == ExecuteUnsignedApplet.NO) { - infoLabelText += "
" + R("SUnsignedRejectedBefore"); + infoLabelText += "
" + R("SUnsignedRejectedBefore"); panelHeight += INFO_PANEL_HINT_HEIGHT; } @@ -299,4 +299,4 @@ } }; } -} \ No newline at end of file +} diff -r efa527f74184 netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletActionStorage.java --- a/netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletActionStorage.java +++ b/netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletActionStorage.java @@ -39,85 +39,85 @@ /** * This is abstract access to white/blacklist created from some permanent storage. - * + *

* It is daclaring adding, updating and searching. Intentionally not removing as * during plugin runtime no deletations should be done. - * + *

+ *

* Implementations of this interface (unless dummy ones:) should ensure correct * communication with permanent storage and be prepared for multiple instances - * read/write the same storage at time - * + * read/write the same storage at time. + *

*/ public interface UnsignedAppletActionStorage { /** * This methods iterates through records in - * DeploymentConfiguration.getAppletTrustSettingsPath(), and is matching + * {@link net.sourceforge.jnlp.config.DeploymentConfiguration#getAppletTrustUserSettingsPath} or + * {@link net.sourceforge.jnlp.config.DeploymentConfiguration#getAppletTrustGlobalSettingsPath}, and is matching * regexes saved here against params. So parameters here are NOT regexes, * but are matched against saved regexes. - * - * Null or empty values are dangerously ignored, user, be aware of it. eg: - * match only codeBase will be null someCodeBase null null match only - * documentBase will be someDocBase null null null match only applet not - * regarding code or document base will be null null mainClass archives - * + *

+ * {@code null} or empty values are dangerously ignored, user, be aware of it. eg: + * match only {@code codeBase} will be {@code null} someCodeBase {@code null} {@code null} match only + * {@code documentBase} will be someDocBase {@code null} {@code null} {@code null} match only applet not + * regarding code or document base will be {@code null} {@code null} mainClass archives. + *

* @param documentBase * @param codeBase - * @param mainClass * @param archives - * @return + * @return a matching unsigned applet action entry */ public UnsignedAppletActionEntry getMatchingItem(String documentBase, String codeBase, List archives); /** - * Shortcut getMatchingItem(documentBase, null,null,null) + * Shortcut {@code getMatchingItem(documentBase, null, null, null)} * * @param documentBase - * @return + * @return a matching unsigned applet action entry */ public UnsignedAppletActionEntry getMatchingItemByDocumentBase(String documentBase); /** - * Shortcut getMatchingItem(null, codeBase,null,null) + * Shortcut {@code getMatchingItem(null, codeBase, null, null)} * * @param codeBase - * @return + * @return a matching unsigned applet action entry */ public UnsignedAppletActionEntry getMatchingItemByCodeBase(String codeBase); /** - * Shortcut getMatchingItem(documentBase, codeBase,null,null) + * Shortcut {@code getMatchingItem(documentBase, codeBase, null, null)} * * @param documentBase * @param codeBase - * @return + * @return a matching unsigned applet action entry */ public UnsignedAppletActionEntry getMatchingItemByBases(String documentBase, String codeBase); /** * Will add new record. Note that regexes are stored for bases matching. - * - * eg UnsignedAppletActionEntry which will deny some applet no matter of - * page will be new UnsignedAppletActionEntry(UnsignedAppletAction.NEVER, - * new Date(), null, null, someMain, someArchives) - * - * eg UnsignedAppletActionEntry which will allow all applets on page with - * same codebase will be new - * UnsignedAppletActionEntry(UnsignedAppletAction.NEVER, new Date(), ".*", - * ".*", null, null); - * + *

+ * eg {@link UnsignedAppletActionEntry} which will deny some applet no matter of + * page will be {@code new }{@link UnsignedAppletActionEntry#UnsignedAppletActionEntry UnsignedAppletActionEntry}{@code (}{@link ExecuteUnsignedApplet#NEVER}{@code , new }{@link java.util.Date#Date() Date()}{@code , null, null, someMain, someArchives)} + *

+ *

+ * eg {@link UnsignedAppletActionEntry} which will + * allow all applets on page with same codebase will be {@code new }{@link UnsignedAppletActionEntry#UnsignedAppletActionEntry UnsignedAppletActionEntry}{@code (}{@link ExecuteUnsignedApplet#NEVER}{@code , new }{@link java.util.Date#Date() Date()}{@code , ".*", ".*", null, null);} + *

* @param item */ public void add(final UnsignedAppletActionEntry item); /** - * Will replace (current impl is matching by object's hashcode This is not - * reloading the list(but still saving after), so StorageIoEception can be + * Will replace (current impl is matching by object's hashcode. This is not + * reloading the list (but still saving after), so + * {@link net.sourceforge.jnlp.util.lockingfile.StorageIoException} can be * thrown if it was not loaded before. - * + *

* Imho this should be used only to actualise timestamps or change - * UnsignedAppletAction - * + * {@link UnsignedAppletActionEntry} + *

* @param item */ public void update(final UnsignedAppletActionEntry item); diff -r efa527f74184 netx/net/sourceforge/jnlp/services/ServiceUtil.java --- a/netx/net/sourceforge/jnlp/services/ServiceUtil.java +++ b/netx/net/sourceforge/jnlp/services/ServiceUtil.java @@ -46,7 +46,7 @@ /** * Provides static methods to interact useful for using the JNLP - * services.

+ * services. * * @author Jon A. Maxwell (JAM) - initial author * @author Joshua Sumali diff -r efa527f74184 netx/net/sourceforge/jnlp/services/XDownloadService.java --- a/netx/net/sourceforge/jnlp/services/XDownloadService.java +++ b/netx/net/sourceforge/jnlp/services/XDownloadService.java @@ -36,8 +36,8 @@ class XDownloadService implements DownloadService { /** - * Returns the JNLPClassLoader of the application - * @return + * Returns the {@link JNLPClassLoader} of the application + * @return the {@link JNLPClassLoader} of the application */ JNLPClassLoader getClassLoader() { return (JNLPClassLoader) JNLPRuntime.getApplication().getClassLoader(); @@ -46,6 +46,7 @@ /** * Returns a listener that will automatically display download * progress to the user. + * @return always {@code null} */ public DownloadServiceListener getDefaultProgressWindow() { return null; diff -r efa527f74184 netx/net/sourceforge/jnlp/services/package-info.java --- /dev/null +++ b/netx/net/sourceforge/jnlp/services/package-info.java @@ -0,0 +1,37 @@ +/* package-info.java + Copyright (C) 2014 Red Hat, Inc. + +This file is part of IcedTea. + +IcedTea is free software; you can redistribute it and/or modify it under the +terms of the GNU General Public License as published by the Free Software +Foundation, version 2. + +IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A +PARTICULAR PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along with +IcedTea; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is making a +combined work based on this library. Thus, the terms and conditions of the GNU +General Public License cover the whole combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent modules, and +to copy and distribute the resulting executable under terms of your choice, +provided that you also meet, for each linked independent module, the terms and +conditions of the license of that module. An independent module is a module +which is not derived from or based on this library. If you modify this library, +you may extend this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this exception +statement from your version.*/ +/** + * This package contains the classes that implement the standard services + * defined by the JNLP specification. + */ +package netx.sourceforge.jnlp.services; diff -r efa527f74184 netx/net/sourceforge/jnlp/services/package.html --- a/netx/net/sourceforge/jnlp/services/package.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - -This package contains the classes that implement the standard -services defined by the JNLP specification. - -

Package Specification

- - - -

Related Documentation

- -For overviews, tutorials, examples, guides, and tool documentation, please see: - - - - - - - - diff -r efa527f74184 netx/net/sourceforge/jnlp/splashscreen/SplashUtils.java --- a/netx/net/sourceforge/jnlp/splashscreen/SplashUtils.java +++ b/netx/net/sourceforge/jnlp/splashscreen/SplashUtils.java @@ -40,9 +40,13 @@ import net.sourceforge.jnlp.runtime.AppletInstance; import net.sourceforge.jnlp.runtime.Boot; import net.sourceforge.jnlp.runtime.JNLPRuntime; -import net.sourceforge.jnlp.splashscreen.impls.*; +import net.sourceforge.jnlp.splashscreen.impls.DefaultSplashScreen2012; +import net.sourceforge.jnlp.splashscreen.impls.DefaultErrorSplashScreen2012; import net.sourceforge.jnlp.util.logging.OutputController; +/** + * @author Jiri Vanek + */ public class SplashUtils { static final String ICEDTEA_WEB_PLUGIN_SPLASH = "ICEDTEA_WEB_PLUGIN_SPLASH"; @@ -50,13 +54,10 @@ static final String NONE = "none"; static final String DEFAULT = "default"; - /** - * * Indicator whether to show icedtea-web plugin or just icedtea-web - * For "just icedtea-web" will be done an attempt to show content of + * For "just icedtea-web" will be done an attempt to show content of * information element - * */ public static enum SplashReason { @@ -110,62 +111,69 @@ private static SplashReason getReason() { - if (JNLPRuntime.isWebstartApplication()){ + if (JNLPRuntime.isWebstartApplication()) { return SplashReason.JAVAWS; - }else{ + } else { return SplashReason.APPLET; - } - + } } /** - * Warrning - splash should have recieve width and height without borders. - * plugin's window have NO border, but javaws window HAVE border. This msut be calcualted prior calling this method + * Warning - splash should have recieve width and height without borders. + * plugin's window have NO border, but javaws window HAVE border. This must + * be calcualted prior calling this method * @param width * @param height - * @return */ public static SplashPanel getSplashScreen(int width, int height) { return getSplashScreen(width, height, getReason()); } /** - * Warrning - splash should have recieve width and height without borders. - * plugin's window have NO border, but javaws window HAVE border. This msut be calcualted prior calling this method + * Warning - splash should have recieve width and height without borders. + * plugin's window have NO border, but javaws window HAVE border. This must + * be calcualted prior calling this method * @param width * @param height - * @param ex - exception to be shown if any - * @return + * @param ex exception to be shown if any */ public static SplashErrorPanel getErrorSplashScreen(int width, int height, Throwable ex) { return getErrorSplashScreen(width, height, getReason(), ex); } /** - * Warrning - splash should have recieve width and height without borders. - * plugin's window have NO border, but javaws window HAVE border. This msut be calcualted prior calling this method + * Warning - splash should have recieve width and height without borders. + * plugin's window have NO border, but javaws window HAVE border. This must + * be calcualted prior calling this method * @param width * @param height * @param splashReason - * @return */ static SplashPanel getSplashScreen(int width, int height, SplashUtils.SplashReason splashReason) { return getSplashScreen(width, height, splashReason, null, false); } /** - * Warrning - splash should have recieve width and height without borders. - * plugin's window have NO border, but javaws window HAVE border. This msut be calcualted prior calling this method + * Warning - splash should have recieve width and height without borders. + * plugin's window have NO border, but javaws window HAVE border. This must + * be calcualted prior calling this method * @param width * @param height * @param splashReason - * @return + * @param ex exception to be shown if any */ static SplashErrorPanel getErrorSplashScreen(int width, int height, SplashUtils.SplashReason splashReason, Throwable ex) { return (SplashErrorPanel) getSplashScreen(width, height, splashReason, ex, true); } + /** + * @param width + * @param height + * @param splashReason + * @param loadingException + * @param isError + */ static SplashPanel getSplashScreen(int width, int height, SplashUtils.SplashReason splashReason, Throwable loadingException, boolean isError) { String splashEnvironmetVar = null; String pluginSplashEnvironmetVar = null; diff -r efa527f74184 netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/ErrorPainter.java --- a/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/ErrorPainter.java +++ b/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/ErrorPainter.java @@ -76,7 +76,7 @@ * @param currentSize * @param from * @param to - * @return + * @return interpolated value */ public static double interpol(double origSize, double currentSize, double from, double to) { return getRatio(origSize, currentSize) * (to - from) + from; @@ -90,7 +90,7 @@ * @param currentSize * @param from * @param to - * @return + * @return interpolated {@link Color} */ public static Color interpolateColor(double origSize, double currentSize, Color from, Color to) { double r = interpol(origSize, currentSize, to.getRed(), from.getRed()); diff -r efa527f74184 netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/TextOutlineRenderer.java --- a/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/TextOutlineRenderer.java +++ b/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/TextOutlineRenderer.java @@ -137,7 +137,7 @@ } /** - * @param outlineColor the color of outline + * @param textOutline the color of outline */ public void setTextOutline(Color textOutline) { this.outlineColor = textOutline; diff -r efa527f74184 netx/net/sourceforge/jnlp/splashscreen/parts/JEditorPaneBasedExceptionDialog.java --- a/netx/net/sourceforge/jnlp/splashscreen/parts/JEditorPaneBasedExceptionDialog.java +++ b/netx/net/sourceforge/jnlp/splashscreen/parts/JEditorPaneBasedExceptionDialog.java @@ -306,7 +306,7 @@ + Translator.R(InfoItem.SPLASH + "mainL4") + "

\n" + info + formatListInfoList(l) + formatInfo(anotherInfo) - +"
"+DateFormat.getInstance().format(shown)+"
" + +"
"+DateFormat.getInstance().format(shown)+"
" + "

" + Translator.R(InfoItem.SPLASH + "exWas") + "
\n" + "

" + getExceptionStackTraceAsString(ex) + "
" @@ -392,9 +392,9 @@ String getMessage() { return message; - } + } - private static String createLink() { + private static String createLink() { return "" + Translator.R(InfoItem.SPLASH + "urlLooks") + ""; } diff -r efa527f74184 netx/net/sourceforge/jnlp/tools/CertInformation.java --- a/netx/net/sourceforge/jnlp/tools/CertInformation.java +++ b/netx/net/sourceforge/jnlp/tools/CertInformation.java @@ -95,7 +95,7 @@ /** * Return if there are signing issues with this certificate. - * @return true if there are any issues with expiry, validity or bad key usage. + * @return {@code true} if there are any issues with expiry, validity or bad key usage. */ public boolean hasSigningIssues() { return hasExpiredCert || isNotYetValidCert || hasBadKeyUsage @@ -105,7 +105,7 @@ /** * Return whether or not the publisher is already trusted. * - * @return True if the publisher is trusted already. + * @return {@code true} if the publisher is trusted already. */ public boolean isPublisherAlreadyTrusted() { return alreadyTrustPublisher; @@ -113,7 +113,6 @@ /** * Set whether or not the publisher is already trusted. - * */ public void setAlreadyTrustPublisher() { alreadyTrustPublisher = true; @@ -122,7 +121,7 @@ /** * Return whether or not the root is in the list of trusted CA certificates. * - * @return True if the root is in the list of CA certificates. + * @return {@code true} if the root is in the list of CA certificates. */ public boolean isRootInCacerts() { return rootInCacerts; @@ -149,7 +148,7 @@ /** * Check if this cert is the signer of a jar. * @param jarName The absolute path of the jar this certificate has signed. - * @return true if this cert has signed the jar found at jarName. + * @return {@code true} if this cert has signed the jar found at {@code jarName}. */ public boolean isSignerOfJar(String jarName) { return signedJars.containsKey(jarName); @@ -160,7 +159,7 @@ * number of entries it has signed in the jar. * * @param jarName The absolute path of the jar this certificate has signed. - * @param signedEntriesCount The number of entries this cert has signed in jarName. + * @param signedEntriesCount The number of entries this cert has signed in {@code jarName}. */ public void setNumJarEntriesSigned(String jarName, int signedEntriesCount) { if (signedJars.containsKey(jarName)) { @@ -174,7 +173,7 @@ /** * Find the number of entries this cert has signed in the specified jar. * @param jarName The absolute path of the jar this certificate has signed. - * @return The number of entries this cert has signed in jarName. + * @return The number of entries this cert has signed in {@code jarName}. */ public int getNumJarEntriesSigned(String jarName) { return signedJars.get(jarName); @@ -183,7 +182,7 @@ /** * Get all the jars this cert has signed along with the number of entries * in each jar. - * @return + * @return a {link Map} of jars and their number of entries this cert has signed */ public Map getSignedJars() { return signedJars; @@ -233,7 +232,7 @@ /** * Get whether or not this cert will expire within 6 months. - * @return true if the cert will be expired after 6 months. + * @return {@code true} if the cert will be expired after 6 months. */ public boolean hasExpiringCert() { return hasExpiringCert; @@ -249,7 +248,6 @@ details.add(Detail.NOT_YET_VALID); } - /** * Set that this cert has bad key usage * and add this issue to the list of details. @@ -260,7 +258,6 @@ details.add(Detail.BAD_KEY_USAGE); } - /** * Set that this cert has bad extended key usage * and add this issue to the list of details. @@ -271,7 +268,6 @@ details.add(Detail.BAT_EXTENDED_KEY_USAGE); } - /** * Set that this cert has a bad netscape cert type * and add this issue to the list of details. @@ -287,6 +283,5 @@ */ public void setUntrusted() { details.add(Detail.UNTRUSTED); - } } diff -r efa527f74184 netx/net/sourceforge/jnlp/tools/JarCertVerifier.java --- a/netx/net/sourceforge/jnlp/tools/JarCertVerifier.java +++ b/netx/net/sourceforge/jnlp/tools/JarCertVerifier.java @@ -58,7 +58,6 @@ import sun.security.x509.NetscapeCertTypeExtension; /** - *

* The jar certificate verifier utility. * * @author Roland Schemers diff -r efa527f74184 netx/net/sourceforge/jnlp/tools/KeyStoreUtil.java --- a/netx/net/sourceforge/jnlp/tools/KeyStoreUtil.java +++ b/netx/net/sourceforge/jnlp/tools/KeyStoreUtil.java @@ -26,7 +26,7 @@ package net.sourceforge.jnlp.tools; /** - *

This class provides several utilities to KeyStore. + * This class provides several utilities to {@link java.security.KeyStore}. * * @since 1.6.0 */ diff -r efa527f74184 netx/net/sourceforge/jnlp/util/PropertiesFile.java --- a/netx/net/sourceforge/jnlp/util/PropertiesFile.java +++ b/netx/net/sourceforge/jnlp/util/PropertiesFile.java @@ -24,7 +24,7 @@ * A properties object backed by a specified file without throwing * exceptions. The properties are automatically loaded from the * file when the first property is requested, but the save method - * must be called before changes are saved to the file.

+ * must be called before changes are saved to the file. * * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.4 $ diff -r efa527f74184 netx/net/sourceforge/jnlp/util/Reflect.java --- a/netx/net/sourceforge/jnlp/util/Reflect.java +++ b/netx/net/sourceforge/jnlp/util/Reflect.java @@ -22,17 +22,19 @@ /** * Provides simply, convenient methods to invoke methods by - * name. This class is used to consolidate reflection needed to + * name. This class is used to consolidate reflection needed to * access methods specific to Sun's JVM or to remain backward - * compatible while supporting method in newer JVMs.

- * + * compatible while supporting method in newer JVMs. + *

* Most methods of this class invoke the first method on the * specified object that matches the name and number of - * parameters. The type of the parameters are not considered, so + * parameters. The type of the parameters are not considered, so * do not attempt to use this class to invoke overloaded - * methods.

- * - * Instances of this class are not synchronized.

+ * methods. + *

+ *

+ * Instances of this class are not synchronized. + *

* * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.1 $ diff -r efa527f74184 netx/net/sourceforge/jnlp/util/WeakList.java --- a/netx/net/sourceforge/jnlp/util/WeakList.java +++ b/netx/net/sourceforge/jnlp/util/WeakList.java @@ -25,7 +25,7 @@ * turn to null at any point (ie, indexOf(x) followed by get(x) * may return null). The weak references are only removed when * the trimToSize method is called so that the indices remain - * constant otherwise.

+ * constant otherwise. * * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.3 $ diff -r efa527f74184 netx/net/sourceforge/jnlp/util/logging/ConsoleOutputPaneModel.java --- a/netx/net/sourceforge/jnlp/util/logging/ConsoleOutputPaneModel.java +++ b/netx/net/sourceforge/jnlp/util/logging/ConsoleOutputPaneModel.java @@ -188,8 +188,8 @@ } String line = (createLine(messageWithHeader)); if (mark) { - line = line.replaceAll("\n", "
\n"); - line = line.replaceAll(" ", "  ");//small trick, html is reducting row of sapces to single space. This handles it and stimm allow line wrap + line = line.replaceAll("\n", "
\n"); + line = line.replaceAll(" ", "  ");//small trick, html is reducting row of spaces to single space. This handles it and stimm allow line wrap line = line.replaceAll("\t", "    "); } sb.append(line); diff -r efa527f74184 netx/net/sourceforge/jnlp/util/logging/FileLog.java --- a/netx/net/sourceforge/jnlp/util/logging/FileLog.java +++ b/netx/net/sourceforge/jnlp/util/logging/FileLog.java @@ -50,12 +50,12 @@ /** * This class writes log information to file. - * + * @author Jiri Vanek */ public final class FileLog implements SingleStreamLogger { - private static SimpleDateFormat fileLogNameFormatter = new SimpleDateFormat("yyyy-MM-dd_HH:mm:ss.S"); + private static SimpleDateFormat fileLogNameFormatter = new SimpleDateFormat("yyyy-MM-dd_HH:mm:ss.S"); /**"Tue Nov 19 09:43:50 CET 2013"*/ - private static SimpleDateFormat pluginSharedFormatter = new SimpleDateFormat("EEE MMM dd HH:mm:ss ZZZ yyyy"); + private static SimpleDateFormat pluginSharedFormatter = new SimpleDateFormat("EEE MMM dd HH:mm:ss ZZZ yyyy"); private final Logger impl; private final FileHandler fh; @@ -71,43 +71,43 @@ - public FileLog(String fileName, boolean append) { - this(fileName, fileName, append); - } + public FileLog(String fileName, boolean append) { + this(fileName, fileName, append); + } - public FileLog(String loggerName, String fileName, boolean append) { - try{ - File futureFile = new File(fileName); - if (!futureFile.exists()) { - FileUtils.createRestrictedFile(futureFile, true); - } - fh = new FileHandler(fileName, append); - fh.setFormatter(new Formatter() { - @Override - public String format(LogRecord record) { - return record.getMessage() + "\n"; - } - }); - impl = Logger.getLogger(loggerName); - impl.setLevel(Level.ALL); - impl.addHandler(fh); - log(new Header(OutputController.Level.WARNING_ALL, Thread.currentThread().getStackTrace(), Thread.currentThread(), false).toString()); - } catch (IOException e) { + public FileLog(String loggerName, String fileName, boolean append) { + try { + File futureFile = new File(fileName); + if (!futureFile.exists()) { + FileUtils.createRestrictedFile(futureFile, true); + } + fh = new FileHandler(fileName, append); + fh.setFormatter(new Formatter() { + @Override + public String format(LogRecord record) { + return record.getMessage() + "\n"; + } + }); + impl = Logger.getLogger(loggerName); + impl.setLevel(Level.ALL); + impl.addHandler(fh); + log(new Header(OutputController.Level.WARNING_ALL, Thread.currentThread().getStackTrace(), Thread.currentThread(), false).toString()); + } catch (IOException e) { throw new RuntimeException(e); - } + } } /** * Log the String to file. * - * @param e Exception that was thrown. + * @param s {@link Exception} that was thrown. */ @Override public synchronized void log(String s) { impl.log(Level.FINE, s); } - public void close(){ + public void close() { fh.close(); } @@ -122,6 +122,4 @@ public static SimpleDateFormat getPluginSharedFormatter() { return pluginSharedFormatter; } - - } diff -r efa527f74184 netx/net/sourceforge/jnlp/util/replacements/CharacterDecoder.java --- a/netx/net/sourceforge/jnlp/util/replacements/CharacterDecoder.java +++ b/netx/net/sourceforge/jnlp/util/replacements/CharacterDecoder.java @@ -38,50 +38,50 @@ * A character decoder is an algorithim for transforming 8 bit * binary data that has been encoded into text by a character * encoder, back into original binary form. - * + *

* The character encoders, in general, have been structured * around a central theme that binary data can be encoded into * text that has the form: - * - *

+ * 

  *      [Buffer Prefix]
  *      [Line Prefix][encoded data atoms][Line Suffix]
  *      [Buffer Suffix]
- * 
- * + *
+ *

+ *

* Of course in the simplest encoding schemes, the buffer has no * distinct prefix of suffix, however all have some fixed relationship * between the text in an 'atom' and the binary data itself. - * - * In the CharacterEncoder and CharacterDecoder classes, one complete - * chunk of data is referred to as a buffer. Encoded buffers - * are all text, and decoded buffers (sometimes just referred to as - * buffers) are binary octets. - * - * To create a custom decoder, you must, at a minimum, overide three + *

+ *

+ * In the {@link CharacterEncoder} and {@code CharacterDecoder} + * classes, one complete chunk of data is referred to as a + * buffer. Encoded buffers are all text, and decoded buffers + * (sometimes just referred to as buffers) are binary octets. + *

+ *

+ * To create a custom decoder, you must, at a minimum, overide three * abstract methods in this class. - *

- *
bytesPerAtom which tells the decoder how many bytes to + *

+ *
+ *
bytesPerAtom which tells the decoder how many bytes to * expect from decodeAtom - *
decodeAtom which decodes the bytes sent to it as text. - *
bytesPerLine which tells the encoder the maximum number of + *
decodeAtom which decodes the bytes sent to it as text. + *
bytesPerLine which tells the encoder the maximum number of * bytes per line. - *
- * + *
+ *

* In general, the character decoders return error in the form of a * CEFormatException. The syntax of the detail string is - *

+ * 

  *      DecoderClassName: Error message.
- * 
- * + *
+ *

* Several useful decoders have already been written and are * referenced in the See Also list below. - * + *

* @author Chuck McManis - * @see CEFormatException * @see CharacterEncoder - * @see UCDecoder - * @see UUDecoder * @see BASE64Decoder */ diff -r efa527f74184 netx/net/sourceforge/jnlp/util/replacements/CharacterEncoder.java --- a/netx/net/sourceforge/jnlp/util/replacements/CharacterEncoder.java +++ b/netx/net/sourceforge/jnlp/util/replacements/CharacterEncoder.java @@ -39,38 +39,38 @@ * A character encoder is an algorithim for transforming 8 bit binary * data into text (generally 7 bit ASCII or 8 bit ISO-Latin-1 text) * for transmition over text channels such as e-mail and network news. - * + *

* The character encoders have been structured around a central theme * that, in general, the encoded text has the form: - * - *

+ * 

  *      [Buffer Prefix]
  *      [Line Prefix][encoded data atoms][Line Suffix]
  *      [Buffer Suffix]
- * 
- * - * In the CharacterEncoder and CharacterDecoder classes, one complete - * chunk of data is referred to as a buffer. Encoded buffers - * are all text, and decoded buffers (sometimes just referred to as - * buffers) are binary octets. - * - * To create a custom encoder, you must, at a minimum, overide three + *
+ *

+ *

+ * In the {@code CharacterEncoder} and {@link CharacterDecoder} + * classes, one complete chunk of data is referred to as a + * buffer. Encoded buffers are all text, and decoded buffers + * (sometimes just referred to as buffers) are binary octets. + *

+ *

+ * To create a custom encoder, you must, at a minimum, overide three * abstract methods in this class. - *

- *
bytesPerAtom which tells the encoder how many bytes to + *
+ *
bytesPerAtom which tells the encoder how many bytes to * send to encodeAtom - *
encodeAtom which encodes the bytes sent to it as text. - *
bytesPerLine which tells the encoder the maximum number of + *
encodeAtom which encodes the bytes sent to it as text. + *
bytesPerLine which tells the encoder the maximum number of * bytes per line. - *
- * + *
+ *

+ *

* Several useful encoders have already been written and are * referenced in the See Also list below. - * + *

* @author Chuck McManis - * @see CharacterDecoder; - * @see UCEncoder - * @see UUEncoder + * @see CharacterDecoder * @see BASE64Encoder */ public abstract class CharacterEncoder { @@ -200,12 +200,14 @@ /** * Return a byte array from the remaining bytes in this ByteBuffer. - *

+ *

* The ByteBuffer's position will be advanced to ByteBuffer's limit. - *

+ *

+ *

* To avoid an extra copy, the implementation will attempt to return the * byte array backing the ByteBuffer. If this is not possible, a * new byte array will be created. + *

*/ private byte [] getBytes(ByteBuffer bb) { /* @@ -247,8 +249,9 @@ /** * Encode the aBuffer ByteBuffer and write the encoded * result to the OutputStream aStream. - *

+ *

* The ByteBuffer's position will be advanced to ByteBuffer's limit. + *

*/ public void encode(ByteBuffer aBuffer, OutputStream aStream) throws IOException { @@ -259,8 +262,9 @@ /** * A 'streamless' version of encode that simply takes a ByteBuffer * and returns a string containing the encoded buffer. - *

+ *

* The ByteBuffer's position will be advanced to ByteBuffer's limit. + *

*/ public String encode(ByteBuffer aBuffer) { byte [] buf = getBytes(aBuffer); @@ -331,8 +335,9 @@ /** * Encode the aBuffer ByteBuffer and write the encoded * result to the OutputStream aStream. - *

+ *

* The ByteBuffer's position will be advanced to ByteBuffer's limit. + *

*/ public void encodeBuffer(ByteBuffer aBuffer, OutputStream aStream) throws IOException { @@ -343,8 +348,9 @@ /** * A 'streamless' version of encode that simply takes a ByteBuffer * and returns a string containing the encoded buffer. - *

+ *

* The ByteBuffer's position will be advanced to ByteBuffer's limit. + *

*/ public String encodeBuffer(ByteBuffer aBuffer) { byte [] buf = getBytes(aBuffer); diff -r efa527f74184 netx/net/sourceforge/jnlp/util/ui/package-info.java --- a/netx/net/sourceforge/jnlp/util/ui/package-info.java +++ b/netx/net/sourceforge/jnlp/util/ui/package-info.java @@ -9,15 +9,15 @@ IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -PARTICULAR PURPOSE. See the GNU General Public License for more details. +PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with -IcedTea; see the file COPYING. If not, write to the +IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a -combined work based on this library. Thus, the terms and conditions of the GNU +combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you @@ -25,12 +25,11 @@ executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and -conditions of the license of that module. An independent module is a module -which is not derived from or based on this library. If you modify this -library, you may extend this exception to your version of the library, but you -are not obligated to do so. If you do not wish to do so, delete this exception -statement from your version. -*/ +conditions of the license of that module. An independent module is a module +which is not derived from or based on this library. If you modify this library, +you may extend this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this exception +statement from your version.*/ /** * Contains classes that deal with common and recurring UI tasks. *

diff -r efa527f74184 netx/net/sourceforge/nanoxml/XMLElement.java --- a/netx/net/sourceforge/nanoxml/XMLElement.java +++ b/netx/net/sourceforge/nanoxml/XMLElement.java @@ -39,52 +39,51 @@ /** * XMLElement is a representation of an XML object. The object is able to parse * XML code. - *

- *
Parsing XML Data
- *
+ *

+ *
Parsing XML Data
+ *
* You can parse XML data using the following code: - *
    {@code - * XMLElement xml = new XMLElement(); - * FileReader reader = new FileReader("filename.xml"); - * xml.parseFromReader(reader); - * }
- *
Retrieving Attributes
- *
+ *
{@code
+ *XMLElement xml = new XMLElement();
+ *FileReader reader = new FileReader("filename.xml");
+ *xml.parseFromReader(reader);
+ *}
+ *
Retrieving Attributes
+ *
* You can enumerate the attributes of an element using the method * {@link #enumerateAttributeNames() enumerateAttributeNames}. * The attribute values can be retrieved using the method * {@link #getAttribute(java.lang.String) getAttribute}. * The following example shows how to list the attributes of an element: - *
    {@code - * XMLElement element = ...; - * Enumeration enum = element.enumerateAttributeNames(); - * while (enum.hasMoreElements()) { - *     String key = (String) enum.nextElement(); - *     String value = (String) element.getAttribute(key); - *     System.out.println(key + " = " + value); - * } - * }
- *
Retrieving Child Elements
- *
+ *
{@code
+ *XMLElement element = ...;
+ *Enumeration enum = element.enumerateAttributeNames();
+ *while (enum.hasMoreElements()) {
+ *    String key = (String) enum.nextElement();
+ *    String value = (String) element.getAttribute(key);
+ *    System.out.println(key + " = " + value);
+ *}}
+ *
Retrieving Child Elements
+ *
* You can enumerate the children of an element using * {@link #enumerateChildren() enumerateChildren}. * The number of child elements can be retrieved using * {@link #countChildren() countChildren}. - *
- *
Elements Containing Character Data
- *
+ *
+ *
Elements Containing Character Data
+ *
* If an elements contains character data, like in the following example: - *
    {@code The Title}
+ *
{@code The Title}
* you can retrieve that data using the method * {@link #getContent() getContent}. - *
- *
Subclassing XMLElement
- *
+ *
+ *
Subclassing XMLElement
+ *
* When subclassing XMLElement, you need to override the method * {@link #createAnotherElement() createAnotherElement} * which has to return a new copy of the receiver. - *
- *

+ *

+ *

* * @see net.sourceforge.nanoxml.XMLParseException * @@ -98,9 +97,9 @@ * The attributes given to the element. * *
Invariants:
- *
  • The field can be empty. - *
  • The field is never null. - *
  • The keys and the values are strings. + *
    • The field can be empty.
    • + *
    • The field is never {@code null}.
    • + *
    • The keys and the values are strings.
    • *
*/ private Hashtable attributes; @@ -109,10 +108,10 @@ * Child elements of the element. * *
Invariants:
- *
  • The field can be empty. - *
  • The field is never null. - *
  • The elements are instances of XMLElement - * or a subclass of XMLElement. + *
    • The field can be empty.
    • + *
    • The field is never {@code null}.
    • + *
    • The elements are instances of {@code XMLElement} + * or a subclass of {@code XMLElement}.
    • *
*/ private Vector children; @@ -121,22 +120,22 @@ * The name of the element. * *
Invariants:
- *
  • The field is null iff the element is not - * initialized by either parse or setName. - *
  • If the field is not null, it's not empty. - *
  • If the field is not null, it contains a valid - * XML identifier. + *
    • The field is {@code null} iff the element is not + * initialized by either parse or {@link #setName setName()}.
    • + *
    • If the field is not {@code null}, it's not empty.
    • + *
    • If the field is not {@code null}, it contains a valid + * XML identifier.
    • *
*/ private String name; /** - * The #PCDATA content of the object. + * The {@code #PCDATA} content of the object. * *
Invariants:
- *
  • The field is null iff the element is not a - * #PCDATA element. - *
  • The field can be any string, including the empty string. + *
    • The field is {@code null} iff the element is not a + * {@code #PCDATA} element.
    • + *
    • The field can be any string, including the empty string.
    • *
*/ private String contents; @@ -146,13 +145,13 @@ * without the & and ; delimiters. * *
Invariants:
- *
  • The field is never null. + *
    • The field is never {@code null}.
    • *
    • The field always contains the following associations: * "lt" => "<", "gt" => ">", * "quot" => "\"", "apos" => "'", - * "amp" => "&" - *
    • The keys are strings - *
    • The values are char arrays + * "amp" => "&"
    • + *
    • The keys are strings
    • + *
    • The values are char arrays
    • *
*/ private Hashtable entities; @@ -161,28 +160,28 @@ * The line number where the element starts. * *
Invariants:
- *
  • {@code lineNr >= 0} + *
    • {@code lineNr >= 0}
    • *
*/ private int lineNr; /** - * true if the case of the element and attribute names - * are case insensitive. + * {@code true} if the case of the element and attribute names are case + * insensitive. */ private boolean ignoreCase; /** - * true if the leading and trailing whitespace of #PCDATA + * {@code true} if the leading and trailing whitespace of {@code #PCDATA} * sections have to be ignored. */ private boolean ignoreWhitespace; /** - * Character read too much. + * Character read too much.
* This character provides push-back functionality to the input reader * without having to use a PushbackReader. - * If there is no such character, this field is '\0'. + * If there is no such character, this field is {@code '\0'}. */ private char charReadTooMuch; @@ -195,8 +194,8 @@ * The reader provided by the caller of the parse method. * *
Invariants:
- *
  • The field is not null while the parse method - * is running. + *
    • The field is not {@code null} while the parse method is + * running.
    • *
*/ private Reader reader; @@ -205,27 +204,25 @@ * The current line number in the source content. * *
Invariants:
- *
  • parserLineNr > 0 while the parse method is running. + *
    • parserLineNr > 0 while the parse method is running.
    • *
*/ private int parserLineNr; /** - * Creates and initializes a new XML element. + * Creates and initializes a new XML element.
* Calling the construction is equivalent to: - *
  • new XMLElement(new Hashtable(), false, true) - *
+ *
  • {@code new XMLElement(new Hashtable(), false, true)}
* *
Postconditions:
- *
  • countChildren() => 0 - *
  • enumerateChildren() => empty enumeration - *
  • enumeratePropertyNames() => empty enumeration - *
  • getChildren() => empty vector - *
  • getContent() => "" - *
  • getLineNr() => 0 - *
  • getName() => null + *
    • {@linkplain #countChildren} => 0
    • + *
    • {@linkplain #enumerateChildren} => empty enumeration
    • + *
    • enumeratePropertyNames() => empty enumeration
    • + *
    • getChildren() => empty vector
    • + *
    • {@linkplain #getContent} => ""
    • + *
    • {@linkplain #getLineNr} => 0
    • + *
    • {@linkplain #getName} => null
    • *
- * */ public XMLElement() { this(new Hashtable(), false, true, true); @@ -233,41 +230,39 @@ /** * Creates and initializes a new XML element. - *

- * This constructor should only be called from - * {@link #createAnotherElement() createAnotherElement} - * to create child elements. + *

+ * This constructor should only be called from + * {@link #createAnotherElement} to create child elements. * * @param entities * The entity conversion table. * @param skipLeadingWhitespace - * true if leading and trailing whitespace in PCDATA + * {@code true} if leading and trailing whitespace in PCDATA * content has to be removed. * @param fillBasicConversionTable - * true if the basic entities need to be added to + * {@code true} if the basic entities need to be added to * the entity list (client code calling this constructor). * @param ignoreCase - * true if the case of element and attribute names have + * {@code true} if the case of element and attribute names have * to be ignored. * *

Preconditions:
- *
  • entities != null - *
  • if fillBasicConversionTable == false - * then entities contains at least the following - * entries: amp, lt, gt, - * apos and quot + *
    • {@code entities != null}
    • + *
    • if {@code fillBasicConversionTable == false} + * then {@code entities} contains at least the following + * entries: {@code amp}, {@code lt}, {@code gt}, {@code apos} and + * {@code quot}
    • *
* *
Postconditions:
- *
  • countChildren() => 0 - *
  • enumerateChildren() => empty enumeration - *
  • enumeratePropertyNames() => empty enumeration - *
  • getChildren() => empty vector - *
  • getContent() => "" - *
  • getLineNr() => 0 - *
  • getName() => null + *
    • {@linkplain #countChildren} => 0
    • + *
    • {@linkplain #enumerateChildren} => empty enumeration
    • + *
    • enumeratePropertyNames() => empty enumeration
    • + *
    • getChildren() => empty vector
    • + *
    • {@linkplain #getContent} => ""
    • + *
    • {@linkplain #getLineNr} => 0
    • + *
    • {@linkplain #getName} => null
    • *
- * */ protected XMLElement(Hashtable entities, boolean skipLeadingWhitespace, @@ -305,15 +300,16 @@ * The child element to add. * *
Preconditions:
- *
  • child != null - *
  • child.getName() != null - *
  • child does not have a parent element + *
    • {@code child != null}
    • + *
    • {@code child.getName() != null}
    • + *
    • {@code child} does not have a parent element
    • *
* *
Postconditions:
- *
  • countChildren() => old.countChildren() + 1 - *
  • enumerateChildren() => old.enumerateChildren() + child - *
  • getChildren() => old.enumerateChildren() + child + *
    • {@linkplain #countChildren} => old.countChildren() + 1
    • + *
    • {@linkplain #enumerateChildren} => old.enumerateChildren() + + child
    • + *
    • getChildren() => old.enumerateChildren() + child
    • *
* */ @@ -330,17 +326,17 @@ * The value of the attribute. * *
Preconditions:
- *
  • name != null - *
  • name is a valid XML identifier - *
  • value != null + *
    • {@code name != null}
    • + *
    • {@code name} is a valid XML identifier
    • + *
    • {@code value != null}
    • *
* *
Postconditions:
- *
  • enumerateAttributeNames() - * => old.enumerateAttributeNames() + name - *
  • getAttribute(name) => value + *
    • {@linkplain #enumerateAttributeNames} + * => old.enumerateAttributeNames() + name
    • + *
    • {@linkplain #getAttribute(java.lang.String) getAttribute(name)} + * => value
    • *
- * */ public void setAttribute(String name, Object value) { @@ -354,9 +350,8 @@ * Returns the number of child elements of the element. * *
Postconditions:
- *
  • {@code result >= 0} + *
    • {@code result >= 0}
    • *
- * */ public int countChildren() { return this.children.size(); @@ -366,9 +361,8 @@ * Enumerates the attribute names. * *
Postconditions:
- *
  • result != null + *
    • {@code result != null}
    • *
- * */ public Enumeration enumerateAttributeNames() { return this.attributes.keys(); @@ -378,9 +372,8 @@ * Enumerates the child elements. * *
Postconditions:
- *
  • result != null + *
    • {@code result != null}
    • *
- * */ public Enumeration enumerateChildren() { return this.children.elements(); @@ -388,8 +381,7 @@ /** * Returns the PCDATA content of the object. If there is no such content, - * null is returned. - * + * {@code null} is returned. */ public String getContent() { return this.contents; @@ -397,10 +389,10 @@ /** * Returns the line nr in the source data on which the element is found. - * This method returns 0 there is no associated source data. + * This method returns {@code 0} there is no associated source data. * *
Postconditions:
- *
  • {@code result >= 0} + *
    • {@code result >= 0}
    • *
*/ public int getLineNr() { @@ -408,16 +400,15 @@ } /** - * Returns an attribute of the element. - * If the attribute doesn't exist, null is returned. + * Returns an attribute of the element.
+ * If the attribute doesn't exist, {@code null} is returned. * * @param name The name of the attribute. * *
Preconditions:
- *
  • name != null - *
  • name is a valid XML identifier + *
    • {@code name != null}
    • + *
    • {@code name} is a valid XML identifier
    • *
- * */ public Object getAttribute(String name) { if (this.ignoreCase) { @@ -429,28 +420,28 @@ /** * Returns the name of the element. - * + * @return this {@code XMLElement} object's name */ public String getName() { return this.name; } /** - * Reads one XML element from a java.io.Reader and parses it. + * Reads one XML element from a {@link java.io.Reader} and parses it. * * @param reader * The reader from which to retrieve the XML data. * *
Preconditions:
- *
  • reader != null - *
  • reader is not closed + *
    • {@code reader != null}
    • + *
    • {@code reader} is not closed
    • *
* *
Postconditions:
*
  • the state of the receiver is updated to reflect the XML element - * parsed from the reader + * parsed from the reader
  • *
  • the reader points to the first character following the last - * '>' character of the XML element + * {@code '>'} character of the XML element
  • *
* * @throws java.io.IOException @@ -472,15 +463,15 @@ * The line number of the first line in the data. * *
Preconditions:
- *
  • reader != null - *
  • reader is not closed + *
    • {@code reader != null}
    • + *
    • {@code reader} is not closed
    • *
* *
Postconditions:
*
  • the state of the receiver is updated to reflect the XML element - * parsed from the reader + * parsed from the reader
  • *
  • the reader points to the first character following the last - * '>' character of the XML element + * {@code '>'} character of the XML element
  • *
* * @throws java.io.IOException @@ -516,8 +507,9 @@ /** * Creates a new similar XML element. - *

+ *

* You should override this method when subclassing XMLElement. + *

*/ protected XMLElement createAnotherElement() { return new XMLElement(this.entities, @@ -543,10 +535,9 @@ * The new name. * *
Preconditions:
- *
  • name != null - *
  • name is a valid XML identifier + *
      + *
    • {@code name} is a valid XML identifier
    • *
- * */ public void setName(String name) { this.name = name; @@ -560,14 +551,14 @@ * The buffer in which the scanned identifier will be put. * *
Preconditions:
- *
  • result != null + *
    • {@code result != null}
    • *
    • The next character read from the reader is a valid first - * character of an XML identifier. + * character of an XML identifier.
    • *
* *
Postconditions:
*
  • The next character read from the reader won't be an identifier - * character. + * character.
  • *
*/ protected void scanIdentifier(StringBuffer result) @@ -606,13 +597,13 @@ } /** - * This method scans an identifier from the current reader. - * The scanned whitespace is appended to result. + * This method scans an identifier from the current reader.
+ * The scanned whitespace is appended to {@code result}. * * @return the next character following the whitespace. * *
Preconditions:
- *
  • result != null + *
    • {@code result != null}
    • *
*/ protected char scanWhitespace(StringBuffer result) @@ -634,13 +625,12 @@ } /** - * This method scans a delimited string from the current reader. - * The scanned string without delimiters is appended to - * string. + * This method scans a delimited string from the current reader.
+ * The scanned string without delimiters is appended to {@code string}. * *
Preconditions:
- *
  • string != null - *
  • the next char read is the string delimiter + *
    • {@code string != null}
    • + *
    • the next char read is the string delimiter
    • *
*/ protected void scanString(StringBuffer string) @@ -662,12 +652,13 @@ } /** - * Scans a #PCDATA element. CDATA sections and entities are resolved. - * The next < char is skipped. - * The scanned data is appended to data. + * Scans a {@code #PCDATA} element. CDATA sections and entities are + * resolved.
+ * The next < char is skipped.
+ * The scanned data is appended to {@code data}. * *
Preconditions:
- *
  • data != null + *
    • {@code data != null}
    • *
*/ protected void scanPCData(StringBuffer data) @@ -692,11 +683,11 @@ /** * Scans a special tag and if the tag is a CDATA section, append its - * content to buf. + * content to {@code buf}. * *
Preconditions:
- *
  • buf != null - *
  • The first < has already been read. + *
    • {@code buf != null}
    • + *
    • The first < has already been read.
    • *
*/ protected boolean checkCDATA(StringBuffer buf) @@ -750,7 +741,7 @@ * Skips a comment. * *
Preconditions:
- *
  • The first <!-- has already been read. + *
    • The first <!-- has already been read.
    • *
*/ protected void skipComment() @@ -790,8 +781,8 @@ * already been read. * *
Preconditions:
- *
  • The first <! has already been read. - *
  • bracketLevel >= 0 + *
    • The first <! has already been read.
    • + *
    • {@code bracketLevel >= 0}
    • *
*/ protected void skipSpecialTag(int bracketLevel) @@ -840,14 +831,14 @@ } /** - * Scans the data for literal text. + * Scans the data for literal text.
* Scanning stops when a character does not match or after the complete * text has been checked, whichever comes first. * * @param literal the literal to check. * *
Preconditions:
- *
  • literal != null + *
    • {@code literal != null}
    • *
*/ protected boolean checkLiteral(String literal) @@ -889,8 +880,8 @@ * @param elt The element that will contain the result. * *
Preconditions:
- *
  • The first < has already been read. - *
  • elt != null + *
    • The first < has already been read.
    • + *
    • {@code elt != null}
    • *
*/ protected void scanElement(XMLElement elt) @@ -994,14 +985,14 @@ } /** - * Resolves an entity. The name of the entity is read from the reader. - * The value of the entity is appended to buf. + * Resolves an entity. The name of the entity is read from the reader.
+ * The value of the entity is appended to {@code buf}. * * @param buf Where to put the entity value. * *
Preconditions:
- *
  • The first & has already been read. - *
  • buf != null + *
    • The first & has already been read.
    • + *
    • {@code buf != null}
    • *
*/ protected void resolveEntity(StringBuffer buf) @@ -1042,8 +1033,8 @@ * @param ch The character to push back. * *
Preconditions:
- *
  • The read-back buffer is empty. - *
  • ch != '\0' + *
    • The read-back buffer is empty.
    • + *
    • {@code ch != '\0'}
    • *
*/ protected void unreadChar(char ch) { @@ -1057,7 +1048,7 @@ * @param name The name of the entity. * *
Preconditions:
- *
  • name != null + *
    • {@code name != null}
    • *
*/ protected XMLParseException invalidValueSet(String name) { @@ -1073,8 +1064,8 @@ * @param value The value of the entity. * *
Preconditions:
- *
  • name != null - *
  • value != null + *
    • {@code name != null}
    • + *
    • {@code value != null}
    • *
*/ protected XMLParseException invalidValue(String name, @@ -1099,8 +1090,8 @@ * @param context The context in which the error occured. * *
Preconditions:
- *
  • context != null - *
  • context.length() > 0 + *
    • {@code context != null}
    • + *
    • {@code context.length() > 0}
    • *
*/ protected XMLParseException syntaxError(String context) { @@ -1116,8 +1107,8 @@ * expected. * *
Preconditions:
- *
  • charSet != null - *
  • charSet.length() > 0 + *
    • {@code charSet != null}
    • + *
    • {@code charSet.length() > 0}
    • *
*/ protected XMLParseException expectedInput(String charSet) { @@ -1133,8 +1124,8 @@ * expected. * @param ch The character that was received instead. *
Preconditions:
- *
  • charSet != null - *
  • charSet.length() > 0 + *
    • {@code charSet != null}
    • + *
    • {@code charSet.length() > 0}
    • *
*/ protected XMLParseException expectedInput(String charSet, char ch) { @@ -1148,8 +1139,8 @@ * @param name The name of the entity. * *
Preconditions:
- *
  • name != null - *
  • name.length() > 0 + *
    • {@code name != null}
    • + *
    • {@code name.length() > 0}
    • *
*/ protected XMLParseException unknownEntity(String name) { @@ -1161,9 +1152,9 @@ * Reads an xml file and removes the comments, leaving only relevant * xml code. * - * @param isr The reader of the InputStream containing the xml. - * @param pout The PipedOutputStream that will be receiving the filtered - * xml file. + * @param isr The reader of the {@link InputStream} containing the xml. + * @param pout The {@link PipedOutputStream} that will be receiving the + * filtered xml file. */ public void sanitizeInput(Reader isr, OutputStream pout) { try { diff -r efa527f74184 netx/net/sourceforge/nanoxml/XMLParseException.java --- a/netx/net/sourceforge/nanoxml/XMLParseException.java +++ b/netx/net/sourceforge/nanoxml/XMLParseException.java @@ -31,9 +31,9 @@ /** * An XMLParseException is thrown when an error occures while parsing an XML * string. - *

- * $Revision: 1.1 $
- * $Date: 2002/08/03 04:05:32 $

+ *

+ * $Revision: 1.1 $
+ * $Date: 2002/08/03 04:05:32 $

* * @see net.sourceforge.nanoxml.XMLElement * @@ -65,11 +65,11 @@ * @param message A message describing what went wrong. * *
Preconditions:
- *
  • {@code message != null} + *
    • {@code message != null}
    • *
* *
Postconditions:
- *
  • {@code getLineNr() => NO_LINE} + *
    • {@code getLineNr() => NO_LINE}
    • *
*/ public XMLParseException(String name, @@ -89,12 +89,12 @@ * @param message A message describing what went wrong. * *
Preconditions:
- *
  • message != null - *
  • lineNr > 0 + *
    • {@code message != null}
    • + *
    • {@code lineNr > 0}
    • *
* *
Postconditions:
- *
  • {@code getLineNr() => lineNr} + *
    • {@code getLineNr() => lineNr}
    • *
*/ public XMLParseException(String name, @@ -108,7 +108,7 @@ } /** - * Where the error occurred, or NO_LINE if the line number is + * Where the error occurred, or {@code NO_LINE} if the line number is * unknown. * * @see net.sourceforge.nanoxml.XMLParseException#NO_LINE @@ -116,5 +116,4 @@ public int getLineNr() { return this.lineNr; } - }