J. Duke | 319a3b9 | 2007-12-01 00:00:00 +0000 | [diff] [blame^] | 1 | <!doctype html public "-//w3c//dtd html 4.0 transitional//en"> |
| 2 | <html> |
| 3 | <head> |
| 4 | <!-- |
| 5 | |
| 6 | Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. |
| 7 | DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
| 8 | |
| 9 | This code is free software; you can redistribute it and/or modify it |
| 10 | under the terms of the GNU General Public License version 2 only, as |
| 11 | published by the Free Software Foundation. Sun designates this |
| 12 | particular file as subject to the "Classpath" exception as provided |
| 13 | by Sun in the LICENSE file that accompanied this code. |
| 14 | |
| 15 | This code is distributed in the hope that it will be useful, but WITHOUT |
| 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 17 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
| 18 | version 2 for more details (a copy is included in the LICENSE file that |
| 19 | accompanied this code). |
| 20 | |
| 21 | You should have received a copy of the GNU General Public License version |
| 22 | 2 along with this work; if not, write to the Free Software Foundation, |
| 23 | Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
| 24 | |
| 25 | Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
| 26 | CA 95054 USA or visit www.sun.com if you need additional information or |
| 27 | have any questions. |
| 28 | --> |
| 29 | </head> |
| 30 | <body bgcolor="white"> |
| 31 | <p> |
| 32 | This package provides methods to read files from a JAR file and |
| 33 | to transform them to a more compact transfer format called Pack200. |
| 34 | It also provides methods to receive the transmitted data and expand |
| 35 | it into a JAR file equivalent to the original JAR file. |
| 36 | |
| 37 | <p> |
| 38 | The <tt>pack</tt> methods may be used by application developers |
| 39 | who wish to deploy large JARs on the web. The <tt>unpack</tt> methods may be used |
| 40 | by deployment applications such as Java Web Start and Java Plugin. |
| 41 | |
| 42 | <p> |
| 43 | In typical use, the packed output should be further compressed using |
| 44 | a suitable tool such as gzip or <tt>java.util.zip.GZIPOutputStream</tt>. |
| 45 | The resulting file (with a suffix ".pack.gz") should be hosted on a HTTP/1.1 |
| 46 | compliant server, which will be capable of handling "Accept-Encoding", |
| 47 | as specified by the HTTP 1.1 RFC2616 specification. |
| 48 | |
| 49 | <p> |
| 50 | <b>NOTE:</b> It is recommended that the original ".jar" file be hosted |
| 51 | in addition to the ".pack.gz" file, so that older client implementations |
| 52 | will continue to work reliably. |
| 53 | (On-demand compression by the server is not recommended.) |
| 54 | |
| 55 | <p> |
| 56 | When a client application requests a ".jar" file (call it "Large.jar"), |
| 57 | the client will transmit the headers |
| 58 | "Content-Type=application/x-java-archive" as well as "Accept-Encoding=pack200-gzip". |
| 59 | This indicates to the server that the client application desires an version |
| 60 | of the file encoded with Pack200 and further compressed with gzip. |
| 61 | |
| 62 | <p> |
| 63 | The server implementation will typically check for the existence of "Large.pack.gz". |
| 64 | If that file is available, the server will transmit it with the headers |
| 65 | "Content-Encoding=pack200-gzip" and "Content-Type=application/x-java-archive". |
| 66 | |
| 67 | <p> |
| 68 | If the ".pack.gz" file, is not available, then the server will transmit |
| 69 | the original ".jar" |
| 70 | with "Content-Encoding=null" and "Content-Type=application/x-java-archive". |
| 71 | |
| 72 | <p> |
| 73 | A MIME type of "application/x-java-pack200" may be specified by the |
| 74 | client application to indicate a ".pack" file is required. |
| 75 | However, this has limited capability, and is not recommended. |
| 76 | |
| 77 | <h2> Package Specification</h2> |
| 78 | Network Transfer Format Specification :<a href="http://jcp.org/en/jsr/detail?id=200"> |
| 79 | http://jcp.org/en/jsr/detail?id=200</a> |
| 80 | |
| 81 | <h2> Related Documentation</h2> |
| 82 | For overviews, tutorials, examples, guides, and tool documentation, please |
| 83 | see: |
| 84 | <ul> |
| 85 | |
| 86 | <li> |
| 87 | Jar File Specification :<a href="http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html"> |
| 88 | http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html</a></li> |
| 89 | |
| 90 | <li> |
| 91 | Java Virtual Machine Specification : <a href="http://java.sun.com/docs/books/vmspec/2nd-edition/html/ClassFile.doc.html"> |
| 92 | http://java.sun.com/docs/books/vmspec/2nd-edition/html/ClassFile.doc.html</a></li> |
| 93 | |
| 94 | <li> |
| 95 | Hypertext Transfer Protocol -- HTTP/1.1 : <a href="http://www.ietf.org/rfc/rfc2616.txt"> |
| 96 | http://www.ietf.org/rfc/rfc2616.txt |
| 97 | </ul> |
| 98 | |
| 99 | <li> |
| 100 | @since JDK1.5.0</li> |
| 101 | |
| 102 | <br><!-- Put @see and @since tags down here. --> |
| 103 | </body> |
| 104 | </html> |