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