diff --git a/fine-third-jdk11/src/com/sun/activation/registries/LogSupport.java b/fine-third-jdk11/src/com/sun/activation/registries/LogSupport.java new file mode 100644 index 000000000..1ccdb3529 --- /dev/null +++ b/fine-third-jdk11/src/com/sun/activation/registries/LogSupport.java @@ -0,0 +1,85 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common Development + * and Distribution License("CDDL") (collectively, the "License"). You + * may not use this file except in compliance with the License. You can + * obtain a copy of the License at + * https://oss.oracle.com/licenses/CDDL+GPL-1.1 + * or LICENSE.txt. See the License for the specific + * language governing permissions and limitations under the License. + * + * When distributing the software, include this License Header Notice in each + * file and include the License file at LICENSE.txt. + * + * GPL Classpath Exception: + * Oracle designates this particular file as subject to the "Classpath" + * exception as provided by Oracle in the GPL Version 2 section of the License + * file that accompanied this code. + * + * Modifications: + * If applicable, add the following below the License Header, with the fields + * enclosed by brackets [] replaced by your own identifying information: + * "Portions Copyright [year] [name of copyright owner]" + * + * Contributor(s): + * If you wish your version of this file to be governed by only the CDDL or + * only the GPL Version 2, indicate your decision by adding "[Contributor] + * elects to include this software in this distribution under the [CDDL or GPL + * Version 2] license." If you don't indicate a single choice of license, a + * recipient has the option to distribute your version of this file under + * either the CDDL, the GPL Version 2 or to extend the choice of license to + * its licensees as provided above. However, if you add GPL Version 2 code + * and therefore, elected the GPL Version 2 license, then the option applies + * only if the new code is made subject to such option by the copyright + * holder. + */ + +package com.sun.activation.registries; + +import java.io.*; +import java.util.logging.*; + +/** + * Logging related methods. + */ +public class LogSupport { + private static boolean debug = false; + private static Logger logger; + private static final Level level = Level.FINE; + + static { + try { + debug = Boolean.getBoolean("javax.activation.debug"); + } catch (Throwable t) { + // ignore any errors + } + logger = Logger.getLogger("javax.activation"); + } + + /** + * Constructor. + */ + private LogSupport() { + // private constructor, can't create instances + } + + public static void log(String msg) { + if (debug) + System.out.println(msg); + logger.log(level, msg); + } + + public static void log(String msg, Throwable t) { + if (debug) + System.out.println(msg + "; Exception: " + t); + logger.log(level, msg, t); + } + + public static boolean isLoggable() { + return debug || logger.isLoggable(level); + } +} diff --git a/fine-third-jdk11/src/com/sun/activation/registries/MailcapFile.java b/fine-third-jdk11/src/com/sun/activation/registries/MailcapFile.java new file mode 100644 index 000000000..3553968e9 --- /dev/null +++ b/fine-third-jdk11/src/com/sun/activation/registries/MailcapFile.java @@ -0,0 +1,578 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common Development + * and Distribution License("CDDL") (collectively, the "License"). You + * may not use this file except in compliance with the License. You can + * obtain a copy of the License at + * https://oss.oracle.com/licenses/CDDL+GPL-1.1 + * or LICENSE.txt. See the License for the specific + * language governing permissions and limitations under the License. + * + * When distributing the software, include this License Header Notice in each + * file and include the License file at LICENSE.txt. + * + * GPL Classpath Exception: + * Oracle designates this particular file as subject to the "Classpath" + * exception as provided by Oracle in the GPL Version 2 section of the License + * file that accompanied this code. + * + * Modifications: + * If applicable, add the following below the License Header, with the fields + * enclosed by brackets [] replaced by your own identifying information: + * "Portions Copyright [year] [name of copyright owner]" + * + * Contributor(s): + * If you wish your version of this file to be governed by only the CDDL or + * only the GPL Version 2, indicate your decision by adding "[Contributor] + * elects to include this software in this distribution under the [CDDL or GPL + * Version 2] license." If you don't indicate a single choice of license, a + * recipient has the option to distribute your version of this file under + * either the CDDL, the GPL Version 2 or to extend the choice of license to + * its licensees as provided above. However, if you add GPL Version 2 code + * and therefore, elected the GPL Version 2 license, then the option applies + * only if the new code is made subject to such option by the copyright + * holder. + */ + +package com.sun.activation.registries; + +import java.io.*; +import java.util.*; + +public class MailcapFile { + + /** + * A Map indexed by MIME type (string) that references + * a Map of commands for each type. The comand Map + * is indexed by the command name and references a List of + * class names (strings) for each command. + */ + private Map type_hash = new HashMap(); + + /** + * Another Map like above, but for fallback entries. + */ + private Map fallback_hash = new HashMap(); + + /** + * A Map indexed by MIME type (string) that references + * a List of native commands (string) corresponding to the type. + */ + private Map native_commands = new HashMap(); + + private static boolean addReverse = false; + + static { + try { + addReverse = Boolean.getBoolean("javax.activation.addreverse"); + } catch (Throwable t) { + // ignore any errors + } + } + + /** + * The constructor that takes a filename as an argument. + * + * @param new_fname The file name of the mailcap file. + */ + public MailcapFile(String new_fname) throws IOException { + if (LogSupport.isLoggable()) + LogSupport.log("new MailcapFile: file " + new_fname); + FileReader reader = null; + try { + reader = new FileReader(new_fname); + parse(new BufferedReader(reader)); + } finally { + if (reader != null) { + try { + reader.close(); + } catch (IOException ex) { } + } + } + } + + /** + * The constructor that takes an input stream as an argument. + * + * @param is the input stream + */ + public MailcapFile(InputStream is) throws IOException { + if (LogSupport.isLoggable()) + LogSupport.log("new MailcapFile: InputStream"); + parse(new BufferedReader(new InputStreamReader(is, "iso-8859-1"))); + } + + /** + * Mailcap file default constructor. + */ + public MailcapFile() { + if (LogSupport.isLoggable()) + LogSupport.log("new MailcapFile: default"); + } + + /** + * Get the Map of MailcapEntries based on the MIME type. + * + *
+ * Semantics: First check for the literal mime type,
+ * if that fails looks for wildcard
+ * Semantics: First check for the literal mime type,
+ * if that fails looks for wildcard
+ *
+ * @param str a string to be parsed.
+ */
+ public LineTokenizer(String str) {
+ currentPosition = 0;
+ this.str = str;
+ maxPosition = str.length();
+ }
+
+ /**
+ * Skips white space.
+ */
+ private void skipWhiteSpace() {
+ while ((currentPosition < maxPosition) &&
+ Character.isWhitespace(str.charAt(currentPosition))) {
+ currentPosition++;
+ }
+ }
+
+ /**
+ * Tests if there are more tokens available from this tokenizer's string.
+ *
+ * @return
+ * The returned DataFlavor will have the following characteristics:
+ *
+ * representationClass = representationClass
+ *
+ * @param representationClass the class used in this DataFlavor
+ * @param mimeType the MIME type of the data represented by this class
+ * @param humanPresentableName the human presentable name of the flavor
+ */
+ public ActivationDataFlavor(Class representationClass,
+ String mimeType, String humanPresentableName) {
+ super(mimeType, humanPresentableName); // need to call super
+
+ // init private variables:
+ this.mimeType = mimeType;
+ this.humanPresentableName = humanPresentableName;
+ this.representationClass = representationClass;
+ }
+
+ /**
+ * Construct a DataFlavor that represents a MimeType.
+ *
+ * The returned DataFlavor will have the following characteristics:
+ *
+ * If the mimeType is "application/x-java-serialized-object;
+ * class=", the result is the same as calling new
+ * DataFlavor(Class.forName()) as above.
+ *
+ * otherwise:
+ *
+ * representationClass = InputStream
+ * mimeType = mimeType
+ *
+ * @param representationClass the class used in this DataFlavor
+ * @param humanPresentableName the human presentable name of the flavor
+ */
+ public ActivationDataFlavor(Class representationClass,
+ String humanPresentableName) {
+ super(representationClass, humanPresentableName);
+ this.mimeType = super.getMimeType();
+ this.representationClass = representationClass;
+ this.humanPresentableName = humanPresentableName;
+ }
+
+ /**
+ * Construct a DataFlavor that represents a MimeType.
+ *
+ * The returned DataFlavor will have the following characteristics:
+ *
+ * If the mimeType is "application/x-java-serialized-object; class=",
+ * the result is the same as calling new DataFlavor(Class.forName()) as
+ * above, otherwise:
+ *
+ * representationClass = InputStream
+ * mimeType = mimeType
+ *
+ * @param mimeType the MIME type of the data represented by this class
+ * @param humanPresentableName the human presentable name of the flavor
+ */
+ public ActivationDataFlavor(String mimeType, String humanPresentableName) {
+ super(mimeType, humanPresentableName);
+ this.mimeType = mimeType;
+ try {
+ this.representationClass = Class.forName("java.io.InputStream");
+ } catch (ClassNotFoundException ex) {
+ // XXX - should never happen, ignore it
+ }
+ this.humanPresentableName = humanPresentableName;
+ }
+
+ /**
+ * Return the MIME type for this DataFlavor.
+ *
+ * @return the MIME type
+ */
+ public String getMimeType() {
+ return mimeType;
+ }
+
+ /**
+ * Return the representation class.
+ *
+ * @return the representation class
+ */
+ public Class getRepresentationClass() {
+ return representationClass;
+ }
+
+ /**
+ * Return the Human Presentable name.
+ *
+ * @return the human presentable name
+ */
+ public String getHumanPresentableName() {
+ return humanPresentableName;
+ }
+
+ /**
+ * Set the human presentable name.
+ *
+ * @param humanPresentableName the name to set
+ */
+ public void setHumanPresentableName(String humanPresentableName) {
+ this.humanPresentableName = humanPresentableName;
+ }
+
+ /**
+ * Compares the DataFlavor passed in with this DataFlavor; calls
+ * the
+ *
+ * ActivationDataFlavor delegates the comparison of MIME types to
+ * the MimeType class included as part of the JavaBeans Activation
+ * Framework. This provides a more robust comparison than is normally
+ * available in the DataFlavor class.
+ *
+ * @param mimeType the MIME type
+ * @return true if the same MIME type
+ */
+ public boolean isMimeTypeEqual(String mimeType) {
+ MimeType mt = null;
+ try {
+ if (mimeObject == null)
+ mimeObject = new MimeType(this.mimeType);
+ mt = new MimeType(mimeType);
+ } catch (MimeTypeParseException e) {
+ // something didn't parse, do a crude comparison
+ return this.mimeType.equalsIgnoreCase(mimeType);
+ }
+
+ return mimeObject.match(mt);
+ }
+
+ /**
+ * Called on DataFlavor for every MIME Type parameter to allow DataFlavor
+ * subclasses to handle special parameters like the text/plain charset
+ * parameters, whose values are case insensitive. (MIME type parameter
+ * values are supposed to be case sensitive).
+ *
+ * This method is called for each parameter name/value pair and should
+ * return the normalized representation of the parameterValue.
+ * This method is never invoked by this implementation.
+ *
+ * @param parameterName the parameter name
+ * @param parameterValue the parameter value
+ * @return the normalized parameter value
+ * @deprecated
+ */
+ protected String normalizeMimeTypeParameter(String parameterName,
+ String parameterValue) {
+ return parameterValue;
+ }
+
+ /**
+ * Called for each MIME type string to give DataFlavor subtypes the
+ * opportunity to change how the normalization of MIME types is
+ * accomplished.
+ * One possible use would be to add default parameter/value pairs in cases
+ * where none are present in the MIME type string passed in.
+ * This method is never invoked by this implementation.
+ *
+ * @param mimeType the MIME type
+ * @return the normalized MIME type
+ * @deprecated
+ */
+ protected String normalizeMimeType(String mimeType) {
+ return mimeType;
+ }
+}
diff --git a/fine-third-jdk11/src/javax/activation/CommandInfo.java b/fine-third-jdk11/src/javax/activation/CommandInfo.java
new file mode 100644
index 000000000..0297938cf
--- /dev/null
+++ b/fine-third-jdk11/src/javax/activation/CommandInfo.java
@@ -0,0 +1,245 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common Development
+ * and Distribution License("CDDL") (collectively, the "License"). You
+ * may not use this file except in compliance with the License. You can
+ * obtain a copy of the License at
+ * https://oss.oracle.com/licenses/CDDL+GPL-1.1
+ * or LICENSE.txt. See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice in each
+ * file and include the License file at LICENSE.txt.
+ *
+ * GPL Classpath Exception:
+ * Oracle designates this particular file as subject to the "Classpath"
+ * exception as provided by Oracle in the GPL Version 2 section of the License
+ * file that accompanied this code.
+ *
+ * Modifications:
+ * If applicable, add the following below the License Header, with the fields
+ * enclosed by brackets [] replaced by your own identifying information:
+ * "Portions Copyright [year] [name of copyright owner]"
+ *
+ * Contributor(s):
+ * If you wish your version of this file to be governed by only the CDDL or
+ * only the GPL Version 2, indicate your decision by adding "[Contributor]
+ * elects to include this software in this distribution under the [CDDL or GPL
+ * Version 2] license." If you don't indicate a single choice of license, a
+ * recipient has the option to distribute your version of this file under
+ * either the CDDL, the GPL Version 2 or to extend the choice of license to
+ * its licensees as provided above. However, if you add GPL Version 2 code
+ * and therefore, elected the GPL Version 2 license, then the option applies
+ * only if the new code is made subject to such option by the copyright
+ * holder.
+ */
+
+package javax.activation;
+
+import java.io.*;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
+/**
+ * The CommandInfo class is used by CommandMap implementations to
+ * describe the results of command requests. It provides the requestor
+ * with both the verb requested, as well as an instance of the
+ * bean. There is also a method that will return the name of the
+ * class that implements the command but it is not guaranteed to
+ * return a valid value. The reason for this is to allow CommandMap
+ * implmentations that subclass CommandInfo to provide special
+ * behavior. For example a CommandMap could dynamically generate
+ * JavaBeans. In this case, it might not be possible to create an
+ * object with all the correct state information solely from the class
+ * name.
+ */
+
+public class CommandInfo {
+ private String verb;
+ private String className;
+
+ /**
+ * The Constructor for CommandInfo.
+ * @param verb The command verb this CommandInfo decribes.
+ * @param className The command's fully qualified class name.
+ */
+ public CommandInfo(String verb, String className) {
+ this.verb = verb;
+ this.className = className;
+ }
+
+ /**
+ * Return the command verb.
+ *
+ * @return the command verb.
+ */
+ public String getCommandName() {
+ return verb;
+ }
+
+ /**
+ * Return the command's class name. This method MAY return null in
+ * cases where a CommandMap subclassed CommandInfo for its
+ * own purposes. In other words, it might not be possible to
+ * create the correct state in the command by merely knowing
+ * its class name. DO NOT DEPEND ON THIS METHOD RETURNING
+ * A VALID VALUE!
+ *
+ * @return The class name of the command, or null
+ */
+ public String getCommandClass() {
+ return className;
+ }
+
+ /**
+ * Return the instantiated JavaBean component.
+ *
+ * If the current runtime environment supports
+ * {@link java.beans.Beans#instantiate Beans.instantiate},
+ * use it to instantiate the JavaBeans component. Otherwise, use
+ * {@link java.lang.Class#forName Class.forName}.
+ *
+ * The component class needs to be public.
+ * On Java SE 9 and newer, if the component class is in a named module,
+ * it needs to be in an exported package.
+ *
+ * If the bean implements the
+ * If the DataHandler parameter is null, then the bean is
+ * instantiated with no data. NOTE: this may be useful
+ * if for some reason the DataHandler that is passed in
+ * throws IOExceptions when this method attempts to
+ * access its InputStream. It will allow the caller to
+ * retrieve a reference to the bean if it can be
+ * instantiated.
+ *
+ * If the bean does NOT implement the CommandObject interface,
+ * this method will check if it implements the
+ * java.io.Externalizable interface. If it does, the bean's
+ * readExternal method will be called if an InputStream
+ * can be acquired from the DataHandler.
+ *
+ * @param dh The DataHandler that describes the data to be
+ * passed to the command.
+ * @param loader The ClassLoader to be used to instantiate the bean.
+ * @return The bean
+ * @exception IOException for failures reading data
+ * @exception ClassNotFoundException if command object class can't
+ * be found
+ * @see java.beans.Beans#instantiate
+ * @see javax.activation.CommandObject
+ */
+ public Object getCommandObject(DataHandler dh, ClassLoader loader)
+ throws IOException, ClassNotFoundException {
+ Object new_bean = null;
+
+ // try to instantiate the bean
+ new_bean = Beans.instantiate(loader, className);
+
+ // if we got one and it is a CommandObject
+ if (new_bean != null) {
+ if (new_bean instanceof CommandObject) {
+ ((CommandObject)new_bean).setCommandContext(verb, dh);
+ } else if (new_bean instanceof Externalizable) {
+ if (dh != null) {
+ InputStream is = dh.getInputStream();
+ if (is != null) {
+ ((Externalizable)new_bean).readExternal(
+ new ObjectInputStream(is));
+ }
+ }
+ }
+ }
+
+ return new_bean;
+ }
+
+ /**
+ * Helper class to invoke Beans.instantiate reflectively or the equivalent
+ * with core reflection when module java.desktop is not readable.
+ */
+ private static final class Beans {
+ static final Method instantiateMethod;
+
+ static {
+ Method m;
+ try {
+ Class> c = Class.forName("java.beans.Beans");
+ m = c.getDeclaredMethod("instantiate", ClassLoader.class, String.class);
+ } catch (ClassNotFoundException e) {
+ m = null;
+ } catch (NoSuchMethodException e) {
+ m = null;
+ }
+ instantiateMethod = m;
+ }
+
+ /**
+ * Equivalent to invoking java.beans.Beans.instantiate(loader, cn)
+ */
+ static Object instantiate(ClassLoader loader, String cn)
+ throws IOException, ClassNotFoundException {
+
+ Exception exception;
+
+ if (instantiateMethod != null) {
+
+ // invoke Beans.instantiate
+ try {
+ return instantiateMethod.invoke(null, loader, cn);
+ } catch (InvocationTargetException e) {
+ exception = e;
+ } catch (IllegalAccessException e) {
+ exception = e;
+ }
+
+ } else {
+
+ SecurityManager security = System.getSecurityManager();
+ if (security != null) {
+ // if it's ok with the SecurityManager, it's ok with me.
+ String cname = cn.replace('/', '.');
+ if (cname.startsWith("[")) {
+ int b = cname.lastIndexOf('[') + 2;
+ if (b > 1 && b < cname.length()) {
+ cname = cname.substring(b);
+ }
+ }
+ int i = cname.lastIndexOf('.');
+ if (i != -1) {
+ security.checkPackageAccess(cname.substring(0, i));
+ }
+ }
+
+ // Beans.instantiate specified to use SCL when loader is null
+ if (loader == null) {
+ loader = (ClassLoader)
+ AccessController.doPrivileged(new PrivilegedAction() {
+ public Object run() {
+ ClassLoader cl = null;
+ try {
+ cl = ClassLoader.getSystemClassLoader();
+ } catch (SecurityException ex) { }
+ return cl;
+ }
+ });
+ }
+ Class> beanClass = Class.forName(cn, true, loader);
+ try {
+ return beanClass.newInstance();
+ } catch (Exception ex) {
+ throw new ClassNotFoundException(beanClass + ": " + ex, ex);
+ }
+
+ }
+ return null;
+ }
+ }
+}
diff --git a/fine-third-jdk11/src/javax/activation/CommandMap.java b/fine-third-jdk11/src/javax/activation/CommandMap.java
new file mode 100644
index 000000000..f51064cb0
--- /dev/null
+++ b/fine-third-jdk11/src/javax/activation/CommandMap.java
@@ -0,0 +1,249 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common Development
+ * and Distribution License("CDDL") (collectively, the "License"). You
+ * may not use this file except in compliance with the License. You can
+ * obtain a copy of the License at
+ * https://oss.oracle.com/licenses/CDDL+GPL-1.1
+ * or LICENSE.txt. See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice in each
+ * file and include the License file at LICENSE.txt.
+ *
+ * GPL Classpath Exception:
+ * Oracle designates this particular file as subject to the "Classpath"
+ * exception as provided by Oracle in the GPL Version 2 section of the License
+ * file that accompanied this code.
+ *
+ * Modifications:
+ * If applicable, add the following below the License Header, with the fields
+ * enclosed by brackets [] replaced by your own identifying information:
+ * "Portions Copyright [year] [name of copyright owner]"
+ *
+ * Contributor(s):
+ * If you wish your version of this file to be governed by only the CDDL or
+ * only the GPL Version 2, indicate your decision by adding "[Contributor]
+ * elects to include this software in this distribution under the [CDDL or GPL
+ * Version 2] license." If you don't indicate a single choice of license, a
+ * recipient has the option to distribute your version of this file under
+ * either the CDDL, the GPL Version 2 or to extend the choice of license to
+ * its licensees as provided above. However, if you add GPL Version 2 code
+ * and therefore, elected the GPL Version 2 license, then the option applies
+ * only if the new code is made subject to such option by the copyright
+ * holder.
+ */
+
+package javax.activation;
+
+import java.util.Map;
+import java.util.WeakHashMap;
+
+
+/**
+ * The CommandMap class provides an interface to a registry of
+ * command objects available in the system.
+ * Developers are expected to either use the CommandMap
+ * implementation included with this package (MailcapCommandMap) or
+ * develop their own. Note that some of the methods in this class are
+ * abstract.
+ */
+public abstract class CommandMap {
+ private static CommandMap defaultCommandMap = null;
+ private static Map
+ *
+ * The
+ *
+ * The
+ *
+ * The
+ *
+ * The
+ *
+ * Applications don't generally call the methods in DataContentHandlers
+ * directly. Instead, an application calls the equivalent methods in
+ * DataHandler. The DataHandler will attempt to find an appropriate
+ * DataContentHandler that corresponds to its MIME type using the
+ * current DataContentHandlerFactory. The DataHandler then calls
+ * through to the methods in the DataContentHandler.
+ */
+
+public interface DataContentHandler {
+ /**
+ * Returns an array of DataFlavor objects indicating the flavors the
+ * data can be provided in. The array should be ordered according to
+ * preference for providing the data (from most richly descriptive to
+ * least descriptive).
+ *
+ * @return The DataFlavors.
+ */
+ public DataFlavor[] getTransferDataFlavors();
+
+ /**
+ * Returns an object which represents the data to be transferred.
+ * The class of the object returned is defined by the representation class
+ * of the flavor.
+ *
+ * @param df The DataFlavor representing the requested type.
+ * @param ds The DataSource representing the data to be converted.
+ * @return The constructed Object.
+ * @exception UnsupportedFlavorException if the handler doesn't
+ * support the requested flavor
+ * @exception IOException if the data can't be accessed
+ */
+ public Object getTransferData(DataFlavor df, DataSource ds)
+ throws UnsupportedFlavorException, IOException;
+
+ /**
+ * Return an object representing the data in its most preferred form.
+ * Generally this will be the form described by the first DataFlavor
+ * returned by the
+ *
+ * DataHandler and the Transferable Interface
+ * DataHandler implements the Transferable interface so that data can
+ * be used in AWT data transfer operations, such as cut and paste and
+ * drag and drop. The implementation of the Transferable interface
+ * relies on the availability of an installed DataContentHandler
+ * object corresponding to the MIME type of the data represented in
+ * the specific instance of the DataHandler.
+ *
+ * DataHandler and CommandMaps
+ * The DataHandler keeps track of the current CommandMap that it uses to
+ * service requests for commands (
+ *
+ * DataHandler and URLs
+ * The current DataHandler implementation creates a private
+ * instance of URLDataSource when it is constructed with a URL.
+ *
+ * @see javax.activation.CommandMap
+ * @see javax.activation.DataContentHandler
+ * @see javax.activation.DataSource
+ * @see javax.activation.URLDataSource
+ */
+
+public class DataHandler implements Transferable {
+
+ // Use the datasource to indicate whether we were started via the
+ // DataSource constructor or the object constructor.
+ private DataSource dataSource = null;
+ private DataSource objDataSource = null;
+
+ // The Object and mimetype from the constructor (if passed in).
+ // object remains null if it was instantiated with a
+ // DataSource.
+ private Object object = null;
+ private String objectMimeType = null;
+
+ // Keep track of the CommandMap
+ private CommandMap currentCommandMap = null;
+
+ // our transfer flavors
+ private static final DataFlavor emptyFlavors[] = new DataFlavor[0];
+ private DataFlavor transferFlavors[] = emptyFlavors;
+
+ // our DataContentHandler
+ private DataContentHandler dataContentHandler = null;
+ private DataContentHandler factoryDCH = null;
+
+ // our DataContentHandlerFactory
+ private static DataContentHandlerFactory factory = null;
+ private DataContentHandlerFactory oldFactory = null;
+ // the short representation of the ContentType (sans params)
+ private String shortType = null;
+
+ /**
+ * Create a
+ * For DataHandlers that have been instantiated with a DataSource,
+ * this method returns the DataSource that was used to create the
+ * DataHandler object. In other cases the DataHandler
+ * constructs a DataSource from the data used to construct
+ * the DataHandler. DataSources created for DataHandlers not
+ * instantiated with a DataSource are cached for performance
+ * reasons.
+ *
+ * @return a valid DataSource object for this DataHandler
+ */
+ public DataSource getDataSource() {
+ if (dataSource == null) {
+ // create one on the fly
+ if (objDataSource == null)
+ objDataSource = new DataHandlerDataSource(this);
+ return objDataSource;
+ }
+ return dataSource;
+ }
+
+ /**
+ * Return the name of the data object. If this DataHandler
+ * was created with a DataSource, this method calls through
+ * to the
+ *
+ * For DataHandlers instantiated with a DataSource, the DataHandler
+ * calls the
+ * For DataHandlers instantiated with an Object, the DataHandler
+ * first attempts to find a DataContentHandler for the Object. If
+ * the DataHandler can not find a DataContentHandler for this MIME
+ * type, it throws an UnsupportedDataTypeException. If it is
+ * successful, it creates a pipe and a thread. The thread uses the
+ * DataContentHandler's
+ *
+ * @return the InputStream representing this data
+ * @exception IOException if an I/O error occurs
+ *
+ * @see javax.activation.DataContentHandler#writeTo
+ * @see javax.activation.UnsupportedDataTypeException
+ */
+ public InputStream getInputStream() throws IOException {
+ InputStream ins = null;
+
+ if (dataSource != null) {
+ ins = dataSource.getInputStream();
+ } else {
+ DataContentHandler dch = getDataContentHandler();
+ // we won't even try if we can't get a dch
+ if (dch == null)
+ throw new UnsupportedDataTypeException(
+ "no DCH for MIME type " + getBaseType());
+
+ if (dch instanceof ObjectDataContentHandler) {
+ if (((ObjectDataContentHandler)dch).getDCH() == null)
+ throw new UnsupportedDataTypeException(
+ "no object DCH for MIME type " + getBaseType());
+ }
+ // there is none but the default^^^^^^^^^^^^^^^^
+ final DataContentHandler fdch = dch;
+
+ // from bill s.
+ // ce n'est pas une pipe!
+ //
+ // NOTE: This block of code needs to throw exceptions, but
+ // can't because it is in another thread!!! ARG!
+ //
+ final PipedOutputStream pos = new PipedOutputStream();
+ PipedInputStream pin = new PipedInputStream(pos);
+ new Thread(
+ new Runnable() {
+ public void run() {
+ try {
+ fdch.writeTo(object, objectMimeType, pos);
+ } catch (IOException e) {
+
+ } finally {
+ try {
+ pos.close();
+ } catch (IOException ie) { }
+ }
+ }
+ },
+ "DataHandler.getInputStream").start();
+ ins = pin;
+ }
+
+ return ins;
+ }
+
+ /**
+ * Write the data to an
+ *
+ * If the DataHandler was created with a DataSource, writeTo
+ * retrieves the InputStream and copies the bytes from the
+ * InputStream to the OutputStream passed in.
+ *
+ * If the DataHandler was created with an object, writeTo
+ * retrieves the DataContentHandler for the object's type.
+ * If the DataContentHandler was found, it calls the
+ *
+ *
+ * Returns an array of DataFlavor objects indicating the flavors
+ * the data can be provided in. The array is usually ordered
+ * according to preference for providing the data, from most
+ * richly descriptive to least richly descriptive.
+ *
+ * The DataHandler attempts to find a DataContentHandler that
+ * corresponds to the MIME type of the data. If one is located,
+ * the DataHandler calls the DataContentHandler's
+ *
+ *
+ * If a DataContentHandler can not be located, and if the
+ * DataHandler was created with a DataSource (or URL), one
+ * DataFlavor is returned that represents this object's MIME type
+ * and the
+ *
+ * This method iterates through the DataFlavors returned from
+ *
+ *
+ * For DataHandler's created with DataSources or URLs:
+ *
+ * The DataHandler attempts to locate a DataContentHandler
+ * for this MIME type. If one is found, the passed in DataFlavor
+ * and the type of the data are passed to its
+ *
+ * For DataHandler's created with Objects:
+ *
+ * The DataHandler attempts to locate a DataContentHandler
+ * for this MIME type. If one is found, the passed in DataFlavor
+ * and the type of the data are passed to its getTransferData
+ * method. If the DataHandler fails to locate a DataContentHandler
+ * and the flavor specifies this object's MIME type and its class,
+ * this DataHandler's referenced object is returned.
+ * Otherwise it throws an UnsupportedFlavorException.
+ *
+ * @param flavor the requested flavor for the data
+ * @return the object
+ * @exception UnsupportedFlavorException if the data could not be
+ * converted to the requested flavor
+ * @exception IOException if an I/O error occurs
+ * @see javax.activation.ActivationDataFlavor
+ */
+ public Object getTransferData(DataFlavor flavor)
+ throws UnsupportedFlavorException, IOException {
+ return getDataContentHandler().getTransferData(flavor, dataSource);
+ }
+
+ /**
+ * Set the CommandMap for use by this DataHandler.
+ * Setting it to
+ *
+ * If the DataHandler was instantiated with an object, return
+ * the object.
+ *
+ * If the DataHandler was instantiated with a DataSource,
+ * this method uses a DataContentHandler to return the content
+ * object for the data represented by this DataHandler. If no
+ *
+ * This method calls the CommandInfo's
+ *
+ * If a DataContentHandlerFactory is set, use it.
+ * Otherwise look for an object to serve DCH in the
+ * following order:
+ *
+ * 1) if a factory is set, use it
+ * 2) if a CommandMap is set, use it
+ * 3) use the default CommandMap
+ *
+ * In any case, wrap the real DataContentHandler with one of our own
+ * to handle any missing cases, fill in defaults, and to ensure that
+ * we always have a non-null DataContentHandler.
+ *
+ * @return the requested DataContentHandler
+ */
+ private synchronized DataContentHandler getDataContentHandler() {
+
+ // make sure the factory didn't change
+ if (factory != oldFactory) {
+ oldFactory = factory;
+ factoryDCH = null;
+ dataContentHandler = null;
+ transferFlavors = emptyFlavors;
+ }
+
+ if (dataContentHandler != null)
+ return dataContentHandler;
+
+ String simpleMT = getBaseType();
+
+ if (factoryDCH == null && factory != null)
+ factoryDCH = factory.createDataContentHandler(simpleMT);
+
+ if (factoryDCH != null)
+ dataContentHandler = factoryDCH;
+
+ if (dataContentHandler == null) {
+ if (dataSource != null)
+ dataContentHandler = getCommandMap().
+ createDataContentHandler(simpleMT, dataSource);
+ else
+ dataContentHandler = getCommandMap().
+ createDataContentHandler(simpleMT);
+ }
+
+ // getDataContentHandler always uses these 'wrapper' handlers
+ // to make sure it returns SOMETHING meaningful...
+ if (dataSource != null)
+ dataContentHandler = new DataSourceDataContentHandler(
+ dataContentHandler,
+ dataSource);
+ else
+ dataContentHandler = new ObjectDataContentHandler(
+ dataContentHandler,
+ object,
+ objectMimeType);
+ return dataContentHandler;
+ }
+
+ /**
+ * Use the MimeType class to extract the MIME type/subtype,
+ * ignoring the parameters. The type is cached.
+ */
+ private synchronized String getBaseType() {
+ if (shortType == null) {
+ String ct = getContentType();
+ try {
+ MimeType mt = new MimeType(ct);
+ shortType = mt.getBaseType();
+ } catch (MimeTypeParseException e) {
+ shortType = ct;
+ }
+ }
+ return shortType;
+ }
+
+ /**
+ * Sets the DataContentHandlerFactory. The DataContentHandlerFactory
+ * is called first to find DataContentHandlers.
+ * The DataContentHandlerFactory can only be set once.
+ *
+ * If the DataContentHandlerFactory has already been set,
+ * this method throws an Error.
+ *
+ * @param newFactory the DataContentHandlerFactory
+ * @exception Error if the factory has already been defined.
+ *
+ * @see javax.activation.DataContentHandlerFactory
+ */
+ public static synchronized void setDataContentHandlerFactory(
+ DataContentHandlerFactory newFactory) {
+ if (factory != null)
+ throw new Error("DataContentHandlerFactory already defined");
+
+ SecurityManager security = System.getSecurityManager();
+ if (security != null) {
+ try {
+ // if it's ok with the SecurityManager, it's ok with me...
+ security.checkSetFactory();
+ } catch (SecurityException ex) {
+ // otherwise, we also allow it if this code and the
+ // factory come from the same class loader (e.g.,
+ // the JAF classes were loaded with the applet classes).
+ if (DataHandler.class.getClassLoader() !=
+ newFactory.getClass().getClassLoader())
+ throw ex;
+ }
+ }
+ factory = newFactory;
+ }
+}
+
+/**
+ * The DataHanderDataSource class implements the
+ * DataSource interface when the DataHandler is constructed
+ * with an Object and a mimeType string.
+ */
+class DataHandlerDataSource implements DataSource {
+ DataHandler dataHandler = null;
+
+ /**
+ * The constructor.
+ */
+ public DataHandlerDataSource(DataHandler dh) {
+ this.dataHandler = dh;
+ }
+
+ /**
+ * Returns an
+ *
+ * FileDataSource Typing Semantics
+ *
+ * The FileDataSource class delegates data typing of files
+ * to an object subclassed from the FileTypeMap class.
+ * The
+ * Mailcap file search order:
+ * The MailcapCommandMap looks in various places in the user's
+ * system for mailcap file entries. When requests are made
+ * to search for commands in the MailcapCommandMap, it searches
+ * mailcap files in the following order:
+ *
+ * (The current implementation looks for the
+ * Mailcap file format:
+ *
+ * Mailcap files must conform to the mailcap
+ * file specification (RFC 1524, A User Agent Configuration Mechanism
+ * For Multimedia Mail Format Information).
+ * The file format consists of entries corresponding to
+ * particular MIME types. In general, the specification
+ * specifies applications for clients to use when they
+ * themselves cannot operate on the specified MIME type. The
+ * MailcapCommandMap extends this specification by using a parameter mechanism
+ * in mailcap files that allows JavaBeans(tm) components to be specified as
+ * corresponding to particular commands for a MIME type.
+ *
+ * When a mailcap file is
+ * parsed, the MailcapCommandMap recognizes certain parameter signatures,
+ * specifically those parameter names that begin with
+ *
+ * When the command name is
+ *
+ * MailcapCommandMap aware mailcap files have the
+ * following general form:
+ *
+ *
+ * @author Bart Calder
+ * @author Bill Shannon
+ */
+
+public class MailcapCommandMap extends CommandMap {
+ /*
+ * We manage a collection of databases, searched in order.
+ */
+ private MailcapFile[] DB;
+ private static final int PROG = 0; // programmatically added entries
+
+ private static final String confDir;
+
+ static {
+ String dir = null;
+ try {
+ dir = (String)AccessController.doPrivileged(
+ new PrivilegedAction() {
+ public Object run() {
+ String home = System.getProperty("java.home");
+ String newdir = home + File.separator + "conf";
+ File conf = new File(newdir);
+ if (conf.exists())
+ return newdir + File.separator;
+ else
+ return home + File.separator + "lib" + File.separator;
+ }
+ });
+ } catch (Exception ex) {
+ // ignore any exceptions
+ }
+ confDir = dir;
+ }
+
+ /**
+ * The default Constructor.
+ */
+ public MailcapCommandMap() {
+ super();
+ List dbv = new ArrayList(5); // usually 5 or less databases
+ MailcapFile mf = null;
+ dbv.add(null); // place holder for PROG entry
+
+ LogSupport.log("MailcapCommandMap: load HOME");
+ try {
+ String user_home = System.getProperty("user.home");
+
+ if (user_home != null) {
+ String path = user_home + File.separator + ".mailcap";
+ mf = loadFile(path);
+ if (mf != null)
+ dbv.add(mf);
+ }
+ } catch (SecurityException ex) {}
+
+ LogSupport.log("MailcapCommandMap: load SYS");
+ try {
+ // check system's home
+ if (confDir != null) {
+ mf = loadFile(confDir + "mailcap");
+ if (mf != null)
+ dbv.add(mf);
+ }
+ } catch (SecurityException ex) {}
+
+ LogSupport.log("MailcapCommandMap: load JAR");
+ // load from the app's jar file
+ loadAllResources(dbv, "META-INF/mailcap");
+
+ LogSupport.log("MailcapCommandMap: load DEF");
+ mf = loadResource("/META-INF/mailcap.default");
+
+ if (mf != null)
+ dbv.add(mf);
+
+ DB = new MailcapFile[dbv.size()];
+ DB = (MailcapFile[])dbv.toArray(DB);
+ }
+
+ /**
+ * Load from the named resource.
+ */
+ private MailcapFile loadResource(String name) {
+ InputStream clis = null;
+ try {
+ clis = SecuritySupport.getResourceAsStream(this.getClass(), name);
+ if (clis != null) {
+ MailcapFile mf = new MailcapFile(clis);
+ if (LogSupport.isLoggable())
+ LogSupport.log("MailcapCommandMap: successfully loaded " +
+ "mailcap file: " + name);
+ return mf;
+ } else {
+ if (LogSupport.isLoggable())
+ LogSupport.log("MailcapCommandMap: not loading " +
+ "mailcap file: " + name);
+ }
+ } catch (IOException e) {
+ if (LogSupport.isLoggable())
+ LogSupport.log("MailcapCommandMap: can't load " + name, e);
+ } catch (SecurityException sex) {
+ if (LogSupport.isLoggable())
+ LogSupport.log("MailcapCommandMap: can't load " + name, sex);
+ } finally {
+ try {
+ if (clis != null)
+ clis.close();
+ } catch (IOException ex) { } // ignore it
+ }
+ return null;
+ }
+
+ /**
+ * Load all of the named resource.
+ */
+ private void loadAllResources(List v, String name) {
+ boolean anyLoaded = false;
+ try {
+ URL[] urls;
+ ClassLoader cld = null;
+ // First try the "application's" class loader.
+ cld = SecuritySupport.getContextClassLoader();
+ if (cld == null)
+ cld = this.getClass().getClassLoader();
+ if (cld != null)
+ urls = SecuritySupport.getResources(cld, name);
+ else
+ urls = SecuritySupport.getSystemResources(name);
+ if (urls != null) {
+ if (LogSupport.isLoggable())
+ LogSupport.log("MailcapCommandMap: getResources");
+ for (int i = 0; i < urls.length; i++) {
+ URL url = urls[i];
+ InputStream clis = null;
+ if (LogSupport.isLoggable())
+ LogSupport.log("MailcapCommandMap: URL " + url);
+ try {
+ clis = SecuritySupport.openStream(url);
+ if (clis != null) {
+ v.add(new MailcapFile(clis));
+ anyLoaded = true;
+ if (LogSupport.isLoggable())
+ LogSupport.log("MailcapCommandMap: " +
+ "successfully loaded " +
+ "mailcap file from URL: " +
+ url);
+ } else {
+ if (LogSupport.isLoggable())
+ LogSupport.log("MailcapCommandMap: " +
+ "not loading mailcap " +
+ "file from URL: " + url);
+ }
+ } catch (IOException ioex) {
+ if (LogSupport.isLoggable())
+ LogSupport.log("MailcapCommandMap: can't load " +
+ url, ioex);
+ } catch (SecurityException sex) {
+ if (LogSupport.isLoggable())
+ LogSupport.log("MailcapCommandMap: can't load " +
+ url, sex);
+ } finally {
+ try {
+ if (clis != null)
+ clis.close();
+ } catch (IOException cex) { }
+ }
+ }
+ }
+ } catch (Exception ex) {
+ if (LogSupport.isLoggable())
+ LogSupport.log("MailcapCommandMap: can't load " + name, ex);
+ }
+
+ // if failed to load anything, fall back to old technique, just in case
+ if (!anyLoaded) {
+ if (LogSupport.isLoggable())
+ LogSupport.log("MailcapCommandMap: !anyLoaded");
+ MailcapFile mf = loadResource("/" + name);
+ if (mf != null)
+ v.add(mf);
+ }
+ }
+
+ /**
+ * Load from the named file.
+ */
+ private MailcapFile loadFile(String name) {
+ MailcapFile mtf = null;
+
+ try {
+ mtf = new MailcapFile(name);
+ } catch (IOException e) {
+ // e.printStackTrace();
+ }
+ return mtf;
+ }
+
+ /**
+ * Constructor that allows the caller to specify the path
+ * of a mailcap file.
+ *
+ * @param fileName The name of the mailcap file to open
+ * @exception IOException if the file can't be accessed
+ */
+ public MailcapCommandMap(String fileName) throws IOException {
+ this();
+
+ if (LogSupport.isLoggable())
+ LogSupport.log("MailcapCommandMap: load PROG from " + fileName);
+ if (DB[PROG] == null) {
+ DB[PROG] = new MailcapFile(fileName);
+ }
+ }
+
+
+ /**
+ * Constructor that allows the caller to specify an InputStream
+ * containing a mailcap file.
+ *
+ * @param is InputStream of the mailcap file to open
+ */
+ public MailcapCommandMap(InputStream is) {
+ this();
+
+ LogSupport.log("MailcapCommandMap: load PROG");
+ if (DB[PROG] == null) {
+ try {
+ DB[PROG] = new MailcapFile(is);
+ } catch (IOException ex) {
+ // XXX - should throw it
+ }
+ }
+ }
+
+ /**
+ * Get the preferred command list for a MIME Type. The MailcapCommandMap
+ * searches the mailcap files as described above under
+ * Mailcap file search order.
+ *
+ * The result of the search is a proper subset of available
+ * commands in all mailcap files known to this instance of
+ * MailcapCommandMap. The first entry for a particular command
+ * is considered the preferred command.
+ *
+ * @param mimeType the MIME type
+ * @return the CommandInfo objects representing the preferred commands.
+ */
+ public synchronized CommandInfo[] getPreferredCommands(String mimeType) {
+ List cmdList = new ArrayList();
+ if (mimeType != null)
+ mimeType = mimeType.toLowerCase(Locale.ENGLISH);
+
+ for (int i = 0; i < DB.length; i++) {
+ if (DB[i] == null)
+ continue;
+ Map cmdMap = DB[i].getMailcapList(mimeType);
+ if (cmdMap != null)
+ appendPrefCmdsToList(cmdMap, cmdList);
+ }
+
+ // now add the fallback commands
+ for (int i = 0; i < DB.length; i++) {
+ if (DB[i] == null)
+ continue;
+ Map cmdMap = DB[i].getMailcapFallbackList(mimeType);
+ if (cmdMap != null)
+ appendPrefCmdsToList(cmdMap, cmdList);
+ }
+
+ CommandInfo[] cmdInfos = new CommandInfo[cmdList.size()];
+ cmdInfos = (CommandInfo[])cmdList.toArray(cmdInfos);
+
+ return cmdInfos;
+ }
+
+ /**
+ * Put the commands that are in the hash table, into the list.
+ */
+ private void appendPrefCmdsToList(Map cmdHash, List cmdList) {
+ Iterator verb_enum = cmdHash.keySet().iterator();
+
+ while (verb_enum.hasNext()) {
+ String verb = (String)verb_enum.next();
+ if (!checkForVerb(cmdList, verb)) {
+ List cmdList2 = (List)cmdHash.get(verb); // get the list
+ String className = (String)cmdList2.get(0);
+ cmdList.add(new CommandInfo(verb, className));
+ }
+ }
+ }
+
+ /**
+ * Check the cmdList to see if this command exists, return
+ * true if the verb is there.
+ */
+ private boolean checkForVerb(List cmdList, String verb) {
+ Iterator ee = cmdList.iterator();
+ while (ee.hasNext()) {
+ String enum_verb =
+ (String)((CommandInfo)ee.next()).getCommandName();
+ if (enum_verb.equals(verb))
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Get all the available commands in all mailcap files known to
+ * this instance of MailcapCommandMap for this MIME type.
+ *
+ * @param mimeType the MIME type
+ * @return the CommandInfo objects representing all the commands.
+ */
+ public synchronized CommandInfo[] getAllCommands(String mimeType) {
+ List cmdList = new ArrayList();
+ if (mimeType != null)
+ mimeType = mimeType.toLowerCase(Locale.ENGLISH);
+
+ for (int i = 0; i < DB.length; i++) {
+ if (DB[i] == null)
+ continue;
+ Map cmdMap = DB[i].getMailcapList(mimeType);
+ if (cmdMap != null)
+ appendCmdsToList(cmdMap, cmdList);
+ }
+
+ // now add the fallback commands
+ for (int i = 0; i < DB.length; i++) {
+ if (DB[i] == null)
+ continue;
+ Map cmdMap = DB[i].getMailcapFallbackList(mimeType);
+ if (cmdMap != null)
+ appendCmdsToList(cmdMap, cmdList);
+ }
+
+ CommandInfo[] cmdInfos = new CommandInfo[cmdList.size()];
+ cmdInfos = (CommandInfo[])cmdList.toArray(cmdInfos);
+
+ return cmdInfos;
+ }
+
+ /**
+ * Put the commands that are in the hash table, into the list.
+ */
+ private void appendCmdsToList(Map typeHash, List cmdList) {
+ Iterator verb_enum = typeHash.keySet().iterator();
+
+ while (verb_enum.hasNext()) {
+ String verb = (String)verb_enum.next();
+ List cmdList2 = (List)typeHash.get(verb);
+ Iterator cmd_enum = ((List)cmdList2).iterator();
+
+ while (cmd_enum.hasNext()) {
+ String cmd = (String)cmd_enum.next();
+ cmdList.add(new CommandInfo(verb, cmd));
+ // cmdList.add(0, new CommandInfo(verb, cmd));
+ }
+ }
+ }
+
+ /**
+ * Get the command corresponding to
+ *
+ * The string that is passed in should be in mailcap
+ * format.
+ *
+ * @param mail_cap a correctly formatted mailcap string
+ */
+ public synchronized void addMailcap(String mail_cap) {
+ // check to see if one exists
+ LogSupport.log("MailcapCommandMap: add to PROG");
+ if (DB[PROG] == null)
+ DB[PROG] = new MailcapFile();
+
+ DB[PROG].appendToMailcap(mail_cap);
+ }
+
+ /**
+ * Return the DataContentHandler for the specified MIME type.
+ *
+ * @param mimeType the MIME type
+ * @return the DataContentHandler
+ */
+ public synchronized DataContentHandler createDataContentHandler(
+ String mimeType) {
+ if (LogSupport.isLoggable())
+ LogSupport.log(
+ "MailcapCommandMap: createDataContentHandler for " + mimeType);
+ if (mimeType != null)
+ mimeType = mimeType.toLowerCase(Locale.ENGLISH);
+
+ for (int i = 0; i < DB.length; i++) {
+ if (DB[i] == null)
+ continue;
+ if (LogSupport.isLoggable())
+ LogSupport.log(" search DB #" + i);
+ Map cmdMap = DB[i].getMailcapList(mimeType);
+ if (cmdMap != null) {
+ List v = (List)cmdMap.get("content-handler");
+ if (v != null) {
+ String name = (String)v.get(0);
+ DataContentHandler dch = getDataContentHandler(name);
+ if (dch != null)
+ return dch;
+ }
+ }
+ }
+
+ // now try the fallback entries
+ for (int i = 0; i < DB.length; i++) {
+ if (DB[i] == null)
+ continue;
+ if (LogSupport.isLoggable())
+ LogSupport.log(" search fallback DB #" + i);
+ Map cmdMap = DB[i].getMailcapFallbackList(mimeType);
+ if (cmdMap != null) {
+ List v = (List)cmdMap.get("content-handler");
+ if (v != null) {
+ String name = (String)v.get(0);
+ DataContentHandler dch = getDataContentHandler(name);
+ if (dch != null)
+ return dch;
+ }
+ }
+ }
+ return null;
+ }
+
+ private DataContentHandler getDataContentHandler(String name) {
+ if (LogSupport.isLoggable())
+ LogSupport.log(" got content-handler");
+ if (LogSupport.isLoggable())
+ LogSupport.log(" class " + name);
+ try {
+ ClassLoader cld = null;
+ // First try the "application's" class loader.
+ cld = SecuritySupport.getContextClassLoader();
+ if (cld == null)
+ cld = this.getClass().getClassLoader();
+ Class cl = null;
+ try {
+ cl = cld.loadClass(name);
+ } catch (Exception ex) {
+ // if anything goes wrong, do it the old way
+ cl = Class.forName(name);
+ }
+ if (cl != null) // XXX - always true?
+ return (DataContentHandler)cl.newInstance();
+ } catch (IllegalAccessException e) {
+ if (LogSupport.isLoggable())
+ LogSupport.log("Can't load DCH " + name, e);
+ } catch (ClassNotFoundException e) {
+ if (LogSupport.isLoggable())
+ LogSupport.log("Can't load DCH " + name, e);
+ } catch (InstantiationException e) {
+ if (LogSupport.isLoggable())
+ LogSupport.log("Can't load DCH " + name, e);
+ }
+ return null;
+ }
+
+ /**
+ * Get all the MIME types known to this command map.
+ *
+ * @return array of MIME types as strings
+ * @since JAF 1.1
+ */
+ public synchronized String[] getMimeTypes() {
+ List mtList = new ArrayList();
+
+ for (int i = 0; i < DB.length; i++) {
+ if (DB[i] == null)
+ continue;
+ String[] ts = DB[i].getMimeTypes();
+ if (ts != null) {
+ for (int j = 0; j < ts.length; j++) {
+ // eliminate duplicates
+ if (!mtList.contains(ts[j]))
+ mtList.add(ts[j]);
+ }
+ }
+ }
+
+ String[] mts = new String[mtList.size()];
+ mts = (String[])mtList.toArray(mts);
+
+ return mts;
+ }
+
+ /**
+ * Get the native commands for the given MIME type.
+ * Returns an array of strings where each string is
+ * an entire mailcap file entry. The application
+ * will need to parse the entry to extract the actual
+ * command as well as any attributes it needs. See
+ * RFC 1524
+ * for details of the mailcap entry syntax. Only mailcap
+ * entries that specify a view command for the specified
+ * MIME type are returned.
+ *
+ * @param mimeType the MIME type
+ * @return array of native command entries
+ * @since JAF 1.1
+ */
+ public synchronized String[] getNativeCommands(String mimeType) {
+ List cmdList = new ArrayList();
+ if (mimeType != null)
+ mimeType = mimeType.toLowerCase(Locale.ENGLISH);
+
+ for (int i = 0; i < DB.length; i++) {
+ if (DB[i] == null)
+ continue;
+ String[] cmds = DB[i].getNativeCommands(mimeType);
+ if (cmds != null) {
+ for (int j = 0; j < cmds.length; j++) {
+ // eliminate duplicates
+ if (!cmdList.contains(cmds[j]))
+ cmdList.add(cmds[j]);
+ }
+ }
+ }
+
+ String[] cmds = new String[cmdList.size()];
+ cmds = (String[])cmdList.toArray(cmds);
+
+ return cmds;
+ }
+
+ /**
+ * for debugging...
+ *
+ public static void main(String[] argv) throws Exception {
+ MailcapCommandMap map = new MailcapCommandMap();
+ CommandInfo[] cmdInfo;
+
+ cmdInfo = map.getPreferredCommands(argv[0]);
+ System.out.println("Preferred Commands:");
+ for (int i = 0; i < cmdInfo.length; i++)
+ System.out.println("Command " + cmdInfo[i].getCommandName() + " [" +
+ cmdInfo[i].getCommandClass() + "]");
+ cmdInfo = map.getAllCommands(argv[0]);
+ System.out.println();
+ System.out.println("All Commands:");
+ for (int i = 0; i < cmdInfo.length; i++)
+ System.out.println("Command " + cmdInfo[i].getCommandName() + " [" +
+ cmdInfo[i].getCommandClass() + "]");
+ DataContentHandler dch = map.createDataContentHandler(argv[0]);
+ if (dch != null)
+ System.out.println("DataContentHandler " +
+ dch.getClass().toString());
+ System.exit(0);
+ }
+ */
+}
diff --git a/fine-third-jdk11/src/javax/activation/MimeType.java b/fine-third-jdk11/src/javax/activation/MimeType.java
new file mode 100644
index 000000000..bed48a816
--- /dev/null
+++ b/fine-third-jdk11/src/javax/activation/MimeType.java
@@ -0,0 +1,359 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common Development
+ * and Distribution License("CDDL") (collectively, the "License"). You
+ * may not use this file except in compliance with the License. You can
+ * obtain a copy of the License at
+ * https://oss.oracle.com/licenses/CDDL+GPL-1.1
+ * or LICENSE.txt. See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice in each
+ * file and include the License file at LICENSE.txt.
+ *
+ * GPL Classpath Exception:
+ * Oracle designates this particular file as subject to the "Classpath"
+ * exception as provided by Oracle in the GPL Version 2 section of the License
+ * file that accompanied this code.
+ *
+ * Modifications:
+ * If applicable, add the following below the License Header, with the fields
+ * enclosed by brackets [] replaced by your own identifying information:
+ * "Portions Copyright [year] [name of copyright owner]"
+ *
+ * Contributor(s):
+ * If you wish your version of this file to be governed by only the CDDL or
+ * only the GPL Version 2, indicate your decision by adding "[Contributor]
+ * elects to include this software in this distribution under the [CDDL or GPL
+ * Version 2] license." If you don't indicate a single choice of license, a
+ * recipient has the option to distribute your version of this file under
+ * either the CDDL, the GPL Version 2 or to extend the choice of license to
+ * its licensees as provided above. However, if you add GPL Version 2 code
+ * and therefore, elected the GPL Version 2 license, then the option applies
+ * only if the new code is made subject to such option by the copyright
+ * holder.
+ */
+
+package javax.activation;
+
+import java.io.*;
+import java.util.Locale;
+
+/**
+ * A Multipurpose Internet Mail Extension (MIME) type, as defined
+ * in RFC 2045 and 2046.
+ */
+public class MimeType implements Externalizable {
+
+ private String primaryType;
+ private String subType;
+ private MimeTypeParameterList parameters;
+
+ /**
+ * A string that holds all the special chars.
+ */
+ private static final String TSPECIALS = "()<>@,;:/[]?=\\\"";
+
+ /**
+ * Default constructor.
+ */
+ public MimeType() {
+ primaryType = "application";
+ subType = "*";
+ parameters = new MimeTypeParameterList();
+ }
+
+ /**
+ * Constructor that builds a MimeType from a String.
+ *
+ * @param rawdata the MIME type string
+ * @exception MimeTypeParseException if the MIME type can't be parsed
+ */
+ public MimeType(String rawdata) throws MimeTypeParseException {
+ parse(rawdata);
+ }
+
+ /**
+ * Constructor that builds a MimeType with the given primary and sub type
+ * but has an empty parameter list.
+ *
+ * @param primary the primary MIME type
+ * @param sub the MIME sub-type
+ * @exception MimeTypeParseException if the primary type or subtype
+ * is not a valid token
+ */
+ public MimeType(String primary, String sub) throws MimeTypeParseException {
+ // check to see if primary is valid
+ if (isValidToken(primary)) {
+ primaryType = primary.toLowerCase(Locale.ENGLISH);
+ } else {
+ throw new MimeTypeParseException("Primary type is invalid.");
+ }
+
+ // check to see if sub is valid
+ if (isValidToken(sub)) {
+ subType = sub.toLowerCase(Locale.ENGLISH);
+ } else {
+ throw new MimeTypeParseException("Sub type is invalid.");
+ }
+
+ parameters = new MimeTypeParameterList();
+ }
+
+ /**
+ * A routine for parsing the MIME type out of a String.
+ */
+ private void parse(String rawdata) throws MimeTypeParseException {
+ int slashIndex = rawdata.indexOf('/');
+ int semIndex = rawdata.indexOf(';');
+ if ((slashIndex < 0) && (semIndex < 0)) {
+ // neither character is present, so treat it
+ // as an error
+ throw new MimeTypeParseException("Unable to find a sub type.");
+ } else if ((slashIndex < 0) && (semIndex >= 0)) {
+ // we have a ';' (and therefore a parameter list),
+ // but no '/' indicating a sub type is present
+ throw new MimeTypeParseException("Unable to find a sub type.");
+ } else if ((slashIndex >= 0) && (semIndex < 0)) {
+ // we have a primary and sub type but no parameter list
+ primaryType = rawdata.substring(0, slashIndex).trim().
+ toLowerCase(Locale.ENGLISH);
+ subType = rawdata.substring(slashIndex + 1).trim().
+ toLowerCase(Locale.ENGLISH);
+ parameters = new MimeTypeParameterList();
+ } else if (slashIndex < semIndex) {
+ // we have all three items in the proper sequence
+ primaryType = rawdata.substring(0, slashIndex).trim().
+ toLowerCase(Locale.ENGLISH);
+ subType = rawdata.substring(slashIndex + 1, semIndex).trim().
+ toLowerCase(Locale.ENGLISH);
+ parameters = new MimeTypeParameterList(rawdata.substring(semIndex));
+ } else {
+ // we have a ';' lexically before a '/' which means we
+ // have a primary type and a parameter list but no sub type
+ throw new MimeTypeParseException("Unable to find a sub type.");
+ }
+
+ // now validate the primary and sub types
+
+ // check to see if primary is valid
+ if (!isValidToken(primaryType))
+ throw new MimeTypeParseException("Primary type is invalid.");
+
+ // check to see if sub is valid
+ if (!isValidToken(subType))
+ throw new MimeTypeParseException("Sub type is invalid.");
+ }
+
+ /**
+ * Retrieve the primary type of this object.
+ *
+ * @return the primary MIME type
+ */
+ public String getPrimaryType() {
+ return primaryType;
+ }
+
+ /**
+ * Set the primary type for this object to the given String.
+ *
+ * @param primary the primary MIME type
+ * @exception MimeTypeParseException if the primary type
+ * is not a valid token
+ */
+ public void setPrimaryType(String primary) throws MimeTypeParseException {
+ // check to see if primary is valid
+ if (!isValidToken(primaryType))
+ throw new MimeTypeParseException("Primary type is invalid.");
+ primaryType = primary.toLowerCase(Locale.ENGLISH);
+ }
+
+ /**
+ * Retrieve the subtype of this object.
+ *
+ * @return the MIME subtype
+ */
+ public String getSubType() {
+ return subType;
+ }
+
+ /**
+ * Set the subtype for this object to the given String.
+ *
+ * @param sub the MIME subtype
+ * @exception MimeTypeParseException if the subtype
+ * is not a valid token
+ */
+ public void setSubType(String sub) throws MimeTypeParseException {
+ // check to see if sub is valid
+ if (!isValidToken(subType))
+ throw new MimeTypeParseException("Sub type is invalid.");
+ subType = sub.toLowerCase(Locale.ENGLISH);
+ }
+
+ /**
+ * Retrieve this object's parameter list.
+ *
+ * @return a MimeTypeParameterList object representing the parameters
+ */
+ public MimeTypeParameterList getParameters() {
+ return parameters;
+ }
+
+ /**
+ * Retrieve the value associated with the given name, or null if there
+ * is no current association.
+ *
+ * @param name the parameter name
+ * @return the paramter's value
+ */
+ public String getParameter(String name) {
+ return parameters.get(name);
+ }
+
+ /**
+ * Set the value to be associated with the given name, replacing
+ * any previous association.
+ *
+ * @param name the parameter name
+ * @param value the paramter's value
+ */
+ public void setParameter(String name, String value) {
+ parameters.set(name, value);
+ }
+
+ /**
+ * Remove any value associated with the given name.
+ *
+ * @param name the parameter name
+ */
+ public void removeParameter(String name) {
+ parameters.remove(name);
+ }
+
+ /**
+ * Return the String representation of this object.
+ */
+ public String toString() {
+ return getBaseType() + parameters.toString();
+ }
+
+ /**
+ * Return a String representation of this object
+ * without the parameter list.
+ *
+ * @return the MIME type and sub-type
+ */
+ public String getBaseType() {
+ return primaryType + "/" + subType;
+ }
+
+ /**
+ * Determine if the primary and sub type of this object is
+ * the same as what is in the given type.
+ *
+ * @param type the MimeType object to compare with
+ * @return true if they match
+ */
+ public boolean match(MimeType type) {
+ return primaryType.equals(type.getPrimaryType())
+ && (subType.equals("*")
+ || type.getSubType().equals("*")
+ || (subType.equals(type.getSubType())));
+ }
+
+ /**
+ * Determine if the primary and sub type of this object is
+ * the same as the content type described in rawdata.
+ *
+ * @param rawdata the MIME type string to compare with
+ * @return true if they match
+ * @exception MimeTypeParseException if the MIME type can't be parsed
+ */
+ public boolean match(String rawdata) throws MimeTypeParseException {
+ return match(new MimeType(rawdata));
+ }
+
+ /**
+ * The object implements the writeExternal method to save its contents
+ * by calling the methods of DataOutput for its primitive values or
+ * calling the writeObject method of ObjectOutput for objects, strings
+ * and arrays.
+ *
+ * @param out the ObjectOutput object to write to
+ * @exception IOException Includes any I/O exceptions that may occur
+ */
+ public void writeExternal(ObjectOutput out) throws IOException {
+ out.writeUTF(toString());
+ out.flush();
+ }
+
+ /**
+ * The object implements the readExternal method to restore its
+ * contents by calling the methods of DataInput for primitive
+ * types and readObject for objects, strings and arrays. The
+ * readExternal method must read the values in the same sequence
+ * and with the same types as were written by writeExternal.
+ *
+ * @param in the ObjectInput object to read from
+ * @exception ClassNotFoundException If the class for an object being
+ * restored cannot be found.
+ */
+ public void readExternal(ObjectInput in)
+ throws IOException, ClassNotFoundException {
+ try {
+ parse(in.readUTF());
+ } catch (MimeTypeParseException e) {
+ throw new IOException(e.toString());
+ }
+ }
+
+ // below here be scary parsing related things
+
+ /**
+ * Determine whether or not a given character belongs to a legal token.
+ */
+ private static boolean isTokenChar(char c) {
+ return ((c > 040) && (c < 0177)) && (TSPECIALS.indexOf(c) < 0);
+ }
+
+ /**
+ * Determine whether or not a given string is a legal token.
+ */
+ private boolean isValidToken(String s) {
+ int len = s.length();
+ if (len > 0) {
+ for (int i = 0; i < len; ++i) {
+ char c = s.charAt(i);
+ if (!isTokenChar(c)) {
+ return false;
+ }
+ }
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ * A simple parser test,
+ * for debugging...
+ *
+ public static void main(String[] args)
+ throws MimeTypeParseException, IOException {
+ for (int i = 0; i < args.length; ++i) {
+ System.out.println("Original: " + args[i]);
+
+ MimeType type = new MimeType(args[i]);
+
+ System.out.println("Short: " + type.getBaseType());
+ System.out.println("Parsed: " + type.toString());
+ System.out.println();
+ }
+ }
+ */
+}
diff --git a/fine-third-jdk11/src/javax/activation/MimeTypeParameterList.java b/fine-third-jdk11/src/javax/activation/MimeTypeParameterList.java
new file mode 100644
index 000000000..4f4926b84
--- /dev/null
+++ b/fine-third-jdk11/src/javax/activation/MimeTypeParameterList.java
@@ -0,0 +1,354 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common Development
+ * and Distribution License("CDDL") (collectively, the "License"). You
+ * may not use this file except in compliance with the License. You can
+ * obtain a copy of the License at
+ * https://oss.oracle.com/licenses/CDDL+GPL-1.1
+ * or LICENSE.txt. See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice in each
+ * file and include the License file at LICENSE.txt.
+ *
+ * GPL Classpath Exception:
+ * Oracle designates this particular file as subject to the "Classpath"
+ * exception as provided by Oracle in the GPL Version 2 section of the License
+ * file that accompanied this code.
+ *
+ * Modifications:
+ * If applicable, add the following below the License Header, with the fields
+ * enclosed by brackets [] replaced by your own identifying information:
+ * "Portions Copyright [year] [name of copyright owner]"
+ *
+ * Contributor(s):
+ * If you wish your version of this file to be governed by only the CDDL or
+ * only the GPL Version 2, indicate your decision by adding "[Contributor]
+ * elects to include this software in this distribution under the [CDDL or GPL
+ * Version 2] license." If you don't indicate a single choice of license, a
+ * recipient has the option to distribute your version of this file under
+ * either the CDDL, the GPL Version 2 or to extend the choice of license to
+ * its licensees as provided above. However, if you add GPL Version 2 code
+ * and therefore, elected the GPL Version 2 license, then the option applies
+ * only if the new code is made subject to such option by the copyright
+ * holder.
+ */
+
+package javax.activation;
+
+import java.util.Hashtable;
+import java.util.Enumeration;
+import java.util.Locale;
+
+/**
+ * A parameter list of a MimeType
+ * as defined in RFC 2045 and 2046. The Primary type of the
+ * object must already be stripped off.
+ *
+ * @see javax.activation.MimeType
+ */
+public class MimeTypeParameterList {
+ private Hashtable parameters;
+
+ /**
+ * A string that holds all the special chars.
+ */
+ private static final String TSPECIALS = "()<>@,;:/[]?=\\\"";
+
+
+ /**
+ * Default constructor.
+ */
+ public MimeTypeParameterList() {
+ parameters = new Hashtable();
+ }
+
+ /**
+ * Constructs a new MimeTypeParameterList with the passed in data.
+ *
+ * @param parameterList an RFC 2045, 2046 compliant parameter list.
+ * @exception MimeTypeParseException if the MIME type can't be parsed
+ */
+ public MimeTypeParameterList(String parameterList)
+ throws MimeTypeParseException {
+ parameters = new Hashtable();
+
+ // now parse rawdata
+ parse(parameterList);
+ }
+
+ /**
+ * A routine for parsing the parameter list out of a String.
+ *
+ * @param parameterList an RFC 2045, 2046 compliant parameter list.
+ * @exception MimeTypeParseException if the MIME type can't be parsed
+ */
+ protected void parse(String parameterList) throws MimeTypeParseException {
+ if (parameterList == null)
+ return;
+
+ int length = parameterList.length();
+ if (length <= 0)
+ return;
+
+ int i;
+ char c;
+ for (i = skipWhiteSpace(parameterList, 0);
+ i < length && (c = parameterList.charAt(i)) == ';';
+ i = skipWhiteSpace(parameterList, i)) {
+ int lastIndex;
+ String name;
+ String value;
+
+ // eat the ';'
+ i++;
+
+ // now parse the parameter name
+
+ // skip whitespace
+ i = skipWhiteSpace(parameterList, i);
+
+ // tolerate trailing semicolon, even though it violates the spec
+ if (i >= length)
+ return;
+
+ // find the end of the token char run
+ lastIndex = i;
+ while ((i < length) && isTokenChar(parameterList.charAt(i)))
+ i++;
+
+ name = parameterList.substring(lastIndex, i).
+ toLowerCase(Locale.ENGLISH);
+
+ // now parse the '=' that separates the name from the value
+ i = skipWhiteSpace(parameterList, i);
+
+ if (i >= length || parameterList.charAt(i) != '=')
+ throw new MimeTypeParseException(
+ "Couldn't find the '=' that separates a " +
+ "parameter name from its value.");
+
+ // eat it and parse the parameter value
+ i++;
+ i = skipWhiteSpace(parameterList, i);
+
+ if (i >= length)
+ throw new MimeTypeParseException(
+ "Couldn't find a value for parameter named " + name);
+
+ // now find out whether or not we have a quoted value
+ c = parameterList.charAt(i);
+ if (c == '"') {
+ // yup it's quoted so eat it and capture the quoted string
+ i++;
+ if (i >= length)
+ throw new MimeTypeParseException(
+ "Encountered unterminated quoted parameter value.");
+
+ lastIndex = i;
+
+ // find the next unescaped quote
+ while (i < length) {
+ c = parameterList.charAt(i);
+ if (c == '"')
+ break;
+ if (c == '\\') {
+ // found an escape sequence
+ // so skip this and the
+ // next character
+ i++;
+ }
+ i++;
+ }
+ if (c != '"')
+ throw new MimeTypeParseException(
+ "Encountered unterminated quoted parameter value.");
+
+ value = unquote(parameterList.substring(lastIndex, i));
+ // eat the quote
+ i++;
+ } else if (isTokenChar(c)) {
+ // nope it's an ordinary token so it
+ // ends with a non-token char
+ lastIndex = i;
+ while (i < length && isTokenChar(parameterList.charAt(i)))
+ i++;
+ value = parameterList.substring(lastIndex, i);
+ } else {
+ // it ain't a value
+ throw new MimeTypeParseException(
+ "Unexpected character encountered at index " + i);
+ }
+
+ // now put the data into the hashtable
+ parameters.put(name, value);
+ }
+ if (i < length) {
+ throw new MimeTypeParseException(
+ "More characters encountered in input than expected.");
+ }
+ }
+
+ /**
+ * Return the number of name-value pairs in this list.
+ *
+ * @return the number of parameters
+ */
+ public int size() {
+ return parameters.size();
+ }
+
+ /**
+ * Determine whether or not this list is empty.
+ *
+ * @return true if there are no parameters
+ */
+ public boolean isEmpty() {
+ return parameters.isEmpty();
+ }
+
+ /**
+ * Retrieve the value associated with the given name, or null if there
+ * is no current association.
+ *
+ * @param name the parameter name
+ * @return the parameter's value
+ */
+ public String get(String name) {
+ return (String)parameters.get(name.trim().toLowerCase(Locale.ENGLISH));
+ }
+
+ /**
+ * Set the value to be associated with the given name, replacing
+ * any previous association.
+ *
+ * @param name the parameter name
+ * @param value the parameter's value
+ */
+ public void set(String name, String value) {
+ parameters.put(name.trim().toLowerCase(Locale.ENGLISH), value);
+ }
+
+ /**
+ * Remove any value associated with the given name.
+ *
+ * @param name the parameter name
+ */
+ public void remove(String name) {
+ parameters.remove(name.trim().toLowerCase(Locale.ENGLISH));
+ }
+
+ /**
+ * Retrieve an enumeration of all the names in this list.
+ *
+ * @return an enumeration of all parameter names
+ */
+ public Enumeration getNames() {
+ return parameters.keys();
+ }
+
+ /**
+ * Return a string representation of this object.
+ */
+ public String toString() {
+ StringBuffer buffer = new StringBuffer();
+ buffer.ensureCapacity(parameters.size() * 16);
+ // heuristic: 8 characters per field
+
+ Enumeration keys = parameters.keys();
+ while (keys.hasMoreElements()) {
+ String key = (String)keys.nextElement();
+ buffer.append("; ");
+ buffer.append(key);
+ buffer.append('=');
+ buffer.append(quote((String)parameters.get(key)));
+ }
+
+ return buffer.toString();
+ }
+
+ // below here be scary parsing related things
+
+ /**
+ * Determine whether or not a given character belongs to a legal token.
+ */
+ private static boolean isTokenChar(char c) {
+ return ((c > 040) && (c < 0177)) && (TSPECIALS.indexOf(c) < 0);
+ }
+
+ /**
+ * return the index of the first non white space character in
+ * rawdata at or after index i.
+ */
+ private static int skipWhiteSpace(String rawdata, int i) {
+ int length = rawdata.length();
+ while ((i < length) && Character.isWhitespace(rawdata.charAt(i)))
+ i++;
+ return i;
+ }
+
+ /**
+ * A routine that knows how and when to quote and escape the given value.
+ */
+ private static String quote(String value) {
+ boolean needsQuotes = false;
+
+ // check to see if we actually have to quote this thing
+ int length = value.length();
+ for (int i = 0; (i < length) && !needsQuotes; i++) {
+ needsQuotes = !isTokenChar(value.charAt(i));
+ }
+
+ if (needsQuotes) {
+ StringBuffer buffer = new StringBuffer();
+ buffer.ensureCapacity((int)(length * 1.5));
+
+ // add the initial quote
+ buffer.append('"');
+
+ // add the properly escaped text
+ for (int i = 0; i < length; ++i) {
+ char c = value.charAt(i);
+ if ((c == '\\') || (c == '"'))
+ buffer.append('\\');
+ buffer.append(c);
+ }
+
+ // add the closing quote
+ buffer.append('"');
+
+ return buffer.toString();
+ } else {
+ return value;
+ }
+ }
+
+ /**
+ * A routine that knows how to strip the quotes and
+ * escape sequences from the given value.
+ */
+ private static String unquote(String value) {
+ int valueLength = value.length();
+ StringBuffer buffer = new StringBuffer();
+ buffer.ensureCapacity(valueLength);
+
+ boolean escaped = false;
+ for (int i = 0; i < valueLength; ++i) {
+ char currentChar = value.charAt(i);
+ if (!escaped && (currentChar != '\\')) {
+ buffer.append(currentChar);
+ } else if (escaped) {
+ buffer.append(currentChar);
+ escaped = false;
+ } else {
+ escaped = true;
+ }
+ }
+
+ return buffer.toString();
+ }
+}
diff --git a/fine-third-jdk11/src/javax/activation/MimeTypeParseException.java b/fine-third-jdk11/src/javax/activation/MimeTypeParseException.java
new file mode 100644
index 000000000..d17f76003
--- /dev/null
+++ b/fine-third-jdk11/src/javax/activation/MimeTypeParseException.java
@@ -0,0 +1,63 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common Development
+ * and Distribution License("CDDL") (collectively, the "License"). You
+ * may not use this file except in compliance with the License. You can
+ * obtain a copy of the License at
+ * https://oss.oracle.com/licenses/CDDL+GPL-1.1
+ * or LICENSE.txt. See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice in each
+ * file and include the License file at LICENSE.txt.
+ *
+ * GPL Classpath Exception:
+ * Oracle designates this particular file as subject to the "Classpath"
+ * exception as provided by Oracle in the GPL Version 2 section of the License
+ * file that accompanied this code.
+ *
+ * Modifications:
+ * If applicable, add the following below the License Header, with the fields
+ * enclosed by brackets [] replaced by your own identifying information:
+ * "Portions Copyright [year] [name of copyright owner]"
+ *
+ * Contributor(s):
+ * If you wish your version of this file to be governed by only the CDDL or
+ * only the GPL Version 2, indicate your decision by adding "[Contributor]
+ * elects to include this software in this distribution under the [CDDL or GPL
+ * Version 2] license." If you don't indicate a single choice of license, a
+ * recipient has the option to distribute your version of this file under
+ * either the CDDL, the GPL Version 2 or to extend the choice of license to
+ * its licensees as provided above. However, if you add GPL Version 2 code
+ * and therefore, elected the GPL Version 2 license, then the option applies
+ * only if the new code is made subject to such option by the copyright
+ * holder.
+ */
+
+package javax.activation;
+
+/**
+ * A class to encapsulate MimeType parsing related exceptions.
+ */
+public class MimeTypeParseException extends Exception {
+
+ /**
+ * Constructs a MimeTypeParseException with no specified detail message.
+ */
+ public MimeTypeParseException() {
+ super();
+ }
+
+ /**
+ * Constructs a MimeTypeParseException with the specified detail message.
+ *
+ * @param s the detail message.
+ */
+ public MimeTypeParseException(String s) {
+ super(s);
+ }
+}
diff --git a/fine-third-jdk11/src/javax/activation/MimetypesFileTypeMap.java b/fine-third-jdk11/src/javax/activation/MimetypesFileTypeMap.java
new file mode 100644
index 000000000..77d7ee902
--- /dev/null
+++ b/fine-third-jdk11/src/javax/activation/MimetypesFileTypeMap.java
@@ -0,0 +1,373 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common Development
+ * and Distribution License("CDDL") (collectively, the "License"). You
+ * may not use this file except in compliance with the License. You can
+ * obtain a copy of the License at
+ * https://oss.oracle.com/licenses/CDDL+GPL-1.1
+ * or LICENSE.txt. See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice in each
+ * file and include the License file at LICENSE.txt.
+ *
+ * GPL Classpath Exception:
+ * Oracle designates this particular file as subject to the "Classpath"
+ * exception as provided by Oracle in the GPL Version 2 section of the License
+ * file that accompanied this code.
+ *
+ * Modifications:
+ * If applicable, add the following below the License Header, with the fields
+ * enclosed by brackets [] replaced by your own identifying information:
+ * "Portions Copyright [year] [name of copyright owner]"
+ *
+ * Contributor(s):
+ * If you wish your version of this file to be governed by only the CDDL or
+ * only the GPL Version 2, indicate your decision by adding "[Contributor]
+ * elects to include this software in this distribution under the [CDDL or GPL
+ * Version 2] license." If you don't indicate a single choice of license, a
+ * recipient has the option to distribute your version of this file under
+ * either the CDDL, the GPL Version 2 or to extend the choice of license to
+ * its licensees as provided above. However, if you add GPL Version 2 code
+ * and therefore, elected the GPL Version 2 license, then the option applies
+ * only if the new code is made subject to such option by the copyright
+ * holder.
+ */
+
+package javax.activation;
+
+import java.io.*;
+import java.net.*;
+import java.util.*;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import com.sun.activation.registries.MimeTypeFile;
+import com.sun.activation.registries.LogSupport;
+
+/**
+ * This class extends FileTypeMap and provides data typing of files
+ * via their file extension. It uses the
+ *
+ * MIME types file search order:
+ * The MimetypesFileTypeMap looks in various places in the user's
+ * system for MIME types file entries. When requests are made
+ * to search for MIME types in the MimetypesFileTypeMap, it searches
+ * MIME types files in the following order:
+ *
+ * (The current implementation looks for the
+ * MIME types file format:
+ *
+ * The The The
+ * In the application namespace:
+ * java:app/<module-name>/<bean-name>
+ * In the module namespace of the module containing the Managed Bean:
+ * java:module/<bean-name>
+ *
+ */
+ public String value() default "";
+}
diff --git a/fine-third-jdk11/src/javax/annotation/PostConstruct.java b/fine-third-jdk11/src/javax/annotation/PostConstruct.java
new file mode 100644
index 000000000..3be69531e
--- /dev/null
+++ b/fine-third-jdk11/src/javax/annotation/PostConstruct.java
@@ -0,0 +1,97 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2005-2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common Development
+ * and Distribution License("CDDL") (collectively, the "License"). You
+ * may not use this file except in compliance with the License. You can
+ * obtain a copy of the License at
+ * https://oss.oracle.com/licenses/CDDL+GPL-1.1
+ * or LICENSE.txt. See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice in each
+ * file and include the License file at LICENSE.txt.
+ *
+ * GPL Classpath Exception:
+ * Oracle designates this particular file as subject to the "Classpath"
+ * exception as provided by Oracle in the GPL Version 2 section of the License
+ * file that accompanied this code.
+ *
+ * Modifications:
+ * If applicable, add the following below the License Header, with the fields
+ * enclosed by brackets [] replaced by your own identifying information:
+ * "Portions Copyright [year] [name of copyright owner]"
+ *
+ * Contributor(s):
+ * If you wish your version of this file to be governed by only the CDDL or
+ * only the GPL Version 2, indicate your decision by adding "[Contributor]
+ * elects to include this software in this distribution under the [CDDL or GPL
+ * Version 2] license." If you don't indicate a single choice of license, a
+ * recipient has the option to distribute your version of this file under
+ * either the CDDL, the GPL Version 2 or to extend the choice of license to
+ * its licensees as provided above. However, if you add GPL Version 2 code
+ * and therefore, elected the GPL Version 2 license, then the option applies
+ * only if the new code is made subject to such option by the copyright
+ * holder.
+ */
+
+package javax.annotation;
+
+import java.lang.annotation.*;
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+/**
+ * The
+ * void <METHOD>(InvocationContext)
+ *
+ * Object <METHOD>(InvocationContext) throws Exception
+ *
+ * Note: A PostConstruct interceptor method must not throw application
+ * exceptions, but it may be declared to throw checked exceptions including
+ * the java.lang.Exception if the same interceptor method interposes on
+ * business or timeout methods in addition to lifecycle events. If a
+ * PostConstruct interceptor method returns a value, it is ignored by
+ * the container.
+ *
+ * void <METHOD>()
+ *
+ * void <METHOD>(InvocationContext)
+ *
+ * Object <METHOD>(InvocationContext) throws Exception
+ *
+ * Note: A PreDestroy interceptor method must not throw application
+ * exceptions, but it may be declared to throw checked exceptions including
+ * the java.lang.Exception if the same interceptor method interposes on
+ * business or timeout methods in addition to lifecycle events. If a
+ * PreDestroy interceptor method returns a value, it is ignored by
+ * the container.
+ *
+ * void <METHOD>()
+ *
+ * For example, the Interceptors specification defines the use of
+ * priorities on interceptors to control the order in which
+ * interceptors are called.
+ * Priority values should generally be non-negative, with negative values
+ * reserved for special meanings such as "undefined" or "not specified".
+ * A specification that defines use of the
+ * Even though this annotation is not marked Application servers are not required to support any particular
+ * form or type of mapped name, nor the ability to use mapped names.
+ * The mapped name is product-dependent and often installation-dependent.
+ * No use of a mapped name is portable.
+ *
+ * The data source will be registered under the name specified in the
+ *
+ * A JDBC driver implementation class of the appropriate type, either
+ *
+ * DataSource properties should not be specified more than once. If
+ * the url annotation element contains a DataSource property that was also
+ * specified using the corresponding annotation element or was specified in
+ * the properties annotation element, the precedence order is undefined
+ * and implementation specific:
+ *
+ *
+ * In the above example, the
+ * If the
+ *
+ * This would result in the following values being used when configuring
+ * the DataSource:
+ *
+ * Vendors are not required to support properties that do not normally
+ * apply to a specific data source type. For example, specifying the
+ *
+ * Vendor-specific properties may be combined with or used to
+ * override standard data source properties defined using this annotation.
+ *
+ *
+ * Examples:
+ *
+ * Using a
+ * An example lookup of the DataSource from an EJB:
+ *
+ * @see javax.sql.DataSource
+ * @see javax.sql.XADataSource
+ * @see javax.sql.ConnectionPoolDataSource
+ * @since Common Annotations 1.1
+ */
+@Target({ElementType.TYPE})
+@Retention(RetentionPolicy.RUNTIME)
+@Repeatable(DataSourceDefinitions.class)
+public @interface DataSourceDefinition {
+
+ /**
+ * JNDI name by which the data source will be registered.
+ * @since 1.1
+ */
+ String name();
+
+ /**
+ * Name of a DataSource class that implements
+ *
+ *
+ * Default is vendor-specific.
+ * @since 1.1
+ */
+ int isolationLevel() default -1;
+
+ /**
+ * Set to
+ * Default is to enlist in a transaction when one is active or becomes
+ * active.
+ * @since 1.1
+ */
+ boolean transactional() default true;
+
+ /**
+ * Number of connections that should be created when a connection pool
+ * is initialized.
+ *
+ * Default is vendor-specific
+ * @since 1.1
+ */
+ int initialPoolSize() default -1;
+
+ /**
+ * Maximum number of connections that should be concurrently allocated for a
+ * connection pool.
+ *
+ * Default is vendor-specific.
+ * @since 1.1
+ */
+ int maxPoolSize() default -1;
+
+ /**
+ * Minimum number of connections that should be allocated for a
+ * connection pool.
+ *
+ * Default is vendor-specific.
+ * @since 1.1
+ */
+ int minPoolSize() default -1;
+
+ /**
+ * The number of seconds that a physical connection
+ * should remain unused in the pool before the
+ * connection is closed for a connection pool.
+ *
+ * Default is vendor-specific
+ * @since 1.1
+ */
+ int maxIdleTime() default -1;
+
+ /**
+ * The total number of statements that a connection pool should keep open.
+ * A value of 0 indicates that the caching of statements is disabled for
+ * a connection pool.
+ *
+ * Default is vendor-specific
+ * @since 1.1
+ */
+ int maxStatements() default -1;
+ /**
+ * Used to specify vendor-specific properties and less commonly
+ * used
+ *
+ * Properties are specified using the format:
+ * propertyName=propertyValue with one property per array element.
+ *
+ * If a DataSource property is specified in the
+ * Default is vendor-specific.
+ * @since 1.1
+ */
+ int loginTimeout() default 0;
+}
diff --git a/fine-third-jdk11/src/javax/annotation/sql/DataSourceDefinitions.java b/fine-third-jdk11/src/javax/annotation/sql/DataSourceDefinitions.java
new file mode 100644
index 000000000..fbd9d9ae7
--- /dev/null
+++ b/fine-third-jdk11/src/javax/annotation/sql/DataSourceDefinitions.java
@@ -0,0 +1,59 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2009-2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common Development
+ * and Distribution License("CDDL") (collectively, the "License"). You
+ * may not use this file except in compliance with the License. You can
+ * obtain a copy of the License at
+ * https://oss.oracle.com/licenses/CDDL+GPL-1.1
+ * or LICENSE.txt. See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice in each
+ * file and include the License file at LICENSE.txt.
+ *
+ * GPL Classpath Exception:
+ * Oracle designates this particular file as subject to the "Classpath"
+ * exception as provided by Oracle in the GPL Version 2 section of the License
+ * file that accompanied this code.
+ *
+ * Modifications:
+ * If applicable, add the following below the License Header, with the fields
+ * enclosed by brackets [] replaced by your own identifying information:
+ * "Portions Copyright [year] [name of copyright owner]"
+ *
+ * Contributor(s):
+ * If you wish your version of this file to be governed by only the CDDL or
+ * only the GPL Version 2, indicate your decision by adding "[Contributor]
+ * elects to include this software in this distribution under the [CDDL or GPL
+ * Version 2] license." If you don't indicate a single choice of license, a
+ * recipient has the option to distribute your version of this file under
+ * either the CDDL, the GPL Version 2 or to extend the choice of license to
+ * its licensees as provided above. However, if you add GPL Version 2 code
+ * and therefore, elected the GPL Version 2 license, then the option applies
+ * only if the new code is made subject to such option by the copyright
+ * holder.
+ */
+
+package javax.annotation.sql;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.RetentionPolicy;
+
+/**
+ * Declares one or more
+ * The location supports 2 formats:
+ *
+ * For SOAP bindings, this determines the value of the soap action.
+ */
+ String action() default "";
+
+ /**
+ * Marks a method to NOT be exposed as a web method.
+ *
+ * Used to stop an inherited method from being exposed as part of this web service.
+ * If this element is specified, other elements MUST NOT be specified for the @WebMethod.
+ *
+ * This member-value is not allowed on endpoint interfaces.
+ *
+ * @since 2.0
+ */
+ boolean exclude() default false;
+};
diff --git a/fine-third-jdk11/src/javax/jws/WebParam.java b/fine-third-jdk11/src/javax/jws/WebParam.java
new file mode 100644
index 000000000..46dd4eceb
--- /dev/null
+++ b/fine-third-jdk11/src/javax/jws/WebParam.java
@@ -0,0 +1,87 @@
+package javax.jws;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+/**
+ * Customizes the mapping of an individual parameter to a Web Service message part and XML element.
+ *
+ * @author Copyright (c) 2004 by BEA Systems, Inc. All Rights Reserved.
+ *
+ * @since 1.6
+ */
+@Retention(value = RetentionPolicy.RUNTIME)
+@Target(value = {ElementType.PARAMETER})
+public @interface WebParam {
+
+ /**
+ * The direction in which the parameter flows
+ */
+ public enum Mode {
+ IN,
+ OUT,
+ INOUT
+ };
+
+ /**
+ * Name of the parameter.
+ *
+ * If the operation is rpc style and @WebParam.partName has not been specified, this is name of the wsdl:part
+ * representing the parameter.
+ *
+ * A name MUST be specified if the operation is document style, the parameter style is BARE, and the mode is OUT
+ * or INOUT.
+ *
+ * @specdefault
+ * If the operation is document style and the parameter style is BARE, {@code @WebMethod.operationName}.
+ * This is only used if the operation is rpc style or if the operation is document style and the parameter style
+ * is BARE.
+ *
+ * @specdefault {@code @WebParam.name}
+ *
+ * @since 2.0
+ */
+ String partName() default "";
+
+ /**
+ * The XML namespace for the parameter.
+ *
+ * Only used if the operation is document style or the paramater maps to a header.
+ * If the target namespace is set to "", this represents the empty namespace.
+ *
+ * @specdefault
+ * If the operation is document style, the parameter style is WRAPPED, and the parameter does not map to a
+ * header, the empty namespace.
+ * The OUT and INOUT modes may only be specified for parameter types that conform to the definition of Holder types
+ * (JAX-WS 2.0 [5], section 2.3.3). Parameters that are Holder Types MUST be OUT or INOUT.
+ *
+ * @specdefault
+ * INOUT if a Holder type.
+ * If the operation is rpc style and @WebResult.partName has not been specified, this is the name of the wsdl:part
+ * representing the return value.
+ *
+ * This is only used if the operation is rpc style, or if the operation is document style and the parameter style
+ * is BARE.
+ *
+ * @specdefault {@code @WebResult.name}
+ *
+ * @since 2.0
+ */
+ String partName() default "";
+
+ /**
+ * The XML namespace for the return value.
+ *
+ * Only used if the operation is document style or the return value maps to a header.
+ * If the target namespace is set to ��, this represents the empty namespace.
+ *
+ * @specdefault
+ * If the operation is document style, the parameter style is WRAPPED, and the return value does not map to a
+ * header, the empty namespace.
+ * Used as the name of the wsdl:portType when mapped to WSDL 1.1.
+ *
+ * @specdefault The simple name of the Java class or interface.
+ */
+ String name() default "";
+
+ /**
+ * If the @WebService.targetNamespace annotation is on a service endpoint interface, the targetNamespace is used
+ * for the namespace for the wsdl:portType (and associated XML elements).
+ *
+ * If the @WebService.targetNamespace annotation is on a service implementation bean that does NOT reference a
+ * service endpoint interface (through the endpointInterface attribute), the targetNamespace is used for both the
+ * wsdl:portType and the wsdl:service (and associated XML elements).
+ *
+ * If the @WebService.targetNamespace annotation is on a service implementation bean that does reference a service
+ * endpoint interface (through the endpointInterface attribute), the targetNamespace is used for only the
+ * wsdl:service (and associated XML elements).
+ *
+ * @specdefault Implementation-defined, as described in JAX-WS 2.0 [5], section 3.2.
+ */
+ String targetNamespace() default "";
+
+ /**
+ * The service name of the Web Service.
+ *
+ * Used as the name of the wsdl:service when mapped to WSDL 1.1.
+ *
+ * This member-value is not allowed on endpoint interfaces.
+ *
+ * @specdefault The simple name of the Java class + Service".
+ */
+ String serviceName() default "";
+
+ /**
+ * The port name of the Web Service.
+ *
+ * Used as the name of the wsdl:port when mapped to WSDL 1.1.
+ *
+ * This member-value is not allowed on endpoint interfaces.
+ *
+ * @specdefault {@code @WebService.name}+Port.
+ *
+ * @since 2.0
+ */
+ String portName() default "";
+
+ /**
+ * The location of a pre-defined WSDL describing the service.
+ *
+ * The wsdlLocation is a URL (relative or absolute) that refers to a pre-existing WSDL file. The presence of a
+ * wsdlLocation value indicates that the service implementation bean is implementing a pre-defined WSDL contract.
+ * The JSR-181 tool MUST provide feedback if the service implementation bean is inconsistent with the portType and
+ * bindings declared in this WSDL. Note that a single WSDL file might contain multiple portTypes and multiple
+ * bindings. The annotations on the service implementation bean determine the specific portType and bindings that
+ * correspond to the Web Service.
+ */
+ String wsdlLocation() default "";
+
+ /**
+ * The complete name of the service endpoint interface defining the service�s abstract Web Service contract.
+ *
+ * This annotation allows the developer to separate the interface contract from the implementation. If this
+ * annotation is present, the service endpoint interface is used to determine the abstract WSDL contract (portType
+ * and bindings). The service endpoint interface MAY include JSR-181 annotations to customize the mapping from
+ * Java to WSDL.
+ *
+ * This member-value is not allowed on endpoint interfaces.
+ */
+ String endpointInterface() default "";
+};
diff --git a/fine-third-jdk11/src/javax/jws/javaee_web_services_metadata_handler_2_0.xsd b/fine-third-jdk11/src/javax/jws/javaee_web_services_metadata_handler_2_0.xsd
new file mode 100644
index 000000000..1ec629906
--- /dev/null
+++ b/fine-third-jdk11/src/javax/jws/javaee_web_services_metadata_handler_2_0.xsd
@@ -0,0 +1,77 @@
+
+
+ * The @SOAPMessageHandlers annotation is an array of SOAPMessageHandler types. The handlers are run in the order in
+ * which they appear in the annotation, starting with the first handler in the array.
+ *
+ * @deprecated As of JSR-181 2.0 with no replacement.
+ *
+ * @author Copyright (c) 2004 by BEA Systems, Inc. All Rights Reserved.
+ *
+ * @since 1.6
+ */
+@Retention(value = RetentionPolicy.RUNTIME)
+@Target(value = {ElementType.TYPE})
+@Deprecated public @interface SOAPMessageHandlers {
+
+ SOAPMessageHandler[] value();
+};
diff --git a/fine-third-jdk11/src/javax/jws/soap/package.html b/fine-third-jdk11/src/javax/jws/soap/package.html
new file mode 100644
index 000000000..4b6c26368
--- /dev/null
+++ b/fine-third-jdk11/src/javax/jws/soap/package.html
@@ -0,0 +1,52 @@
+
+
+
+ * An instance of this class maintains the association between XML nodes of
+ * an infoset preserving view and a JAXB representation of an XML document.
+ * Navigation between the two views is provided by the methods
+ * {@link #getXMLNode(Object)} and {@link #getJAXBNode(Object)}.
+ *
+ *
+ * Modifications can be made to either the infoset preserving view or the
+ * JAXB representation of the document while the other view remains
+ * unmodified. The binder is able to synchronize the changes made in the
+ * modified view back into the other view using the appropriate
+ * Binder update methods, {@link #updateXML(Object, Object)} or
+ * {@link #updateJAXB(Object)}.
+ *
+ *
+ * A typical usage scenario is the following:
+ *
+ * A Binder instance is created using the factory method
+ * {@link JAXBContext#createBinder()} or {@link JAXBContext#createBinder(Class)}.
+ *
+ *
+ * The template parameter,
+ * This method is similar to {@link Unmarshaller#unmarshal(Node)}
+ * with the addition of maintaining the association between XML nodes
+ * and the produced JAXB objects, enabling future update operations,
+ * {@link #updateXML(Object, Object)} or {@link #updateJAXB(Object)}.
+ *
+ *
+ * When {@link #getSchema()} is non-null,
+ * This method throws {@link UnmarshalException} when the Binder's
+ * {@link JAXBContext} does not have a mapping for the XML element name
+ * or the type, specifiable via {@code @xsi:type}, of {@code xmlNode}
+ * to a JAXB mapped class. The method {@link #unmarshal(Object, Class)}
+ * enables an application to specify the JAXB mapped class that
+ * the {@code xmlNode} should be mapped to.
+ *
+ * @param xmlNode
+ * the document/element to unmarshal XML data from.
+ *
+ * @return
+ * the newly created root object of the JAXB object tree.
+ *
+ * @throws JAXBException
+ * If any unexpected errors occur while unmarshalling
+ * @throws UnmarshalException
+ * If the {@link ValidationEventHandler ValidationEventHandler}
+ * returns false from its {@code handleEvent} method or the
+ * {@code Binder} is unable to perform the XML to Java
+ * binding.
+ * @throws IllegalArgumentException
+ * If the node parameter is null
+ */
+ public abstract Object unmarshal( XmlNode xmlNode ) throws JAXBException;
+
+ /**
+ * Unmarshal XML root element by provided {@code declaredType}
+ * to a JAXB object tree.
+ *
+ *
+ * Implements Unmarshal by Declared Type
+ *
+ *
+ * This method is similar to {@link Unmarshaller#unmarshal(Node, Class)}
+ * with the addition of maintaining the association between XML nodes
+ * and the produced JAXB objects, enabling future update operations,
+ * {@link #updateXML(Object, Object)} or {@link #updateJAXB(Object)}.
+ *
+ *
+ * When {@link #getSchema()} is non-null,
+ * This method is similar to {@link Marshaller#marshal(Object, Node)}
+ * with the addition of maintaining the association between JAXB objects
+ * and the produced XML nodes,
+ * enabling future update operations such as
+ * {@link #updateXML(Object, Object)} or {@link #updateJAXB(Object)}.
+ *
+ *
+ * When {@link #getSchema()} is non-null, the marshalled
+ * xml content is validated during this operation.
+ *
+ * @param jaxbObject
+ * The content tree to be marshalled.
+ * @param xmlNode
+ * The parameter must be a Node that accepts children.
+ *
+ * @throws JAXBException
+ * If any unexpected problem occurs during the marshalling.
+ * @throws MarshalException
+ * If the {@link ValidationEventHandler ValidationEventHandler}
+ * returns false from its {@code handleEvent} method or the
+ * {@code Binder} is unable to marshal {@code jaxbObject} (or any
+ * object reachable from {@code jaxbObject}).
+ *
+ * @throws IllegalArgumentException
+ * If any of the method parameters are null
+ */
+ public abstract void marshal( Object jaxbObject, XmlNode xmlNode ) throws JAXBException;
+
+ /**
+ * Gets the XML element associated with the given JAXB object.
+ *
+ *
+ * Once a JAXB object tree is associated with an XML fragment,
+ * this method enables navigation between the two trees.
+ *
+ *
+ * An association between an XML element and a JAXB object is
+ * established by the bind methods and the update methods.
+ * Note that this association is partial; not all XML elements
+ * have associated JAXB objects, and not all JAXB objects have
+ * associated XML elements.
+ *
+ * @param jaxbObject An instance that is reachable from a prior
+ * call to a bind or update method that returned
+ * a JAXB object tree.
+ *
+ * @return
+ * null if the specified JAXB object is not known to this
+ * {@link Binder}, or if it is not associated with an
+ * XML element.
+ *
+ * @throws IllegalArgumentException
+ * If the jaxbObject parameter is null
+ */
+ public abstract XmlNode getXMLNode( Object jaxbObject );
+
+ /**
+ * Gets the JAXB object associated with the given XML element.
+ *
+ *
+ * Once a JAXB object tree is associated with an XML fragment,
+ * this method enables navigation between the two trees.
+ *
+ *
+ * An association between an XML element and a JAXB object is
+ * established by the unmarshal, marshal and update methods.
+ * Note that this association is partial; not all XML elements
+ * have associated JAXB objects, and not all JAXB objects have
+ * associated XML elements.
+ *
+ * @return
+ * null if the specified XML node is not known to this
+ * {@link Binder}, or if it is not associated with a
+ * JAXB object.
+ *
+ * @throws IllegalArgumentException
+ * If the node parameter is null
+ */
+ public abstract Object getJAXBNode( XmlNode xmlNode );
+
+ /**
+ * Takes an JAXB object and updates
+ * its associated XML node and its descendants.
+ *
+ *
+ * This is a convenience method of:
+ *
+ * This operation can be thought of as an "in-place" marshalling.
+ * The difference is that instead of creating a whole new XML tree,
+ * this operation updates an existing tree while trying to preserve
+ * the XML as much as possible.
+ *
+ *
+ * For example, unknown elements/attributes in XML that were not bound
+ * to JAXB will be left untouched (whereas a marshalling operation
+ * would create a new tree that doesn't contain any of those.)
+ *
+ *
+ * As a side-effect, this operation updates the association between
+ * XML nodes and JAXB objects.
+ *
+ * @param jaxbObject root of potentially modified JAXB object tree
+ * @param xmlNode root of update target XML parse tree
+ *
+ * @return
+ * Returns the updated XML node. Typically, this is the same
+ * node you passed in as xmlNode, but it maybe
+ * a different object, for example when the tag name of the object
+ * has changed.
+ *
+ * @throws JAXBException
+ * If any unexpected problem occurs updating corresponding XML content.
+ * @throws IllegalArgumentException
+ * If any of the input parameters are null
+ */
+ public abstract XmlNode updateXML( Object jaxbObject, XmlNode xmlNode ) throws JAXBException;
+
+ /**
+ * Takes an XML node and updates its associated JAXB object and its descendants.
+ *
+ *
+ * This operation can be thought of as an "in-place" unmarshalling.
+ * The difference is that instead of creating a whole new JAXB tree,
+ * this operation updates an existing tree, reusing as much JAXB objects
+ * as possible.
+ *
+ *
+ * As a side-effect, this operation updates the association between
+ * XML nodes and JAXB objects.
+ *
+ * @return
+ * Returns the updated JAXB object. Typically, this is the same
+ * object that was returned from earlier
+ * {@link #marshal(Object,Object)} or
+ * {@link #updateJAXB(Object)} method invocation,
+ * but it maybe
+ * a different object, for example when the name of the XML
+ * element has changed.
+ *
+ * @throws JAXBException
+ * If any unexpected problem occurs updating corresponding JAXB mapped content.
+ * @throws IllegalArgumentException
+ * If node parameter is null
+ */
+ public abstract Object updateJAXB( XmlNode xmlNode ) throws JAXBException;
+
+
+ /**
+ * Specifies whether marshal, unmarshal and update methods
+ * performs validation on their XML content.
+ *
+ * @param schema set to null to disable validation.
+ *
+ * @see Unmarshaller#setSchema(Schema)
+ */
+ public abstract void setSchema( Schema schema );
+
+ /**
+ * Gets the last {@link Schema} object (including null) set by the
+ * {@link #setSchema(Schema)} method.
+ *
+ * @return the Schema object for validation or null if not present
+ */
+ public abstract Schema getSchema();
+
+ /**
+ * Allow an application to register a {@code ValidationEventHandler}.
+ *
+ * The {@code ValidationEventHandler} will be called by the JAXB Provider
+ * if any validation errors are encountered during calls to any of the
+ * Binder unmarshal, marshal and update methods.
+ *
+ *
+ * Calling this method with a null parameter will cause the Binder
+ * to revert back to the default default event handler.
+ *
+ * @param handler the validation event handler
+ * @throws JAXBException if an error was encountered while setting the
+ * event handler
+ */
+ public abstract void setEventHandler( ValidationEventHandler handler ) throws JAXBException;
+
+ /**
+ * Return the current event handler or the default event handler if one
+ * hasn't been set.
+ *
+ * @return the current ValidationEventHandler or the default event handler
+ * if it hasn't been set
+ * @throws JAXBException if an error was encountered while getting the
+ * current event handler
+ */
+ public abstract ValidationEventHandler getEventHandler() throws JAXBException;
+
+ /**
+ *
+ * Set the particular property in the underlying implementation of
+ * {@code Binder}. This method can only be used to set one of
+ * the standard JAXB defined unmarshal/marshal properties
+ * or a provider specific property for binder, unmarshal or marshal.
+ * Attempting to set an undefined property will result in
+ * a PropertyException being thrown. See
+ * Supported Unmarshal Properties
+ * and
+ * Supported Marshal Properties.
+ *
+ * @param name the name of the property to be set. This value can either
+ * be specified using one of the constant fields or a user
+ * supplied string.
+ * @param value the value of the property to be set
+ *
+ * @throws PropertyException when there is an error processing the given
+ * property or value
+ * @throws IllegalArgumentException
+ * If the name parameter is null
+ */
+ abstract public void setProperty( String name, Object value ) throws PropertyException;
+
+
+ /**
+ * Get the particular property in the underlying implementation of
+ * {@code Binder}. This method can only
+ * be used to get one of
+ * the standard JAXB defined unmarshal/marshal properties
+ * or a provider specific property for binder, unmarshal or marshal.
+ * Attempting to get an undefined property will result in
+ * a PropertyException being thrown. See
+ * Supported Unmarshal Properties
+ * and
+ * Supported Marshal Properties.
+ *
+ * @param name the name of the property to retrieve
+ * @return the value of the requested property
+ *
+ * @throws PropertyException
+ * when there is an error retrieving the given property or value
+ * property name
+ * @throws IllegalArgumentException
+ * If the name parameter is null
+ */
+ abstract public Object getProperty( String name ) throws PropertyException;
+
+}
diff --git a/fine-third-jdk11/src/javax/xml/bind/ContextFinder.java b/fine-third-jdk11/src/javax/xml/bind/ContextFinder.java
new file mode 100644
index 000000000..97769a9cc
--- /dev/null
+++ b/fine-third-jdk11/src/javax/xml/bind/ContextFinder.java
@@ -0,0 +1,672 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2003-2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common Development
+ * and Distribution License("CDDL") (collectively, the "License"). You
+ * may not use this file except in compliance with the License. You can
+ * obtain a copy of the License at
+ * https://oss.oracle.com/licenses/CDDL+GPL-1.1
+ * or LICENSE.txt. See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice in each
+ * file and include the License file at LICENSE.txt.
+ *
+ * GPL Classpath Exception:
+ * Oracle designates this particular file as subject to the "Classpath"
+ * exception as provided by Oracle in the GPL Version 2 section of the License
+ * file that accompanied this code.
+ *
+ * Modifications:
+ * If applicable, add the following below the License Header, with the fields
+ * enclosed by brackets [] replaced by your own identifying information:
+ * "Portions Copyright [year] [name of copyright owner]"
+ *
+ * Contributor(s):
+ * If you wish your version of this file to be governed by only the CDDL or
+ * only the GPL Version 2, indicate your decision by adding "[Contributor]
+ * elects to include this software in this distribution under the [CDDL or GPL
+ * Version 2] license." If you don't indicate a single choice of license, a
+ * recipient has the option to distribute your version of this file under
+ * either the CDDL, the GPL Version 2 or to extend the choice of license to
+ * its licensees as provided above. However, if you add GPL Version 2 code
+ * and therefore, elected the GPL Version 2 license, then the option applies
+ * only if the new code is made subject to such option by the copyright
+ * holder.
+ */
+
+package javax.xml.bind;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.net.URL;
+import java.security.AccessController;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
+import java.util.Map;
+import java.util.Properties;
+import java.util.StringTokenizer;
+import java.util.logging.ConsoleHandler;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+
+/**
+ * This class is package private and therefore is not exposed as part of the
+ * JAXB API.
+ *
+ * This code is designed to implement the JAXB 1.0 spec pluggability feature
+ *
+ * @author
+ * When the user bundles his own JAXB implementation, we'd like to use it, and we
+ * want the platform default to be used only when there's no other JAXB provider.
+ *
+ *
+ * For this reason, we have to hard-code the class name into the API.
+ */
+ private static final String PLATFORM_DEFAULT_FACTORY_CLASS = "com.sun.xml.internal.bind.v2.ContextFactory";
+
+ // previous value of JAXBContext.JAXB_CONTEXT_FACTORY, using also this to ensure backwards compatibility
+ private static final String JAXB_CONTEXT_FACTORY_DEPRECATED = "javax.xml.bind.context.factory";
+
+ private static final Logger logger;
+
+ static {
+ logger = Logger.getLogger("javax.xml.bind");
+ try {
+ if (AccessController.doPrivileged(new GetPropertyAction("jaxb.debug")) != null) {
+ // disconnect the logger from a bigger framework (if any)
+ // and take the matters into our own hands
+ logger.setUseParentHandlers(false);
+ logger.setLevel(Level.ALL);
+ ConsoleHandler handler = new ConsoleHandler();
+ handler.setLevel(Level.ALL);
+ logger.addHandler(handler);
+ } else {
+ // don't change the setting of this logger
+ // to honor what other frameworks
+ // have done on configurations.
+ }
+ } catch (Throwable t) {
+ // just to be extra safe. in particular System.getProperty may throw
+ // SecurityException.
+ }
+ }
+
+ private static ServiceLoaderUtil.ExceptionHandlertrue
if there are more tokens available from this
+ * tokenizer's string; false
otherwise.
+ */
+ public boolean hasMoreTokens() {
+ if (stack.size() > 0)
+ return true;
+ skipWhiteSpace();
+ return (currentPosition < maxPosition);
+ }
+
+ /**
+ * Returns the next token from this tokenizer.
+ *
+ * @return the next token from this tokenizer.
+ * @exception NoSuchElementException if there are no more tokens in this
+ * tokenizer's string.
+ */
+ public String nextToken() {
+ int size = stack.size();
+ if (size > 0) {
+ String t = (String)stack.elementAt(size - 1);
+ stack.removeElementAt(size - 1);
+ return t;
+ }
+ skipWhiteSpace();
+
+ if (currentPosition >= maxPosition) {
+ throw new NoSuchElementException();
+ }
+
+ int start = currentPosition;
+ char c = str.charAt(start);
+ if (c == '"') {
+ currentPosition++;
+ boolean filter = false;
+ while (currentPosition < maxPosition) {
+ c = str.charAt(currentPosition++);
+ if (c == '\\') {
+ currentPosition++;
+ filter = true;
+ } else if (c == '"') {
+ String s;
+
+ if (filter) {
+ StringBuffer sb = new StringBuffer();
+ for (int i = start + 1; i < currentPosition - 1; i++) {
+ c = str.charAt(i);
+ if (c != '\\')
+ sb.append(c);
+ }
+ s = sb.toString();
+ } else
+ s = str.substring(start + 1, currentPosition - 1);
+ return s;
+ }
+ }
+ } else if (singles.indexOf(c) >= 0) {
+ currentPosition++;
+ } else {
+ while ((currentPosition < maxPosition) &&
+ singles.indexOf(str.charAt(currentPosition)) < 0 &&
+ !Character.isWhitespace(str.charAt(currentPosition))) {
+ currentPosition++;
+ }
+ }
+ return str.substring(start, currentPosition);
+ }
+
+ public void pushToken(String token) {
+ stack.addElement(token);
+ }
+}
diff --git a/fine-third-jdk11/src/com/sun/activation/viewers/ImageViewer.java b/fine-third-jdk11/src/com/sun/activation/viewers/ImageViewer.java
new file mode 100644
index 000000000..eea8adde7
--- /dev/null
+++ b/fine-third-jdk11/src/com/sun/activation/viewers/ImageViewer.java
@@ -0,0 +1,138 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common Development
+ * and Distribution License("CDDL") (collectively, the "License"). You
+ * may not use this file except in compliance with the License. You can
+ * obtain a copy of the License at
+ * https://oss.oracle.com/licenses/CDDL+GPL-1.1
+ * or LICENSE.txt. See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice in each
+ * file and include the License file at LICENSE.txt.
+ *
+ * GPL Classpath Exception:
+ * Oracle designates this particular file as subject to the "Classpath"
+ * exception as provided by Oracle in the GPL Version 2 section of the License
+ * file that accompanied this code.
+ *
+ * Modifications:
+ * If applicable, add the following below the License Header, with the fields
+ * enclosed by brackets [] replaced by your own identifying information:
+ * "Portions Copyright [year] [name of copyright owner]"
+ *
+ * Contributor(s):
+ * If you wish your version of this file to be governed by only the CDDL or
+ * only the GPL Version 2, indicate your decision by adding "[Contributor]
+ * elects to include this software in this distribution under the [CDDL or GPL
+ * Version 2] license." If you don't indicate a single choice of license, a
+ * recipient has the option to distribute your version of this file under
+ * either the CDDL, the GPL Version 2 or to extend the choice of license to
+ * its licensees as provided above. However, if you add GPL Version 2 code
+ * and therefore, elected the GPL Version 2 license, then the option applies
+ * only if the new code is made subject to such option by the copyright
+ * holder.
+ */
+
+package com.sun.activation.viewers;
+
+import java.awt.*;
+import java.io.*;
+import java.beans.*;
+import javax.activation.*;
+
+public class ImageViewer extends Panel implements CommandObject {
+ // UI Vars...
+ private ImageViewerCanvas canvas = null;
+
+ // File Vars
+ // private InputStream data_ins = null;
+ private Image image = null;
+ private DataHandler _dh = null;
+
+ private boolean DEBUG = false;
+ /**
+ * Constructor
+ */
+ public ImageViewer(){
+
+ // create the ImageViewerCanvas
+ canvas = new ImageViewerCanvas();
+ add(canvas);
+ }
+ /**
+ * Set the DataHandler for this CommandObject
+ * @param DataHandler the DataHandler
+ */
+ public void setCommandContext(String verb, DataHandler dh) throws IOException{
+ _dh = dh;
+ this.setInputStream( _dh.getInputStream() );
+ }
+ //--------------------------------------------------------------------
+
+ /**
+ * Set the data stream, component to assume it is ready to
+ * be read.
+ */
+ private void setInputStream(InputStream ins) throws IOException {
+ MediaTracker mt = new MediaTracker(this);
+ int bytes_read = 0;
+ byte data[] = new byte[1024];
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+
+ while((bytes_read = ins.read(data)) >0)
+ baos.write(data, 0, bytes_read);
+ ins.close();
+
+ // convert the buffer into an image
+ image = getToolkit().createImage(baos.toByteArray());
+
+ mt.addImage(image, 0);
+
+ try {
+ mt.waitForID(0);
+ mt.waitForAll();
+ if(mt.statusID(0, true ) != MediaTracker.COMPLETE){
+ System.out.println("Error occured in image loading = " +
+ mt.getErrorsID(0));
+
+ }
+
+ }
+ catch(InterruptedException e) {
+ throw new IOException("Error reading image data");
+ }
+
+ canvas.setImage(image);
+ if(DEBUG)
+ System.out.println("calling invalidate");
+
+ }
+ //--------------------------------------------------------------------
+ public void addNotify(){
+ super.addNotify(); // call the real one first...
+ this.invalidate();
+ this.validate();
+ this.doLayout();
+ }
+ //--------------------------------------------------------------------
+ public Dimension getPreferredSize(){
+ return canvas.getPreferredSize();
+ }
+
+}
+
+
+
+
+
+
+
+
+
+
+
diff --git a/fine-third-jdk11/src/com/sun/activation/viewers/ImageViewerCanvas.java b/fine-third-jdk11/src/com/sun/activation/viewers/ImageViewerCanvas.java
new file mode 100644
index 000000000..54f897c12
--- /dev/null
+++ b/fine-third-jdk11/src/com/sun/activation/viewers/ImageViewerCanvas.java
@@ -0,0 +1,95 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common Development
+ * and Distribution License("CDDL") (collectively, the "License"). You
+ * may not use this file except in compliance with the License. You can
+ * obtain a copy of the License at
+ * https://oss.oracle.com/licenses/CDDL+GPL-1.1
+ * or LICENSE.txt. See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice in each
+ * file and include the License file at LICENSE.txt.
+ *
+ * GPL Classpath Exception:
+ * Oracle designates this particular file as subject to the "Classpath"
+ * exception as provided by Oracle in the GPL Version 2 section of the License
+ * file that accompanied this code.
+ *
+ * Modifications:
+ * If applicable, add the following below the License Header, with the fields
+ * enclosed by brackets [] replaced by your own identifying information:
+ * "Portions Copyright [year] [name of copyright owner]"
+ *
+ * Contributor(s):
+ * If you wish your version of this file to be governed by only the CDDL or
+ * only the GPL Version 2, indicate your decision by adding "[Contributor]
+ * elects to include this software in this distribution under the [CDDL or GPL
+ * Version 2] license." If you don't indicate a single choice of license, a
+ * recipient has the option to distribute your version of this file under
+ * either the CDDL, the GPL Version 2 or to extend the choice of license to
+ * its licensees as provided above. However, if you add GPL Version 2 code
+ * and therefore, elected the GPL Version 2 license, then the option applies
+ * only if the new code is made subject to such option by the copyright
+ * holder.
+ */
+
+package com.sun.activation.viewers;
+
+import java.awt.*;
+
+public class ImageViewerCanvas extends Canvas
+{
+ private Image canvas_image = null;
+
+ /**
+ * The constructor
+ */
+ public ImageViewerCanvas()
+ {
+
+ }
+
+ /**
+ * set the image
+ */
+ public void setImage(Image new_image)
+ {
+ canvas_image = new_image;
+ this.invalidate();
+ this.repaint();
+ }
+
+ /**
+ * getPreferredSize
+ */
+ public Dimension getPreferredSize()
+ {
+ Dimension d = null;
+
+ if(canvas_image == null)
+ {
+ d = new Dimension(200, 200);
+ }
+ else
+ d = new Dimension(canvas_image.getWidth(this),
+ canvas_image.getHeight(this));
+
+ return d;
+ }
+ /**
+ * paint method
+ */
+ public void paint(Graphics g)
+ {
+
+ if(canvas_image != null)
+ g.drawImage(canvas_image, 0, 0, this);
+
+ }
+
+}
diff --git a/fine-third-jdk11/src/com/sun/activation/viewers/TextEditor.java b/fine-third-jdk11/src/com/sun/activation/viewers/TextEditor.java
new file mode 100644
index 000000000..66a153faa
--- /dev/null
+++ b/fine-third-jdk11/src/com/sun/activation/viewers/TextEditor.java
@@ -0,0 +1,203 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common Development
+ * and Distribution License("CDDL") (collectively, the "License"). You
+ * may not use this file except in compliance with the License. You can
+ * obtain a copy of the License at
+ * https://oss.oracle.com/licenses/CDDL+GPL-1.1
+ * or LICENSE.txt. See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice in each
+ * file and include the License file at LICENSE.txt.
+ *
+ * GPL Classpath Exception:
+ * Oracle designates this particular file as subject to the "Classpath"
+ * exception as provided by Oracle in the GPL Version 2 section of the License
+ * file that accompanied this code.
+ *
+ * Modifications:
+ * If applicable, add the following below the License Header, with the fields
+ * enclosed by brackets [] replaced by your own identifying information:
+ * "Portions Copyright [year] [name of copyright owner]"
+ *
+ * Contributor(s):
+ * If you wish your version of this file to be governed by only the CDDL or
+ * only the GPL Version 2, indicate your decision by adding "[Contributor]
+ * elects to include this software in this distribution under the [CDDL or GPL
+ * Version 2] license." If you don't indicate a single choice of license, a
+ * recipient has the option to distribute your version of this file under
+ * either the CDDL, the GPL Version 2 or to extend the choice of license to
+ * its licensees as provided above. However, if you add GPL Version 2 code
+ * and therefore, elected the GPL Version 2 license, then the option applies
+ * only if the new code is made subject to such option by the copyright
+ * holder.
+ */
+
+package com.sun.activation.viewers;
+
+import java.awt.*;
+import java.awt.event.*;
+import java.io.*;
+import java.beans.*;
+import javax.activation.*;
+
+public class TextEditor extends Panel implements CommandObject,
+ ActionListener {
+ // UI Vars...
+ private TextArea text_area = null;
+ private GridBagLayout panel_gb = null;
+ private Panel button_panel = null;
+ private Button save_button = null;
+ // File Vars
+ private File text_file = null;
+ private String text_buffer = null;
+ private InputStream data_ins = null;
+ private FileInputStream fis = null;
+
+ private DataHandler _dh = null;
+ private boolean DEBUG = false;
+ /**
+ * Constructor
+ */
+ public TextEditor() {
+ panel_gb = new GridBagLayout();
+ setLayout(panel_gb);
+
+ button_panel = new Panel();
+ // button_panel.setBackground(Color.white);
+ button_panel.setLayout( new FlowLayout() );
+ save_button = new Button("SAVE");
+ button_panel.add(save_button);
+ addGridComponent(this,
+ button_panel,
+ panel_gb,
+ 0,0,
+ 1,1,
+ 1,0);
+
+ // create the text area
+ text_area = new TextArea("This is text",24, 80,
+ TextArea.SCROLLBARS_VERTICAL_ONLY );
+ // text_area.setBackground(Color.lightGray);
+ text_area.setEditable( true );
+
+ addGridComponent(this,
+ text_area,
+ panel_gb,
+ 0,1,
+ 1,2,
+ 1,1);
+
+ // add listeners
+ save_button.addActionListener( this );
+
+ }
+
+ ////////////////////////////////////////////////////////////////////////
+ /**
+ * adds a component to our gridbag layout
+ */
+ private void addGridComponent(Container cont,
+ Component comp,
+ GridBagLayout mygb,
+ int gridx,
+ int gridy,
+ int gridw,
+ int gridh,
+ int weightx,
+ int weighty) {
+ GridBagConstraints c = new GridBagConstraints();
+ c.gridx = gridx;
+ c.gridy = gridy;
+ c.gridwidth = gridw;
+ c.gridheight = gridh;
+ c.fill = GridBagConstraints.BOTH;
+ c.weighty = weighty;
+ c.weightx = weightx;
+ c.anchor = GridBagConstraints.CENTER;
+ mygb.setConstraints(comp, c);
+ cont.add(comp);
+ }
+
+ //--------------------------------------------------------------------
+ public void setCommandContext(String verb, DataHandler dh) throws IOException {
+ _dh = dh;
+ this.setInputStream( _dh.getInputStream() );
+
+ }
+ //--------------------------------------------------------------------
+
+ /**
+ * set the data stream, component to assume it is ready to
+ * be read.
+ */
+ public void setInputStream(InputStream ins) throws IOException {
+
+ byte data[] = new byte[1024];
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ int bytes_read = 0;
+ // check that we can actually read
+
+ while((bytes_read = ins.read(data)) >0)
+ baos.write(data, 0, bytes_read);
+ ins.close();
+
+
+ // convert the buffer into a string
+ // popuplate the buffer
+ text_buffer = baos.toString();
+
+ // place in the text area
+ text_area.setText(text_buffer);
+ }
+ ///////////////////////////////////////////////////////////////////////
+ private void performSaveOperation(){
+ OutputStream fos = null;
+ try {
+ fos = _dh.getOutputStream();
+ } catch (Exception e) {}
+
+ String buffer = text_area.getText();
+
+ // make sure we got one
+ if(fos == null) {
+ System.out.println("Invalid outputstream in TextEditor!");
+ System.out.println("not saving!");
+ return;
+ }
+
+ try {
+ fos.write( buffer.getBytes() );
+ fos.flush(); // flush it!
+ fos.close(); // close it!
+ } catch(IOException e)
+ {
+ System.out.println("TextEditor Save Operation failed with: " + e);
+ }
+
+ }
+ //--------------------------------------------------------------------
+ public void addNotify() {
+ super.addNotify();
+ invalidate();
+ }
+ //--------------------------------------------------------------------
+ public Dimension getPreferredSize() {
+ return text_area.getMinimumSize(24, 80);
+ }
+ /////////////////////////////////////////////////////////////////////
+ // for ActionListener
+ public void actionPerformed(ActionEvent evt){
+ if(evt.getSource() == save_button) { // save button pressed!
+
+ // Save ourselves
+ this.performSaveOperation();
+ }
+ }
+
+}
diff --git a/fine-third-jdk11/src/com/sun/activation/viewers/TextViewer.java b/fine-third-jdk11/src/com/sun/activation/viewers/TextViewer.java
new file mode 100644
index 000000000..6019fc795
--- /dev/null
+++ b/fine-third-jdk11/src/com/sun/activation/viewers/TextViewer.java
@@ -0,0 +1,118 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common Development
+ * and Distribution License("CDDL") (collectively, the "License"). You
+ * may not use this file except in compliance with the License. You can
+ * obtain a copy of the License at
+ * https://oss.oracle.com/licenses/CDDL+GPL-1.1
+ * or LICENSE.txt. See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice in each
+ * file and include the License file at LICENSE.txt.
+ *
+ * GPL Classpath Exception:
+ * Oracle designates this particular file as subject to the "Classpath"
+ * exception as provided by Oracle in the GPL Version 2 section of the License
+ * file that accompanied this code.
+ *
+ * Modifications:
+ * If applicable, add the following below the License Header, with the fields
+ * enclosed by brackets [] replaced by your own identifying information:
+ * "Portions Copyright [year] [name of copyright owner]"
+ *
+ * Contributor(s):
+ * If you wish your version of this file to be governed by only the CDDL or
+ * only the GPL Version 2, indicate your decision by adding "[Contributor]
+ * elects to include this software in this distribution under the [CDDL or GPL
+ * Version 2] license." If you don't indicate a single choice of license, a
+ * recipient has the option to distribute your version of this file under
+ * either the CDDL, the GPL Version 2 or to extend the choice of license to
+ * its licensees as provided above. However, if you add GPL Version 2 code
+ * and therefore, elected the GPL Version 2 license, then the option applies
+ * only if the new code is made subject to such option by the copyright
+ * holder.
+ */
+
+package com.sun.activation.viewers;
+
+import java.awt.*;
+import java.io.*;
+import java.beans.*;
+import javax.activation.*;
+
+public class TextViewer extends Panel implements CommandObject {
+ // UI Vars...
+ private TextArea text_area = null;
+
+ // File Vars
+ private File text_file = null;
+ private String text_buffer = null;
+
+ private DataHandler _dh = null;
+ private boolean DEBUG = false;
+ /**
+ * Constructor
+ */
+ public TextViewer() {
+ setLayout( new GridLayout(1,1));
+ // create the text area
+ text_area = new TextArea("", 24, 80,
+ TextArea.SCROLLBARS_VERTICAL_ONLY );
+ text_area.setEditable( false );
+
+ add(text_area);
+ }
+
+ //--------------------------------------------------------------------
+ public void setCommandContext(String verb, DataHandler dh) throws IOException {
+ _dh = dh;
+ this.setInputStream( _dh.getInputStream() );
+ }
+ //--------------------------------------------------------------------
+
+ /**
+ * set the data stream, component to assume it is ready to
+ * be read.
+ */
+ public void setInputStream(InputStream ins) throws IOException {
+
+ int bytes_read = 0;
+ // check that we can actually read
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ byte data[] = new byte[1024];
+
+ while((bytes_read = ins.read(data)) >0)
+ baos.write(data, 0, bytes_read);
+
+ ins.close();
+
+ // convert the buffer into a string
+ // popuplate the buffer
+ text_buffer = baos.toString();
+
+ // place in the text area
+ text_area.setText(text_buffer);
+
+ }
+ //--------------------------------------------------------------------
+ public void addNotify() {
+ super.addNotify();
+ invalidate();
+ }
+ //--------------------------------------------------------------------
+ public Dimension getPreferredSize() {
+ return text_area.getMinimumSize(24, 80);
+ }
+
+}
+
+
+
+
+
+
diff --git a/fine-third-jdk11/src/javax/activation/ActivationDataFlavor.java b/fine-third-jdk11/src/javax/activation/ActivationDataFlavor.java
new file mode 100644
index 000000000..e1b456e5d
--- /dev/null
+++ b/fine-third-jdk11/src/javax/activation/ActivationDataFlavor.java
@@ -0,0 +1,263 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common Development
+ * and Distribution License("CDDL") (collectively, the "License"). You
+ * may not use this file except in compliance with the License. You can
+ * obtain a copy of the License at
+ * https://oss.oracle.com/licenses/CDDL+GPL-1.1
+ * or LICENSE.txt. See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice in each
+ * file and include the License file at LICENSE.txt.
+ *
+ * GPL Classpath Exception:
+ * Oracle designates this particular file as subject to the "Classpath"
+ * exception as provided by Oracle in the GPL Version 2 section of the License
+ * file that accompanied this code.
+ *
+ * Modifications:
+ * If applicable, add the following below the License Header, with the fields
+ * enclosed by brackets [] replaced by your own identifying information:
+ * "Portions Copyright [year] [name of copyright owner]"
+ *
+ * Contributor(s):
+ * If you wish your version of this file to be governed by only the CDDL or
+ * only the GPL Version 2, indicate your decision by adding "[Contributor]
+ * elects to include this software in this distribution under the [CDDL or GPL
+ * Version 2] license." If you don't indicate a single choice of license, a
+ * recipient has the option to distribute your version of this file under
+ * either the CDDL, the GPL Version 2 or to extend the choice of license to
+ * its licensees as provided above. However, if you add GPL Version 2 code
+ * and therefore, elected the GPL Version 2 license, then the option applies
+ * only if the new code is made subject to such option by the copyright
+ * holder.
+ */
+
+package javax.activation;
+
+import java.awt.datatransfer.DataFlavor;
+import java.io.IOException;
+import javax.activation.MimeType;
+
+/**
+ * The ActivationDataFlavor class is a special subclass of
+ * java.awt.datatransfer.DataFlavor
. It allows the JAF to
+ * set all three values stored by the DataFlavor class via a new
+ * constructor. It also contains improved MIME parsing in the equals
+ *
method. Except for the improved parsing, its semantics are
+ * identical to that of the JDK's DataFlavor class.
+ */
+
+public class ActivationDataFlavor extends DataFlavor {
+
+ /*
+ * Raison d'etre:
+ *
+ * The DataFlavor class included in JDK 1.1 has several limitations
+ * including piss poor MIME type parsing, and the limitation of
+ * only supporting serialized objects and InputStreams as
+ * representation objects. This class 'fixes' that.
+ */
+
+ // I think for now I'll keep copies of all the variables and
+ // then later I may choose try to better coexist with the base
+ // class *sigh*
+ private String mimeType = null;
+ private MimeType mimeObject = null;
+ private String humanPresentableName = null;
+ private Class representationClass = null;
+
+ /**
+ * Construct a DataFlavor that represents an arbitrary
+ * Java object. This constructor is an extension of the
+ * JDK's DataFlavor in that it allows the explicit setting
+ * of all three DataFlavor attributes.
+ *
+ * mimeType = mimeType
+ * humanName = humanName
+ * isMimeTypeEqual
method.
+ *
+ * @param dataFlavor the DataFlavor to compare with
+ * @return true if the MIME type and representation class
+ * are the same
+ */
+ public boolean equals(DataFlavor dataFlavor) {
+ return (isMimeTypeEqual(dataFlavor) &&
+ dataFlavor.getRepresentationClass() == representationClass);
+ }
+
+ /**
+ * Is the string representation of the MIME type passed in equivalent
+ * to the MIME type of this DataFlavor. javax.activation.CommandObject
+ * interface, call its setCommandContext
method.
+ *
+ *
+ *
+ * @return the CommandMap
+ */
+ public static synchronized CommandMap getDefaultCommandMap() {
+ if (defaultCommandMap != null)
+ return defaultCommandMap;
+
+ // fetch per-thread-context-class-loader default
+ ClassLoader tccl = SecuritySupport.getContextClassLoader();
+ CommandMap def = map.get(tccl);
+ if (def == null) {
+ def = new MailcapCommandMap();
+ map.put(tccl, def);
+ }
+ return def;
+ }
+
+ /**
+ * Set the default CommandMap. Reset the CommandMap to the default by
+ * calling this method with MailcapCommandMap
and
+ * set that to the default, returning its value.
+ *
+ * null
.
+ *
+ * @param commandMap The new default CommandMap.
+ * @exception SecurityException if the caller doesn't have permission
+ * to change the default
+ */
+ public static synchronized void setDefaultCommandMap(CommandMap commandMap) {
+ SecurityManager security = System.getSecurityManager();
+ if (security != null) {
+ try {
+ // if it's ok with the SecurityManager, it's ok with me...
+ security.checkSetFactory();
+ } catch (SecurityException ex) {
+ // otherwise, we also allow it if this code and the
+ // factory come from the same (non-system) class loader (e.g.,
+ // the JAF classes were loaded with the applet classes).
+ ClassLoader cl = CommandMap.class.getClassLoader();
+ if (cl == null || cl.getParent() == null ||
+ cl != commandMap.getClass().getClassLoader()) {
+ throw ex;
+ }
+ }
+ }
+ // remove any per-thread-context-class-loader CommandMap
+ map.remove(SecuritySupport.getContextClassLoader());
+ defaultCommandMap = commandMap;
+ }
+
+ /**
+ * Get the preferred command list from a MIME Type. The actual semantics
+ * are determined by the implementation of the CommandMap.
+ *
+ * @param mimeType the MIME type
+ * @return the CommandInfo classes that represent the command Beans.
+ */
+ abstract public CommandInfo[] getPreferredCommands(String mimeType);
+
+ /**
+ * Get the preferred command list from a MIME Type. The actual semantics
+ * are determined by the implementation of the CommandMap. DataSource
provides extra information, such as
+ * the file name, that a CommandMap implementation may use to further
+ * refine the list of commands that are returned. The implementation
+ * in this class simply calls the getPreferredCommands
+ * method that ignores this argument.
+ *
+ * @param mimeType the MIME type
+ * @param ds a DataSource for the data
+ * @return the CommandInfo classes that represent the command Beans.
+ * @since JAF 1.1
+ */
+ public CommandInfo[] getPreferredCommands(String mimeType, DataSource ds) {
+ return getPreferredCommands(mimeType);
+ }
+
+ /**
+ * Get all the available commands for this type. This method
+ * should return all the possible commands for this MIME type.
+ *
+ * @param mimeType the MIME type
+ * @return the CommandInfo objects representing all the commands.
+ */
+ abstract public CommandInfo[] getAllCommands(String mimeType);
+
+ /**
+ * Get all the available commands for this type. This method
+ * should return all the possible commands for this MIME type. DataSource
provides extra information, such as
+ * the file name, that a CommandMap implementation may use to further
+ * refine the list of commands that are returned. The implementation
+ * in this class simply calls the getAllCommands
+ * method that ignores this argument.
+ *
+ * @param mimeType the MIME type
+ * @param ds a DataSource for the data
+ * @return the CommandInfo objects representing all the commands.
+ * @since JAF 1.1
+ */
+ public CommandInfo[] getAllCommands(String mimeType, DataSource ds) {
+ return getAllCommands(mimeType);
+ }
+
+ /**
+ * Get the default command corresponding to the MIME type.
+ *
+ * @param mimeType the MIME type
+ * @param cmdName the command name
+ * @return the CommandInfo corresponding to the command.
+ */
+ abstract public CommandInfo getCommand(String mimeType, String cmdName);
+
+ /**
+ * Get the default command corresponding to the MIME type. DataSource
provides extra information, such as
+ * the file name, that a CommandMap implementation may use to further
+ * refine the command that is chosen. The implementation
+ * in this class simply calls the getCommand
+ * method that ignores this argument.
+ *
+ * @param mimeType the MIME type
+ * @param cmdName the command name
+ * @param ds a DataSource for the data
+ * @return the CommandInfo corresponding to the command.
+ * @since JAF 1.1
+ */
+ public CommandInfo getCommand(String mimeType, String cmdName,
+ DataSource ds) {
+ return getCommand(mimeType, cmdName);
+ }
+
+ /**
+ * Locate a DataContentHandler that corresponds to the MIME type.
+ * The mechanism and semantics for determining this are determined
+ * by the implementation of the particular CommandMap.
+ *
+ * @param mimeType the MIME type
+ * @return the DataContentHandler for the MIME type
+ */
+ abstract public DataContentHandler createDataContentHandler(String
+ mimeType);
+
+ /**
+ * Locate a DataContentHandler that corresponds to the MIME type.
+ * The mechanism and semantics for determining this are determined
+ * by the implementation of the particular CommandMap. DataSource
provides extra information, such as
+ * the file name, that a CommandMap implementation may use to further
+ * refine the choice of DataContentHandler. The implementation
+ * in this class simply calls the createDataContentHandler
+ * method that ignores this argument.
+ *
+ * @param mimeType the MIME type
+ * @param ds a DataSource for the data
+ * @return the DataContentHandler for the MIME type
+ * @since JAF 1.1
+ */
+ public DataContentHandler createDataContentHandler(String mimeType,
+ DataSource ds) {
+ return createDataContentHandler(mimeType);
+ }
+
+ /**
+ * Get all the MIME types known to this command map.
+ * If the command map doesn't support this operation,
+ * null is returned.
+ *
+ * @return array of MIME types as strings, or null if not supported
+ * @since JAF 1.1
+ */
+ public String[] getMimeTypes() {
+ return null;
+ }
+}
diff --git a/fine-third-jdk11/src/javax/activation/CommandObject.java b/fine-third-jdk11/src/javax/activation/CommandObject.java
new file mode 100644
index 000000000..f37f687ff
--- /dev/null
+++ b/fine-third-jdk11/src/javax/activation/CommandObject.java
@@ -0,0 +1,68 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common Development
+ * and Distribution License("CDDL") (collectively, the "License"). You
+ * may not use this file except in compliance with the License. You can
+ * obtain a copy of the License at
+ * https://oss.oracle.com/licenses/CDDL+GPL-1.1
+ * or LICENSE.txt. See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice in each
+ * file and include the License file at LICENSE.txt.
+ *
+ * GPL Classpath Exception:
+ * Oracle designates this particular file as subject to the "Classpath"
+ * exception as provided by Oracle in the GPL Version 2 section of the License
+ * file that accompanied this code.
+ *
+ * Modifications:
+ * If applicable, add the following below the License Header, with the fields
+ * enclosed by brackets [] replaced by your own identifying information:
+ * "Portions Copyright [year] [name of copyright owner]"
+ *
+ * Contributor(s):
+ * If you wish your version of this file to be governed by only the CDDL or
+ * only the GPL Version 2, indicate your decision by adding "[Contributor]
+ * elects to include this software in this distribution under the [CDDL or GPL
+ * Version 2] license." If you don't indicate a single choice of license, a
+ * recipient has the option to distribute your version of this file under
+ * either the CDDL, the GPL Version 2 or to extend the choice of license to
+ * its licensees as provided above. However, if you add GPL Version 2 code
+ * and therefore, elected the GPL Version 2 license, then the option applies
+ * only if the new code is made subject to such option by the copyright
+ * holder.
+ */
+
+package javax.activation;
+
+import java.io.IOException;
+
+/**
+ * JavaBeans components that are Activation Framework aware implement
+ * this interface to find out which command verb they're being asked
+ * to perform, and to obtain the DataHandler representing the
+ * data they should operate on. JavaBeans that don't implement
+ * this interface may be used as well. Such commands may obtain
+ * the data using the Externalizable interface, or using an
+ * application-specific method.
+ */
+public interface CommandObject {
+
+ /**
+ * Initialize the Command with the verb it is requested to handle
+ * and the DataHandler that describes the data it will
+ * operate on. NOTE: it is acceptable for the caller
+ * to pass null as the value for DataHandler
.
+ *
+ * @param verb The Command Verb this object refers to.
+ * @param dh The DataHandler.
+ * @exception IOException for failures accessing data
+ */
+ public void setCommandContext(String verb, DataHandler dh)
+ throws IOException;
+}
diff --git a/fine-third-jdk11/src/javax/activation/DataContentHandler.java b/fine-third-jdk11/src/javax/activation/DataContentHandler.java
new file mode 100644
index 000000000..78c01cace
--- /dev/null
+++ b/fine-third-jdk11/src/javax/activation/DataContentHandler.java
@@ -0,0 +1,114 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common Development
+ * and Distribution License("CDDL") (collectively, the "License"). You
+ * may not use this file except in compliance with the License. You can
+ * obtain a copy of the License at
+ * https://oss.oracle.com/licenses/CDDL+GPL-1.1
+ * or LICENSE.txt. See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice in each
+ * file and include the License file at LICENSE.txt.
+ *
+ * GPL Classpath Exception:
+ * Oracle designates this particular file as subject to the "Classpath"
+ * exception as provided by Oracle in the GPL Version 2 section of the License
+ * file that accompanied this code.
+ *
+ * Modifications:
+ * If applicable, add the following below the License Header, with the fields
+ * enclosed by brackets [] replaced by your own identifying information:
+ * "Portions Copyright [year] [name of copyright owner]"
+ *
+ * Contributor(s):
+ * If you wish your version of this file to be governed by only the CDDL or
+ * only the GPL Version 2, indicate your decision by adding "[Contributor]
+ * elects to include this software in this distribution under the [CDDL or GPL
+ * Version 2] license." If you don't indicate a single choice of license, a
+ * recipient has the option to distribute your version of this file under
+ * either the CDDL, the GPL Version 2 or to extend the choice of license to
+ * its licensees as provided above. However, if you add GPL Version 2 code
+ * and therefore, elected the GPL Version 2 license, then the option applies
+ * only if the new code is made subject to such option by the copyright
+ * holder.
+ */
+
+package javax.activation;
+
+import java.awt.datatransfer.DataFlavor;
+import java.awt.datatransfer.UnsupportedFlavorException;
+import java.io.InputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import javax.activation.DataSource;
+
+/**
+ * The DataContentHandler interface is implemented by objects that can
+ * be used to extend the capabilities of the DataHandler's implementation
+ * of the Transferable interface. Through DataContentHandlers
+ * the framework can be extended to convert streams in to objects, and
+ * to write objects to streams. getTransferDataFlavors
method.
+ *
+ * @param ds The DataSource representing the data to be converted.
+ * @return The constructed Object.
+ * @exception IOException if the data can't be accessed
+ */
+ public Object getContent(DataSource ds) throws IOException;
+
+ /**
+ * Convert the object to a byte stream of the specified MIME type
+ * and write it to the output stream.
+ *
+ * @param obj The object to be converted.
+ * @param mimeType The requested MIME type of the resulting byte stream.
+ * @param os The output stream into which to write the converted
+ * byte stream.
+ * @exception IOException errors writing to the stream
+ */
+ public void writeTo(Object obj, String mimeType, OutputStream os)
+ throws IOException;
+}
diff --git a/fine-third-jdk11/src/javax/activation/DataContentHandlerFactory.java b/fine-third-jdk11/src/javax/activation/DataContentHandlerFactory.java
new file mode 100644
index 000000000..3e60d3e9b
--- /dev/null
+++ b/fine-third-jdk11/src/javax/activation/DataContentHandlerFactory.java
@@ -0,0 +1,61 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common Development
+ * and Distribution License("CDDL") (collectively, the "License"). You
+ * may not use this file except in compliance with the License. You can
+ * obtain a copy of the License at
+ * https://oss.oracle.com/licenses/CDDL+GPL-1.1
+ * or LICENSE.txt. See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice in each
+ * file and include the License file at LICENSE.txt.
+ *
+ * GPL Classpath Exception:
+ * Oracle designates this particular file as subject to the "Classpath"
+ * exception as provided by Oracle in the GPL Version 2 section of the License
+ * file that accompanied this code.
+ *
+ * Modifications:
+ * If applicable, add the following below the License Header, with the fields
+ * enclosed by brackets [] replaced by your own identifying information:
+ * "Portions Copyright [year] [name of copyright owner]"
+ *
+ * Contributor(s):
+ * If you wish your version of this file to be governed by only the CDDL or
+ * only the GPL Version 2, indicate your decision by adding "[Contributor]
+ * elects to include this software in this distribution under the [CDDL or GPL
+ * Version 2] license." If you don't indicate a single choice of license, a
+ * recipient has the option to distribute your version of this file under
+ * either the CDDL, the GPL Version 2 or to extend the choice of license to
+ * its licensees as provided above. However, if you add GPL Version 2 code
+ * and therefore, elected the GPL Version 2 license, then the option applies
+ * only if the new code is made subject to such option by the copyright
+ * holder.
+ */
+
+package javax.activation;
+
+/**
+ * This interface defines a factory for DataContentHandlers
. An
+ * implementation of this interface should map a MIME type into an
+ * instance of DataContentHandler. The design pattern for classes implementing
+ * this interface is the same as for the ContentHandler mechanism used in
+ * java.net.URL
.
+ */
+
+public interface DataContentHandlerFactory {
+
+ /**
+ * Creates a new DataContentHandler object for the MIME type.
+ *
+ * @param mimeType the MIME type to create the DataContentHandler for.
+ * @return The new DataContentHandler
, or null
+ * if none are found.
+ */
+ public DataContentHandler createDataContentHandler(String mimeType);
+}
diff --git a/fine-third-jdk11/src/javax/activation/DataHandler.java b/fine-third-jdk11/src/javax/activation/DataHandler.java
new file mode 100644
index 000000000..4f38c5292
--- /dev/null
+++ b/fine-third-jdk11/src/javax/activation/DataHandler.java
@@ -0,0 +1,912 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common Development
+ * and Distribution License("CDDL") (collectively, the "License"). You
+ * may not use this file except in compliance with the License. You can
+ * obtain a copy of the License at
+ * https://oss.oracle.com/licenses/CDDL+GPL-1.1
+ * or LICENSE.txt. See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice in each
+ * file and include the License file at LICENSE.txt.
+ *
+ * GPL Classpath Exception:
+ * Oracle designates this particular file as subject to the "Classpath"
+ * exception as provided by Oracle in the GPL Version 2 section of the License
+ * file that accompanied this code.
+ *
+ * Modifications:
+ * If applicable, add the following below the License Header, with the fields
+ * enclosed by brackets [] replaced by your own identifying information:
+ * "Portions Copyright [year] [name of copyright owner]"
+ *
+ * Contributor(s):
+ * If you wish your version of this file to be governed by only the CDDL or
+ * only the GPL Version 2, indicate your decision by adding "[Contributor]
+ * elects to include this software in this distribution under the [CDDL or GPL
+ * Version 2] license." If you don't indicate a single choice of license, a
+ * recipient has the option to distribute your version of this file under
+ * either the CDDL, the GPL Version 2 or to extend the choice of license to
+ * its licensees as provided above. However, if you add GPL Version 2 code
+ * and therefore, elected the GPL Version 2 license, then the option applies
+ * only if the new code is made subject to such option by the copyright
+ * holder.
+ */
+
+package javax.activation;
+
+import java.io.InputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.PipedInputStream;
+import java.io.PipedOutputStream;
+import java.io.OutputStreamWriter;
+import java.net.URL;
+import java.awt.datatransfer.Transferable;
+import java.awt.datatransfer.DataFlavor;
+import java.awt.datatransfer.UnsupportedFlavorException;
+
+/**
+ * The DataHandler class provides a consistent interface to data
+ * available in many different sources and formats.
+ * It manages simple stream to string conversions and related operations
+ * using DataContentHandlers.
+ * It provides access to commands that can operate on the data.
+ * The commands are found using a CommandMap. getCommand
,
+ * getAllCommands
, getPreferredCommands
).
+ * Each instance of a DataHandler may have a CommandMap associated with
+ * it using the setCommandMap
method. If a CommandMap was
+ * not set, DataHandler calls the getDefaultCommandMap
+ * method in CommandMap and uses the value it returns. See
+ * CommandMap for more information. DataHandler
instance referencing the
+ * specified DataSource. The data exists in a byte stream form.
+ * The DataSource will provide an InputStream to access the data.
+ *
+ * @param ds the DataSource
+ */
+ public DataHandler(DataSource ds) {
+ // save a reference to the incoming DS
+ dataSource = ds;
+ oldFactory = factory; // keep track of the factory
+ }
+
+ /**
+ * Create a DataHandler
instance representing an object
+ * of this MIME type. This constructor is
+ * used when the application already has an in-memory representation
+ * of the data in the form of a Java Object.
+ *
+ * @param obj the Java Object
+ * @param mimeType the MIME type of the object
+ */
+ public DataHandler(Object obj, String mimeType) {
+ object = obj;
+ objectMimeType = mimeType;
+ oldFactory = factory; // keep track of the factory
+ }
+
+ /**
+ * Create a DataHandler
instance referencing a URL.
+ * The DataHandler internally creates a URLDataSource
+ * instance to represent the URL.
+ *
+ * @param url a URL object
+ */
+ public DataHandler(URL url) {
+ dataSource = new URLDataSource(url);
+ oldFactory = factory; // keep track of the factory
+ }
+
+ /**
+ * Return the CommandMap for this instance of DataHandler.
+ */
+ private synchronized CommandMap getCommandMap() {
+ if (currentCommandMap != null)
+ return currentCommandMap;
+ else
+ return CommandMap.getDefaultCommandMap();
+ }
+
+ /**
+ * Return the DataSource associated with this instance
+ * of DataHandler.
+ * DataSource.getName
method, otherwise it
+ * returns null.
+ *
+ * @return the name of the object
+ */
+ public String getName() {
+ if (dataSource != null)
+ return dataSource.getName();
+ else
+ return null;
+ }
+
+ /**
+ * Return the MIME type of this object as retrieved from
+ * the source object. Note that this is the full
+ * type with parameters.
+ *
+ * @return the MIME type
+ */
+ public String getContentType() {
+ if (dataSource != null) // data source case
+ return dataSource.getContentType();
+ else
+ return objectMimeType; // obj/type case
+ }
+
+ /**
+ * Get the InputStream for this object. DataSource.getInputStream
method and
+ * returns the result to the caller.
+ * writeTo
method to write the
+ * stream data into one end of the pipe. The other end of the pipe
+ * is returned to the caller. Because a thread is created to copy
+ * the data, IOExceptions that may occur during the copy can not be
+ * propagated back to the caller. The result is an empty stream.OutputStream
.writeTo
method on the DataContentHandler
.
+ *
+ * @param os the OutputStream to write to
+ * @exception IOException if an I/O error occurs
+ */
+ public void writeTo(OutputStream os) throws IOException {
+ // for the DataSource case
+ if (dataSource != null) {
+ InputStream is = null;
+ byte data[] = new byte[8*1024];
+ int bytes_read;
+
+ is = dataSource.getInputStream();
+
+ try {
+ while ((bytes_read = is.read(data)) > 0) {
+ os.write(data, 0, bytes_read);
+ }
+ } finally {
+ is.close();
+ is = null;
+ }
+ } else { // for the Object case
+ DataContentHandler dch = getDataContentHandler();
+ dch.writeTo(object, objectMimeType, os);
+ }
+ }
+
+ /**
+ * Get an OutputStream for this DataHandler to allow overwriting
+ * the underlying data.
+ * If the DataHandler was created with a DataSource, the
+ * DataSource's getOutputStream
method is called.
+ * Otherwise, null
is returned.
+ *
+ * @return the OutputStream
+ * @exception IOException for failures creating the OutputStream
+ *
+ * @see javax.activation.DataSource#getOutputStream
+ * @see javax.activation.URLDataSource
+ */
+ public OutputStream getOutputStream() throws IOException {
+ if (dataSource != null)
+ return dataSource.getOutputStream();
+ else
+ return null;
+ }
+
+ /**
+ * Return the DataFlavors in which this data is available. getTransferDataFlavors
method. java.io.InputStream
class. If the
+ * DataHandler was created with an object and a MIME type,
+ * getTransferDataFlavors returns one DataFlavor that represents
+ * this object's MIME type and the object's class.
+ *
+ * @return an array of data flavors in which this data can be transferred
+ * @see javax.activation.DataContentHandler#getTransferDataFlavors
+ */
+ public synchronized DataFlavor[] getTransferDataFlavors() {
+ if (factory != oldFactory) // if the factory has changed, clear cache
+ transferFlavors = emptyFlavors;
+
+ // if it's not set, set it...
+ if (transferFlavors == emptyFlavors)
+ transferFlavors = getDataContentHandler().getTransferDataFlavors();
+ if (transferFlavors == emptyFlavors)
+ return transferFlavors; // no need to clone an empty array
+ else
+ return transferFlavors.clone();
+ }
+
+ /**
+ * Returns whether the specified data flavor is supported
+ * for this object.getTransferDataFlavors
, comparing each with
+ * the specified flavor.
+ *
+ * @param flavor the requested flavor for the data
+ * @return true if the data flavor is supported
+ * @see javax.activation.DataHandler#getTransferDataFlavors
+ */
+ public boolean isDataFlavorSupported(DataFlavor flavor) {
+ DataFlavor[] lFlavors = getTransferDataFlavors();
+
+ for (int i = 0; i < lFlavors.length; i++) {
+ if (lFlavors[i].equals(flavor))
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Returns an object that represents the data to be
+ * transferred. The class of the object returned is defined by the
+ * representation class of the data flavor.getTransferData
+ * method. If the DataHandler fails to locate a DataContentHandler
+ * and the flavor specifies this object's MIME type and the
+ * java.io.InputStream
class, this object's InputStream
+ * is returned.
+ * Otherwise it throws an UnsupportedFlavorException. null
causes the CommandMap to revert
+ * to the CommandMap returned by the
+ * CommandMap.getDefaultCommandMap
method.
+ * Changing the CommandMap, or setting it to null
,
+ * clears out any data cached from the previous CommandMap.
+ *
+ * @param commandMap the CommandMap to use in this DataHandler
+ *
+ * @see javax.activation.CommandMap#setDefaultCommandMap
+ */
+ public synchronized void setCommandMap(CommandMap commandMap) {
+ if (commandMap != currentCommandMap || commandMap == null) {
+ // clear cached values...
+ transferFlavors = emptyFlavors;
+ dataContentHandler = null;
+
+ currentCommandMap = commandMap;
+ }
+ }
+
+ /**
+ * Return the preferred commands for this type of data.
+ * This method calls the getPreferredCommands
method
+ * in the CommandMap associated with this instance of DataHandler.
+ * This method returns an array that represents a subset of
+ * available commands. In cases where multiple commands for the
+ * MIME type represented by this DataHandler are present, the
+ * installed CommandMap chooses the appropriate commands.
+ *
+ * @return the CommandInfo objects representing the preferred commands
+ *
+ * @see javax.activation.CommandMap#getPreferredCommands
+ */
+ public CommandInfo[] getPreferredCommands() {
+ if (dataSource != null)
+ return getCommandMap().getPreferredCommands(getBaseType(),
+ dataSource);
+ else
+ return getCommandMap().getPreferredCommands(getBaseType());
+ }
+
+ /**
+ * Return all the commands for this type of data.
+ * This method returns an array containing all commands
+ * for the type of data represented by this DataHandler. The
+ * MIME type for the underlying data represented by this DataHandler
+ * is used to call through to the getAllCommands
method
+ * of the CommandMap associated with this DataHandler.
+ *
+ * @return the CommandInfo objects representing all the commands
+ *
+ * @see javax.activation.CommandMap#getAllCommands
+ */
+ public CommandInfo[] getAllCommands() {
+ if (dataSource != null)
+ return getCommandMap().getAllCommands(getBaseType(), dataSource);
+ else
+ return getCommandMap().getAllCommands(getBaseType());
+ }
+
+ /**
+ * Get the command cmdName. Use the search semantics as
+ * defined by the CommandMap installed in this DataHandler. The
+ * MIME type for the underlying data represented by this DataHandler
+ * is used to call through to the getCommand
method
+ * of the CommandMap associated with this DataHandler.
+ *
+ * @param cmdName the command name
+ * @return the CommandInfo corresponding to the command
+ *
+ * @see javax.activation.CommandMap#getCommand
+ */
+ public CommandInfo getCommand(String cmdName) {
+ if (dataSource != null)
+ return getCommandMap().getCommand(getBaseType(), cmdName,
+ dataSource);
+ else
+ return getCommandMap().getCommand(getBaseType(), cmdName);
+ }
+
+ /**
+ * Return the data in its preferred Object form. DataContentHandler
can be found for the
+ * the type of this data, the DataHandler returns an
+ * InputStream for the data.
+ *
+ * @return the content.
+ * @exception IOException if an IOException occurs during
+ * this operation.
+ */
+ public Object getContent() throws IOException {
+ if (object != null)
+ return object;
+ else
+ return getDataContentHandler().getContent(getDataSource());
+ }
+
+ /**
+ * A convenience method that takes a CommandInfo object
+ * and instantiates the corresponding command, usually
+ * a JavaBean component.
+ * getCommandObject
+ * method with the ClassLoader
used to load
+ * the javax.activation.DataHandler
class itself.
+ *
+ * @param cmdinfo the CommandInfo corresponding to a command
+ * @return the instantiated command object
+ */
+ public Object getBean(CommandInfo cmdinfo) {
+ Object bean = null;
+
+ try {
+ // make the bean
+ ClassLoader cld = null;
+ // First try the "application's" class loader.
+ cld = SecuritySupport.getContextClassLoader();
+ if (cld == null)
+ cld = this.getClass().getClassLoader();
+ bean = cmdinfo.getCommandObject(this, cld);
+ } catch (IOException e) {
+ } catch (ClassNotFoundException e) { }
+
+ return bean;
+ }
+
+ /**
+ * Get the DataContentHandler for this DataHandler: InputStream
representing this object.
+ * @return the InputStream
+ */
+ public InputStream getInputStream() throws IOException {
+ return dataHandler.getInputStream();
+ }
+
+ /**
+ * Returns the OutputStream
for this object.
+ * @return the OutputStream
+ */
+ public OutputStream getOutputStream() throws IOException {
+ return dataHandler.getOutputStream();
+ }
+
+ /**
+ * Returns the MIME type of the data represented by this object.
+ * @return the MIME type
+ */
+ public String getContentType() {
+ return dataHandler.getContentType();
+ }
+
+ /**
+ * Returns the name of this object.
+ * @return the name of this object
+ */
+ public String getName() {
+ return dataHandler.getName(); // what else would it be?
+ }
+}
+
+/*
+ * DataSourceDataContentHandler
+ *
+ * This is a private DataContentHandler that wraps the real
+ * DataContentHandler in the case where the DataHandler was instantiated
+ * with a DataSource.
+ */
+class DataSourceDataContentHandler implements DataContentHandler {
+ private DataSource ds = null;
+ private DataFlavor transferFlavors[] = null;
+ private DataContentHandler dch = null;
+
+ /**
+ * The constructor.
+ */
+ public DataSourceDataContentHandler(DataContentHandler dch, DataSource ds) {
+ this.ds = ds;
+ this.dch = dch;
+ }
+
+ /**
+ * Return the DataFlavors for this DataContentHandler
.
+ * @return the DataFlavors
+ */
+ public DataFlavor[] getTransferDataFlavors() {
+
+ if (transferFlavors == null) {
+ if (dch != null) { // is there a dch?
+ transferFlavors = dch.getTransferDataFlavors();
+ } else {
+ transferFlavors = new DataFlavor[1];
+ transferFlavors[0] =
+ new ActivationDataFlavor(ds.getContentType(),
+ ds.getContentType());
+ }
+ }
+ return transferFlavors;
+ }
+
+ /**
+ * Return the Transfer Data of type DataFlavor from InputStream.
+ * @param df the DataFlavor
+ * @param ds the DataSource
+ * @return the constructed Object
+ */
+ public Object getTransferData(DataFlavor df, DataSource ds) throws
+ UnsupportedFlavorException, IOException {
+
+ if (dch != null)
+ return dch.getTransferData(df, ds);
+ else if (df.equals(getTransferDataFlavors()[0])) // only have one now
+ return ds.getInputStream();
+ else
+ throw new UnsupportedFlavorException(df);
+ }
+
+ public Object getContent(DataSource ds) throws IOException {
+
+ if (dch != null)
+ return dch.getContent(ds);
+ else
+ return ds.getInputStream();
+ }
+
+ /**
+ * Write the object to the output stream.
+ */
+ public void writeTo(Object obj, String mimeType, OutputStream os)
+ throws IOException {
+ if (dch != null)
+ dch.writeTo(obj, mimeType, os);
+ else
+ throw new UnsupportedDataTypeException(
+ "no DCH for content type " + ds.getContentType());
+ }
+}
+
+/*
+ * ObjectDataContentHandler
+ *
+ * This is a private DataContentHandler that wraps the real
+ * DataContentHandler in the case where the DataHandler was instantiated
+ * with an object.
+ */
+class ObjectDataContentHandler implements DataContentHandler {
+ private DataFlavor transferFlavors[] = null;
+ private Object obj;
+ private String mimeType;
+ private DataContentHandler dch = null;
+
+ /**
+ * The constructor.
+ */
+ public ObjectDataContentHandler(DataContentHandler dch,
+ Object obj, String mimeType) {
+ this.obj = obj;
+ this.mimeType = mimeType;
+ this.dch = dch;
+ }
+
+ /**
+ * Return the DataContentHandler for this object.
+ * Used only by the DataHandler class.
+ */
+ public DataContentHandler getDCH() {
+ return dch;
+ }
+
+ /**
+ * Return the DataFlavors for this DataContentHandler
.
+ * @return the DataFlavors
+ */
+ public synchronized DataFlavor[] getTransferDataFlavors() {
+ if (transferFlavors == null) {
+ if (dch != null) {
+ transferFlavors = dch.getTransferDataFlavors();
+ } else {
+ transferFlavors = new DataFlavor[1];
+ transferFlavors[0] = new ActivationDataFlavor(obj.getClass(),
+ mimeType, mimeType);
+ }
+ }
+ return transferFlavors;
+ }
+
+ /**
+ * Return the Transfer Data of type DataFlavor from InputStream.
+ * @param df the DataFlavor
+ * @param ds the DataSource
+ * @return the constructed Object
+ */
+ public Object getTransferData(DataFlavor df, DataSource ds)
+ throws UnsupportedFlavorException, IOException {
+
+ if (dch != null)
+ return dch.getTransferData(df, ds);
+ else if (df.equals(getTransferDataFlavors()[0])) // only have one now
+ return obj;
+ else
+ throw new UnsupportedFlavorException(df);
+
+ }
+
+ public Object getContent(DataSource ds) {
+ return obj;
+ }
+
+ /**
+ * Write the object to the output stream.
+ */
+ public void writeTo(Object obj, String mimeType, OutputStream os)
+ throws IOException {
+ if (dch != null)
+ dch.writeTo(obj, mimeType, os);
+ else if (obj instanceof byte[])
+ os.write((byte[])obj);
+ else if (obj instanceof String) {
+ OutputStreamWriter osw = new OutputStreamWriter(os);
+ osw.write((String)obj);
+ osw.flush();
+ } else
+ throw new UnsupportedDataTypeException(
+ "no object DCH for MIME type " + this.mimeType);
+ }
+}
diff --git a/fine-third-jdk11/src/javax/activation/DataSource.java b/fine-third-jdk11/src/javax/activation/DataSource.java
new file mode 100644
index 000000000..51745b562
--- /dev/null
+++ b/fine-third-jdk11/src/javax/activation/DataSource.java
@@ -0,0 +1,101 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common Development
+ * and Distribution License("CDDL") (collectively, the "License"). You
+ * may not use this file except in compliance with the License. You can
+ * obtain a copy of the License at
+ * https://oss.oracle.com/licenses/CDDL+GPL-1.1
+ * or LICENSE.txt. See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice in each
+ * file and include the License file at LICENSE.txt.
+ *
+ * GPL Classpath Exception:
+ * Oracle designates this particular file as subject to the "Classpath"
+ * exception as provided by Oracle in the GPL Version 2 section of the License
+ * file that accompanied this code.
+ *
+ * Modifications:
+ * If applicable, add the following below the License Header, with the fields
+ * enclosed by brackets [] replaced by your own identifying information:
+ * "Portions Copyright [year] [name of copyright owner]"
+ *
+ * Contributor(s):
+ * If you wish your version of this file to be governed by only the CDDL or
+ * only the GPL Version 2, indicate your decision by adding "[Contributor]
+ * elects to include this software in this distribution under the [CDDL or GPL
+ * Version 2] license." If you don't indicate a single choice of license, a
+ * recipient has the option to distribute your version of this file under
+ * either the CDDL, the GPL Version 2 or to extend the choice of license to
+ * its licensees as provided above. However, if you add GPL Version 2 code
+ * and therefore, elected the GPL Version 2 license, then the option applies
+ * only if the new code is made subject to such option by the copyright
+ * holder.
+ */
+
+package javax.activation;
+
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.IOException;
+
+/**
+ * The DataSource interface provides the JavaBeans Activation Framework
+ * with an abstraction of an arbitrary collection of data. It
+ * provides a type for that data as well as access
+ * to it in the form of InputStreams
and
+ * OutputStreams
where appropriate.
+ */
+
+public interface DataSource {
+
+ /**
+ * This method returns an InputStream
representing
+ * the data and throws the appropriate exception if it can
+ * not do so. Note that a new InputStream
object must be
+ * returned each time this method is called, and the stream must be
+ * positioned at the beginning of the data.
+ *
+ * @return an InputStream
+ * @exception IOException for failures creating the InputStream
+ */
+ public InputStream getInputStream() throws IOException;
+
+ /**
+ * This method returns an OutputStream
where the
+ * data can be written and throws the appropriate exception if it can
+ * not do so. Note that a new OutputStream
object must
+ * be returned each time this method is called, and the stream must
+ * be positioned at the location the data is to be written.
+ *
+ * @return an OutputStream
+ * @exception IOException for failures creating the OutputStream
+ */
+ public OutputStream getOutputStream() throws IOException;
+
+ /**
+ * This method returns the MIME type of the data in the form of a
+ * string. It should always return a valid type. It is suggested
+ * that getContentType return "application/octet-stream" if the
+ * DataSource implementation can not determine the data type.
+ *
+ * @return the MIME Type
+ */
+ public String getContentType();
+
+ /**
+ * Return the name of this object where the name of the object
+ * is dependant on the nature of the underlying objects. DataSources
+ * encapsulating files may choose to return the filename of the object.
+ * (Typically this would be the last component of the filename, not an
+ * entire pathname.)
+ *
+ * @return the name of the object.
+ */
+ public String getName();
+}
diff --git a/fine-third-jdk11/src/javax/activation/FileDataSource.java b/fine-third-jdk11/src/javax/activation/FileDataSource.java
new file mode 100644
index 000000000..caf1c2b32
--- /dev/null
+++ b/fine-third-jdk11/src/javax/activation/FileDataSource.java
@@ -0,0 +1,171 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common Development
+ * and Distribution License("CDDL") (collectively, the "License"). You
+ * may not use this file except in compliance with the License. You can
+ * obtain a copy of the License at
+ * https://oss.oracle.com/licenses/CDDL+GPL-1.1
+ * or LICENSE.txt. See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice in each
+ * file and include the License file at LICENSE.txt.
+ *
+ * GPL Classpath Exception:
+ * Oracle designates this particular file as subject to the "Classpath"
+ * exception as provided by Oracle in the GPL Version 2 section of the License
+ * file that accompanied this code.
+ *
+ * Modifications:
+ * If applicable, add the following below the License Header, with the fields
+ * enclosed by brackets [] replaced by your own identifying information:
+ * "Portions Copyright [year] [name of copyright owner]"
+ *
+ * Contributor(s):
+ * If you wish your version of this file to be governed by only the CDDL or
+ * only the GPL Version 2, indicate your decision by adding "[Contributor]
+ * elects to include this software in this distribution under the [CDDL or GPL
+ * Version 2] license." If you don't indicate a single choice of license, a
+ * recipient has the option to distribute your version of this file under
+ * either the CDDL, the GPL Version 2 or to extend the choice of license to
+ * its licensees as provided above. However, if you add GPL Version 2 code
+ * and therefore, elected the GPL Version 2 license, then the option applies
+ * only if the new code is made subject to such option by the copyright
+ * holder.
+ */
+
+package javax.activation;
+
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.File;
+import java.io.FileDescriptor;
+import java.io.FileNotFoundException;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import com.sun.activation.registries.MimeTypeFile;
+
+/**
+ * The FileDataSource class implements a simple DataSource object
+ * that encapsulates a file. It provides data typing services via
+ * a FileTypeMap object. setFileTypeMap
method can be used to explicitly
+ * set the FileTypeMap for an instance of FileDataSource. If no
+ * FileTypeMap is set, the FileDataSource will call the FileTypeMap's
+ * getDefaultFileTypeMap method to get the System's default FileTypeMap.
+ *
+ * @see javax.activation.DataSource
+ * @see javax.activation.FileTypeMap
+ * @see javax.activation.MimetypesFileTypeMap
+ */
+public class FileDataSource implements DataSource {
+
+ // keep track of original 'ref' passed in, non-null
+ // one indicated which was passed in:
+ private File _file = null;
+ private FileTypeMap typeMap = null;
+
+ /**
+ * Creates a FileDataSource from a File object. Note:
+ * The file will not actually be opened until a method is
+ * called that requires the file to be opened.
+ *
+ * @param file the file
+ */
+ public FileDataSource(File file) {
+ _file = file; // save the file Object...
+ }
+
+ /**
+ * Creates a FileDataSource from
+ * the specified path name. Note:
+ * The file will not actually be opened until a method is
+ * called that requires the file to be opened.
+ *
+ * @param name the system-dependent file name.
+ */
+ public FileDataSource(String name) {
+ this(new File(name)); // use the file constructor
+ }
+
+ /**
+ * This method will return an InputStream representing the
+ * the data and will throw an IOException if it can
+ * not do so. This method will return a new
+ * instance of InputStream with each invocation.
+ *
+ * @return an InputStream
+ */
+ public InputStream getInputStream() throws IOException {
+ return new FileInputStream(_file);
+ }
+
+ /**
+ * This method will return an OutputStream representing the
+ * the data and will throw an IOException if it can
+ * not do so. This method will return a new instance of
+ * OutputStream with each invocation.
+ *
+ * @return an OutputStream
+ */
+ public OutputStream getOutputStream() throws IOException {
+ return new FileOutputStream(_file);
+ }
+
+ /**
+ * This method returns the MIME type of the data in the form of a
+ * string. This method uses the currently installed FileTypeMap. If
+ * there is no FileTypeMap explictly set, the FileDataSource will
+ * call the getDefaultFileTypeMap
method on
+ * FileTypeMap to acquire a default FileTypeMap. Note: By
+ * default, the FileTypeMap used will be a MimetypesFileTypeMap.
+ *
+ * @return the MIME Type
+ * @see javax.activation.FileTypeMap#getDefaultFileTypeMap
+ */
+ public String getContentType() {
+ // check to see if the type map is null?
+ if (typeMap == null)
+ return FileTypeMap.getDefaultFileTypeMap().getContentType(_file);
+ else
+ return typeMap.getContentType(_file);
+ }
+
+ /**
+ * Return the name of this object. The FileDataSource
+ * will return the file name of the object.
+ *
+ * @return the name of the object.
+ * @see javax.activation.DataSource
+ */
+ public String getName() {
+ return _file.getName();
+ }
+
+ /**
+ * Return the File object that corresponds to this FileDataSource.
+ * @return the File object for the file represented by this object.
+ */
+ public File getFile() {
+ return _file;
+ }
+
+ /**
+ * Set the FileTypeMap to use with this FileDataSource
+ *
+ * @param map The FileTypeMap for this object.
+ */
+ public void setFileTypeMap(FileTypeMap map) {
+ typeMap = map;
+ }
+}
diff --git a/fine-third-jdk11/src/javax/activation/FileTypeMap.java b/fine-third-jdk11/src/javax/activation/FileTypeMap.java
new file mode 100644
index 000000000..74b26381e
--- /dev/null
+++ b/fine-third-jdk11/src/javax/activation/FileTypeMap.java
@@ -0,0 +1,145 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common Development
+ * and Distribution License("CDDL") (collectively, the "License"). You
+ * may not use this file except in compliance with the License. You can
+ * obtain a copy of the License at
+ * https://oss.oracle.com/licenses/CDDL+GPL-1.1
+ * or LICENSE.txt. See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice in each
+ * file and include the License file at LICENSE.txt.
+ *
+ * GPL Classpath Exception:
+ * Oracle designates this particular file as subject to the "Classpath"
+ * exception as provided by Oracle in the GPL Version 2 section of the License
+ * file that accompanied this code.
+ *
+ * Modifications:
+ * If applicable, add the following below the License Header, with the fields
+ * enclosed by brackets [] replaced by your own identifying information:
+ * "Portions Copyright [year] [name of copyright owner]"
+ *
+ * Contributor(s):
+ * If you wish your version of this file to be governed by only the CDDL or
+ * only the GPL Version 2, indicate your decision by adding "[Contributor]
+ * elects to include this software in this distribution under the [CDDL or GPL
+ * Version 2] license." If you don't indicate a single choice of license, a
+ * recipient has the option to distribute your version of this file under
+ * either the CDDL, the GPL Version 2 or to extend the choice of license to
+ * its licensees as provided above. However, if you add GPL Version 2 code
+ * and therefore, elected the GPL Version 2 license, then the option applies
+ * only if the new code is made subject to such option by the copyright
+ * holder.
+ */
+
+package javax.activation;
+
+import java.io.File;
+import java.util.Map;
+import java.util.WeakHashMap;
+
+/**
+ * The FileTypeMap is an abstract class that provides a data typing
+ * interface for files. Implementations of this class will
+ * implement the getContentType methods which will derive a content
+ * type from a file name or a File object. FileTypeMaps could use any
+ * scheme to determine the data type, from examining the file extension
+ * of a file (like the MimetypesFileTypeMap) to opening the file and
+ * trying to derive its type from the contents of the file. The
+ * FileDataSource class uses the default FileTypeMap (a MimetypesFileTypeMap
+ * unless changed) to determine the content type of files.
+ *
+ * @see javax.activation.FileTypeMap
+ * @see javax.activation.FileDataSource
+ * @see javax.activation.MimetypesFileTypeMap
+ */
+
+public abstract class FileTypeMap {
+
+ private static FileTypeMap defaultMap = null;
+ private static MapMimetypesFileTypeMap
.
+ *
+ * @return The default FileTypeMap
+ * @see javax.activation.FileTypeMap#setDefaultFileTypeMap
+ */
+ public static synchronized FileTypeMap getDefaultFileTypeMap() {
+ if (defaultMap != null)
+ return defaultMap;
+
+ // fetch per-thread-context-class-loader default
+ ClassLoader tccl = SecuritySupport.getContextClassLoader();
+ FileTypeMap def = map.get(tccl);
+ if (def == null) {
+ def = new MimetypesFileTypeMap();
+ map.put(tccl, def);
+ }
+ return def;
+ }
+}
diff --git a/fine-third-jdk11/src/javax/activation/MailcapCommandMap.java b/fine-third-jdk11/src/javax/activation/MailcapCommandMap.java
new file mode 100644
index 000000000..c7c85083d
--- /dev/null
+++ b/fine-third-jdk11/src/javax/activation/MailcapCommandMap.java
@@ -0,0 +1,737 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common Development
+ * and Distribution License("CDDL") (collectively, the "License"). You
+ * may not use this file except in compliance with the License. You can
+ * obtain a copy of the License at
+ * https://oss.oracle.com/licenses/CDDL+GPL-1.1
+ * or LICENSE.txt. See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice in each
+ * file and include the License file at LICENSE.txt.
+ *
+ * GPL Classpath Exception:
+ * Oracle designates this particular file as subject to the "Classpath"
+ * exception as provided by Oracle in the GPL Version 2 section of the License
+ * file that accompanied this code.
+ *
+ * Modifications:
+ * If applicable, add the following below the License Header, with the fields
+ * enclosed by brackets [] replaced by your own identifying information:
+ * "Portions Copyright [year] [name of copyright owner]"
+ *
+ * Contributor(s):
+ * If you wish your version of this file to be governed by only the CDDL or
+ * only the GPL Version 2, indicate your decision by adding "[Contributor]
+ * elects to include this software in this distribution under the [CDDL or GPL
+ * Version 2] license." If you don't indicate a single choice of license, a
+ * recipient has the option to distribute your version of this file under
+ * either the CDDL, the GPL Version 2 or to extend the choice of license to
+ * its licensees as provided above. However, if you add GPL Version 2 code
+ * and therefore, elected the GPL Version 2 license, then the option applies
+ * only if the new code is made subject to such option by the copyright
+ * holder.
+ */
+
+package javax.activation;
+
+import java.util.*;
+import java.io.*;
+import java.net.*;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import com.sun.activation.registries.MailcapFile;
+import com.sun.activation.registries.LogSupport;
+
+/**
+ * MailcapCommandMap extends the CommandMap
+ * abstract class. It implements a CommandMap whose configuration
+ * is based on mailcap files
+ * (RFC 1524).
+ * The MailcapCommandMap can be configured both programmatically
+ * and via configuration files.
+ *
+ *
+ * .mailcap
in the user's home directory.
+ * mailcap
in the Java runtime.
+ * META-INF/mailcap
.
+ * META-INF/mailcap.default
+ * (usually found only in the activation.jar
file).
+ * mailcap
file
+ * in the Java runtime in the directory java.home/conf
+ * if it exists, and otherwise in the directory
+ * java.home/lib
, where java.home is the value
+ * of the "java.home" System property. Note that the "conf" directory was
+ * introduced in JDK 9.)
+ * x-java-
.
+ * The MailcapCommandMap uses this signature to find
+ * command entries for inclusion into its registries.
+ * Parameter names with the form x-java-<name>
+ * are read by the MailcapCommandMap as identifying a command
+ * with the name name. When the name is
+ * content-handler
the MailcapCommandMap recognizes the class
+ * signified by this parameter as a DataContentHandler.
+ * All other commands are handled generically regardless of command
+ * name. The command implementation is specified by a fully qualified
+ * class name of a JavaBean(tm) component. For example; a command for viewing
+ * some data can be specified as: x-java-view=com.foo.ViewBean
.fallback-entry
, the value of
+ * the command may be true
or false
. An
+ * entry for a MIME type that includes a parameter of
+ * x-java-fallback-entry=true
defines fallback commands
+ * for that MIME type that will only be used if no non-fallback entry
+ * can be found. For example, an entry of the form text/*; ;
+ * x-java-fallback-entry=true; x-java-view=com.sun.TextViewer
+ * specifies a view command to be used for any text MIME type. This
+ * view command would only be used if a non-fallback view command for
+ * the MIME type could not be found.
+ * # Comments begin with a '#' and continue to the end of the line.
+ *
+ * <mime type>; ; <parameter list>
+ * # Where a parameter list consists of one or more parameters,
+ * # where parameters look like: x-java-view=com.sun.TextViewer
+ * # and a parameter list looks like:
+ * text/plain; ; x-java-view=com.sun.TextViewer; x-java-edit=com.sun.TextEdit
+ *
+ * # Note that mailcap entries that do not contain 'x-java' parameters
+ * # and comply to RFC 1524 are simply ignored:
+ * image/gif; /usr/dt/bin/sdtimage %s
+ *
+ * cmdName
for the MIME type.
+ *
+ * @param mimeType the MIME type
+ * @param cmdName the command name
+ * @return the CommandInfo object corresponding to the command.
+ */
+ public synchronized CommandInfo getCommand(String mimeType,
+ String cmdName) {
+ if (mimeType != null)
+ mimeType = mimeType.toLowerCase(Locale.ENGLISH);
+
+ for (int i = 0; i < DB.length; i++) {
+ if (DB[i] == null)
+ continue;
+ Map cmdMap = DB[i].getMailcapList(mimeType);
+ if (cmdMap != null) {
+ // get the cmd list for the cmd
+ List v = (List)cmdMap.get(cmdName);
+ if (v != null) {
+ String cmdClassName = (String)v.get(0);
+
+ if (cmdClassName != null)
+ return new CommandInfo(cmdName, cmdClassName);
+ }
+ }
+ }
+
+ // now try the fallback list
+ for (int i = 0; i < DB.length; i++) {
+ if (DB[i] == null)
+ continue;
+ Map cmdMap = DB[i].getMailcapFallbackList(mimeType);
+ if (cmdMap != null) {
+ // get the cmd list for the cmd
+ List v = (List)cmdMap.get(cmdName);
+ if (v != null) {
+ String cmdClassName = (String)v.get(0);
+
+ if (cmdClassName != null)
+ return new CommandInfo(cmdName, cmdClassName);
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Add entries to the registry. Programmatically
+ * added entries are searched before other entries..mime.types
format.
+ *
+ * .mime.types
in the user's home directory.
+ * mime.types
in the Java runtime.
+ * META-INF/mime.types
.
+ * META-INF/mimetypes.default
+ * (usually found only in the activation.jar
file).
+ * mime.types
file
+ * in the Java runtime in the directory java.home/conf
+ * if it exists, and otherwise in the directory
+ * java.home/lib
, where java.home is the value
+ * of the "java.home" System property. Note that the "conf" directory was
+ * introduced in JDK 9.)
+ *
+ * # comments begin with a '#'
+ *
+ * @author Bart Calder
+ * @author Bill Shannon
+ */
+public class MimetypesFileTypeMap extends FileTypeMap {
+ /*
+ * We manage a collection of databases, searched in order.
+ */
+ private MimeTypeFile[] DB;
+ private static final int PROG = 0; // programmatically added entries
+
+ private static final String defaultType = "application/octet-stream";
+
+ private static final String confDir;
+
+ static {
+ String dir = null;
+ try {
+ dir = (String)AccessController.doPrivileged(
+ new PrivilegedAction() {
+ public Object run() {
+ String home = System.getProperty("java.home");
+ String newdir = home + File.separator + "conf";
+ File conf = new File(newdir);
+ if (conf.exists())
+ return newdir + File.separator;
+ else
+ return home + File.separator + "lib" + File.separator;
+ }
+ });
+ } catch (Exception ex) {
+ // ignore any exceptions
+ }
+ confDir = dir;
+ }
+
+ /**
+ * The default constructor.
+ */
+ public MimetypesFileTypeMap() {
+ Vector dbv = new Vector(5); // usually 5 or less databases
+ MimeTypeFile mf = null;
+ dbv.addElement(null); // place holder for PROG entry
+
+ LogSupport.log("MimetypesFileTypeMap: load HOME");
+ try {
+ String user_home = System.getProperty("user.home");
+
+ if (user_home != null) {
+ String path = user_home + File.separator + ".mime.types";
+ mf = loadFile(path);
+ if (mf != null)
+ dbv.addElement(mf);
+ }
+ } catch (SecurityException ex) {}
+
+ LogSupport.log("MimetypesFileTypeMap: load SYS");
+ try {
+ // check system's home
+ if (confDir != null) {
+ mf = loadFile(confDir + "mime.types");
+ if (mf != null)
+ dbv.addElement(mf);
+ }
+ } catch (SecurityException ex) {}
+
+ LogSupport.log("MimetypesFileTypeMap: load JAR");
+ // load from the app's jar file
+ loadAllResources(dbv, "META-INF/mime.types");
+
+ LogSupport.log("MimetypesFileTypeMap: load DEF");
+ mf = loadResource("/META-INF/mimetypes.default");
+
+ if (mf != null)
+ dbv.addElement(mf);
+
+ DB = new MimeTypeFile[dbv.size()];
+ dbv.copyInto(DB);
+ }
+
+ /**
+ * Load from the named resource.
+ */
+ private MimeTypeFile loadResource(String name) {
+ InputStream clis = null;
+ try {
+ clis = SecuritySupport.getResourceAsStream(this.getClass(), name);
+ if (clis != null) {
+ MimeTypeFile mf = new MimeTypeFile(clis);
+ if (LogSupport.isLoggable())
+ LogSupport.log("MimetypesFileTypeMap: successfully " +
+ "loaded mime types file: " + name);
+ return mf;
+ } else {
+ if (LogSupport.isLoggable())
+ LogSupport.log("MimetypesFileTypeMap: not loading " +
+ "mime types file: " + name);
+ }
+ } catch (IOException e) {
+ if (LogSupport.isLoggable())
+ LogSupport.log("MimetypesFileTypeMap: can't load " + name, e);
+ } catch (SecurityException sex) {
+ if (LogSupport.isLoggable())
+ LogSupport.log("MimetypesFileTypeMap: can't load " + name, sex);
+ } finally {
+ try {
+ if (clis != null)
+ clis.close();
+ } catch (IOException ex) { } // ignore it
+ }
+ return null;
+ }
+
+ /**
+ * Load all of the named resource.
+ */
+ private void loadAllResources(Vector v, String name) {
+ boolean anyLoaded = false;
+ try {
+ URL[] urls;
+ ClassLoader cld = null;
+ // First try the "application's" class loader.
+ cld = SecuritySupport.getContextClassLoader();
+ if (cld == null)
+ cld = this.getClass().getClassLoader();
+ if (cld != null)
+ urls = SecuritySupport.getResources(cld, name);
+ else
+ urls = SecuritySupport.getSystemResources(name);
+ if (urls != null) {
+ if (LogSupport.isLoggable())
+ LogSupport.log("MimetypesFileTypeMap: getResources");
+ for (int i = 0; i < urls.length; i++) {
+ URL url = urls[i];
+ InputStream clis = null;
+ if (LogSupport.isLoggable())
+ LogSupport.log("MimetypesFileTypeMap: URL " + url);
+ try {
+ clis = SecuritySupport.openStream(url);
+ if (clis != null) {
+ v.addElement(new MimeTypeFile(clis));
+ anyLoaded = true;
+ if (LogSupport.isLoggable())
+ LogSupport.log("MimetypesFileTypeMap: " +
+ "successfully loaded " +
+ "mime types from URL: " + url);
+ } else {
+ if (LogSupport.isLoggable())
+ LogSupport.log("MimetypesFileTypeMap: " +
+ "not loading " +
+ "mime types from URL: " + url);
+ }
+ } catch (IOException ioex) {
+ if (LogSupport.isLoggable())
+ LogSupport.log("MimetypesFileTypeMap: can't load " +
+ url, ioex);
+ } catch (SecurityException sex) {
+ if (LogSupport.isLoggable())
+ LogSupport.log("MimetypesFileTypeMap: can't load " +
+ url, sex);
+ } finally {
+ try {
+ if (clis != null)
+ clis.close();
+ } catch (IOException cex) { }
+ }
+ }
+ }
+ } catch (Exception ex) {
+ if (LogSupport.isLoggable())
+ LogSupport.log("MimetypesFileTypeMap: can't load " + name, ex);
+ }
+
+ // if failed to load anything, fall back to old technique, just in case
+ if (!anyLoaded) {
+ LogSupport.log("MimetypesFileTypeMap: !anyLoaded");
+ MimeTypeFile mf = loadResource("/" + name);
+ if (mf != null)
+ v.addElement(mf);
+ }
+ }
+
+ /**
+ * Load the named file.
+ */
+ private MimeTypeFile loadFile(String name) {
+ MimeTypeFile mtf = null;
+
+ try {
+ mtf = new MimeTypeFile(name);
+ } catch (IOException e) {
+ // e.printStackTrace();
+ }
+ return mtf;
+ }
+
+ /**
+ * Construct a MimetypesFileTypeMap with programmatic entries
+ * added from the named file.
+ *
+ * @param mimeTypeFileName the file name
+ * @exception IOException for errors reading the file
+ */
+ public MimetypesFileTypeMap(String mimeTypeFileName) throws IOException {
+ this();
+ DB[PROG] = new MimeTypeFile(mimeTypeFileName);
+ }
+
+ /**
+ * Construct a MimetypesFileTypeMap with programmatic entries
+ * added from the InputStream.
+ *
+ * @param is the input stream to read from
+ */
+ public MimetypesFileTypeMap(InputStream is) {
+ this();
+ try {
+ DB[PROG] = new MimeTypeFile(is);
+ } catch (IOException ex) {
+ // XXX - really should throw it
+ }
+ }
+
+ /**
+ * Prepend the MIME type values to the registry.
+ *
+ * @param mime_types A .mime.types formatted string of entries.
+ */
+ public synchronized void addMimeTypes(String mime_types) {
+ // check to see if we have created the registry
+ if (DB[PROG] == null)
+ DB[PROG] = new MimeTypeFile(); // make one
+
+ DB[PROG].appendToRegistry(mime_types);
+ }
+
+ /**
+ * Return the MIME type of the file object.
+ * The implementation in this class calls
+ *
+ * # the format is <mime type> <space separated file extensions>
+ * # for example:
+ * text/plain txt text TXT
+ * # this would map file.txt, file.text, and file.TXT to
+ * # the mime type "text/plain"
+ * getContentType(f.getName())
.
+ *
+ * @param f the file
+ * @return the file's MIME type
+ */
+ public String getContentType(File f) {
+ return this.getContentType(f.getName());
+ }
+
+ /**
+ * Return the MIME type based on the specified file name.
+ * The MIME type entries are searched as described above under
+ * MIME types file search order.
+ * If no entry is found, the type "application/octet-stream" is returned.
+ *
+ * @param filename the file name
+ * @return the file's MIME type
+ */
+ public synchronized String getContentType(String filename) {
+ int dot_pos = filename.lastIndexOf("."); // period index
+
+ if (dot_pos < 0)
+ return defaultType;
+
+ String file_ext = filename.substring(dot_pos + 1);
+ if (file_ext.length() == 0)
+ return defaultType;
+
+ for (int i = 0; i < DB.length; i++) {
+ if (DB[i] == null)
+ continue;
+ String result = DB[i].getMIMETypeString(file_ext);
+ if (result != null)
+ return result;
+ }
+ return defaultType;
+ }
+
+ /**
+ * for debugging...
+ *
+ public static void main(String[] argv) throws Exception {
+ MimetypesFileTypeMap map = new MimetypesFileTypeMap();
+ System.out.println("File " + argv[0] + " has MIME type " +
+ map.getContentType(argv[0]));
+ System.exit(0);
+ }
+ */
+}
diff --git a/fine-third-jdk11/src/javax/activation/SecuritySupport.java b/fine-third-jdk11/src/javax/activation/SecuritySupport.java
new file mode 100644
index 000000000..cf6943e43
--- /dev/null
+++ b/fine-third-jdk11/src/javax/activation/SecuritySupport.java
@@ -0,0 +1,144 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common Development
+ * and Distribution License("CDDL") (collectively, the "License"). You
+ * may not use this file except in compliance with the License. You can
+ * obtain a copy of the License at
+ * https://oss.oracle.com/licenses/CDDL+GPL-1.1
+ * or LICENSE.txt. See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice in each
+ * file and include the License file at LICENSE.txt.
+ *
+ * GPL Classpath Exception:
+ * Oracle designates this particular file as subject to the "Classpath"
+ * exception as provided by Oracle in the GPL Version 2 section of the License
+ * file that accompanied this code.
+ *
+ * Modifications:
+ * If applicable, add the following below the License Header, with the fields
+ * enclosed by brackets [] replaced by your own identifying information:
+ * "Portions Copyright [year] [name of copyright owner]"
+ *
+ * Contributor(s):
+ * If you wish your version of this file to be governed by only the CDDL or
+ * only the GPL Version 2, indicate your decision by adding "[Contributor]
+ * elects to include this software in this distribution under the [CDDL or GPL
+ * Version 2] license." If you don't indicate a single choice of license, a
+ * recipient has the option to distribute your version of this file under
+ * either the CDDL, the GPL Version 2 or to extend the choice of license to
+ * its licensees as provided above. However, if you add GPL Version 2 code
+ * and therefore, elected the GPL Version 2 license, then the option applies
+ * only if the new code is made subject to such option by the copyright
+ * holder.
+ */
+
+package javax.activation;
+
+import java.security.*;
+import java.net.*;
+import java.io.*;
+import java.util.*;
+
+/**
+ * Security related methods that only work on J2SE 1.2 and newer.
+ */
+class SecuritySupport {
+
+ private SecuritySupport() {
+ // private constructor, can't create an instance
+ }
+
+ public static ClassLoader getContextClassLoader() {
+ return (ClassLoader)
+ AccessController.doPrivileged(new PrivilegedAction() {
+ public Object run() {
+ ClassLoader cl = null;
+ try {
+ cl = Thread.currentThread().getContextClassLoader();
+ } catch (SecurityException ex) { }
+ return cl;
+ }
+ });
+ }
+
+ public static InputStream getResourceAsStream(final Class c,
+ final String name) throws IOException {
+ try {
+ return (InputStream)
+ AccessController.doPrivileged(new PrivilegedExceptionAction() {
+ public Object run() throws IOException {
+ return c.getResourceAsStream(name);
+ }
+ });
+ } catch (PrivilegedActionException e) {
+ throw (IOException)e.getException();
+ }
+ }
+
+ public static URL[] getResources(final ClassLoader cl, final String name) {
+ return (URL[])
+ AccessController.doPrivileged(new PrivilegedAction() {
+ public Object run() {
+ URL[] ret = null;
+ try {
+ List v = new ArrayList();
+ Enumeration e = cl.getResources(name);
+ while (e != null && e.hasMoreElements()) {
+ URL url = (URL)e.nextElement();
+ if (url != null)
+ v.add(url);
+ }
+ if (v.size() > 0) {
+ ret = new URL[v.size()];
+ ret = (URL[])v.toArray(ret);
+ }
+ } catch (IOException ioex) {
+ } catch (SecurityException ex) { }
+ return ret;
+ }
+ });
+ }
+
+ public static URL[] getSystemResources(final String name) {
+ return (URL[])
+ AccessController.doPrivileged(new PrivilegedAction() {
+ public Object run() {
+ URL[] ret = null;
+ try {
+ List v = new ArrayList();
+ Enumeration e = ClassLoader.getSystemResources(name);
+ while (e != null && e.hasMoreElements()) {
+ URL url = (URL)e.nextElement();
+ if (url != null)
+ v.add(url);
+ }
+ if (v.size() > 0) {
+ ret = new URL[v.size()];
+ ret = (URL[])v.toArray(ret);
+ }
+ } catch (IOException ioex) {
+ } catch (SecurityException ex) { }
+ return ret;
+ }
+ });
+ }
+
+ public static InputStream openStream(final URL url) throws IOException {
+ try {
+ return (InputStream)
+ AccessController.doPrivileged(new PrivilegedExceptionAction() {
+ public Object run() throws IOException {
+ return url.openStream();
+ }
+ });
+ } catch (PrivilegedActionException e) {
+ throw (IOException)e.getException();
+ }
+ }
+}
diff --git a/fine-third-jdk11/src/javax/activation/URLDataSource.java b/fine-third-jdk11/src/javax/activation/URLDataSource.java
new file mode 100644
index 000000000..f5b937e7a
--- /dev/null
+++ b/fine-third-jdk11/src/javax/activation/URLDataSource.java
@@ -0,0 +1,150 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common Development
+ * and Distribution License("CDDL") (collectively, the "License"). You
+ * may not use this file except in compliance with the License. You can
+ * obtain a copy of the License at
+ * https://oss.oracle.com/licenses/CDDL+GPL-1.1
+ * or LICENSE.txt. See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice in each
+ * file and include the License file at LICENSE.txt.
+ *
+ * GPL Classpath Exception:
+ * Oracle designates this particular file as subject to the "Classpath"
+ * exception as provided by Oracle in the GPL Version 2 section of the License
+ * file that accompanied this code.
+ *
+ * Modifications:
+ * If applicable, add the following below the License Header, with the fields
+ * enclosed by brackets [] replaced by your own identifying information:
+ * "Portions Copyright [year] [name of copyright owner]"
+ *
+ * Contributor(s):
+ * If you wish your version of this file to be governed by only the CDDL or
+ * only the GPL Version 2, indicate your decision by adding "[Contributor]
+ * elects to include this software in this distribution under the [CDDL or GPL
+ * Version 2] license." If you don't indicate a single choice of license, a
+ * recipient has the option to distribute your version of this file under
+ * either the CDDL, the GPL Version 2 or to extend the choice of license to
+ * its licensees as provided above. However, if you add GPL Version 2 code
+ * and therefore, elected the GPL Version 2 license, then the option applies
+ * only if the new code is made subject to such option by the copyright
+ * holder.
+ */
+
+package javax.activation;
+
+import java.net.URL;
+import java.net.URLConnection;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.IOException;
+
+/**
+ * The URLDataSource class provides an object that wraps a URL
+ * object in a DataSource interface. URLDataSource simplifies the handling
+ * of data described by URLs within the JavaBeans Activation Framework
+ * because this class can be used to create new DataHandlers. NOTE: The
+ * DataHandler object creates a URLDataSource internally,
+ * when it is constructed with a URL.
+ *
+ * @see javax.activation.DataSource
+ * @see javax.activation.DataHandler
+ */
+public class URLDataSource implements DataSource {
+ private URL url = null;
+ private URLConnection url_conn = null;
+
+ /**
+ * URLDataSource constructor. The URLDataSource class will
+ * not open a connection to the URL until a method requiring it
+ * to do so is called.
+ *
+ * @param url The URL to be encapsulated in this object.
+ */
+ public URLDataSource(URL url) {
+ this.url = url;
+ }
+
+ /**
+ * Returns the value of the URL content-type header field.
+ * It calls the URL's URLConnection.getContentType
method
+ * after retrieving a URLConnection object.
+ * Note: this method attempts to call the openConnection
+ * method on the URL. If this method fails, or if a content type is not
+ * returned from the URLConnection, getContentType returns
+ * "application/octet-stream" as the content type.
+ *
+ * @return the content type.
+ */
+ public String getContentType() {
+ String type = null;
+
+ try {
+ if (url_conn == null)
+ url_conn = url.openConnection();
+ } catch (IOException e) { }
+
+ if (url_conn != null)
+ type = url_conn.getContentType();
+
+ if (type == null)
+ type = "application/octet-stream";
+
+ return type;
+ }
+
+ /**
+ * Calls the getFile
method on the URL used to
+ * instantiate the object.
+ *
+ * @return the result of calling the URL's getFile method.
+ */
+ public String getName() {
+ return url.getFile();
+ }
+
+ /**
+ * The getInputStream method from the URL. Calls the
+ * openStream
method on the URL.
+ *
+ * @return the InputStream.
+ */
+ public InputStream getInputStream() throws IOException {
+ return url.openStream();
+ }
+
+ /**
+ * The getOutputStream method from the URL. First an attempt is
+ * made to get the URLConnection object for the URL. If that
+ * succeeds, the getOutputStream method on the URLConnection
+ * is returned.
+ *
+ * @return the OutputStream.
+ */
+ public OutputStream getOutputStream() throws IOException {
+ // get the url connection if it is available
+ url_conn = url.openConnection();
+
+ if (url_conn != null) {
+ url_conn.setDoOutput(true);
+ return url_conn.getOutputStream();
+ } else
+ return null;
+ }
+
+ /**
+ * Return the URL used to create this DataSource.
+ *
+ * @return The URL.
+ */
+ public URL getURL() {
+ return url;
+ }
+}
diff --git a/fine-third-jdk11/src/javax/activation/UnsupportedDataTypeException.java b/fine-third-jdk11/src/javax/activation/UnsupportedDataTypeException.java
new file mode 100644
index 000000000..6358d6d0d
--- /dev/null
+++ b/fine-third-jdk11/src/javax/activation/UnsupportedDataTypeException.java
@@ -0,0 +1,70 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common Development
+ * and Distribution License("CDDL") (collectively, the "License"). You
+ * may not use this file except in compliance with the License. You can
+ * obtain a copy of the License at
+ * https://oss.oracle.com/licenses/CDDL+GPL-1.1
+ * or LICENSE.txt. See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice in each
+ * file and include the License file at LICENSE.txt.
+ *
+ * GPL Classpath Exception:
+ * Oracle designates this particular file as subject to the "Classpath"
+ * exception as provided by Oracle in the GPL Version 2 section of the License
+ * file that accompanied this code.
+ *
+ * Modifications:
+ * If applicable, add the following below the License Header, with the fields
+ * enclosed by brackets [] replaced by your own identifying information:
+ * "Portions Copyright [year] [name of copyright owner]"
+ *
+ * Contributor(s):
+ * If you wish your version of this file to be governed by only the CDDL or
+ * only the GPL Version 2, indicate your decision by adding "[Contributor]
+ * elects to include this software in this distribution under the [CDDL or GPL
+ * Version 2] license." If you don't indicate a single choice of license, a
+ * recipient has the option to distribute your version of this file under
+ * either the CDDL, the GPL Version 2 or to extend the choice of license to
+ * its licensees as provided above. However, if you add GPL Version 2 code
+ * and therefore, elected the GPL Version 2 license, then the option applies
+ * only if the new code is made subject to such option by the copyright
+ * holder.
+ */
+
+package javax.activation;
+
+import java.io.IOException;
+
+/**
+ * Signals that the requested operation does not support the
+ * requested data type.
+ *
+ * @see javax.activation.DataHandler
+ */
+
+public class UnsupportedDataTypeException extends IOException {
+ /**
+ * Constructs an UnsupportedDataTypeException with no detail
+ * message.
+ */
+ public UnsupportedDataTypeException() {
+ super();
+ }
+
+ /**
+ * Constructs an UnsupportedDataTypeException with the specified
+ * message.
+ *
+ * @param s The detail message.
+ */
+ public UnsupportedDataTypeException(String s) {
+ super(s);
+ }
+}
diff --git a/fine-third-jdk11/src/javax/activation/package.html b/fine-third-jdk11/src/javax/activation/package.html
new file mode 100644
index 000000000..8392470f2
--- /dev/null
+++ b/fine-third-jdk11/src/javax/activation/package.html
@@ -0,0 +1,53 @@
+
+
+Generated
annotation is used to mark source code
+ * that has been generated.
+ * It can also be used to differentiate user written code from generated code
+ * in a single file.
+ * value
element must have the name of the
+ * code generator. The recommended convention is to use the fully qualified
+ * name of the code generator in the value field,
+ * for example com.company.package.classname
.date
element is used to indicate the date the
+ * source was generated.
+ * The date
element must follow the ISO 8601 standard.
+ * For example, the date
element could have the
+ * value 2001-07-04T12:08:56.235-0700
,
+ * which represents 2001-07-04 12:08:56 local time in the U.S. Pacific
+ * time zone.comment
element is a place holder for any comments
+ * that the code generator may want to include in the generated code.com.acme.generator.CodeGen
.
+ */
+ String[] value();
+
+ /**
+ * Date when the source was generated.
+ */
+ String date() default "";
+
+ /**
+ * A place holder for any comments that the code generator may want to
+ * include in the generated code.
+ */
+ String comments() default "";
+}
+
diff --git a/fine-third-jdk11/src/javax/annotation/ManagedBean.java b/fine-third-jdk11/src/javax/annotation/ManagedBean.java
new file mode 100644
index 000000000..30c10d319
--- /dev/null
+++ b/fine-third-jdk11/src/javax/annotation/ManagedBean.java
@@ -0,0 +1,70 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2009-2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common Development
+ * and Distribution License("CDDL") (collectively, the "License"). You
+ * may not use this file except in compliance with the License. You can
+ * obtain a copy of the License at
+ * https://oss.oracle.com/licenses/CDDL+GPL-1.1
+ * or LICENSE.txt. See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice in each
+ * file and include the License file at LICENSE.txt.
+ *
+ * GPL Classpath Exception:
+ * Oracle designates this particular file as subject to the "Classpath"
+ * exception as provided by Oracle in the GPL Version 2 section of the License
+ * file that accompanied this code.
+ *
+ * Modifications:
+ * If applicable, add the following below the License Header, with the fields
+ * enclosed by brackets [] replaced by your own identifying information:
+ * "Portions Copyright [year] [name of copyright owner]"
+ *
+ * Contributor(s):
+ * If you wish your version of this file to be governed by only the CDDL or
+ * only the GPL Version 2, indicate your decision by adding "[Contributor]
+ * elects to include this software in this distribution under the [CDDL or GPL
+ * Version 2] license." If you don't indicate a single choice of license, a
+ * recipient has the option to distribute your version of this file under
+ * either the CDDL, the GPL Version 2 or to extend the choice of license to
+ * its licensees as provided above. However, if you add GPL Version 2 code
+ * and therefore, elected the GPL Version 2 license, then the option applies
+ * only if the new code is made subject to such option by the copyright
+ * holder.
+ */
+
+package javax.annotation;
+
+import java.lang.annotation.*;
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+/**
+ * The ManagedBean
annotation marks a POJO (Plain Old Java Object)
+ * as a ManagedBean. A ManagedBean supports a small set of basic services
+ * such as resource injection, lifecycle callbacks and interceptors.
+ *
+ * @since Common Annotations 1.1
+ */
+@Target(TYPE)
+@Retention(RUNTIME)
+public @interface ManagedBean {
+ /**
+ * The name of the Managed Bean. Managed Bean names must be unique within a
+ * Java EE module. For each named Managed Bean, Java EE containers must make
+ * available the following entries in JNDI, using the same naming scheme used
+ * for EJB components.
+ * PostConstruct
annotation is used on a method that
+ * needs to be executed after dependency injection is done to perform
+ * any initialization. This method must be invoked before the class
+ * is put into service. This annotation must be supported on all classes
+ * that support dependency injection. The method annotated with
+ * PostConstruct
must be invoked even if the class does
+ * not request any resources to be injected. Only one
+ * method in a given class can be annotated with this annotation.
+ * The method on which the PostConstruct
annotation is
+ * applied must fulfill all of the following criteria:
+ *
+ *
+ *
+ * @see javax.annotation.PreDestroy
+ * @see javax.annotation.Resource
+ * @since 1.6, Common Annotations 1.0
+ */
+@Documented
+@Retention (RUNTIME)
+@Target(METHOD)
+public @interface PostConstruct {
+}
diff --git a/fine-third-jdk11/src/javax/annotation/PreDestroy.java b/fine-third-jdk11/src/javax/annotation/PreDestroy.java
new file mode 100644
index 000000000..c7c113ef0
--- /dev/null
+++ b/fine-third-jdk11/src/javax/annotation/PreDestroy.java
@@ -0,0 +1,97 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2005-2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common Development
+ * and Distribution License("CDDL") (collectively, the "License"). You
+ * may not use this file except in compliance with the License. You can
+ * obtain a copy of the License at
+ * https://oss.oracle.com/licenses/CDDL+GPL-1.1
+ * or LICENSE.txt. See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice in each
+ * file and include the License file at LICENSE.txt.
+ *
+ * GPL Classpath Exception:
+ * Oracle designates this particular file as subject to the "Classpath"
+ * exception as provided by Oracle in the GPL Version 2 section of the License
+ * file that accompanied this code.
+ *
+ * Modifications:
+ * If applicable, add the following below the License Header, with the fields
+ * enclosed by brackets [] replaced by your own identifying information:
+ * "Portions Copyright [year] [name of copyright owner]"
+ *
+ * Contributor(s):
+ * If you wish your version of this file to be governed by only the CDDL or
+ * only the GPL Version 2, indicate your decision by adding "[Contributor]
+ * elects to include this software in this distribution under the [CDDL or GPL
+ * Version 2] license." If you don't indicate a single choice of license, a
+ * recipient has the option to distribute your version of this file under
+ * either the CDDL, the GPL Version 2 or to extend the choice of license to
+ * its licensees as provided above. However, if you add GPL Version 2 code
+ * and therefore, elected the GPL Version 2 license, then the option applies
+ * only if the new code is made subject to such option by the copyright
+ * holder.
+ */
+
+package javax.annotation;
+
+import java.lang.annotation.*;
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+/**
+ * The InvocationContext
+ * object as defined by the Interceptors specification.PostConstruct
annotation
+ * is applied may be public, protected, package private or private.PreDestroy
annotation is used on a method as a
+ * callback notification to signal that the instance is in the
+ * process of being removed by the container. The method annotated
+ * with PreDestroy
is typically used to
+ * release resources that it has been holding. This annotation must be
+ * supported by all container-managed objects that support the use of
+ * the PostConstruct
annotation except the Java EE application
+ * client. The method on which the PreDestroy
annotation
+ * is applied must fulfill all of the following criteria:
+ *
+ *
+ *
+ * @see javax.annotation.PostConstruct
+ * @see javax.annotation.Resource
+ * @since 1.6, Common Annotations 1.0
+ */
+
+@Documented
+@Retention (RUNTIME)
+@Target(METHOD)
+public @interface PreDestroy {
+}
diff --git a/fine-third-jdk11/src/javax/annotation/Priority.java b/fine-third-jdk11/src/javax/annotation/Priority.java
new file mode 100644
index 000000000..21fac05a7
--- /dev/null
+++ b/fine-third-jdk11/src/javax/annotation/Priority.java
@@ -0,0 +1,74 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2005-2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common Development
+ * and Distribution License("CDDL") (collectively, the "License"). You
+ * may not use this file except in compliance with the License. You can
+ * obtain a copy of the License at
+ * https://oss.oracle.com/licenses/CDDL+GPL-1.1
+ * or LICENSE.txt. See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice in each
+ * file and include the License file at LICENSE.txt.
+ *
+ * GPL Classpath Exception:
+ * Oracle designates this particular file as subject to the "Classpath"
+ * exception as provided by Oracle in the GPL Version 2 section of the License
+ * file that accompanied this code.
+ *
+ * Modifications:
+ * If applicable, add the following below the License Header, with the fields
+ * enclosed by brackets [] replaced by your own identifying information:
+ * "Portions Copyright [year] [name of copyright owner]"
+ *
+ * Contributor(s):
+ * If you wish your version of this file to be governed by only the CDDL or
+ * only the GPL Version 2, indicate your decision by adding "[Contributor]
+ * elects to include this software in this distribution under the [CDDL or GPL
+ * Version 2] license." If you don't indicate a single choice of license, a
+ * recipient has the option to distribute your version of this file under
+ * either the CDDL, the GPL Version 2 or to extend the choice of license to
+ * its licensees as provided above. However, if you add GPL Version 2 code
+ * and therefore, elected the GPL Version 2 license, then the option applies
+ * only if the new code is made subject to such option by the copyright
+ * holder.
+ */
+
+package javax.annotation;
+
+import java.lang.annotation.*;
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+/**
+ * The InvocationContext
+ * object as defined by the Interceptors specification.Priority
annotation can be applied to classes
+ * or parameters to indicate in what order they should be used.
+ * The effect of using the Priority
annotation in
+ * any particular instance is defined by other specifications that
+ * define the use of a specific class.
+ * Priority
annotation may define
+ * the range of allowed priorities and any priority values with special
+ * meaning.Resource
annotation marks a resource that is needed
+ * by the application. This annotation may be applied to an
+ * application component class, or to fields or methods of the
+ * component class. When the annotation is applied to a
+ * field or method, the container will inject an instance
+ * of the requested resource into the application component
+ * when the component is initialized. If the annotation is
+ * applied to the component class, the annotation declares a
+ * resource that the application will look up at runtime.
+ * Inherited
, deployment
+ * tools are required to examine all superclasses of any component
+ * class to discover all uses of this annotation in all superclasses.
+ * All such annotation instances specify resources that are needed
+ * by the application component. Note that this annotation may
+ * appear on private fields and methods of superclasses; the container
+ * is required to perform injection in these cases as well.mappedName
element provides for mapping the
+ * resource reference to the name of a resource known to the
+ * applicaiton server. The mapped name could be of any form.
+ * DeclareRoles
+ * annotation is a list of security role names.
+ *
+ * @since Common Annotations 1.0
+ */
+@Documented
+@Retention (RUNTIME)
+@Target(TYPE)
+public @interface DeclareRoles {
+ /**
+ * List of security role names.
+ */
+ String[] value();
+}
diff --git a/fine-third-jdk11/src/javax/annotation/security/DenyAll.java b/fine-third-jdk11/src/javax/annotation/security/DenyAll.java
new file mode 100644
index 000000000..c0aa5db54
--- /dev/null
+++ b/fine-third-jdk11/src/javax/annotation/security/DenyAll.java
@@ -0,0 +1,58 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2005-2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common Development
+ * and Distribution License("CDDL") (collectively, the "License"). You
+ * may not use this file except in compliance with the License. You can
+ * obtain a copy of the License at
+ * https://oss.oracle.com/licenses/CDDL+GPL-1.1
+ * or LICENSE.txt. See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice in each
+ * file and include the License file at LICENSE.txt.
+ *
+ * GPL Classpath Exception:
+ * Oracle designates this particular file as subject to the "Classpath"
+ * exception as provided by Oracle in the GPL Version 2 section of the License
+ * file that accompanied this code.
+ *
+ * Modifications:
+ * If applicable, add the following below the License Header, with the fields
+ * enclosed by brackets [] replaced by your own identifying information:
+ * "Portions Copyright [year] [name of copyright owner]"
+ *
+ * Contributor(s):
+ * If you wish your version of this file to be governed by only the CDDL or
+ * only the GPL Version 2, indicate your decision by adding "[Contributor]
+ * elects to include this software in this distribution under the [CDDL or GPL
+ * Version 2] license." If you don't indicate a single choice of license, a
+ * recipient has the option to distribute your version of this file under
+ * either the CDDL, the GPL Version 2 or to extend the choice of license to
+ * its licensees as provided above. However, if you add GPL Version 2 code
+ * and therefore, elected the GPL Version 2 license, then the option applies
+ * only if the new code is made subject to such option by the copyright
+ * holder.
+ */
+
+package javax.annotation.security;
+import java.lang.annotation.*;
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+/**
+ * Specifies that no security roles are allowed to invoke the specified
+ * method(s).
+ *
+ * @see javax.annotation.security.RolesAllowed
+ * @see javax.annotation.security.PermitAll
+ * @since Common Annotations 1.0
+ */
+@Documented
+@Retention (RUNTIME)
+@Target({TYPE, METHOD})
+public @interface DenyAll {
+}
diff --git a/fine-third-jdk11/src/javax/annotation/security/PermitAll.java b/fine-third-jdk11/src/javax/annotation/security/PermitAll.java
new file mode 100644
index 000000000..f4ad071e5
--- /dev/null
+++ b/fine-third-jdk11/src/javax/annotation/security/PermitAll.java
@@ -0,0 +1,66 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2005-2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common Development
+ * and Distribution License("CDDL") (collectively, the "License"). You
+ * may not use this file except in compliance with the License. You can
+ * obtain a copy of the License at
+ * https://oss.oracle.com/licenses/CDDL+GPL-1.1
+ * or LICENSE.txt. See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice in each
+ * file and include the License file at LICENSE.txt.
+ *
+ * GPL Classpath Exception:
+ * Oracle designates this particular file as subject to the "Classpath"
+ * exception as provided by Oracle in the GPL Version 2 section of the License
+ * file that accompanied this code.
+ *
+ * Modifications:
+ * If applicable, add the following below the License Header, with the fields
+ * enclosed by brackets [] replaced by your own identifying information:
+ * "Portions Copyright [year] [name of copyright owner]"
+ *
+ * Contributor(s):
+ * If you wish your version of this file to be governed by only the CDDL or
+ * only the GPL Version 2, indicate your decision by adding "[Contributor]
+ * elects to include this software in this distribution under the [CDDL or GPL
+ * Version 2] license." If you don't indicate a single choice of license, a
+ * recipient has the option to distribute your version of this file under
+ * either the CDDL, the GPL Version 2 or to extend the choice of license to
+ * its licensees as provided above. However, if you add GPL Version 2 code
+ * and therefore, elected the GPL Version 2 license, then the option applies
+ * only if the new code is made subject to such option by the copyright
+ * holder.
+ */
+
+package javax.annotation.security;
+import java.lang.annotation.*;
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+/**
+ * Specifies that all security roles are allowed to invoke the specified
+ * method(s) — i.e., that the specified method(s) are "unchecked".
+ * It can be specified on a class or on methods. Specifying it on the class
+ * means that it applies to all methods of the class. If specified at the
+ * method level, it only affects that method. If the RolesAllowed
+ * annotation is specified at the class level and this annotation is
+ * applied at the method level, the PermitAll
+ * annotation overrides the RolesAllowed
annotation for
+ * the specified method.
+ *
+ * @see javax.annotation.security.RolesAllowed
+ * @see javax.annotation.security.DenyAll
+ *
+ * @since Common Annotations 1.0
+ */
+@Documented
+@Retention (RUNTIME)
+@Target({TYPE, METHOD})
+public @interface PermitAll {
+}
diff --git a/fine-third-jdk11/src/javax/annotation/security/RolesAllowed.java b/fine-third-jdk11/src/javax/annotation/security/RolesAllowed.java
new file mode 100644
index 000000000..74ffb29f9
--- /dev/null
+++ b/fine-third-jdk11/src/javax/annotation/security/RolesAllowed.java
@@ -0,0 +1,66 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2005-2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common Development
+ * and Distribution License("CDDL") (collectively, the "License"). You
+ * may not use this file except in compliance with the License. You can
+ * obtain a copy of the License at
+ * https://oss.oracle.com/licenses/CDDL+GPL-1.1
+ * or LICENSE.txt. See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice in each
+ * file and include the License file at LICENSE.txt.
+ *
+ * GPL Classpath Exception:
+ * Oracle designates this particular file as subject to the "Classpath"
+ * exception as provided by Oracle in the GPL Version 2 section of the License
+ * file that accompanied this code.
+ *
+ * Modifications:
+ * If applicable, add the following below the License Header, with the fields
+ * enclosed by brackets [] replaced by your own identifying information:
+ * "Portions Copyright [year] [name of copyright owner]"
+ *
+ * Contributor(s):
+ * If you wish your version of this file to be governed by only the CDDL or
+ * only the GPL Version 2, indicate your decision by adding "[Contributor]
+ * elects to include this software in this distribution under the [CDDL or GPL
+ * Version 2] license." If you don't indicate a single choice of license, a
+ * recipient has the option to distribute your version of this file under
+ * either the CDDL, the GPL Version 2 or to extend the choice of license to
+ * its licensees as provided above. However, if you add GPL Version 2 code
+ * and therefore, elected the GPL Version 2 license, then the option applies
+ * only if the new code is made subject to such option by the copyright
+ * holder.
+ */
+
+package javax.annotation.security;
+import java.lang.annotation.*;
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+/**
+ * Specifies the list of security roles permitted to access method(s) in an
+ * application. The value of the RolesAllowed
annotation
+ * is a list of security role names.
+ * This annotation can be specified on a class or on method(s). Specifying it
+ * at a class level means that it applies to all the methods in the class.
+ * Specifying it on a method means that it is applicable to that method only.
+ * If applied at both the class and methods level, the method value overrides
+ * the class value if the two conflict.
+ *
+ * @since Common Annotations 1.0
+ */
+@Documented
+@Retention (RUNTIME)
+@Target({TYPE, METHOD})
+public @interface RolesAllowed {
+ /**
+ * List of roles that are permitted access.
+ */
+ String[] value();
+}
diff --git a/fine-third-jdk11/src/javax/annotation/security/RunAs.java b/fine-third-jdk11/src/javax/annotation/security/RunAs.java
new file mode 100644
index 000000000..e31f7e6e6
--- /dev/null
+++ b/fine-third-jdk11/src/javax/annotation/security/RunAs.java
@@ -0,0 +1,62 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2005-2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common Development
+ * and Distribution License("CDDL") (collectively, the "License"). You
+ * may not use this file except in compliance with the License. You can
+ * obtain a copy of the License at
+ * https://oss.oracle.com/licenses/CDDL+GPL-1.1
+ * or LICENSE.txt. See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice in each
+ * file and include the License file at LICENSE.txt.
+ *
+ * GPL Classpath Exception:
+ * Oracle designates this particular file as subject to the "Classpath"
+ * exception as provided by Oracle in the GPL Version 2 section of the License
+ * file that accompanied this code.
+ *
+ * Modifications:
+ * If applicable, add the following below the License Header, with the fields
+ * enclosed by brackets [] replaced by your own identifying information:
+ * "Portions Copyright [year] [name of copyright owner]"
+ *
+ * Contributor(s):
+ * If you wish your version of this file to be governed by only the CDDL or
+ * only the GPL Version 2, indicate your decision by adding "[Contributor]
+ * elects to include this software in this distribution under the [CDDL or GPL
+ * Version 2] license." If you don't indicate a single choice of license, a
+ * recipient has the option to distribute your version of this file under
+ * either the CDDL, the GPL Version 2 or to extend the choice of license to
+ * its licensees as provided above. However, if you add GPL Version 2 code
+ * and therefore, elected the GPL Version 2 license, then the option applies
+ * only if the new code is made subject to such option by the copyright
+ * holder.
+ */
+
+package javax.annotation.security;
+import java.lang.annotation.*;
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+/**
+ * Defines the identity of the application during execution.
+ * This allows developers to execute an application under a particular role.
+ * The role must map to the user / group information in the container's
+ * security realm. Its value is the name of a security role.
+ *
+ * @since Common Annotations 1.0
+ */
+@Documented
+@Retention (RUNTIME)
+@Target(TYPE)
+public @interface RunAs {
+ /**
+ * Name of a security role.
+ */
+ String value();
+}
diff --git a/fine-third-jdk11/src/javax/annotation/security/package.html b/fine-third-jdk11/src/javax/annotation/security/package.html
new file mode 100644
index 000000000..5a195df8a
--- /dev/null
+++ b/fine-third-jdk11/src/javax/annotation/security/package.html
@@ -0,0 +1,47 @@
+
+
+
+
+ This package contains the security common annotations.
+
+
diff --git a/fine-third-jdk11/src/javax/annotation/sql/DataSourceDefinition.java b/fine-third-jdk11/src/javax/annotation/sql/DataSourceDefinition.java
new file mode 100644
index 000000000..bb3d68ad5
--- /dev/null
+++ b/fine-third-jdk11/src/javax/annotation/sql/DataSourceDefinition.java
@@ -0,0 +1,337 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2009-2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common Development
+ * and Distribution License("CDDL") (collectively, the "License"). You
+ * may not use this file except in compliance with the License. You can
+ * obtain a copy of the License at
+ * https://oss.oracle.com/licenses/CDDL+GPL-1.1
+ * or LICENSE.txt. See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice in each
+ * file and include the License file at LICENSE.txt.
+ *
+ * GPL Classpath Exception:
+ * Oracle designates this particular file as subject to the "Classpath"
+ * exception as provided by Oracle in the GPL Version 2 section of the License
+ * file that accompanied this code.
+ *
+ * Modifications:
+ * If applicable, add the following below the License Header, with the fields
+ * enclosed by brackets [] replaced by your own identifying information:
+ * "Portions Copyright [year] [name of copyright owner]"
+ *
+ * Contributor(s):
+ * If you wish your version of this file to be governed by only the CDDL or
+ * only the GPL Version 2, indicate your decision by adding "[Contributor]
+ * elects to include this software in this distribution under the [CDDL or GPL
+ * Version 2] license." If you don't indicate a single choice of license, a
+ * recipient has the option to distribute your version of this file under
+ * either the CDDL, the GPL Version 2 or to extend the choice of license to
+ * its licensees as provided above. However, if you add GPL Version 2 code
+ * and therefore, elected the GPL Version 2 license, then the option applies
+ * only if the new code is made subject to such option by the copyright
+ * holder.
+ */
+
+package javax.annotation.sql;
+
+import java.lang.annotation.*;
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.RetentionPolicy;
+
+/**
+ * Annotation used to define a container DataSource
to
+ * be registered with JNDI. The DataSource
may be configured by
+ * setting the annotation elements for commonly used DataSource
+ * properties. Additional standard and vendor-specific properties may be
+ * specified using the properties
element.
+ * name
element. It may be defined to be in any valid
+ * Java EE namespace, which will determine the accessibility of
+ * the data source from other components.
+ * DataSource
, ConnectionPoolDataSource
, or
+ * XADataSource
, must be indicated by the className
+ * element. The availability of the driver class will be assumed at runtime.
+ *
+ * @DataSourceDefinition(name="java:global/MyApp/MyDataSource",
+ * className="org.apache.derby.jdbc.ClientDataSource",
+ * url="jdbc:derby://localhost:1527/myDB;user=bill",
+ * user="lance",
+ * password="secret",
+ * databaseName="testDB",
+ * serverName="luckydog"
+ * )// DO NOT DO THIS!!!
+ *
+ * databaseName
, user
+ * and serverName
properties were specified as part of the
+ * url
property and using the corresponding
+ * annotation elements. This should be avoided.
+ * properties
annotation element is used and contains a
+ * DataSource property that was also specified using the corresponding
+ * annotation element, the annotation element value takes precedence.
+ * For example:
+ *
+ * @DataSourceDefinition(name="java:global/MyApp/MyDataSource",
+ * className="org.apache.derby.jdbc.ClientDataSource",
+ * user="lance",
+ * password="secret",
+ * databaseName="testDB",
+ * serverName="luckydog",
+ * properties= {"databaseName=myDB", "databaseProp=doThis"}
+ * )// DO NOT DO THIS!!!
+ *
+ *
+ *
+ * transactional
property to be true
but supplying
+ * a value for className
that implements a data source class
+ * other than XADataSource
may not be supported.
+ * DataSource
properties that are specified and are not supported
+ * in a given configuration or cannot be mapped to a vendor specific
+ * configuration property may be ignored.
+ *
+ *
+ * @DataSourceDefinition(name="java:global/MyApp/MyDataSource",
+ * className="com.foobar.MyDataSource",
+ * portNumber=6689,
+ * serverName="myserver.com",
+ * user="lance",
+ * password="secret"
+ * )
+ *
+ *
+ * URL
:
+ *
+ *
+ * @DataSourceDefinition(name="java:global/MyApp/MyDataSource",
+ * className="org.apache.derby.jdbc.ClientDataSource",
+ * url="jdbc:derby://localhost:1527/myDB",
+ * user="lance",
+ * password="secret"
+ * )
+ *
+ *
+ * @Stateless
+ * public class MyStatelessEJB {
+ * @Resource(lookup="java:global/MyApp/myDataSource")
+ * DataSource myDB;
+ * ...
+ * }
+ *
+ * javax.sql.DataSource
or javax.sql.XADataSource
+ * or javax.sql.ConnectionPoolDataSource
.
+ * @since 1.1
+ */
+ String className();
+
+ /**
+ * Description of this data source
+ * @since 1.1
+ */
+ String description() default "";
+
+ /**
+ * A JDBC URL. If the url
annotation element contains a
+ * DataSource property that was also specified using the corresponding
+ * annotation element, the precedence order is undefined and
+ * implementation specific.
+ * @since 1.1
+ */
+ String url() default "";
+
+ /**
+ * User name to use for connection authentication.
+ * @since 1.1
+ */
+ String user() default "";
+
+ /**
+ * Password to use for connection authentication.
+ * @since 1.1
+ */
+ String password() default "";
+
+ /**
+ * Name of a database on a server.
+ * @since 1.1
+ */
+ String databaseName() default "";
+
+ /**
+ * Port number where a server is listening for requests.
+ * @since 1.1
+ */
+ int portNumber() default -1;
+
+ /**
+ * Database server name.
+ * @since 1.1
+ */
+ String serverName() default "localhost";
+
+ /**
+ * Isolation level for connections. The Isolation level
+ * must be one of the following:
+ *
+ *
+ * false
if connections should not participate
+ * in transactions.
+ * DataSource
properties such as:
+ *
+ *
+ * properties
+ * element and the annotation element for the property is also
+ * specified, the annotation element value takes precedence.
+ * @since 1.1
+ */
+ String[] properties() default {};
+
+
+ /**
+ * Sets the maximum time in seconds that this data source will wait while
+ * attempting to connect to a database. A value of zero specifies that
+ * the timeout is the default system timeout if there is one; otherwise,
+ * it specifies that there is no timeout.
+ * DataSourceDefinition
annotations.
+ *
+ * @see javax.annotation.sql.DataSourceDefinition
+ * @since Common Annotations 1.1
+ */
+@Target({ElementType.TYPE})
+@Retention(RetentionPolicy.RUNTIME)
+public @interface DataSourceDefinitions {
+ DataSourceDefinition[] value ();
+
+}
diff --git a/fine-ehcache/src/javax/jms/BytesMessage.java b/fine-third-jdk11/src/javax/jms/BytesMessage.java
similarity index 100%
rename from fine-ehcache/src/javax/jms/BytesMessage.java
rename to fine-third-jdk11/src/javax/jms/BytesMessage.java
diff --git a/fine-ehcache/src/javax/jms/Connection.java b/fine-third-jdk11/src/javax/jms/Connection.java
similarity index 100%
rename from fine-ehcache/src/javax/jms/Connection.java
rename to fine-third-jdk11/src/javax/jms/Connection.java
diff --git a/fine-ehcache/src/javax/jms/ConnectionConsumer.java b/fine-third-jdk11/src/javax/jms/ConnectionConsumer.java
similarity index 100%
rename from fine-ehcache/src/javax/jms/ConnectionConsumer.java
rename to fine-third-jdk11/src/javax/jms/ConnectionConsumer.java
diff --git a/fine-ehcache/src/javax/jms/ConnectionFactory.java b/fine-third-jdk11/src/javax/jms/ConnectionFactory.java
similarity index 100%
rename from fine-ehcache/src/javax/jms/ConnectionFactory.java
rename to fine-third-jdk11/src/javax/jms/ConnectionFactory.java
diff --git a/fine-ehcache/src/javax/jms/ConnectionMetaData.java b/fine-third-jdk11/src/javax/jms/ConnectionMetaData.java
similarity index 100%
rename from fine-ehcache/src/javax/jms/ConnectionMetaData.java
rename to fine-third-jdk11/src/javax/jms/ConnectionMetaData.java
diff --git a/fine-ehcache/src/javax/jms/DeliveryMode.java b/fine-third-jdk11/src/javax/jms/DeliveryMode.java
similarity index 100%
rename from fine-ehcache/src/javax/jms/DeliveryMode.java
rename to fine-third-jdk11/src/javax/jms/DeliveryMode.java
diff --git a/fine-ehcache/src/javax/jms/Destination.java b/fine-third-jdk11/src/javax/jms/Destination.java
similarity index 100%
rename from fine-ehcache/src/javax/jms/Destination.java
rename to fine-third-jdk11/src/javax/jms/Destination.java
diff --git a/fine-ehcache/src/javax/jms/ExceptionListener.java b/fine-third-jdk11/src/javax/jms/ExceptionListener.java
similarity index 100%
rename from fine-ehcache/src/javax/jms/ExceptionListener.java
rename to fine-third-jdk11/src/javax/jms/ExceptionListener.java
diff --git a/fine-ehcache/src/javax/jms/IllegalStateException.java b/fine-third-jdk11/src/javax/jms/IllegalStateException.java
similarity index 100%
rename from fine-ehcache/src/javax/jms/IllegalStateException.java
rename to fine-third-jdk11/src/javax/jms/IllegalStateException.java
diff --git a/fine-ehcache/src/javax/jms/InvalidClientIDException.java b/fine-third-jdk11/src/javax/jms/InvalidClientIDException.java
similarity index 100%
rename from fine-ehcache/src/javax/jms/InvalidClientIDException.java
rename to fine-third-jdk11/src/javax/jms/InvalidClientIDException.java
diff --git a/fine-ehcache/src/javax/jms/InvalidDestinationException.java b/fine-third-jdk11/src/javax/jms/InvalidDestinationException.java
similarity index 100%
rename from fine-ehcache/src/javax/jms/InvalidDestinationException.java
rename to fine-third-jdk11/src/javax/jms/InvalidDestinationException.java
diff --git a/fine-ehcache/src/javax/jms/InvalidSelectorException.java b/fine-third-jdk11/src/javax/jms/InvalidSelectorException.java
similarity index 100%
rename from fine-ehcache/src/javax/jms/InvalidSelectorException.java
rename to fine-third-jdk11/src/javax/jms/InvalidSelectorException.java
diff --git a/fine-ehcache/src/javax/jms/JMSException.java b/fine-third-jdk11/src/javax/jms/JMSException.java
similarity index 100%
rename from fine-ehcache/src/javax/jms/JMSException.java
rename to fine-third-jdk11/src/javax/jms/JMSException.java
diff --git a/fine-ehcache/src/javax/jms/JMSSecurityException.java b/fine-third-jdk11/src/javax/jms/JMSSecurityException.java
similarity index 100%
rename from fine-ehcache/src/javax/jms/JMSSecurityException.java
rename to fine-third-jdk11/src/javax/jms/JMSSecurityException.java
diff --git a/fine-ehcache/src/javax/jms/MapMessage.java b/fine-third-jdk11/src/javax/jms/MapMessage.java
similarity index 100%
rename from fine-ehcache/src/javax/jms/MapMessage.java
rename to fine-third-jdk11/src/javax/jms/MapMessage.java
diff --git a/fine-ehcache/src/javax/jms/Message.java b/fine-third-jdk11/src/javax/jms/Message.java
similarity index 100%
rename from fine-ehcache/src/javax/jms/Message.java
rename to fine-third-jdk11/src/javax/jms/Message.java
diff --git a/fine-ehcache/src/javax/jms/MessageConsumer.java b/fine-third-jdk11/src/javax/jms/MessageConsumer.java
similarity index 100%
rename from fine-ehcache/src/javax/jms/MessageConsumer.java
rename to fine-third-jdk11/src/javax/jms/MessageConsumer.java
diff --git a/fine-ehcache/src/javax/jms/MessageEOFException.java b/fine-third-jdk11/src/javax/jms/MessageEOFException.java
similarity index 100%
rename from fine-ehcache/src/javax/jms/MessageEOFException.java
rename to fine-third-jdk11/src/javax/jms/MessageEOFException.java
diff --git a/fine-ehcache/src/javax/jms/MessageFormatException.java b/fine-third-jdk11/src/javax/jms/MessageFormatException.java
similarity index 100%
rename from fine-ehcache/src/javax/jms/MessageFormatException.java
rename to fine-third-jdk11/src/javax/jms/MessageFormatException.java
diff --git a/fine-ehcache/src/javax/jms/MessageListener.java b/fine-third-jdk11/src/javax/jms/MessageListener.java
similarity index 100%
rename from fine-ehcache/src/javax/jms/MessageListener.java
rename to fine-third-jdk11/src/javax/jms/MessageListener.java
diff --git a/fine-ehcache/src/javax/jms/MessageNotReadableException.java b/fine-third-jdk11/src/javax/jms/MessageNotReadableException.java
similarity index 100%
rename from fine-ehcache/src/javax/jms/MessageNotReadableException.java
rename to fine-third-jdk11/src/javax/jms/MessageNotReadableException.java
diff --git a/fine-ehcache/src/javax/jms/MessageNotWriteableException.java b/fine-third-jdk11/src/javax/jms/MessageNotWriteableException.java
similarity index 100%
rename from fine-ehcache/src/javax/jms/MessageNotWriteableException.java
rename to fine-third-jdk11/src/javax/jms/MessageNotWriteableException.java
diff --git a/fine-ehcache/src/javax/jms/MessageProducer.java b/fine-third-jdk11/src/javax/jms/MessageProducer.java
similarity index 100%
rename from fine-ehcache/src/javax/jms/MessageProducer.java
rename to fine-third-jdk11/src/javax/jms/MessageProducer.java
diff --git a/fine-ehcache/src/javax/jms/ObjectMessage.java b/fine-third-jdk11/src/javax/jms/ObjectMessage.java
similarity index 100%
rename from fine-ehcache/src/javax/jms/ObjectMessage.java
rename to fine-third-jdk11/src/javax/jms/ObjectMessage.java
diff --git a/fine-ehcache/src/javax/jms/Queue.java b/fine-third-jdk11/src/javax/jms/Queue.java
similarity index 100%
rename from fine-ehcache/src/javax/jms/Queue.java
rename to fine-third-jdk11/src/javax/jms/Queue.java
diff --git a/fine-ehcache/src/javax/jms/QueueBrowser.java b/fine-third-jdk11/src/javax/jms/QueueBrowser.java
similarity index 100%
rename from fine-ehcache/src/javax/jms/QueueBrowser.java
rename to fine-third-jdk11/src/javax/jms/QueueBrowser.java
diff --git a/fine-ehcache/src/javax/jms/QueueConnection.java b/fine-third-jdk11/src/javax/jms/QueueConnection.java
similarity index 100%
rename from fine-ehcache/src/javax/jms/QueueConnection.java
rename to fine-third-jdk11/src/javax/jms/QueueConnection.java
diff --git a/fine-ehcache/src/javax/jms/QueueConnectionFactory.java b/fine-third-jdk11/src/javax/jms/QueueConnectionFactory.java
similarity index 100%
rename from fine-ehcache/src/javax/jms/QueueConnectionFactory.java
rename to fine-third-jdk11/src/javax/jms/QueueConnectionFactory.java
diff --git a/fine-ehcache/src/javax/jms/QueueReceiver.java b/fine-third-jdk11/src/javax/jms/QueueReceiver.java
similarity index 100%
rename from fine-ehcache/src/javax/jms/QueueReceiver.java
rename to fine-third-jdk11/src/javax/jms/QueueReceiver.java
diff --git a/fine-ehcache/src/javax/jms/QueueRequestor.java b/fine-third-jdk11/src/javax/jms/QueueRequestor.java
similarity index 100%
rename from fine-ehcache/src/javax/jms/QueueRequestor.java
rename to fine-third-jdk11/src/javax/jms/QueueRequestor.java
diff --git a/fine-ehcache/src/javax/jms/QueueSender.java b/fine-third-jdk11/src/javax/jms/QueueSender.java
similarity index 100%
rename from fine-ehcache/src/javax/jms/QueueSender.java
rename to fine-third-jdk11/src/javax/jms/QueueSender.java
diff --git a/fine-ehcache/src/javax/jms/QueueSession.java b/fine-third-jdk11/src/javax/jms/QueueSession.java
similarity index 100%
rename from fine-ehcache/src/javax/jms/QueueSession.java
rename to fine-third-jdk11/src/javax/jms/QueueSession.java
diff --git a/fine-ehcache/src/javax/jms/ResourceAllocationException.java b/fine-third-jdk11/src/javax/jms/ResourceAllocationException.java
similarity index 100%
rename from fine-ehcache/src/javax/jms/ResourceAllocationException.java
rename to fine-third-jdk11/src/javax/jms/ResourceAllocationException.java
diff --git a/fine-ehcache/src/javax/jms/ServerSession.java b/fine-third-jdk11/src/javax/jms/ServerSession.java
similarity index 100%
rename from fine-ehcache/src/javax/jms/ServerSession.java
rename to fine-third-jdk11/src/javax/jms/ServerSession.java
diff --git a/fine-ehcache/src/javax/jms/ServerSessionPool.java b/fine-third-jdk11/src/javax/jms/ServerSessionPool.java
similarity index 100%
rename from fine-ehcache/src/javax/jms/ServerSessionPool.java
rename to fine-third-jdk11/src/javax/jms/ServerSessionPool.java
diff --git a/fine-ehcache/src/javax/jms/Session.java b/fine-third-jdk11/src/javax/jms/Session.java
similarity index 100%
rename from fine-ehcache/src/javax/jms/Session.java
rename to fine-third-jdk11/src/javax/jms/Session.java
diff --git a/fine-ehcache/src/javax/jms/StreamMessage.java b/fine-third-jdk11/src/javax/jms/StreamMessage.java
similarity index 100%
rename from fine-ehcache/src/javax/jms/StreamMessage.java
rename to fine-third-jdk11/src/javax/jms/StreamMessage.java
diff --git a/fine-ehcache/src/javax/jms/TemporaryQueue.java b/fine-third-jdk11/src/javax/jms/TemporaryQueue.java
similarity index 100%
rename from fine-ehcache/src/javax/jms/TemporaryQueue.java
rename to fine-third-jdk11/src/javax/jms/TemporaryQueue.java
diff --git a/fine-ehcache/src/javax/jms/TemporaryTopic.java b/fine-third-jdk11/src/javax/jms/TemporaryTopic.java
similarity index 100%
rename from fine-ehcache/src/javax/jms/TemporaryTopic.java
rename to fine-third-jdk11/src/javax/jms/TemporaryTopic.java
diff --git a/fine-ehcache/src/javax/jms/TextMessage.java b/fine-third-jdk11/src/javax/jms/TextMessage.java
similarity index 100%
rename from fine-ehcache/src/javax/jms/TextMessage.java
rename to fine-third-jdk11/src/javax/jms/TextMessage.java
diff --git a/fine-ehcache/src/javax/jms/Topic.java b/fine-third-jdk11/src/javax/jms/Topic.java
similarity index 100%
rename from fine-ehcache/src/javax/jms/Topic.java
rename to fine-third-jdk11/src/javax/jms/Topic.java
diff --git a/fine-ehcache/src/javax/jms/TopicConnection.java b/fine-third-jdk11/src/javax/jms/TopicConnection.java
similarity index 100%
rename from fine-ehcache/src/javax/jms/TopicConnection.java
rename to fine-third-jdk11/src/javax/jms/TopicConnection.java
diff --git a/fine-ehcache/src/javax/jms/TopicConnectionFactory.java b/fine-third-jdk11/src/javax/jms/TopicConnectionFactory.java
similarity index 100%
rename from fine-ehcache/src/javax/jms/TopicConnectionFactory.java
rename to fine-third-jdk11/src/javax/jms/TopicConnectionFactory.java
diff --git a/fine-ehcache/src/javax/jms/TopicPublisher.java b/fine-third-jdk11/src/javax/jms/TopicPublisher.java
similarity index 100%
rename from fine-ehcache/src/javax/jms/TopicPublisher.java
rename to fine-third-jdk11/src/javax/jms/TopicPublisher.java
diff --git a/fine-ehcache/src/javax/jms/TopicRequestor.java b/fine-third-jdk11/src/javax/jms/TopicRequestor.java
similarity index 100%
rename from fine-ehcache/src/javax/jms/TopicRequestor.java
rename to fine-third-jdk11/src/javax/jms/TopicRequestor.java
diff --git a/fine-ehcache/src/javax/jms/TopicSession.java b/fine-third-jdk11/src/javax/jms/TopicSession.java
similarity index 100%
rename from fine-ehcache/src/javax/jms/TopicSession.java
rename to fine-third-jdk11/src/javax/jms/TopicSession.java
diff --git a/fine-ehcache/src/javax/jms/TopicSubscriber.java b/fine-third-jdk11/src/javax/jms/TopicSubscriber.java
similarity index 100%
rename from fine-ehcache/src/javax/jms/TopicSubscriber.java
rename to fine-third-jdk11/src/javax/jms/TopicSubscriber.java
diff --git a/fine-ehcache/src/javax/jms/TransactionInProgressException.java b/fine-third-jdk11/src/javax/jms/TransactionInProgressException.java
similarity index 100%
rename from fine-ehcache/src/javax/jms/TransactionInProgressException.java
rename to fine-third-jdk11/src/javax/jms/TransactionInProgressException.java
diff --git a/fine-ehcache/src/javax/jms/TransactionRolledBackException.java b/fine-third-jdk11/src/javax/jms/TransactionRolledBackException.java
similarity index 100%
rename from fine-ehcache/src/javax/jms/TransactionRolledBackException.java
rename to fine-third-jdk11/src/javax/jms/TransactionRolledBackException.java
diff --git a/fine-ehcache/src/javax/jms/XAConnection.java b/fine-third-jdk11/src/javax/jms/XAConnection.java
similarity index 100%
rename from fine-ehcache/src/javax/jms/XAConnection.java
rename to fine-third-jdk11/src/javax/jms/XAConnection.java
diff --git a/fine-ehcache/src/javax/jms/XAConnectionFactory.java b/fine-third-jdk11/src/javax/jms/XAConnectionFactory.java
similarity index 100%
rename from fine-ehcache/src/javax/jms/XAConnectionFactory.java
rename to fine-third-jdk11/src/javax/jms/XAConnectionFactory.java
diff --git a/fine-ehcache/src/javax/jms/XAQueueConnection.java b/fine-third-jdk11/src/javax/jms/XAQueueConnection.java
similarity index 100%
rename from fine-ehcache/src/javax/jms/XAQueueConnection.java
rename to fine-third-jdk11/src/javax/jms/XAQueueConnection.java
diff --git a/fine-ehcache/src/javax/jms/XAQueueConnectionFactory.java b/fine-third-jdk11/src/javax/jms/XAQueueConnectionFactory.java
similarity index 100%
rename from fine-ehcache/src/javax/jms/XAQueueConnectionFactory.java
rename to fine-third-jdk11/src/javax/jms/XAQueueConnectionFactory.java
diff --git a/fine-ehcache/src/javax/jms/XAQueueSession.java b/fine-third-jdk11/src/javax/jms/XAQueueSession.java
similarity index 100%
rename from fine-ehcache/src/javax/jms/XAQueueSession.java
rename to fine-third-jdk11/src/javax/jms/XAQueueSession.java
diff --git a/fine-ehcache/src/javax/jms/XASession.java b/fine-third-jdk11/src/javax/jms/XASession.java
similarity index 100%
rename from fine-ehcache/src/javax/jms/XASession.java
rename to fine-third-jdk11/src/javax/jms/XASession.java
diff --git a/fine-ehcache/src/javax/jms/XATopicConnection.java b/fine-third-jdk11/src/javax/jms/XATopicConnection.java
similarity index 100%
rename from fine-ehcache/src/javax/jms/XATopicConnection.java
rename to fine-third-jdk11/src/javax/jms/XATopicConnection.java
diff --git a/fine-ehcache/src/javax/jms/XATopicConnectionFactory.java b/fine-third-jdk11/src/javax/jms/XATopicConnectionFactory.java
similarity index 100%
rename from fine-ehcache/src/javax/jms/XATopicConnectionFactory.java
rename to fine-third-jdk11/src/javax/jms/XATopicConnectionFactory.java
diff --git a/fine-ehcache/src/javax/jms/XATopicSession.java b/fine-third-jdk11/src/javax/jms/XATopicSession.java
similarity index 100%
rename from fine-ehcache/src/javax/jms/XATopicSession.java
rename to fine-third-jdk11/src/javax/jms/XATopicSession.java
diff --git a/fine-third-jdk11/src/javax/jws/HandlerChain.java b/fine-third-jdk11/src/javax/jws/HandlerChain.java
new file mode 100644
index 000000000..f90462d64
--- /dev/null
+++ b/fine-third-jdk11/src/javax/jws/HandlerChain.java
@@ -0,0 +1,41 @@
+package javax.jws;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+/**
+ * Associates the Web Service with an externally defined handler chain. This annotation is typically used in scenarios
+ * where embedding the handler configuration directly in the Java source is not appropriate; for example, where the
+ * handler configuration needs to be shared across multiple Web Services, or where the handler chain consists of
+ * handlers for multiple transports.
+ *
+ * It is an error to combine this annotation with the @SOAPMessageHandlers annotation.
+ *
+ * @author Copyright (c) 2004 by BEA Systems, Inc. All Rights Reserved.
+ *
+ * @since 1.6
+ */
+@Retention(value = RetentionPolicy.RUNTIME)
+@Target(value = {ElementType.TYPE, ElementType.METHOD, ElementType.FIELD})
+public @interface HandlerChain {
+
+ /**
+ * Location of the handler chain file.
+ *
+ *
+ */
+ String file();
+
+ /**
+ * Name of the handler chain in the configuration file
+ *
+ * @deprecated As of JSR-181 2.0 with no replacement.
+ */
+ @Deprecated String name() default "";
+};
diff --git a/fine-third-jdk11/src/javax/jws/Oneway.java b/fine-third-jdk11/src/javax/jws/Oneway.java
new file mode 100644
index 000000000..7ff38d323
--- /dev/null
+++ b/fine-third-jdk11/src/javax/jws/Oneway.java
@@ -0,0 +1,21 @@
+package javax.jws;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+/**
+ * Indicates that the given @WebMethod has only an input message and no output. Typically, a oneway method returns
+ * the thread of control to the calling application prior to executing the actual business method. A 181 processor
+ * should report an error if an operation marked @Oneway has a return value or Holder parameters, or declares any
+ * checked exceptions.
+ *
+ * @author Copyright (c) 2004 by BEA Systems, Inc. All Rights Reserved.
+ *
+ * @since 1.6
+ */
+@Retention(value = RetentionPolicy.RUNTIME)
+@Target(value = {ElementType.METHOD})
+public @interface Oneway {
+}
diff --git a/fine-third-jdk11/src/javax/jws/WebMethod.java b/fine-third-jdk11/src/javax/jws/WebMethod.java
new file mode 100644
index 000000000..92813b5a2
--- /dev/null
+++ b/fine-third-jdk11/src/javax/jws/WebMethod.java
@@ -0,0 +1,48 @@
+package javax.jws;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+/**
+ * Customizes a method that is exposed as a Web Service operation.
+ * The associated method must be public and its parameters return value,
+ * and exceptions must follow the rules defined in JAX-RPC 1.1, section 5.
+ *
+ * The method is not required to throw java.rmi.RemoteException.
+ *
+ * @author Copyright (c) 2004 by BEA Systems, Inc. All Rights Reserved.
+ *
+ * @since 1.6
+ */
+@Retention(value = RetentionPolicy.RUNTIME)
+@Target({ElementType.METHOD})
+public @interface WebMethod {
+
+ /**
+ * Name of the wsdl:operation matching this method.
+ *
+ * @specdefault Name of the Java method.
+ */
+ String operationName() default "";
+
+ /**
+ * The action for this operation.
+ *
+ * If the operation is document style or the parameter maps to a header, this is the local name of the XML element
+ * representing the parameter.
+ *
+ * Otherwise, argN, where N represents the index of the parameter in the method signature (starting at arg0).
+ */
+ String name() default "";
+
+ /**
+ * The name of the wsdl:part representing this parameter.
+ *
+ * Otherwise, the targetNamespace for the Web Service.
+ */
+ String targetNamespace() default "";
+
+ /**
+ * The direction in which the parameter is flowing (One of IN, OUT, or INOUT).
+ *
+ * IN if not a Holder type.
+ */
+ Mode mode() default Mode.IN;
+
+ /**
+ * If true, the parameter is pulled from a message header rather then the message body.
+ */
+ boolean header() default false;
+};
diff --git a/fine-third-jdk11/src/javax/jws/WebResult.java b/fine-third-jdk11/src/javax/jws/WebResult.java
new file mode 100644
index 000000000..b8735dbd2
--- /dev/null
+++ b/fine-third-jdk11/src/javax/jws/WebResult.java
@@ -0,0 +1,66 @@
+package javax.jws;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+/**
+ * Customizes the mapping of the return value to a WSDL part and XML element.
+ *
+ * @author Copyright (c) 2004 by BEA Systems, Inc. All Rights Reserved.
+ *
+ * @since 1.6
+ */
+@Retention(value = RetentionPolicy.RUNTIME)
+ @Target(value = {ElementType.METHOD})
+ public @interface WebResult
+{
+
+ /**
+ * Name of return value.
+ *
+ * If the operation is document style or the return value maps to a header, this is the local name of the XML
+ * element representing the return value.
+ *
+ * @specdefault
+ * If the operation is document style and the parameter style is BARE, {@code @WebParam.operationName}+"Response".
+ * Otherwise, "return."
+ */
+ String name() default "";
+
+ /**
+ * The name of the wsdl:part representing this return value.
+ *
+ * Otherwise, the targetNamespace for the Web Service.
+ */
+ String targetNamespace() default "";
+
+ /**
+ * If true, the result is pulled from a message header rather then the message body.
+ *
+ * @since 2.0
+ */
+ boolean header() default false;
+}
diff --git a/fine-third-jdk11/src/javax/jws/WebService.java b/fine-third-jdk11/src/javax/jws/WebService.java
new file mode 100644
index 000000000..ac49a07c5
--- /dev/null
+++ b/fine-third-jdk11/src/javax/jws/WebService.java
@@ -0,0 +1,97 @@
+package javax.jws;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.ElementType;
+
+/**
+ * Marks a Java class as implementing a Web Service, or a Java interface as defining a Web Service interface.
+ *
+ * @author Copyright (c) 2004 by BEA Systems, Inc. All Rights Reserved.
+ *
+ * @since 1.6
+ */
+@Retention(value = RetentionPolicy.RUNTIME)
+@Target(value = {ElementType.TYPE})
+public @interface WebService {
+
+ /**
+ * The name of the Web Service.
+ *
+ * The service implementation bean MAY implement the service endpoint interface, but is not REQUIRED to do so.
+ *
+ * If this member-value is not present, the Web Service contract is generated from annotations on the service
+ * implementation bean. If a service endpoint interface is required by the target environment, it will be
+ * generated into an implementation-defined package with an implementation- defined name
+ *
+ *
+ *
+ * XmlNode
, is the
+ * root interface/class for the XML infoset preserving representation.
+ * A Binder implementation is required to minimally support
+ * an XmlNode
value of org.w3c.dom.Node.class
.
+ * A Binder implementation can support alternative XML infoset
+ * preserving representations.
+ *
+ * @author
+ * Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+ * Joseph Fialli
+ *
+ * @since 1.6, JAXB 2.0
+ */
+public abstract class BinderxmlNode
+ * and its descendants is validated during this operation.
+ *
+ * xmlNode
+ * and its descendants is validated during this operation.
+ *
+ * @param xmlNode
+ * the document/element to unmarshal XML data from.
+ * @param declaredType
+ * appropriate JAXB mapped class to hold {@code node}'s XML data.
+ *
+ * @return
+ * JAXB Element representation
+ * of {@code node}
+ *
+ * @throws JAXBException
+ * If any unexpected errors occur while unmarshalling
+ * @throws UnmarshalException
+ * If the {@link ValidationEventHandler ValidationEventHandler}
+ * returns false from its {@code handleEvent} method or the
+ * {@code Binder} is unable to perform the XML to Java
+ * binding.
+ * @throws IllegalArgumentException
+ * If any of the input parameters are null
+ * @since 1.6, JAXB 2.0
+ */
+ public abstract
+ * updateXML( jaxbObject, getXMLNode(jaxbObject));
+ *
+ *
+ * @throws JAXBException
+ * If any unexpected problem occurs updating corresponding XML content.
+ * @throws IllegalArgumentException
+ * If the jaxbObject parameter is null
+ */
+ public abstract XmlNode updateXML( Object jaxbObject ) throws JAXBException;
+
+ /**
+ * Changes in JAXB object tree are updated in its associated XML parse tree.
+ *
+ *
+ * @see JAXBContext
+ */
+class ContextFinder {
+
+ /**
+ * When JAXB is in J2SE, rt.jar has to have a JAXB implementation.
+ * However, rt.jar cannot have META-INF/services/javax.xml.bind.JAXBContext
+ * because if it has, it will take precedence over any file that applications have
+ * in their jar files.
+ *
+ *