taogu.mxx 2 years ago
commit
ad507d9af6
100 changed files with 31237 additions and 0 deletions
  1. 9 0
      .gitignore
  2. 26 0
      Activation/JavaBeans Activation Framework 1.1.1/jaf-1.1.1/README.txt
  3. 78 0
      Activation/JavaBeans Activation Framework 1.1.1/jaf-1.1.1/RELNOTES.txt
  4. BIN
      Activation/JavaBeans Activation Framework 1.1.1/jaf-1.1.1/activation.jar
  5. 144 0
      Activation/JavaBeans Activation Framework 1.1.1/jaf-1.1.1/demo/CompViewer.java
  6. 108 0
      Activation/JavaBeans Activation Framework 1.1.1/jaf-1.1.1/demo/DCHTest.java
  7. 116 0
      Activation/JavaBeans Activation Framework 1.1.1/jaf-1.1.1/demo/DCHTest2.java
  8. 87 0
      Activation/JavaBeans Activation Framework 1.1.1/jaf-1.1.1/demo/DHURL.java
  9. 70 0
      Activation/JavaBeans Activation Framework 1.1.1/jaf-1.1.1/demo/FileView.java
  10. 414 0
      Activation/JavaBeans Activation Framework 1.1.1/jaf-1.1.1/demo/JAFApp.java
  11. 107 0
      Activation/JavaBeans Activation Framework 1.1.1/jaf-1.1.1/demo/MCDump.java
  12. 78 0
      Activation/JavaBeans Activation Framework 1.1.1/jaf-1.1.1/demo/MCTest.java
  13. 99 0
      Activation/JavaBeans Activation Framework 1.1.1/jaf-1.1.1/demo/ODCHTest.java
  14. 149 0
      Activation/JavaBeans Activation Framework 1.1.1/jaf-1.1.1/demo/PlainDCH.java
  15. 79 0
      Activation/JavaBeans Activation Framework 1.1.1/jaf-1.1.1/demo/PrefTest.java
  16. 117 0
      Activation/JavaBeans Activation Framework 1.1.1/jaf-1.1.1/demo/SimpleDCF.java
  17. 113 0
      Activation/JavaBeans Activation Framework 1.1.1/jaf-1.1.1/demo/TextInternalizer.java
  18. 37 0
      Activation/JavaBeans Activation Framework 1.1.1/jaf-1.1.1/distributionREADME.txt
  19. BIN
      Activation/JavaBeans Activation Framework 1.1.1/jaf-1.1.1/docs/JAF-1.1.pdf
  20. 62 0
      Activation/JavaBeans Activation Framework 1.1.1/jaf-1.1.1/docs/javadocs/allclasses-frame.html
  21. 62 0
      Activation/JavaBeans Activation Framework 1.1.1/jaf-1.1.1/docs/javadocs/allclasses-noframe.html
  22. 23 0
      Activation/JavaBeans Activation Framework 1.1.1/jaf-1.1.1/docs/javadocs/index.html
  23. 82 0
      Activation/JavaBeans Activation Framework 1.1.1/jaf-1.1.1/docs/javadocs/javax/activation/package-frame.html
  24. 1 0
      Activation/JavaBeans Activation Framework 1.1.1/jaf-1.1.1/docs/javadocs/package-list
  25. 37 0
      Activation/JavaBeans Activation Framework 1.1.1/jaf-1.1.1/docs/javadocs/packages.html
  26. BIN
      Activation/JavaBeans Activation Framework 1.1.1/jaf-1.1.1/docs/javadocs/resources/inherit.gif
  27. 29 0
      Activation/JavaBeans Activation Framework 1.1.1/jaf-1.1.1/docs/javadocs/stylesheet.css
  28. 306 0
      Activation/jaf-1_1_1/jaf-1.1.1/LICENSE.txt
  29. 26 0
      Activation/jaf-1_1_1/jaf-1.1.1/README.txt
  30. 78 0
      Activation/jaf-1_1_1/jaf-1.1.1/RELNOTES.txt
  31. BIN
      Activation/jaf-1_1_1/jaf-1.1.1/activation.jar
  32. 144 0
      Activation/jaf-1_1_1/jaf-1.1.1/demo/CompViewer.java
  33. 108 0
      Activation/jaf-1_1_1/jaf-1.1.1/demo/DCHTest.java
  34. 116 0
      Activation/jaf-1_1_1/jaf-1.1.1/demo/DCHTest2.java
  35. 87 0
      Activation/jaf-1_1_1/jaf-1.1.1/demo/DHURL.java
  36. 70 0
      Activation/jaf-1_1_1/jaf-1.1.1/demo/FileView.java
  37. 414 0
      Activation/jaf-1_1_1/jaf-1.1.1/demo/JAFApp.java
  38. 107 0
      Activation/jaf-1_1_1/jaf-1.1.1/demo/MCDump.java
  39. 78 0
      Activation/jaf-1_1_1/jaf-1.1.1/demo/MCTest.java
  40. 99 0
      Activation/jaf-1_1_1/jaf-1.1.1/demo/ODCHTest.java
  41. 149 0
      Activation/jaf-1_1_1/jaf-1.1.1/demo/PlainDCH.java
  42. 79 0
      Activation/jaf-1_1_1/jaf-1.1.1/demo/PrefTest.java
  43. 117 0
      Activation/jaf-1_1_1/jaf-1.1.1/demo/SimpleDCF.java
  44. 113 0
      Activation/jaf-1_1_1/jaf-1.1.1/demo/TextInternalizer.java
  45. 37 0
      Activation/jaf-1_1_1/jaf-1.1.1/distributionREADME.txt
  46. 197 0
      Activation/jaf-1_1_1/jaf-1.1.1/docs/JAF-1.1-changes.txt
  47. 14155 0
      Activation/jaf-1_1_1/jaf-1.1.1/docs/JAF-1.1.ps
  48. 62 0
      Activation/jaf-1_1_1/jaf-1.1.1/docs/javadocs/allclasses-frame.html
  49. 62 0
      Activation/jaf-1_1_1/jaf-1.1.1/docs/javadocs/allclasses-noframe.html
  50. 136 0
      Activation/jaf-1_1_1/jaf-1.1.1/docs/javadocs/constant-values.html
  51. 151 0
      Activation/jaf-1_1_1/jaf-1.1.1/docs/javadocs/deprecated-list.html
  52. 185 0
      Activation/jaf-1_1_1/jaf-1.1.1/docs/javadocs/help-doc.html
  53. 149 0
      Activation/jaf-1_1_1/jaf-1.1.1/docs/javadocs/index-files/index-1.html
  54. 138 0
      Activation/jaf-1_1_1/jaf-1.1.1/docs/javadocs/index-files/index-10.html
  55. 135 0
      Activation/jaf-1_1_1/jaf-1.1.1/docs/javadocs/index-files/index-11.html
  56. 143 0
      Activation/jaf-1_1_1/jaf-1.1.1/docs/javadocs/index-files/index-12.html
  57. 172 0
      Activation/jaf-1_1_1/jaf-1.1.1/docs/javadocs/index-files/index-13.html
  58. 138 0
      Activation/jaf-1_1_1/jaf-1.1.1/docs/javadocs/index-files/index-14.html
  59. 145 0
      Activation/jaf-1_1_1/jaf-1.1.1/docs/javadocs/index-files/index-15.html
  60. 145 0
      Activation/jaf-1_1_1/jaf-1.1.1/docs/javadocs/index-files/index-16.html
  61. 155 0
      Activation/jaf-1_1_1/jaf-1.1.1/docs/javadocs/index-files/index-2.html
  62. 147 0
      Activation/jaf-1_1_1/jaf-1.1.1/docs/javadocs/index-files/index-3.html
  63. 136 0
      Activation/jaf-1_1_1/jaf-1.1.1/docs/javadocs/index-files/index-4.html
  64. 144 0
      Activation/jaf-1_1_1/jaf-1.1.1/docs/javadocs/index-files/index-5.html
  65. 335 0
      Activation/jaf-1_1_1/jaf-1.1.1/docs/javadocs/index-files/index-6.html
  66. 143 0
      Activation/jaf-1_1_1/jaf-1.1.1/docs/javadocs/index-files/index-7.html
  67. 133 0
      Activation/jaf-1_1_1/jaf-1.1.1/docs/javadocs/index-files/index-8.html
  68. 188 0
      Activation/jaf-1_1_1/jaf-1.1.1/docs/javadocs/index-files/index-9.html
  69. 23 0
      Activation/jaf-1_1_1/jaf-1.1.1/docs/javadocs/index.html
  70. 547 0
      Activation/jaf-1_1_1/jaf-1.1.1/docs/javadocs/javax/activation/ActivationDataFlavor.html
  71. 349 0
      Activation/jaf-1_1_1/jaf-1.1.1/docs/javadocs/javax/activation/CommandInfo.html
  72. 556 0
      Activation/jaf-1_1_1/jaf-1.1.1/docs/javadocs/javax/activation/CommandMap.html
  73. 232 0
      Activation/jaf-1_1_1/jaf-1.1.1/docs/javadocs/javax/activation/CommandObject.html
  74. 322 0
      Activation/jaf-1_1_1/jaf-1.1.1/docs/javadocs/javax/activation/DataContentHandler.html
  75. 222 0
      Activation/jaf-1_1_1/jaf-1.1.1/docs/javadocs/javax/activation/DataContentHandlerFactory.html
  76. 871 0
      Activation/jaf-1_1_1/jaf-1.1.1/docs/javadocs/javax/activation/DataHandler.html
  77. 317 0
      Activation/jaf-1_1_1/jaf-1.1.1/docs/javadocs/javax/activation/DataSource.html
  78. 449 0
      Activation/jaf-1_1_1/jaf-1.1.1/docs/javadocs/javax/activation/FileDataSource.html
  79. 348 0
      Activation/jaf-1_1_1/jaf-1.1.1/docs/javadocs/javax/activation/FileTypeMap.html
  80. 557 0
      Activation/jaf-1_1_1/jaf-1.1.1/docs/javadocs/javax/activation/MailcapCommandMap.html
  81. 671 0
      Activation/jaf-1_1_1/jaf-1.1.1/docs/javadocs/javax/activation/MimeType.html
  82. 439 0
      Activation/jaf-1_1_1/jaf-1.1.1/docs/javadocs/javax/activation/MimeTypeParameterList.html
  83. 256 0
      Activation/jaf-1_1_1/jaf-1.1.1/docs/javadocs/javax/activation/MimeTypeParseException.html
  84. 387 0
      Activation/jaf-1_1_1/jaf-1.1.1/docs/javadocs/javax/activation/MimetypesFileTypeMap.html
  85. 393 0
      Activation/jaf-1_1_1/jaf-1.1.1/docs/javadocs/javax/activation/URLDataSource.html
  86. 263 0
      Activation/jaf-1_1_1/jaf-1.1.1/docs/javadocs/javax/activation/UnsupportedDataTypeException.html
  87. 134 0
      Activation/jaf-1_1_1/jaf-1.1.1/docs/javadocs/javax/activation/class-use/ActivationDataFlavor.html
  88. 270 0
      Activation/jaf-1_1_1/jaf-1.1.1/docs/javadocs/javax/activation/class-use/CommandInfo.html
  89. 198 0
      Activation/jaf-1_1_1/jaf-1.1.1/docs/javadocs/javax/activation/class-use/CommandMap.html
  90. 134 0
      Activation/jaf-1_1_1/jaf-1.1.1/docs/javadocs/javax/activation/class-use/CommandObject.html
  91. 182 0
      Activation/jaf-1_1_1/jaf-1.1.1/docs/javadocs/javax/activation/class-use/DataContentHandler.html
  92. 157 0
      Activation/jaf-1_1_1/jaf-1.1.1/docs/javadocs/javax/activation/class-use/DataContentHandlerFactory.html
  93. 169 0
      Activation/jaf-1_1_1/jaf-1.1.1/docs/javadocs/javax/activation/class-use/DataHandler.html
  94. 261 0
      Activation/jaf-1_1_1/jaf-1.1.1/docs/javadocs/javax/activation/class-use/DataSource.html
  95. 134 0
      Activation/jaf-1_1_1/jaf-1.1.1/docs/javadocs/javax/activation/class-use/FileDataSource.html
  96. 198 0
      Activation/jaf-1_1_1/jaf-1.1.1/docs/javadocs/javax/activation/class-use/FileTypeMap.html
  97. 134 0
      Activation/jaf-1_1_1/jaf-1.1.1/docs/javadocs/javax/activation/class-use/MailcapCommandMap.html
  98. 158 0
      Activation/jaf-1_1_1/jaf-1.1.1/docs/javadocs/javax/activation/class-use/MimeType.html
  99. 157 0
      Activation/jaf-1_1_1/jaf-1.1.1/docs/javadocs/javax/activation/class-use/MimeTypeParameterList.html
  100. 0 0
      Activation/jaf-1_1_1/jaf-1.1.1/docs/javadocs/javax/activation/class-use/MimeTypeParseException.html

+ 9 - 0
.gitignore

@@ -0,0 +1,9 @@
+.css
+.js
+.html
+.htm
+.jsp
+.class
+.java
+.jar
+

+ 26 - 0
Activation/JavaBeans Activation Framework 1.1.1/jaf-1.1.1/README.txt

@@ -0,0 +1,26 @@
+	  **JAVABEANS(tm) ACTIVATION FRAMEWORK 1.1.1 RELEASE**
+
+Thank you for downloading the release of the JavaBeans(tm) Activation
+Framework! We hope you find it useful.  Included in this release are
+the following files and directories:
+
+README.txt     : This file!
+
+RELNOTES.txt   : The release notes for this release including,
+                 installation instructions, system requirements, 
+                 known bugs, and open issues.
+
+LICENSE.txt    : The license covering this software.
+
+activation.jar : This JAR file contains the classes that
+                 make up JavaBeans(tm) Activation Framework.
+
+demos          : This directory contains some simple *unsupported*
+                 demos that make use of some of the JAF's features.
+
+docs           : This directory contains the Javadoc API descriptions
+                 for the public classes in the JAF.
+
+If you encounter any problems please contact us at:
+
+  activation-comments@sun.com

+ 78 - 0
Activation/JavaBeans Activation Framework 1.1.1/jaf-1.1.1/RELNOTES.txt

@@ -0,0 +1,78 @@
+	 JavaBeans(tm)Activation Framework 1.1.1 Release Notes
+
+Welcome to the JavaBeans(tm) Activation Framework! A great deal of time
+and effort was put into making this package functional and
+usable.  We are however, realistic in anticipating that there exist
+scenarios and applications where this implementation could be improved
+upon.  We welcome your feedback in this area to the email address
+listed below.
+
+System Requirements:
+--------------------
+
+The JavaBeans(tm) Activation Framework (JAF) was developed and tested
+against Sun's JDK 1.4.2 on the Solaris SPARC platform.  JAF is
+written in Java (with no native code). It will run on any JDK(tm) 1.4
+(or newer) compatible virtual machine so don't hesitate to try it and
+please report failures.
+
+Note that JAF is also included in Java SE 6 and later releases.
+
+Installation:
+-------------
+
+There is effectively *no* installation of the JAF. The classes that
+make up the JAF are contained in the included Java(tm) Archive (JAR) file,
+"activation.jar". This file can be placed anywhere accessible to the
+Java virtual machine running on your system. The only requirement is
+that the activation.jar be included in your system's class path so
+Java can find the JAF classes.
+
+Related Web Sites:
+------------------
+
+There are a number of web sites you might find useful if you haven't
+already run across them:
+
+http://java.sun.com  -- This is Sun's Java Software External Web Site.
+
+http://java.sun.com/beans -- This is the JavaBeans web site which is
+                             full of the latest beans information. The
+                             JAF spec is available in the 'Glasgow' area.
+
+http://java.sun.com/products/javamail -- The JavaMail(tm) API provides a set
+                             of abstract classes that model a mail system.
+                             It's implementation is dependent on the JAF.
+
+
+Bugs fixed in the 1.1.1 Release:
+--------------------------------
+
+6456395	DataHandler.writeTo should have built-in support for byte arrays
+	and Strings
+6538484	JAF fails in Turkish locale
+
+
+Bugs fixed in the 1.1 Release:
+------------------------------
+
+<no id>	use context class loader to load data content handlers
+<no id>	guard against possible NPE when parsing mailcap file
+<no id>	really make sure input stream gets closed in DataHandler.writeTo
+4134676	need way to find all known MIME types
+4786035	API doc: some bugs in javax/activation/MimeType.cmnt
+4848096	MailcapCommandMap should store *ALL* mailcap entries
+5090200	CommandMap needs file name to choose proper command on Windows
+6245613	fix ActivationDataFlavor normalize methods to match DataFlavor
+6252930	MailcapCommandMap needs support for "fallback" entries in mailcap file
+6357487	DataHandler.getBean should load class using application's class loader
+
+
+How to contact us:
+------------------
+
+We have created an email alias that will send all your questions and
+comments to the JAF 'team'. We cannot guarantee that we will respond
+to all of your email, but we do promise to read them. 
+
+activation-comments@sun.com

BIN
Activation/JavaBeans Activation Framework 1.1.1/jaf-1.1.1/activation.jar


+ 144 - 0
Activation/JavaBeans Activation Framework 1.1.1/jaf-1.1.1/demo/CompViewer.java

@@ -0,0 +1,144 @@
+/*
+ * @(#)CompViewer.java	1.5 07/07/13
+ *
+ * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   - Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *
+ *   - Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ *   - Neither the name of Sun Microsystems nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import java.awt.*;
+import java.beans.*;
+import java.lang.reflect.Method;
+import java.io.*;
+import java.awt.event.*;
+
+/**
+ * Class <code>CompViewer</code> creates a 'viewer' component
+ * that implements the CommandObject interface.
+ *
+ */
+public class CompViewer extends Frame implements WindowListener {
+
+    /**
+     * Our constructor...
+     */
+    public CompViewer(){
+	super("Component");
+	this.initCompViewer(null);
+    }
+
+    public CompViewer(String name){
+	super(name);
+	this.initCompViewer(name);
+    }
+
+    public void initCompViewer(String name){
+	if (name != null)
+	    setTitle(name);
+	setSize(400,400);
+	setLayout(new BorderLayout());
+	this.addWindowListener(this);
+    }
+    
+    ////////////////////////////////////////////////////////////////////////
+    // we got our bean as a component display it!
+    void setBean(Component new_bean)
+	{
+	    Dimension start_dim = null;
+	    add((Component)new_bean, "Center");
+	    start_dim =  ((Component)new_bean).getPreferredSize();
+	    
+	    if(start_dim.width != 0 && start_dim.height != 0) {
+		// this is what we do under normal conditions
+		start_dim.height += 40;
+		start_dim.width += 15;
+		this.setSize( start_dim );
+		((Component)new_bean).invalidate(); 
+		((Component)new_bean).validate();
+		((Component)new_bean).doLayout();
+		show();           
+	    }
+	    else {
+		// we get here if for some reason our child's
+		// getPref size needs to have it's peer created
+		// first...
+		show();           
+		start_dim =  ((Component)new_bean).getPreferredSize();
+		start_dim.height += 40;
+		start_dim.width += 15;
+		this.setSize( start_dim );
+		((Component)new_bean).validate();
+	    }
+	    this.setSize(this.getSize());
+	    validate();
+	}
+
+
+    /**
+     * Make the bean based on it's class loader and name
+     */
+    private Object makeBean(ClassLoader cls, String beanName) {
+	Object new_bean = null;
+
+	try {
+	    try {
+		new_bean = java.beans.Beans.instantiate(cls, beanName);
+	    }
+	    catch(IOException e) {
+		System.out.println("CompViewer:Beans.instantiate:IOException " + beanName + ".");
+		System.out.println(e);
+		System.exit(1);
+	    }
+	}
+	catch (ClassNotFoundException e) {
+	    System.out.println("CompViewer:Beans.instantiate:ClassNotFoundException " + beanName + "."); 
+	    System.out.println(e);
+	    System.exit(1);
+	}
+      
+	if( !(new_bean instanceof Component) ) {
+	    System.out.println("CompViewer: " + beanName + " not instance of awt.Component exiting");
+	    System.exit(1);
+	}
+	return new_bean;
+    }
+
+    public void windowOpened(WindowEvent e) {}
+    public void windowClosing(WindowEvent e) {
+	this.setVisible(false);
+    }
+    public void windowClosed(WindowEvent e) {}
+    public void windowIconified(WindowEvent e) {}
+    public void windowDeiconified(WindowEvent e) {}
+    public void windowActivated(WindowEvent e) {}
+    public void windowDeactivated(WindowEvent e) {}
+
+}
+
+
+

+ 108 - 0
Activation/JavaBeans Activation Framework 1.1.1/jaf-1.1.1/demo/DCHTest.java

@@ -0,0 +1,108 @@
+/*
+ * @(#)DCHTest.java	1.5 07/07/13
+ *
+ * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   - Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *
+ *   - Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ *   - Neither the name of Sun Microsystems nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import java.io.*;
+import javax.activation.*;
+import java.awt.datatransfer.*;
+
+public class DCHTest {
+    private FileDataSource fds = null;
+    private DataHandler dh = null;
+    private DataContentHandlerFactory dchf = null;
+    /**
+     * main function
+     */
+    public static void main(String args[]) {
+	DCHTest test = new DCHTest();
+	
+	if(args.length == 0) {
+	    System.out.println("usage: DCHTest file.txt");
+	    System.exit(1);
+	}
+	
+	// first let's get a DataSource
+
+	test.setFile(args[0]);
+	
+	test.doit();
+    }
+
+    private void doit() {
+	DataFlavor xfer_flavors[];
+	Object content = null;
+
+	// now let's create a DataHandler
+	dh = new DataHandler(fds);
+	System.out.println("DCHTest: DataHandler created");
+
+	// now lets set a DataContentHandlerFactory
+	dchf = new SimpleDCF("text/plain:PlainDCH\n");
+	System.out.println("DCHTest: Simple dchf created");
+	
+	// now let's set the dchf in the dh
+	dh.setDataContentHandlerFactory(dchf);
+	System.out.println("DCHTest: DataContentHandlerFactory set in DataHandler");
+	
+	// get the dataflavors
+	xfer_flavors = dh.getTransferDataFlavors();
+	System.out.println("DCHTest: dh.getTransferDF returned " +
+			   xfer_flavors.length + " data flavors.");
+
+	// get the content:
+        try {
+	   content = dh.getContent();
+        } catch (Exception e) { e.printStackTrace(); }
+
+	if(content == null)
+	    System.out.println("DCHTest: no content to be had!!!");
+	else
+	    System.out.println("DCHTest: got content of the following type: " +
+			       content.getClass().getName());
+	
+    }
+
+    /**
+     * set the file
+     */
+    public void setFile(String filename) {
+	fds = new FileDataSource(filename);
+	System.out.println("DCHTest: FileDataSource created");
+	if(!fds.getContentType().equals("text/plain")) {
+	    System.out.println("Type must be text/plain");
+	    System.exit(1);
+	}
+    }
+	    
+}
+
+

+ 116 - 0
Activation/JavaBeans Activation Framework 1.1.1/jaf-1.1.1/demo/DCHTest2.java

@@ -0,0 +1,116 @@
+/*
+ * @(#)DCHTest2.java	1.7 07/07/13
+ *
+ * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   - Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *
+ *   - Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ *   - Neither the name of Sun Microsystems nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import java.io.*;
+import javax.activation.*;
+import java.awt.datatransfer.*;
+
+public class DCHTest2 {
+    private FileDataSource fds = null;
+    private MailcapCommandMap cmdMap = null;
+    private DataHandler dh = null;
+    private DataContentHandlerFactory dchf = null;
+    /**
+     * main function
+     */
+    public static void main(String args[]) {
+	DCHTest2 test = new DCHTest2();
+	
+	if(args.length < 2) {
+	    System.out.println("usage: DCHTest2 file.txt mailcap");
+	    System.exit(1);
+	}
+	
+	// first let's get a DataSource
+
+	test.setFile(args[0]);
+	
+	test.setMailcap(args[1]);
+	test.doit();
+    }
+
+    private void doit() {
+	DataFlavor xfer_flavors[];
+	Object content = null;
+
+	// now let's create a DataHandler
+	dh = new DataHandler(fds);
+        dh.setCommandMap(cmdMap);
+	System.out.println("DCHTest2: DataHandler created");
+
+	// get the dataflavors
+	xfer_flavors = dh.getTransferDataFlavors();
+	System.out.println("DCHTest2: dh.getTransferDF returned " +
+			   xfer_flavors.length + " data flavors.");
+
+	// get the content:
+	try {
+	    content = dh.getContent();
+        } catch (Exception e) { e.printStackTrace(); }
+	if(content == null)
+	    System.out.println("DCHTest2: no content to be had!!!");
+	else
+	    System.out.println("DCHTest2: got content of the following type: " +
+			       content.getClass().getName());
+	
+    }
+
+    /**
+     * set the file
+     */
+    public void setFile(String filename) {
+	fds = new FileDataSource(filename);
+	System.out.println("DCHTest2: FileDataSource created");
+	if(!fds.getContentType().equals("text/plain")) {
+	    System.out.println("Type must be text/plain");
+	    System.exit(1);
+	}
+    }
+
+   /**
+    * set the mailcap file in the CMD Map
+    */
+   public void setMailcap(String mailcap) {
+
+       try {
+	   cmdMap = new MailcapCommandMap(mailcap);
+       } catch(Exception e){
+	   e.printStackTrace();
+	   System.exit(1);
+       }
+   }
+
+	    
+}
+
+

+ 87 - 0
Activation/JavaBeans Activation Framework 1.1.1/jaf-1.1.1/demo/DHURL.java

@@ -0,0 +1,87 @@
+/*
+ * @(#)DHURL.java	1.5 07/07/13
+ *
+ * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   - Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *
+ *   - Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ *   - Neither the name of Sun Microsystems nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import java.net.*;
+import java.io.*;
+import javax.activation.*;
+
+public class DHURL {
+    URL url = null;
+    DataHandler dh = null;
+    
+    public static void main(String args[]){
+        DHURL test = new DHURL();
+
+        if(args.length == 0) {
+            System.out.println("usage: DHURL url");
+            System.exit(1);
+        }
+
+        test.setURL(args[0]);
+
+        test.doit();
+
+    }
+
+    public void setURL(String url) {
+	
+	try {
+	    this.url = new URL(url);
+	} catch(MalformedURLException e) {
+	    e.printStackTrace();
+	    System.out.println("malformed URL!!!");
+	    System.exit(1);
+	}
+
+    }
+    
+    public void doit() {
+	System.out.print("Creating DataHandler...");
+	dh = new DataHandler(url);
+	System.out.println("...done.");
+
+	System.out.println("The MimeType of the DH : " +
+			   dh.getContentType());
+	try {
+	InputStream is = dh.getInputStream();
+	if(is != null)
+	    System.out.println("got an inputstream");
+	} catch(Exception e) {
+	    e.printStackTrace();
+	}
+
+	
+    }
+	
+    
+}

+ 70 - 0
Activation/JavaBeans Activation Framework 1.1.1/jaf-1.1.1/demo/FileView.java

@@ -0,0 +1,70 @@
+/*
+ * @(#)FileView.java	1.7 07/07/13
+ *
+ * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   - Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *
+ *   - Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ *   - Neither the name of Sun Microsystems nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import java.awt.*;
+import java.beans.*;
+import java.net.*;
+import javax.activation.*;
+
+public class FileView {
+    private Frame frame;
+
+    public static void main(String args[]) throws Exception {
+        FileView fv = new FileView();
+        if (args.length == 0) {
+            System.out.println("usage: FileView  file.txt");
+            System.exit(1);
+        }
+        fv.view(args[0]);
+    }
+
+    private void view(String filename) throws Exception {
+  	FileDataSource fds = new FileDataSource(filename); 
+  	DataHandler dh = new DataHandler(fds); 
+	// comment out previous two lines, and uncomment next
+	// line and pass in a URL on the command line.
+	// DataHandler dh = new DataHandler(new URL(filename));
+
+	CommandInfo bi = dh.getCommand("view");
+	
+	if (bi == null) {
+	    System.out.println("no viewer found, exiting");
+	    System.exit(1);
+	}
+
+	frame = new Frame("Viewer");
+	frame.add((Component)dh.getBean(bi));
+	frame.setSize(new Dimension(400,300));
+	frame.show();
+    }
+}

+ 414 - 0
Activation/JavaBeans Activation Framework 1.1.1/jaf-1.1.1/demo/JAFApp.java

@@ -0,0 +1,414 @@
+/*
+ * @(#)JAFApp.java	1.13 07/07/13
+ *
+ * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   - Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *
+ *   - Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ *   - Neither the name of Sun Microsystems nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import java.awt.*;
+import java.awt.event.*;
+import java.beans.*;
+import java.io.*;
+import javax.activation.*;
+
+public class JAFApp extends Frame implements WindowListener, ItemListener, ActionListener {
+
+    // UI stuff...
+    private GridBagLayout gridbag = null;
+    private GridBagLayout panel_gb = null;
+    private List file_list = null;
+    private Panel results_panel = null;
+    private Label f_title = null;
+    private Label f_name_label = null;
+    private Label type_label = null;
+    private Label type_title = null;
+    private Button launch_button = null;
+    private Choice verb_choice = null;
+    // File stuff...
+    private File _file = null;
+    // private FileDataSource fds[] = null;
+    private DataHandler dh[] = null;
+
+    private boolean debug = false;
+    //    private 
+    ///////////////////////////////////////////////////////////////////////
+    // ctor
+    public JAFApp(String title)
+	{
+	   super(title);
+	   initMe();
+	}
+
+    public JAFApp()
+	{
+	    super();
+	    initMe();
+	}
+    
+    ///////////////////////////////////////////////////////////////////////
+    // initME -- init the UI
+    private void initMe()
+	{
+	    Font label_font = new Font("Default", Font.PLAIN, 12);
+	    Font title_font = new Font("Default", Font.BOLD, 12);
+
+	    gridbag = new GridBagLayout();
+	    setLayout(gridbag);
+	    
+	    this.setBackground(Color.white);
+
+	    // results panel create
+	    results_panel = new Panel();
+	    panel_gb = new GridBagLayout();
+	    results_panel.setLayout(panel_gb);
+	    results_panel.setBackground(Color.lightGray);
+	    addGridComponent(this,
+			     results_panel,
+			     gridbag,
+			     0,0,
+			     1,1,
+			     1,0 );
+
+	    // file name label
+	    f_title = new Label("File Name:");
+	    f_title.setBackground(Color.lightGray);
+	    f_title.setAlignment(Label.RIGHT);
+	    f_title.setFont(title_font);	    
+	    addGridComponent(results_panel,
+			     f_title,
+			     panel_gb,
+			     0, 0,
+			     1, 1,
+			     5, 100);
+
+	    // file name label
+	    f_name_label = new Label("<none selected>");
+	    f_name_label.setBackground(Color.lightGray);
+	    f_name_label.setAlignment(Label.LEFT);
+	    f_name_label.setFont(label_font);
+	    addGridComponent(results_panel,
+			     f_name_label,
+			     panel_gb,
+			     1, 0,
+			     1, 1,
+			     15, 100);
+	    
+	    	    // file name label
+	    f_title = new Label("MIME Type:");
+	    f_title.setBackground(Color.lightGray);
+	    f_title.setAlignment(Label.RIGHT);
+	    f_title.setFont(title_font);	    
+	    addGridComponent(results_panel,
+			     f_title,
+			     panel_gb,
+			     2, 0,
+			     1, 1,
+			     5, 100);
+
+	    // type_label
+	    type_label = new Label("<no type>");
+	    type_label.setBackground(Color.lightGray);
+	    type_label.setAlignment(Label.LEFT);
+	    type_label.setFont(label_font);
+	    addGridComponent(results_panel,
+			     type_label,
+			     panel_gb,
+			     3,0,
+			     1,1,
+			     10, 100);
+
+	    // launch button
+	    launch_button = new Button("Launch!");
+	    launch_button.setEnabled( false );
+	    launch_button.setBackground(Color.red);
+	    launch_button.setFont(title_font);
+	    addGridComponent(results_panel,
+			     launch_button,
+			     panel_gb,
+			     4,0,
+			     1,1,
+			     5, 100);
+	    
+	    // verb popup
+	    verb_choice = new Choice();
+	    verb_choice.setEnabled( false );
+	    verb_choice.setFont(label_font);
+	    verb_choice.add("<empty>");
+	    addGridComponent(results_panel,
+			     verb_choice,
+			     panel_gb,
+			     5,0,
+			     1,1,
+			     10, 100);
+
+	    // file list
+	    file_list = new List();
+	    file_list.setBackground(Color.white);
+	    file_list.setFont(label_font);
+	    addGridComponent(this,
+			     file_list,
+			     gridbag,
+			     0,1,
+			     1, 2,
+			     1,1);
+
+	    this.invalidate();
+
+	    // set up events
+	    this.addWindowListener(this);
+	    file_list.addItemListener(this);
+	    launch_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); 
+	}
+
+    ///////////////////////////////////////////////////////////////////////
+    // setFile - sets the file/directory for this frame at startup usually
+    //
+    public void setFile( File file )
+	{
+	    _file = file;
+	    int i;
+	    MailcapCommandMap cmdmap = 
+		(MailcapCommandMap)CommandMap.getDefaultCommandMap();
+	    cmdmap.addMailcap("application/x-int;      jaf.viewers.IntViewer");
+
+	    if(_file.isFile())
+		{
+		    dh = new DataHandler[1];
+		    dh[0] = new DataHandler(new FileDataSource( _file ));
+
+		    file_list.add( dh[0].getName() );
+		}
+	    else if( _file.isDirectory() )
+		{
+		    String files[] = _file.list();
+		    MimetypesFileTypeMap map = new MimetypesFileTypeMap();
+		    map.addMimeTypes("text/java java\n");
+		    FileTypeMap.setDefaultFileTypeMap(map);
+		    dh = new DataHandler[ files.length ];
+		    // iterate through the list and make fds
+		    for( i = 0; i < files.length; i++)
+			{
+
+
+			    if(debug)
+				System.out.println(files[i]);
+
+			    dh[i] = new  DataHandler(
+					   new FileDataSource( _file.getAbsolutePath() +
+							       _file.separator +  
+							       files[i] )
+					   );
+			    dh[i].setCommandMap(cmdmap);
+
+// 			    try {
+// 				((FileDataSource)dh[i].getDataSource()).addMimeTypes("text/plain java\n");
+// 			    } catch(IOException e){ System.out.println(e); }
+			    file_list.add(dh[i].getName());
+			}
+		    System.out.println("number of files: " + files.length +
+				       " read : " + i);
+
+		}
+
+	}
+    /////////////////***ACTION LISTENER***///////////////////////
+    // is called when a monkey (user) presses the launch button
+    public void actionPerformed(ActionEvent evt)
+	{
+	    Object source = evt.getSource();
+	    int index = file_list.getSelectedIndex();
+	    
+	    // make sure it's the launch button and that
+	    // a list item is selected...
+	    if(source == launch_button && index > -1){
+		CommandInfo cmds[] = null;
+		String mimeType = dh[index].getContentType();
+		
+		if(debug)
+		    System.out.println("Finding...");
+		
+		// get the available commands for this type
+		cmds = dh[index].getPreferredCommands();
+		
+		// if we actually got some back...
+		if(cmds.length > 0){ 
+		    CompViewer cont = null;
+		    Object my_bean = null;
+		    // take the first one
+		    if(debug)
+			System.out.println("Launching...");
+		    
+		    // get the first one
+		    my_bean = dh[index].getBean( cmds[verb_choice.getSelectedIndex()] );
+		    
+			    // if it isn't a CommandObject we still
+			    // have to give it it's data...
+// 			    if(!(my_bean instanceof javax.activation.CommandObject))
+// 				{
+// 				    System.out.println("WHOOOAAA!");
+// 				    if(my_bean instanceof 
+// 				       java.io.Externalizable)
+		
+// 					{
+// 					    try
+// 						{
+//                 	     ((Externalizable)my_bean).readExternal(
+// 						new ObjectInputStream( 
+// 						   dh[index].getInputStream() 
+// 						   )
+// 						);
+// 						} catch(Exception e)
+// 						    {
+// 				  System.out.println("There was a problem reading the Externalized Data in the viewer bean : " + e);
+// 						    }
+// 					}
+// 				}
+		    if(debug)
+			System.out.println("GOTTA BEAN!: " + 
+					   my_bean.getClass().getName() );
+			    // create a new bean container
+		    cont = new CompViewer( "JAF Component" );
+		    cont.setBean( (Component) my_bean);
+		    cont.show();
+		}
+	    }
+	}
+    /////////////////***ITEM LISTENER***/////////////////////////
+    public void itemStateChanged(ItemEvent evt)
+	{
+	    Integer id = (Integer)evt.getItem();
+
+	    if(evt.getStateChange() == ItemEvent.SELECTED)
+		{
+		    // get the content type from the data handler...
+		    String mime_type = dh[id.intValue()].getContentType();
+		    // set the state in the info dlog:
+		    f_name_label.setText(dh[id.intValue()].getName());
+		    
+		    // set the field in the UI and enable launch button
+		    if(mime_type != null)
+			{
+			    CommandInfo cmds[] = null;
+			    // set the text label
+			    type_label.setText(mime_type);
+
+			    // check to see if any commands are available
+			    cmds = dh[id.intValue()].getPreferredCommands();
+			    if(cmds != null && cmds.length > 0) // we got a command!
+				{
+				    launch_button.setEnabled( true );
+				    verb_choice.setEnabled( true );
+				    launch_button.setBackground( Color.green );
+
+				    verb_choice.removeAll();
+				    for(int i = 0; i < cmds.length; i++)
+					{
+					    //		    verb_choice.addItem(cmds[i].getBeanDescriptor().getName());
+					    verb_choice.addItem(cmds[i].getCommandName());
+					}
+				}
+			    else
+				{
+				    launch_button.setEnabled( false );
+				    verb_choice.setEnabled( false );
+				    launch_button.setBackground( Color.red );
+				}
+			    
+			}
+		    else
+			{
+			    // set label to be unknown and launch button off!
+			    type_label.setText("<unknown>");
+			    launch_button.setEnabled( false );
+			    launch_button.setBackground( Color.red );
+			}
+		    
+		}
+	}
+    /////////////////***WINDOW LISTENER***////////////////////////
+    public void windowOpened(WindowEvent e){}
+    public void windowClosing(WindowEvent e)
+	{
+	    System.exit(0); // quit
+	}
+    public void windowClosed(WindowEvent e){}
+    public void windowIconified(WindowEvent e){}
+    public void windowDeiconified(WindowEvent e){}
+    public void windowActivated(WindowEvent e){}
+    public void windowDeactivated(WindowEvent e){}
+	    
+    ///////////////////////////////////////////////////////////////////////
+    // main
+    public static void main(String args[])
+	{
+	    JAFApp appFrame = new JAFApp("JAF Testing Application");
+	    appFrame.setSize(600, 400);
+	    appFrame.show();
+
+	    // set the directory
+	    if(args.length == 0)
+		{
+		    appFrame.setFile( new File("."));
+		}
+	    else
+		{
+		    appFrame.setFile( new File(args[0]) );
+		}
+	}
+
+	    
+}

+ 107 - 0
Activation/JavaBeans Activation Framework 1.1.1/jaf-1.1.1/demo/MCDump.java

@@ -0,0 +1,107 @@
+/*
+ * @(#)MCDump.java	1.3 07/07/13
+ *
+ * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   - Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *
+ *   - Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ *   - Neither the name of Sun Microsystems nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+import java.io.*;
+import java.beans.*;
+import com.sun.activation.registries.*;
+import javax.activation.*;
+
+/**
+ * Dump out everything we know about a MailcapCommandMap.
+ */
+public class MCDump {
+    static MailcapCommandMap mcf = null;
+
+    public static void main(String args[]) {
+	
+	try {
+	    if (args.length == 0)
+		mcf = new MailcapCommandMap();
+	    else
+		mcf = new MailcapCommandMap(args[0]);
+	} catch (Exception e){ 
+	    e.printStackTrace();
+	    System.exit(1);
+	}
+
+	String[] types = mcf.getMimeTypes();
+	if (types == null) {
+	    System.out.println("No known MIME types");
+	    System.exit(0);
+	} else {
+	    System.out.println("Known MIME types:");
+	    for (int i = 0; i < types.length; i++)
+		System.out.println("\t" + types[i]);
+	}
+
+	System.out.println();
+	System.out.println("All commands for each MIME type:");
+	for (int i = 0; i < types.length; i++) {
+	    System.out.println("    " + types[i]);
+	    CommandInfo[] cmdinfo = mcf.getAllCommands(types[i]);
+	    if (cmdinfo == null) {
+		System.out.println("\tNONE");
+	    } else {
+		for (int k = 0; k < cmdinfo.length; k++)
+		    System.out.println("\t" + cmdinfo[k].getCommandName() +
+			": " + cmdinfo[k].getCommandClass());
+	    }
+	}
+
+	System.out.println();
+	System.out.println("Preferred commands for each MIME type:");
+	for (int i = 0; i < types.length; i++) {
+	    System.out.println("    " + types[i]);
+	    CommandInfo[] cmdinfo = mcf.getPreferredCommands(types[i]);
+	    if (cmdinfo == null) {
+		System.out.println("\tNONE");
+	    } else {
+		for (int k = 0; k < cmdinfo.length; k++)
+		    System.out.println("\t" + cmdinfo[k].getCommandName() +
+			": " + cmdinfo[k].getCommandClass());
+	    }
+	}
+
+	System.out.println();
+	System.out.println("Native commands for each MIME type:");
+	for (int i = 0; i < types.length; i++) {
+	    System.out.println("    " + types[i]);
+	    String[] cmds = mcf.getNativeCommands(types[i]);
+	    if (cmds.length == 0) {
+		System.out.println("\tNONE");
+	    } else {
+		for (int k = 0; k < cmds.length; k++)
+		    System.out.println("\t" + cmds[k]);
+	    }
+	}
+    }
+}

+ 78 - 0
Activation/JavaBeans Activation Framework 1.1.1/jaf-1.1.1/demo/MCTest.java

@@ -0,0 +1,78 @@
+/*
+ * @(#)MCTest.java	1.9 07/07/13
+ *
+ * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   - Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *
+ *   - Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ *   - Neither the name of Sun Microsystems nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+import java.io.*;
+import java.beans.*;
+import com.sun.activation.registries.*;
+import javax.activation.*;
+
+public class MCTest {
+    static MailcapCommandMap mcf = null;
+
+    public static void main(String args[]) {
+	
+	try {
+	    if (args.length == 0)
+		mcf = new MailcapCommandMap();
+	    else
+		mcf = new MailcapCommandMap(args[0]);
+	} catch (Exception e){ 
+	    e.printStackTrace();
+	    System.exit(1);
+	}
+
+	CommandInfo cmdinfo[] = mcf.getAllCommands("text/plain");
+        System.out.print("Are there any commands for text/plain?");
+
+	if (cmdinfo != null) {
+	    System.out.println("number of cmds = " + cmdinfo.length);
+	    System.out.println("now try an individual cmd");
+	    CommandInfo info = mcf.getCommand("text/plain", "view");
+	    if (info != null) {
+		System.out.println("Got command...");
+	    } else {
+		System.out.println("no cmds");
+	    }
+
+	    mcf.addMailcap("text/plain;; x-java-flobotz=com.sun.activation.flobotz\n");	
+	    //	    System.out.println("...dome");
+	    if (cmdinfo != null) {
+		cmdinfo = mcf.getAllCommands("text/plain");
+		System.out.println("now we have cmds = " + cmdinfo.length);
+		
+	    }	
+
+        } else {
+	    System.out.println("NO CMDS AT ALL!");
+	}
+    }
+}

+ 99 - 0
Activation/JavaBeans Activation Framework 1.1.1/jaf-1.1.1/demo/ODCHTest.java

@@ -0,0 +1,99 @@
+/*
+ * @(#)ODCHTest.java	1.4 07/07/13
+ *
+ * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   - Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *
+ *   - Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ *   - Neither the name of Sun Microsystems nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import java.io.*;
+import javax.activation.*;
+import java.awt.datatransfer.*;
+
+public class ODCHTest {
+    private FileDataSource fds = null;
+    private DataHandler dh = null;
+    private DataContentHandlerFactory dchf = null;
+    private String str;
+    /**
+     * main function
+     */
+    public static void main(String args[]) {
+	ODCHTest test = new ODCHTest();
+	
+	if(args.length != 0) {
+	    System.out.println("usage: ODCHTest");
+	    System.exit(1);
+	}
+	
+	// first let's get a DataSource
+
+	
+	test.doit();
+    }
+
+    private void doit() {
+	DataFlavor xfer_flavors[];
+	Object content = null;
+
+	str = new String("This is a test");
+
+	// now let's create a DataHandler
+	dh = new DataHandler(str, "text/plain");
+	System.out.println("ODCHTest: DataHandler created with str & text/plain");
+
+	// now lets set a DataContentHandlerFactory
+	dchf = new SimpleDCF("text/plain:PlainDCH\n");
+	System.out.println("ODCHTest: Simple dchf created");
+	
+	// now let's set the dchf in the dh
+	dh.setDataContentHandlerFactory(dchf);
+	System.out.println("ODCHTest: DataContentHandlerFactory set in DataHandler");
+	
+	// get the dataflavors
+	xfer_flavors = dh.getTransferDataFlavors();
+	System.out.println("ODCHTest: dh.getTransferDF returned " +
+			   xfer_flavors.length + " data flavors.");
+
+	// get the content:
+        try {
+	   content = dh.getContent();
+        } catch (Exception e) { e.printStackTrace(); }
+
+	if(content == null)
+	    System.out.println("ODCHTest: no content to be had!!!");
+	else {
+	    System.out.println("ODCHTest: got content of the following type: " +
+			       content.getClass().getName());
+	    if(content == str)
+		System.out.println("get content works");
+	    
+	}
+    }
+	    
+}

+ 149 - 0
Activation/JavaBeans Activation Framework 1.1.1/jaf-1.1.1/demo/PlainDCH.java

@@ -0,0 +1,149 @@
+/*
+ * @(#)PlainDCH.java	1.10 07/07/13
+ *
+ * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   - Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *
+ *   - Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ *   - Neither the name of Sun Microsystems nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+import java.io.*;
+import java.awt.datatransfer.DataFlavor;
+import javax.activation.*;
+
+
+public class PlainDCH implements DataContentHandler {
+    /**
+     * return the DataFlavors for this <code>DataContentHandler</code>
+     * @return The DataFlavors.
+     */
+    public DataFlavor[] getTransferDataFlavors() { // throws Exception;
+	DataFlavor flavors[] = new DataFlavor[2];
+	
+
+	try {
+	    flavors[0] = new ActivationDataFlavor(Class.forName("java.lang.String"),
+					   "text/plain",
+					   "text string");
+	} catch(Exception e)
+	    { System.out.println(e); }
+
+	flavors[1] = new DataFlavor("text/plain", "Plain Text");
+	return flavors;
+    }
+    /**
+     * return the Transfer Data of type DataFlavor from InputStream
+     * @param df The DataFlavor.
+     * @param ins The InputStream corresponding to the data.
+     * @return The constructed Object.
+     */
+    public Object getTransferData(DataFlavor df, DataSource ds) {
+	
+	// this is sort of hacky, but will work for the
+	// sake of testing...
+	if(df.getMimeType().equals("text/plain")) {
+	    if(df.getRepresentationClass().getName().equals(
+					       "java.lang.String")) {
+		// spit out String
+		StringBuffer buf = new StringBuffer();
+		char data[] = new char[1024];
+		// InputStream is = null;
+		InputStreamReader isr = null;
+		int bytes_read = 0;
+		int total_bytes = 0;
+
+		try {
+		    isr = new InputStreamReader(ds.getInputStream());
+		    
+// 		    while(is.read(data) > 0)
+// 			buf.append(data);
+
+		    while(true){
+			bytes_read = isr.read(data);
+			if(bytes_read > 0)
+			    buf.append(data, total_bytes, bytes_read);
+			else
+			    break;
+			total_bytes += bytes_read;
+		    } 
+		} catch(Exception e) {}
+
+		return buf.toString();
+		
+	    }
+	    else if(df.getRepresentationClass().getName().equals(
+					     "java.io.InputStream")){
+		// spit out InputStream
+		try {
+		    return ds.getInputStream();
+		} catch (Exception e) {}
+	    }
+		
+	} 
+
+	    return null;
+    }
+    
+    /**
+     *
+     */
+    public Object getContent(DataSource ds) { // throws Exception;
+	StringBuffer buf = new StringBuffer();
+	char data[] = new char[1024];
+	// InputStream is = null;
+	InputStreamReader isr = null;
+	int bytes_read = 0;
+	int total_bytes = 0;
+	
+	try {
+	    isr = new InputStreamReader(ds.getInputStream());
+	    
+	    // 		    while(is.read(data) > 0)
+	    // 			buf.append(data);
+	    
+	    while(true){
+		bytes_read = isr.read(data);
+		if(bytes_read > 0)
+		    buf.append(data, total_bytes, bytes_read);
+		else
+		    break;
+		total_bytes += bytes_read;
+	    } 
+	} catch(Exception e) {}
+	
+	return buf.toString();
+    }
+    /**
+     * construct an object from a byte stream
+     * (similar semantically to previous method, we are deciding
+     *  which one to support)
+     */
+    public void writeTo(Object obj, String mimeTye, OutputStream os) 
+	throws IOException {
+	// throws Exception;
+    }
+    
+}

+ 79 - 0
Activation/JavaBeans Activation Framework 1.1.1/jaf-1.1.1/demo/PrefTest.java

@@ -0,0 +1,79 @@
+/*
+ * @(#)PrefTest.java	1.6 07/07/13
+ *
+ * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   - Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *
+ *   - Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ *   - Neither the name of Sun Microsystems nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+import java.io.*;
+import java.beans.*;
+import javax.activation.*;
+
+public class PrefTest {
+
+    public static void main(String args[]) {
+	MailcapCommandMap mcf = null;
+
+	if (args.length > 0) {
+	    try {
+		mcf = new MailcapCommandMap(args[0]);
+	    } catch (Exception e) {
+		e.printStackTrace();
+		System.exit(1);
+	    }
+	} else
+	    mcf = new MailcapCommandMap();
+
+	CommandInfo cmdinfo[] = mcf.getAllCommands("text/plain");
+	
+	if (cmdinfo != null) {
+	    System.out.println("ALL Commands for text/plain:");
+	    for (int i = 0; i < cmdinfo.length; i++) {
+		System.out.println("Verb: " + cmdinfo[i].getCommandName() +
+				  " Class: " + cmdinfo[i].getCommandClass());
+	    }
+	    System.out.println("done");
+	} else {
+	    System.out.println("no commands");
+	}
+	System.out.println();
+
+	cmdinfo = mcf.getPreferredCommands("text/plain");
+	if (cmdinfo != null) {
+	    System.out.println("PREFERRED Commands for text/plain:");
+	    for (int i = 0; i < cmdinfo.length; i++) {
+		System.out.println("Verb: " + cmdinfo[i].getCommandName() +
+				  " Class: " + cmdinfo[i].getCommandClass());
+	    }
+	    System.out.println("done");
+	} else {
+	    System.out.println("no commands");
+	}
+	System.out.println();
+    }
+}

+ 117 - 0
Activation/JavaBeans Activation Framework 1.1.1/jaf-1.1.1/demo/SimpleDCF.java

@@ -0,0 +1,117 @@
+/*
+ * @(#)SimpleDCF.java	1.4 07/07/13
+ *
+ * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   - Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *
+ *   - Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ *   - Neither the name of Sun Microsystems nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import javax.activation.*;
+import java.util.StringTokenizer;
+import java.util.Hashtable;
+
+public class SimpleDCF implements DataContentHandlerFactory {
+    Hashtable entry_hash = new Hashtable();
+    /**
+     * the constructor, takes a list of classes as an argument in the
+     * form:
+     * <mimetype>:<class name>\n
+     *
+     * For Example:
+     *
+     * application/x-wombat:com.womco.WombatDCH
+     * text/plain:com.textco.TextDCH
+     *
+     */
+    public SimpleDCF(String entries) {
+	StringTokenizer tok = new StringTokenizer(entries);
+
+	String entry;
+	System.out.println("SimpleDCH: new SimpleDCF being created");
+
+	// parse the string
+	while(tok.hasMoreTokens()) {
+	    int colon;
+
+	    entry = tok.nextToken();
+	    System.out.println("full entry = " + entry);
+
+	    // parse out the fields
+	    colon = entry.indexOf(':');
+	    VectorEntry ve = new VectorEntry(entry.substring(0,colon),
+					     entry.substring(colon + 1, 
+							     entry.length()));
+	    System.out.println("adding element = " + ve);
+	    entry_hash.put(ve.getMimeType(),ve);
+	}
+    }
+
+    /**
+     * implement the factor interface
+     */
+    public DataContentHandler createDataContentHandler(String mimeType){
+	DataContentHandler dch = null;
+
+	System.out.print("SimpleDCF: trying to create a DCH");
+
+	VectorEntry ve = (VectorEntry)entry_hash.get(mimeType);
+	if(ve != null) {
+	    System.out.print("...found token");
+	    try { 
+		
+		dch = (DataContentHandler)Class.forName(
+					ve.getClassName()).newInstance();
+		if(dch == null)
+		    System.out.println("...FAILED!!!");
+		else
+		    System.out.println("...SUCCESS!!!");
+
+	    } catch(Exception e) {
+		System.out.println(e);
+	    }
+	}
+	return dch;
+    }
+}
+
+class VectorEntry {
+    private String mimeType;
+    private String className;
+
+    public VectorEntry(String mimeType, String className) {
+	this.mimeType = mimeType;
+	this.className = className;
+    }
+    
+    public String getMimeType() { return mimeType; }
+    public String getClassName() { return className; }
+    public String toString() { 
+	return new String("type: " + mimeType + " class name: " + className);
+    }
+
+}

+ 113 - 0
Activation/JavaBeans Activation Framework 1.1.1/jaf-1.1.1/demo/TextInternalizer.java

@@ -0,0 +1,113 @@
+/*
+ * @(#)TextInternalizer.java	1.4 07/07/13
+ *
+ * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   - Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *
+ *   - Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ *   - Neither the name of Sun Microsystems nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import java.awt.*;
+import java.io.*;
+import java.beans.*;
+import javax.activation.*;
+
+public class TextInternalizer extends Panel implements Externalizable {
+    // 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 TextInternalizer() {
+	System.out.println("TextInternalizer!!!!!");
+
+	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 writeExternal(ObjectOutput out) throws IOException{
+
+    }
+
+    public void readExternal(ObjectInput in) throws IOException, 
+	ClassNotFoundException {
+
+	
+	this.setObjectInput(in);
+    }
+
+
+
+    //--------------------------------------------------------------------
+//     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 setObjectInput(ObjectInput ins) throws IOException {
+      try {
+
+      text_buffer = (String)ins.readObject();
+      } catch(Exception e){ e.printStackTrace(); }
+      // 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);
+    }
+
+}
+
+
+
+
+
+

+ 37 - 0
Activation/JavaBeans Activation Framework 1.1.1/jaf-1.1.1/distributionREADME.txt

@@ -0,0 +1,37 @@
+DistributionREADME
+
+DISTRIBUTION BY DEVELOPERS.  Subject to the terms and conditions of the
+Software License Agreement and the obligations, restrictions, and
+exceptions set forth below, You may reproduce and distribute the
+portions of Software identified below (each a "Redistributable"),
+provided that:
+
+(a) you distribute the Redistributable complete and unmodified and only
+bundled as part of Your applets and applications ("Programs"),
+
+(b) your Programs add significant and primary functionality to the
+Software
+
+(c) you distribute Redistributable for the sole purpose of running your
+Programs,
+
+(d) you do not distribute additional software intended to replace any
+component(s) of the Redistributable,
+
+(e) you do not remove or alter any proprietary legends or notices
+contained in or on the Redistributable.
+
+(f) you only distribute the Redistributable subject to a license
+agreement that protects Sun's interests consistent with the terms
+contained in the Software License Agreement, and
+
+(g) you agree to defend and indemnify Sun and its licensors from and
+against any damages, costs, liabilities, settlement amounts and/or
+expenses  (including attorneys' fees) incurred in connection with any
+claim, lawsuit or action by any third party that arises or results from
+the use or distribution of any and all Programs and/or
+Redistributable.
+
+The following files are each a Redistributable:
+
+activation.jar

BIN
Activation/JavaBeans Activation Framework 1.1.1/jaf-1.1.1/docs/JAF-1.1.pdf


+ 62 - 0
Activation/JavaBeans Activation Framework 1.1.1/jaf-1.1.1/docs/javadocs/allclasses-frame.html

@@ -0,0 +1,62 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<!--NewPage-->
+<HTML>
+<HEAD>
+<!-- Generated by javadoc (build 1.4.2) on Wed Oct 17 11:05:51 PDT 2007 -->
+<TITLE>
+All Classes (JavaBeans Activation Framework API documentation)
+</TITLE>
+
+
+<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
+
+
+</HEAD>
+
+<BODY BGCOLOR="white">
+<FONT size="+1" CLASS="FrameHeadingFont">
+<B>All Classes</B></FONT>
+<BR>
+
+<TABLE BORDER="0" WIDTH="100%" SUMMARY="">
+<TR>
+<TD NOWRAP><FONT CLASS="FrameItemFont"><A HREF="javax/activation/ActivationDataFlavor.html" title="class in javax.activation" target="classFrame">ActivationDataFlavor</A>
+<BR>
+<A HREF="javax/activation/CommandInfo.html" title="class in javax.activation" target="classFrame">CommandInfo</A>
+<BR>
+<A HREF="javax/activation/CommandMap.html" title="class in javax.activation" target="classFrame">CommandMap</A>
+<BR>
+<A HREF="javax/activation/CommandObject.html" title="interface in javax.activation" target="classFrame"><I>CommandObject</I></A>
+<BR>
+<A HREF="javax/activation/DataContentHandler.html" title="interface in javax.activation" target="classFrame"><I>DataContentHandler</I></A>
+<BR>
+<A HREF="javax/activation/DataContentHandlerFactory.html" title="interface in javax.activation" target="classFrame"><I>DataContentHandlerFactory</I></A>
+<BR>
+<A HREF="javax/activation/DataHandler.html" title="class in javax.activation" target="classFrame">DataHandler</A>
+<BR>
+<A HREF="javax/activation/DataSource.html" title="interface in javax.activation" target="classFrame"><I>DataSource</I></A>
+<BR>
+<A HREF="javax/activation/FileDataSource.html" title="class in javax.activation" target="classFrame">FileDataSource</A>
+<BR>
+<A HREF="javax/activation/FileTypeMap.html" title="class in javax.activation" target="classFrame">FileTypeMap</A>
+<BR>
+<A HREF="javax/activation/MailcapCommandMap.html" title="class in javax.activation" target="classFrame">MailcapCommandMap</A>
+<BR>
+<A HREF="javax/activation/MimeType.html" title="class in javax.activation" target="classFrame">MimeType</A>
+<BR>
+<A HREF="javax/activation/MimeTypeParameterList.html" title="class in javax.activation" target="classFrame">MimeTypeParameterList</A>
+<BR>
+<A HREF="javax/activation/MimeTypeParseException.html" title="class in javax.activation" target="classFrame">MimeTypeParseException</A>
+<BR>
+<A HREF="javax/activation/MimetypesFileTypeMap.html" title="class in javax.activation" target="classFrame">MimetypesFileTypeMap</A>
+<BR>
+<A HREF="javax/activation/URLDataSource.html" title="class in javax.activation" target="classFrame">URLDataSource</A>
+<BR>
+<A HREF="javax/activation/UnsupportedDataTypeException.html" title="class in javax.activation" target="classFrame">UnsupportedDataTypeException</A>
+<BR>
+</FONT></TD>
+</TR>
+</TABLE>
+
+</BODY>
+</HTML>

+ 62 - 0
Activation/JavaBeans Activation Framework 1.1.1/jaf-1.1.1/docs/javadocs/allclasses-noframe.html

@@ -0,0 +1,62 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<!--NewPage-->
+<HTML>
+<HEAD>
+<!-- Generated by javadoc (build 1.4.2) on Wed Oct 17 11:05:51 PDT 2007 -->
+<TITLE>
+All Classes (JavaBeans Activation Framework API documentation)
+</TITLE>
+
+
+<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
+
+
+</HEAD>
+
+<BODY BGCOLOR="white">
+<FONT size="+1" CLASS="FrameHeadingFont">
+<B>All Classes</B></FONT>
+<BR>
+
+<TABLE BORDER="0" WIDTH="100%" SUMMARY="">
+<TR>
+<TD NOWRAP><FONT CLASS="FrameItemFont"><A HREF="javax/activation/ActivationDataFlavor.html" title="class in javax.activation">ActivationDataFlavor</A>
+<BR>
+<A HREF="javax/activation/CommandInfo.html" title="class in javax.activation">CommandInfo</A>
+<BR>
+<A HREF="javax/activation/CommandMap.html" title="class in javax.activation">CommandMap</A>
+<BR>
+<A HREF="javax/activation/CommandObject.html" title="interface in javax.activation"><I>CommandObject</I></A>
+<BR>
+<A HREF="javax/activation/DataContentHandler.html" title="interface in javax.activation"><I>DataContentHandler</I></A>
+<BR>
+<A HREF="javax/activation/DataContentHandlerFactory.html" title="interface in javax.activation"><I>DataContentHandlerFactory</I></A>
+<BR>
+<A HREF="javax/activation/DataHandler.html" title="class in javax.activation">DataHandler</A>
+<BR>
+<A HREF="javax/activation/DataSource.html" title="interface in javax.activation"><I>DataSource</I></A>
+<BR>
+<A HREF="javax/activation/FileDataSource.html" title="class in javax.activation">FileDataSource</A>
+<BR>
+<A HREF="javax/activation/FileTypeMap.html" title="class in javax.activation">FileTypeMap</A>
+<BR>
+<A HREF="javax/activation/MailcapCommandMap.html" title="class in javax.activation">MailcapCommandMap</A>
+<BR>
+<A HREF="javax/activation/MimeType.html" title="class in javax.activation">MimeType</A>
+<BR>
+<A HREF="javax/activation/MimeTypeParameterList.html" title="class in javax.activation">MimeTypeParameterList</A>
+<BR>
+<A HREF="javax/activation/MimeTypeParseException.html" title="class in javax.activation">MimeTypeParseException</A>
+<BR>
+<A HREF="javax/activation/MimetypesFileTypeMap.html" title="class in javax.activation">MimetypesFileTypeMap</A>
+<BR>
+<A HREF="javax/activation/URLDataSource.html" title="class in javax.activation">URLDataSource</A>
+<BR>
+<A HREF="javax/activation/UnsupportedDataTypeException.html" title="class in javax.activation">UnsupportedDataTypeException</A>
+<BR>
+</FONT></TD>
+</TR>
+</TABLE>
+
+</BODY>
+</HTML>

+ 23 - 0
Activation/JavaBeans Activation Framework 1.1.1/jaf-1.1.1/docs/javadocs/index.html

@@ -0,0 +1,23 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
+<!--NewPage-->
+<HTML>
+<HEAD>
+<!-- Generated by javadoc on Wed Oct 17 11:05:51 PDT 2007-->
+<TITLE>
+JavaBeans Activation Framework API documentation
+</TITLE>
+</HEAD>
+<FRAMESET cols="20%,80%">
+<FRAME src="allclasses-frame.html" name="packageFrame" title="All classes and interfaces (except non-static nested types)">
+<FRAME src="javax/activation/package-summary.html" name="classFrame" title="Package, class and interface descriptions">
+<NOFRAMES>
+<H2>
+Frame Alert</H2>
+
+<P>
+This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client.
+<BR>
+Link to<A HREF="javax/activation/package-summary.html">Non-frame version.</A>
+</NOFRAMES>
+</FRAMESET>
+</HTML>

+ 82 - 0
Activation/JavaBeans Activation Framework 1.1.1/jaf-1.1.1/docs/javadocs/javax/activation/package-frame.html

@@ -0,0 +1,82 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<!--NewPage-->
+<HTML>
+<HEAD>
+<!-- Generated by javadoc (build 1.4.2) on Wed Oct 17 11:05:51 PDT 2007 -->
+<TITLE>
+javax.activation (JavaBeans Activation Framework API documentation)
+</TITLE>
+
+<META NAME="keywords" CONTENT="javax.activation package">
+
+<LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">
+
+
+</HEAD>
+
+<BODY BGCOLOR="white">
+<FONT size="+1" CLASS="FrameTitleFont">
+<A HREF="../../javax/activation/package-summary.html" target="classFrame">javax.activation</A></FONT>
+<TABLE BORDER="0" WIDTH="100%" SUMMARY="">
+<TR>
+<TD NOWRAP><FONT size="+1" CLASS="FrameHeadingFont">
+Interfaces</FONT>&nbsp;
+<FONT CLASS="FrameItemFont">
+<BR>
+<A HREF="CommandObject.html" title="interface in javax.activation" target="classFrame"><I>CommandObject</I></A>
+<BR>
+<A HREF="DataContentHandler.html" title="interface in javax.activation" target="classFrame"><I>DataContentHandler</I></A>
+<BR>
+<A HREF="DataContentHandlerFactory.html" title="interface in javax.activation" target="classFrame"><I>DataContentHandlerFactory</I></A>
+<BR>
+<A HREF="DataSource.html" title="interface in javax.activation" target="classFrame"><I>DataSource</I></A></FONT></TD>
+</TR>
+</TABLE>
+
+
+<TABLE BORDER="0" WIDTH="100%" SUMMARY="">
+<TR>
+<TD NOWRAP><FONT size="+1" CLASS="FrameHeadingFont">
+Classes</FONT>&nbsp;
+<FONT CLASS="FrameItemFont">
+<BR>
+<A HREF="ActivationDataFlavor.html" title="class in javax.activation" target="classFrame">ActivationDataFlavor</A>
+<BR>
+<A HREF="CommandInfo.html" title="class in javax.activation" target="classFrame">CommandInfo</A>
+<BR>
+<A HREF="CommandMap.html" title="class in javax.activation" target="classFrame">CommandMap</A>
+<BR>
+<A HREF="DataHandler.html" title="class in javax.activation" target="classFrame">DataHandler</A>
+<BR>
+<A HREF="FileDataSource.html" title="class in javax.activation" target="classFrame">FileDataSource</A>
+<BR>
+<A HREF="FileTypeMap.html" title="class in javax.activation" target="classFrame">FileTypeMap</A>
+<BR>
+<A HREF="MailcapCommandMap.html" title="class in javax.activation" target="classFrame">MailcapCommandMap</A>
+<BR>
+<A HREF="MimeType.html" title="class in javax.activation" target="classFrame">MimeType</A>
+<BR>
+<A HREF="MimeTypeParameterList.html" title="class in javax.activation" target="classFrame">MimeTypeParameterList</A>
+<BR>
+<A HREF="MimetypesFileTypeMap.html" title="class in javax.activation" target="classFrame">MimetypesFileTypeMap</A>
+<BR>
+<A HREF="URLDataSource.html" title="class in javax.activation" target="classFrame">URLDataSource</A></FONT></TD>
+</TR>
+</TABLE>
+
+
+<TABLE BORDER="0" WIDTH="100%" SUMMARY="">
+<TR>
+<TD NOWRAP><FONT size="+1" CLASS="FrameHeadingFont">
+Exceptions</FONT>&nbsp;
+<FONT CLASS="FrameItemFont">
+<BR>
+<A HREF="MimeTypeParseException.html" title="class in javax.activation" target="classFrame">MimeTypeParseException</A>
+<BR>
+<A HREF="UnsupportedDataTypeException.html" title="class in javax.activation" target="classFrame">UnsupportedDataTypeException</A></FONT></TD>
+</TR>
+</TABLE>
+
+
+</BODY>
+</HTML>

+ 1 - 0
Activation/JavaBeans Activation Framework 1.1.1/jaf-1.1.1/docs/javadocs/package-list

@@ -0,0 +1 @@
+javax.activation

+ 37 - 0
Activation/JavaBeans Activation Framework 1.1.1/jaf-1.1.1/docs/javadocs/packages.html

@@ -0,0 +1,37 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<!--NewPage-->
+<HTML>
+<HEAD>
+<!-- Generated by javadoc (build 1.4.2) on Wed Oct 17 11:05:51 PDT 2007 -->
+<TITLE>
+ (JavaBeans Activation Framework API documentation)
+</TITLE>
+
+
+<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
+
+<SCRIPT type="text/javascript">
+function windowTitle()
+{
+    parent.document.title=" (JavaBeans Activation Framework API documentation)";
+}
+</SCRIPT>
+
+</HEAD>
+
+<BODY BGCOLOR="white" onload="windowTitle();">
+
+<BR>
+
+<BR>
+
+<BR>
+<CENTER>
+The front page has been relocated.Please see:
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="index.html">Frame version</A>
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="javax/activation/package-summary.html">Non-frame version.</A></CENTER>
+
+</BODY>
+</HTML>

BIN
Activation/JavaBeans Activation Framework 1.1.1/jaf-1.1.1/docs/javadocs/resources/inherit.gif


+ 29 - 0
Activation/JavaBeans Activation Framework 1.1.1/jaf-1.1.1/docs/javadocs/stylesheet.css

@@ -0,0 +1,29 @@
+/* Javadoc style sheet */
+
+/* Define colors, fonts and other style attributes here to override the defaults */
+
+/* Page background color */
+body { background-color: #FFFFFF }
+
+/* Headings */
+h1 { font-size: 145% }
+
+/* Table colors */
+.TableHeadingColor     { background: #CCCCFF } /* Dark mauve */
+.TableSubHeadingColor  { background: #EEEEFF } /* Light mauve */
+.TableRowColor         { background: #FFFFFF } /* White */
+
+/* Font used in left-hand frame lists */
+.FrameTitleFont   { font-size: 100%; font-family: Helvetica, Arial, sans-serif }
+.FrameHeadingFont { font-size:  90%; font-family: Helvetica, Arial, sans-serif }
+.FrameItemFont    { font-size:  90%; font-family: Helvetica, Arial, sans-serif }
+
+/* Navigation bar fonts and colors */
+.NavBarCell1    { background-color:#EEEEFF;} /* Light mauve */
+.NavBarCell1Rev { background-color:#00008B;} /* Dark Blue */
+.NavBarFont1    { font-family: Arial, Helvetica, sans-serif; color:#000000;}
+.NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;}
+
+.NavBarCell2    { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;}
+.NavBarCell3    { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;}
+

+ 306 - 0
Activation/jaf-1_1_1/jaf-1.1.1/LICENSE.txt

@@ -0,0 +1,306 @@
+A. Sun Microsystems, Inc. ("Sun") ENTITLEMENT for SOFTWARE
+
+Licensee/Company: Entity receiving Software.
+
+Effective Date: Date of delivery of the Software to You.
+
+Software: JavaBeans Activation Framework 1.1.1.
+
+License Term:  Perpetual (subject to termination under the SLA).
+
+Licensed Unit: Software Copy.
+
+Licensed unit Count: Unlimited.
+
+Permitted Uses:
+
+1. You may reproduce and use the Software for Individual, Commercial,
+or Research and Instructional Use for the purposes of designing,
+developing, testing, and running Your applets and
+application("Programs").
+
+2. Subject to the terms and conditions of this Agreement and
+restrictions and exceptions set forth in the Software's documentation,
+You may reproduce and distribute portions of Software identified as a
+redistributable in the documentation ("Redistributable"), provided
+that:
+
+(a) you distribute Redistributable complete and unmodified and only
+bundled as part of Your Programs,
+
+(b) your Programs add significant and primary functionality to the
+Redistributable,
+
+(c) you distribute Redistributable for the sole purpose of running your
+Programs,
+
+(d) you do not distribute additional software intended to replace any
+component(s) of the Redistributable,
+
+(e) you do not remove or alter any proprietary legends or notices
+contained in or on the Redistributable.
+
+(f) you only distribute the Redistributable subject to a license
+agreement that protects Sun's interests consistent with the terms
+contained in this Agreement, and
+
+(g) you agree to defend and indemnify Sun and its licensors from and
+against any damages, costs, liabilities, settlement amounts and/or
+expenses  (including attorneys' fees) incurred in connection with any
+claim, lawsuit or action by any third party that arises or results from
+the use or distribution of any and all Programs and/or
+Redistributable.
+
+3. Java Technology Restrictions.  You may not create, modify, or change
+the behavior of, or authorize your licensees to create, modify, or
+change the behavior of, classes, interfaces, or subpackages that are in
+any way identified as "java", "javax", "sun" or similar convention as
+specified by Sun in any naming convention designation.
+
+B. Sun Microsystems, Inc. ("Sun")
+SOFTWARE LICENSE AGREEMENT
+
+READ THE TERMS OF THIS AGREEMENT ("AGREEMENT") CAREFULLY BEFORE OPENING
+SOFTWARE MEDIA PACKAGE. BY OPENING SOFTWARE MEDIA PACKAGE, YOU AGREE TO
+THE TERMS OF THIS AGREEMENT. IF YOU ARE ACCESSING SOFTWARE
+ELECTRONICALLY, INDICATE YOUR ACCEPTANCE OF THESE TERMS BY SELECTING
+THE "ACCEPT" BUTTON AT THE END OF THIS AGREEMENT. IF YOU DO NOT AGREE
+TO ALL OF THE TERMS, PROMPTLY RETURN THE UNUSED SOFTWARE TO YOUR PLACE
+OF PURCHASE FOR A REFUND OR, IF SOFTWARE IS ACCESSED ELECTRONICALLY,
+SELECT THE "DECLINE" (OR "EXIT") BUTTON AT THE END OF THIS AGREEMENT.
+IF YOU HAVE SEPARATELY AGREED TO LICENSE TERMS ("MASTER TERMS") FOR
+YOUR LICENSE TO THIS SOFTWARE, THEN SECTIONS 1-5 OF THIS AGREEMENT
+("SUPPLEMENTAL LICENSE TERMS") SHALL SUPPLEMENT AND SUPERSEDE THE
+MASTER TERMS IN RELATION TO THIS SOFTWARE.
+
+1.      Definitions.
+
+(a)     "Entitlement" means the collective set of applicable documents
+authorized by Sun evidencing your obligation to pay associated fees (if
+any) for the license, associated Services, and the authorized scope of
+use of Software under this Agreement.
+
+(b)     "Licensed Unit" means the unit of measure by which your use of
+Software and/or Service is licensed, as described in your Entitlement.
+
+(c)     "Permitted Use" means the licensed Software use(s) authorized
+in this Agreement as specified in your Entitlement. The Permitted Use
+for any bundled Sun software not specified in your Entitlement will be
+evaluation use as provided in Section 3.
+
+(d)     "Service" means the service(s) that Sun or its delegate will
+provide, if any, as selected in your Entitlement and as further
+described in the applicable service listings at
+www.sun.com/service/servicelist.
+
+(e)     "Software" means the Sun software described in your
+Entitlement. Also, certain software may be included for evaluation use
+under Section 3.
+
+(f)     "You" and "Your" means the individual or legal entity specified
+in the Entitlement, or for evaluation purposes, the entity performing
+the evaluation.
+
+2.      License Grant and Entitlement.
+
+Subject to the terms of your Entitlement, Sun grants you a
+nonexclusive, nontransferable limited license to use Software for its
+Permitted Use for the license term. Your Entitlement will specify (a)
+Software licensed, (b) the Permitted Use, (c) the license term, and (d)
+the Licensed Units.
+
+Additionally, if your Entitlement includes Services, then it will also
+specify the (e) Service and (f) service term.
+
+If your rights to Software or Services are limited in duration and the
+date such rights begin is other than the purchase date, your
+Entitlement will provide that beginning date(s).
+
+The Entitlement may be delivered to you in various ways depending on
+the manner in which you obtain Software and Services, for example, the
+Entitlement may be provided in your receipt, invoice or your contract
+with Sun or authorized Sun reseller. It may also be in electronic
+format if you download Software.
+
+3.      Permitted Use.
+
+As selected in your Entitlement, one or more of the following Permitted
+Uses will apply to your use of Software. Unless you have an Entitlement
+that expressly permits it, you may not use Software for any of the
+other Permitted Uses. If you don't have an Entitlement, or if your
+Entitlement doesn't cover additional software delivered to you, then
+such software is for your Evaluation Use.
+
+(a) Evaluation Use. You may evaluate Software internally for a period
+of 90 days from your first use.
+
+(b) Research and Instructional Use. You may use Software internally to
+design, develop and test, and also to provide instruction on such
+uses.
+
+(c) Individual Use. You may use Software internally for personal,
+individual use.
+
+(d) Commercial Use. You may use Software internally for your own
+commercial purposes.
+
+(e) Service Provider Use. You may make Software functionality
+accessible (but not by providing Software itself or through outsourcing
+services) to your end users in an extranet deployment, but not to your
+affiliated companies or to government agencies.
+
+4.      Licensed Units.
+
+Your Permitted Use is limited to the number of Licensed Units stated in
+your Entitlement. If you require additional Licensed Units, you will
+need additional Entitlement(s).
+
+5.	Restrictions.
+
+(a) The copies of Software provided to you under this Agreement are
+licensed, not sold, to you by Sun. Sun reserves all rights not
+expressly granted. (b) You may make a single archival copy of Software,
+but otherwise may not copy, modify, or distribute Software. However if
+the Sun documentation accompanying Software lists specific portions of
+Software, such as header files, class libraries, reference source code,
+and/or redistributable files, that may be handled differently, you may
+do so only as provided in the Sun documentation. (c) You may not rent,
+lease, lend or encumber Software. (d) Unless enforcement is prohibited
+by applicable law, you may not decompile, or reverse engineer
+Software.  (e) The terms and conditions of this Agreement will apply to
+any Software updates, provided to you at Sun's discretion, that replace
+and/or supplement the original Software, unless such update contains a
+separate license. (f) You may not publish or provide the results of any
+benchmark or comparison tests run on Software to any third party
+without the prior written consent of Sun. (g) Software is confidential
+and copyrighted. (h) Unless otherwise specified, if Software is
+delivered with embedded or bundled software that enables functionality
+of Software, you may not use such software on a stand-alone basis or
+use any portion of such software to interoperate with any program(s)
+other than Software.  (i) Software may contain programs that perform
+automated collection of system data and/or automated software updating
+services. System data collected through such programs may be used by
+Sun, its subcontractors, and its service delivery partners for the
+purpose of providing you with remote system services and/or improving
+Sun's software and systems. (j) Software is not designed, licensed or
+intended for use in the design, construction, operation or maintenance
+of any nuclear facility and Sun and its licensors disclaim any express
+or implied warranty of fitness for such uses. (k) No right, title or
+interest in or to any trademark, service mark, logo or trade name of
+Sun or its licensors is granted under this Agreement.
+
+6.	Term and Termination. 
+
+The license and service term are set forth in your Entitlement(s). Your
+rights under this Agreement will terminate immediately without notice
+from Sun if you materially breach it or take any action in derogation
+of Sun's and/or its licensors' rights to Software. Sun may terminate
+this Agreement should any Software become, or in Sun's reasonable
+opinion likely to become, the subject of a claim of intellectual
+property infringement or trade secret misappropriation. Upon
+termination, you will cease use of, and destroy, Software and confirm
+compliance in writing to Sun. Sections 1, 5, 6, 7, and 9-15 will
+survive termination of the Agreement.
+
+7.      Java Compatibility and Open Source.
+
+Software may contain Java technology. You may not create additional
+classes to, or modifications of, the Java technology, except under
+compatibility requirements available under a separate agreement
+available at www.java.net.
+
+Sun supports and benefits from the global community of open source
+developers, and thanks the community for its important contributions
+and open standards-based technology, which Sun has adopted into many of
+its products.
+
+Please note that portions of Software may be provided with notices and
+open source licenses from such communities and third parties that
+govern the use of those portions, and any licenses granted hereunder do
+not alter any rights and obligations you may have under such open
+source licenses, however, the disclaimer of warranty and limitation of
+liability provisions in this Agreement will apply to all Software in
+this distribution.
+
+8.      Limited Warranty.
+
+Sun warrants to you that for a period of 90 days from the date of
+purchase, as evidenced by a copy of the receipt, the media on which
+Software is furnished (if any) will be free of defects in materials and
+workmanship under normal use. Except for the foregoing, Software is
+provided "AS IS". Your exclusive remedy and Sun's entire liability
+under this limited warranty will be at Sun's option to replace Software
+media or refund the fee paid for Software. Some states do not allow
+limitations on certain implied warranties, so the above may not apply
+to you. This limited warranty gives you specific legal rights. You may
+have others, which vary from state to state.
+
+9.      Disclaimer of Warranty.
+
+UNLESS SPECIFIED IN THIS AGREEMENT, ALL EXPRESS OR IMPLIED CONDITIONS,
+REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT
+ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT THESE DISCLAIMERS ARE HELD TO
+BE LEGALLY INVALID.
+
+10.     Limitation of Liability.
+
+TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL SUN OR ITS
+LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES,
+HOWEVER CAUSED REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR
+RELATED TO THE USE OF OR INABILITY TO USE SOFTWARE, EVEN IF SUN HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. In no event will Sun's
+liability to you, whether in contract, tort (including negligence), or
+otherwise, exceed the amount paid by you for Software under this
+Agreement. The foregoing limitations will apply even if the above
+stated warranty fails of its essential purpose. Some states do not
+allow the exclusion of incidental or consequential damages, so some of
+the terms above may not be applicable to you.
+
+11.     Export Regulations.
+
+All Software, documents, technical data, and any other materials
+delivered under this Agreement are subject to U.S. export control laws
+and may be subject to export or import regulations in other countries.
+You agree to comply strictly with these laws and regulations and
+acknowledge that you have the responsibility to obtain any licenses to
+export, re-export, or import as may be required after delivery to you.
+
+12.     U.S. Government Restricted Rights.
+
+If Software is being acquired by or on behalf of the U.S. Government or
+by a U.S. Government prime contractor or subcontractor (at any tier),
+then the Government's rights in Software and accompanying documentation
+will be only as set forth in this Agreement; this is in accordance with
+48 CFR 227.7201 through 227.7202-4 (for Department of Defense (DOD)
+acquisitions) and with 48 CFR 2.101 and 12.212 (for non-DOD
+acquisitions).
+
+13.     Governing Law.
+
+Any action related to this Agreement will be governed by California law
+and controlling U.S. federal law. No choice of law rules of any
+jurisdiction will apply.
+
+14.     Severability.
+
+If any provision of this Agreement is held to be unenforceable, this
+Agreement will remain in effect with the provision omitted, unless
+omission would frustrate the intent of the parties, in which case this
+Agreement will immediately terminate.
+
+15.     Integration.
+
+This Agreement, including any terms contained in your Entitlement, is
+the entire agreement between you and Sun relating to its subject
+matter. It supersedes all prior or contemporaneous oral or written
+communications, proposals, representations and warranties and prevails
+over any conflicting or additional terms of any quote, order,
+acknowledgment, or other communication between the parties relating to
+its subject matter during the term of this Agreement. No modification
+of this Agreement will be binding, unless in writing and signed by an
+authorized representative of each party.
+
+Please contact Sun Microsystems, Inc. 4150 Network Circle, Santa Clara,
+California 95054 if you have questions.

+ 26 - 0
Activation/jaf-1_1_1/jaf-1.1.1/README.txt

@@ -0,0 +1,26 @@
+	  **JAVABEANS(tm) ACTIVATION FRAMEWORK 1.1.1 RELEASE**
+
+Thank you for downloading the release of the JavaBeans(tm) Activation
+Framework! We hope you find it useful.  Included in this release are
+the following files and directories:
+
+README.txt     : This file!
+
+RELNOTES.txt   : The release notes for this release including,
+                 installation instructions, system requirements, 
+                 known bugs, and open issues.
+
+LICENSE.txt    : The license covering this software.
+
+activation.jar : This JAR file contains the classes that
+                 make up JavaBeans(tm) Activation Framework.
+
+demos          : This directory contains some simple *unsupported*
+                 demos that make use of some of the JAF's features.
+
+docs           : This directory contains the Javadoc API descriptions
+                 for the public classes in the JAF.
+
+If you encounter any problems please contact us at:
+
+  activation-comments@sun.com

+ 78 - 0
Activation/jaf-1_1_1/jaf-1.1.1/RELNOTES.txt

@@ -0,0 +1,78 @@
+	 JavaBeans(tm)Activation Framework 1.1.1 Release Notes
+
+Welcome to the JavaBeans(tm) Activation Framework! A great deal of time
+and effort was put into making this package functional and
+usable.  We are however, realistic in anticipating that there exist
+scenarios and applications where this implementation could be improved
+upon.  We welcome your feedback in this area to the email address
+listed below.
+
+System Requirements:
+--------------------
+
+The JavaBeans(tm) Activation Framework (JAF) was developed and tested
+against Sun's JDK 1.4.2 on the Solaris SPARC platform.  JAF is
+written in Java (with no native code). It will run on any JDK(tm) 1.4
+(or newer) compatible virtual machine so don't hesitate to try it and
+please report failures.
+
+Note that JAF is also included in Java SE 6 and later releases.
+
+Installation:
+-------------
+
+There is effectively *no* installation of the JAF. The classes that
+make up the JAF are contained in the included Java(tm) Archive (JAR) file,
+"activation.jar". This file can be placed anywhere accessible to the
+Java virtual machine running on your system. The only requirement is
+that the activation.jar be included in your system's class path so
+Java can find the JAF classes.
+
+Related Web Sites:
+------------------
+
+There are a number of web sites you might find useful if you haven't
+already run across them:
+
+http://java.sun.com  -- This is Sun's Java Software External Web Site.
+
+http://java.sun.com/beans -- This is the JavaBeans web site which is
+                             full of the latest beans information. The
+                             JAF spec is available in the 'Glasgow' area.
+
+http://java.sun.com/products/javamail -- The JavaMail(tm) API provides a set
+                             of abstract classes that model a mail system.
+                             It's implementation is dependent on the JAF.
+
+
+Bugs fixed in the 1.1.1 Release:
+--------------------------------
+
+6456395	DataHandler.writeTo should have built-in support for byte arrays
+	and Strings
+6538484	JAF fails in Turkish locale
+
+
+Bugs fixed in the 1.1 Release:
+------------------------------
+
+<no id>	use context class loader to load data content handlers
+<no id>	guard against possible NPE when parsing mailcap file
+<no id>	really make sure input stream gets closed in DataHandler.writeTo
+4134676	need way to find all known MIME types
+4786035	API doc: some bugs in javax/activation/MimeType.cmnt
+4848096	MailcapCommandMap should store *ALL* mailcap entries
+5090200	CommandMap needs file name to choose proper command on Windows
+6245613	fix ActivationDataFlavor normalize methods to match DataFlavor
+6252930	MailcapCommandMap needs support for "fallback" entries in mailcap file
+6357487	DataHandler.getBean should load class using application's class loader
+
+
+How to contact us:
+------------------
+
+We have created an email alias that will send all your questions and
+comments to the JAF 'team'. We cannot guarantee that we will respond
+to all of your email, but we do promise to read them. 
+
+activation-comments@sun.com

BIN
Activation/jaf-1_1_1/jaf-1.1.1/activation.jar


+ 144 - 0
Activation/jaf-1_1_1/jaf-1.1.1/demo/CompViewer.java

@@ -0,0 +1,144 @@
+/*
+ * @(#)CompViewer.java	1.5 07/07/13
+ *
+ * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   - Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *
+ *   - Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ *   - Neither the name of Sun Microsystems nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import java.awt.*;
+import java.beans.*;
+import java.lang.reflect.Method;
+import java.io.*;
+import java.awt.event.*;
+
+/**
+ * Class <code>CompViewer</code> creates a 'viewer' component
+ * that implements the CommandObject interface.
+ *
+ */
+public class CompViewer extends Frame implements WindowListener {
+
+    /**
+     * Our constructor...
+     */
+    public CompViewer(){
+	super("Component");
+	this.initCompViewer(null);
+    }
+
+    public CompViewer(String name){
+	super(name);
+	this.initCompViewer(name);
+    }
+
+    public void initCompViewer(String name){
+	if (name != null)
+	    setTitle(name);
+	setSize(400,400);
+	setLayout(new BorderLayout());
+	this.addWindowListener(this);
+    }
+    
+    ////////////////////////////////////////////////////////////////////////
+    // we got our bean as a component display it!
+    void setBean(Component new_bean)
+	{
+	    Dimension start_dim = null;
+	    add((Component)new_bean, "Center");
+	    start_dim =  ((Component)new_bean).getPreferredSize();
+	    
+	    if(start_dim.width != 0 && start_dim.height != 0) {
+		// this is what we do under normal conditions
+		start_dim.height += 40;
+		start_dim.width += 15;
+		this.setSize( start_dim );
+		((Component)new_bean).invalidate(); 
+		((Component)new_bean).validate();
+		((Component)new_bean).doLayout();
+		show();           
+	    }
+	    else {
+		// we get here if for some reason our child's
+		// getPref size needs to have it's peer created
+		// first...
+		show();           
+		start_dim =  ((Component)new_bean).getPreferredSize();
+		start_dim.height += 40;
+		start_dim.width += 15;
+		this.setSize( start_dim );
+		((Component)new_bean).validate();
+	    }
+	    this.setSize(this.getSize());
+	    validate();
+	}
+
+
+    /**
+     * Make the bean based on it's class loader and name
+     */
+    private Object makeBean(ClassLoader cls, String beanName) {
+	Object new_bean = null;
+
+	try {
+	    try {
+		new_bean = java.beans.Beans.instantiate(cls, beanName);
+	    }
+	    catch(IOException e) {
+		System.out.println("CompViewer:Beans.instantiate:IOException " + beanName + ".");
+		System.out.println(e);
+		System.exit(1);
+	    }
+	}
+	catch (ClassNotFoundException e) {
+	    System.out.println("CompViewer:Beans.instantiate:ClassNotFoundException " + beanName + "."); 
+	    System.out.println(e);
+	    System.exit(1);
+	}
+      
+	if( !(new_bean instanceof Component) ) {
+	    System.out.println("CompViewer: " + beanName + " not instance of awt.Component exiting");
+	    System.exit(1);
+	}
+	return new_bean;
+    }
+
+    public void windowOpened(WindowEvent e) {}
+    public void windowClosing(WindowEvent e) {
+	this.setVisible(false);
+    }
+    public void windowClosed(WindowEvent e) {}
+    public void windowIconified(WindowEvent e) {}
+    public void windowDeiconified(WindowEvent e) {}
+    public void windowActivated(WindowEvent e) {}
+    public void windowDeactivated(WindowEvent e) {}
+
+}
+
+
+

+ 108 - 0
Activation/jaf-1_1_1/jaf-1.1.1/demo/DCHTest.java

@@ -0,0 +1,108 @@
+/*
+ * @(#)DCHTest.java	1.5 07/07/13
+ *
+ * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions