Merge
This commit is contained in:
commit
959d776904
7
jdk/make/data/charsetmapping/JIS_X_0208_MS932.c2b
Normal file
7
jdk/make/data/charsetmapping/JIS_X_0208_MS932.c2b
Normal file
@ -0,0 +1,7 @@
|
||||
0x2124 0x00b8
|
||||
0x2126 0x00b7
|
||||
0x2131 0x00af
|
||||
0x2263 0x00ab
|
||||
0x2264 0x00bb
|
||||
0x2574 0x3094
|
||||
0x264c 0x00b5
|
@ -1,7 +1,7 @@
|
||||
#
|
||||
# mapping is based on JIS_X_0208_MS932_De/Encoder
|
||||
#
|
||||
# moved following entries to .nr
|
||||
# copied following entries to .nr
|
||||
#
|
||||
# 0x224c 0xffe2
|
||||
# 0x225d 0x22a5
|
||||
@ -14,7 +14,7 @@
|
||||
# 0x2d7b 0x2229
|
||||
# 0x2d7c 0x222a
|
||||
#
|
||||
# and following to c2b
|
||||
# and moved following to c2b
|
||||
#
|
||||
# 0x2124 0x00b8
|
||||
# 0x2126 0x00b7
|
||||
@ -144,13 +144,13 @@
|
||||
0x2241 0x2229
|
||||
0x224a 0x2227
|
||||
0x224b 0x2228
|
||||
#0x224c 0xffe2
|
||||
0x224c 0xffe2
|
||||
0x224d 0x21d2
|
||||
0x224e 0x21d4
|
||||
0x224f 0x2200
|
||||
0x2250 0x2203
|
||||
0x225c 0x2220
|
||||
#0x225d 0x22a5
|
||||
0x225d 0x22a5
|
||||
0x225e 0x2312
|
||||
0x225f 0x2202
|
||||
0x2260 0x2207
|
||||
@ -158,11 +158,11 @@
|
||||
0x2262 0x2252
|
||||
0x2263 0x226a
|
||||
0x2264 0x226b
|
||||
#0x2265 0x221a
|
||||
0x2265 0x221a
|
||||
0x2266 0x223d
|
||||
0x2267 0x221d
|
||||
0x2268 0x2235
|
||||
#0x2269 0x222b
|
||||
0x2269 0x222b
|
||||
0x226a 0x222c
|
||||
0x2272 0x212b
|
||||
0x2273 0x2030
|
||||
@ -620,19 +620,19 @@
|
||||
0x2d6d 0x337e
|
||||
0x2d6e 0x337d
|
||||
0x2d6f 0x337c
|
||||
#0x2d70 0x2252
|
||||
#0x2d71 0x2261
|
||||
0x2d70 0x2252
|
||||
0x2d71 0x2261
|
||||
0x2d72 0x222b
|
||||
0x2d73 0x222e
|
||||
0x2d74 0x2211
|
||||
0x2d75 0x221a
|
||||
0x2d76 0x22a5
|
||||
#0x2d77 0x2220
|
||||
0x2d77 0x2220
|
||||
0x2d78 0x221f
|
||||
0x2d79 0x22bf
|
||||
#0x2d7a 0x2235
|
||||
#0x2d7b 0x2229
|
||||
#0x2d7c 0x222a
|
||||
0x2d7a 0x2235
|
||||
0x2d7b 0x2229
|
||||
0x2d7c 0x222a
|
||||
0x3021 0x4e9c
|
||||
0x3022 0x5516
|
||||
0x3023 0x5a03
|
||||
|
@ -23,7 +23,7 @@
|
||||
# as the round-trip entries.
|
||||
#
|
||||
# b2c and c2b all have entry "0x2271 <-> 0x2116", so the
|
||||
# "0x742c -> 0x2116" entry is moved to the .nr table.
|
||||
# "0x742c -> 0x2116" entry is copied to the .nr table.
|
||||
#
|
||||
# mapping (c2b) generated from JIS_X_0212_Solaris_Encoder has
|
||||
# two "dup" entries
|
||||
@ -6126,7 +6126,7 @@
|
||||
0x7429 0xff07
|
||||
0x742a 0xff02
|
||||
0x742b 0x3231
|
||||
#0x742c 0x2116
|
||||
0x742c 0x2116
|
||||
0x742d 0x2121
|
||||
0x742e 0x70bb
|
||||
0x742f 0x4efc
|
||||
|
6
jdk/make/data/charsetmapping/stdcs-aix
Normal file
6
jdk/make/data/charsetmapping/stdcs-aix
Normal file
@ -0,0 +1,6 @@
|
||||
#
|
||||
# generate these charsets into sun.nio.cs
|
||||
#
|
||||
EUC_CN
|
||||
EUC_KR
|
||||
GBK
|
@ -25,9 +25,9 @@
|
||||
|
||||
include GendataCommon.gmk
|
||||
|
||||
$(eval $(call IncludeCustomExtension, jdk, gendata/Gendata-jdk.dev.gmk))
|
||||
$(eval $(call IncludeCustomExtension, jdk, gendata/Gendata-jdk.jdeps.gmk))
|
||||
|
||||
JDEPS_MODULES_XML := $(JDK_OUTPUTDIR)/modules/jdk.dev/com/sun/tools/jdeps/resources/jdeps-modules.xml
|
||||
JDEPS_MODULES_XML := $(JDK_OUTPUTDIR)/modules/jdk.jdeps/com/sun/tools/jdeps/resources/jdeps-modules.xml
|
||||
MODULES_XML += $(TOPDIR)/modules.xml
|
||||
|
||||
#
|
@ -35,11 +35,6 @@ $(eval $(call SetupLauncher,javah, \
|
||||
-DNEVER_ACT_AS_SERVER_CLASS_MACHINE \
|
||||
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.javah.Main"$(COMMA) }'))
|
||||
|
||||
$(eval $(call SetupLauncher,javap, \
|
||||
-DEXPAND_CLASSPATH_WILDCARDS \
|
||||
-DNEVER_ACT_AS_SERVER_CLASS_MACHINE \
|
||||
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.javap.Main"$(COMMA) }'))
|
||||
|
||||
$(eval $(call SetupLauncher,serialver, \
|
||||
-DEXPAND_CLASSPATH_WILDCARDS \
|
||||
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.tools.serialver.SerialVer"$(COMMA) }'))
|
||||
|
@ -25,14 +25,5 @@
|
||||
|
||||
include LauncherCommon.gmk
|
||||
|
||||
$(eval $(call SetupLauncher,jdeps, \
|
||||
-DEXPAND_CLASSPATH_WILDCARDS \
|
||||
-DNEVER_ACT_AS_SERVER_CLASS_MACHINE \
|
||||
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.jdeps.Main"$(COMMA) }'))
|
||||
|
||||
$(eval $(call SetupLauncher,jimage,\
|
||||
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "jdk.tools.jimage.Main"$(COMMA) }'))
|
||||
|
||||
$(eval $(call SetupLauncher,native2ascii, \
|
||||
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.tools.native2ascii.Main"$(COMMA) }'))
|
||||
|
||||
|
@ -1,41 +1,36 @@
|
||||
#
|
||||
# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
# @test
|
||||
# @bug 4200310
|
||||
# @summary make sure class files are not duplicated between rt.jar,
|
||||
# charsets.jar, and localedata.jar
|
||||
# @author Norbert Lindenberg
|
||||
# @run shell Test4200310.sh
|
||||
|
||||
2>&1 $TESTJAVA/bin/jar -tf "$TESTJAVA/jre/lib/rt.jar" > class-list
|
||||
2>&1 $TESTJAVA/bin/jar -tf "$TESTJAVA/jre/lib/charsets.jar" >> class-list
|
||||
2>&1 $TESTJAVA/bin/jar -tf "$TESTJAVA/jre/lib/ext/localedata.jar" >> class-list
|
||||
duplicates=`grep '\.class$' class-list | sort | uniq -d`
|
||||
include LauncherCommon.gmk
|
||||
|
||||
rm -f class-list
|
||||
if [ "$duplicates" != "" ]; then
|
||||
echo FAILED: $duplicates are duplicated between rt.jar, charsets.jar, and localedata.jar
|
||||
exit 1
|
||||
fi
|
||||
$(eval $(call SetupLauncher,javap, \
|
||||
-DEXPAND_CLASSPATH_WILDCARDS \
|
||||
-DNEVER_ACT_AS_SERVER_CLASS_MACHINE \
|
||||
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.javap.Main"$(COMMA) }'))
|
||||
|
||||
exit 0
|
||||
$(eval $(call SetupLauncher,jdeps, \
|
||||
-DEXPAND_CLASSPATH_WILDCARDS \
|
||||
-DNEVER_ACT_AS_SERVER_CLASS_MACHINE \
|
||||
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.jdeps.Main"$(COMMA) }'))
|
@ -146,11 +146,6 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBJAVA, \
|
||||
OPTIMIZATION := HIGH, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) \
|
||||
$(LIBJAVA_CFLAGS), \
|
||||
DISABLED_WARNINGS_gcc := type-limits format-nonliteral, \
|
||||
DISABLED_WARNINGS_clang := int-conversion, \
|
||||
DISABLED_WARNINGS_solstudio := E_DECLARATION_IN_CODE, \
|
||||
DISABLED_WARNINGS_microsoft := 4022 4267 4996, \
|
||||
WARNINGS_AS_ERRORS_solstudio := false, \
|
||||
MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjava/mapfile-vers, \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
||||
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
||||
|
@ -49,7 +49,6 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBHPROF, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) $(CFLAGS_WARNINGS_ARE_ERRORS) \
|
||||
$(BUILD_LIBHPROF_CFLAGS), \
|
||||
CFLAGS_debug := -DHPROF_LOGGING, \
|
||||
CFLAGS_windows := -D_WINSOCK_DEPRECATED_NO_WARNINGS, \
|
||||
MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libhprof/mapfile-vers, \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
||||
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
||||
|
@ -1,24 +0,0 @@
|
||||
." Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
." DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
."
|
||||
." This code is free software; you can redistribute it and/or modify it
|
||||
." under the terms of the GNU General Public License version 2 only, as
|
||||
." published by the Free Software Foundation.
|
||||
."
|
||||
." This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
." ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
." FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
." version 2 for more details (a copy is included in the LICENSE file that
|
||||
." accompanied this code).
|
||||
."
|
||||
." You should have received a copy of the GNU General Public License version
|
||||
." 2 along with this work; if not, write to the Free Software Foundation,
|
||||
." Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
."
|
||||
." Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
." or visit www.oracle.com if you need additional information or have any
|
||||
." questions.
|
||||
."
|
||||
.TH native2ascii 1 "07 May 2011"
|
||||
|
||||
.LP
|
@ -1,87 +0,0 @@
|
||||
'\" t
|
||||
.\" Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
.\"
|
||||
.\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
.\"
|
||||
.\" This code is free software; you can redistribute it and/or modify it
|
||||
.\" under the terms of the GNU General Public License version 2 only, as
|
||||
.\" published by the Free Software Foundation.
|
||||
.\"
|
||||
.\" This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
.\" version 2 for more details (a copy is included in the LICENSE file that
|
||||
.\" accompanied this code).
|
||||
.\"
|
||||
.\" You should have received a copy of the GNU General Public License version
|
||||
.\" 2 along with this work; if not, write to the Free Software Foundation,
|
||||
.\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
.\"
|
||||
.\" Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
.\" or visit www.oracle.com if you need additional information or have any
|
||||
.\" questions.
|
||||
.\"
|
||||
.\" Arch: generic
|
||||
.\" Software: JDK 8
|
||||
.\" Date: 21 November 2013
|
||||
.\" SectDesc: Internationalization Tools
|
||||
.\" Title: native2ascii.1
|
||||
.\"
|
||||
.if n .pl 99999
|
||||
.TH native2ascii 1 "21 November 2013" "JDK 8" "Internationalization Tools"
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * Define some portability stuff
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
.\" http://bugs.debian.org/507673
|
||||
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
|
||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
.ie \n(.g .ds Aq \(aq
|
||||
.el .ds Aq '
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * set default formatting
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" disable hyphenation
|
||||
.nh
|
||||
.\" disable justification (adjust text to left margin only)
|
||||
.ad l
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * MAIN CONTENT STARTS HERE *
|
||||
.\" -----------------------------------------------------------------
|
||||
|
||||
.SH NAME
|
||||
native2ascii \- Creates localizable applications by converting a file with characters in any supported character encoding to one with ASCII and/or Unicode escapes or vice versa\&.
|
||||
.SH SYNOPSIS
|
||||
.sp
|
||||
.nf
|
||||
|
||||
\fBnative2ascii\fR [ \fIinputfile\fR ] [ \fIoutputfile\fR ]
|
||||
.fi
|
||||
.sp
|
||||
.TP
|
||||
\fIinputfile\fR
|
||||
The encoded file to be converted to ASCII\&.
|
||||
.TP
|
||||
\fIoutputfile\fR
|
||||
The converted ASCII file\&.
|
||||
.SH DESCRIPTION
|
||||
The \f3native2ascii\fR command converts encoded files supported by the Java Runtime Environment (JRE) to files encoded in ASCII, using Unicode escapes (\f3\eu\fR\fIxxxx\fR) notation for all characters that are not part of the ASCII character set\&. This process is required for properties files that contain characters not in ISO-8859-1 character sets\&. The tool can also perform the reverse conversion\&.
|
||||
.PP
|
||||
If the \f3outputfile\fR value is omitted, then standard output is used for output\&. If, in addition, the \f3inputfile\fR value is omitted, then standard input is used for input\&.
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
-reverse
|
||||
.br
|
||||
Perform the reverse operation: Converts a file encoded in ISO-8859-1 with Unicode escapes to a file in any character encoding supported by the JRE\&.
|
||||
.TP
|
||||
-encoding \fIencoding_name\fR
|
||||
.br
|
||||
Specifies the name of the character encoding to be used by the conversion procedure\&. If this option is not present, then the default character encoding (as determined by the \f3java\&.nio\&.charset\&.Charset\&.defaultCharset\fR method) is used\&. The \f3encoding_name\fR string must be the name of a character encoding that is supported by the JRE\&. See Supported Encodings at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/intl/encoding\&.doc\&.html
|
||||
.TP
|
||||
-J\fIoption\fR
|
||||
.br
|
||||
Passes \f3option\fR to the Java Virtual Machine (JVM), where option is one of the options described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
|
||||
.RE
|
||||
.br
|
||||
'pl 8.5i
|
||||
'bp
|
@ -0,0 +1,101 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/**
|
||||
* This package provides methods to read files from a JAR file and to
|
||||
* transform them to a more compact transfer format called Pack200.
|
||||
* It also provides methods to receive the transmitted data and expand
|
||||
* it into a JAR file equivalent to the original JAR file.
|
||||
*
|
||||
* <p>
|
||||
* The {@code pack} methods may be used by application developers who
|
||||
* wish to deploy large JARs on the web. The {@code unpack} methods
|
||||
* may be used by deployment applications such as Java Web Start and
|
||||
* Java Plugin.
|
||||
*
|
||||
* <p>
|
||||
* In typical use, the packed output should be further compressed
|
||||
* using a suitable tool such as gzip or
|
||||
* {@code java.util.zip.GZIPOutputStream}. The resulting file (with
|
||||
* a suffix ".pack.gz") should be hosted on a HTTP/1.1 compliant
|
||||
* server, which will be capable of handling "Accept-Encoding", as
|
||||
* specified by the HTTP 1.1 RFC2616 specification.
|
||||
*
|
||||
* <p>
|
||||
* <b>NOTE:</b> It is recommended that the original ".jar" file be
|
||||
* hosted in addition to the ".pack.gz" file, so that older client
|
||||
* implementations will continue to work reliably. (On-demand
|
||||
* compression by the server is not recommended.)
|
||||
*
|
||||
* <p>
|
||||
* When a client application requests a ".jar" file (call it
|
||||
* "Large.jar"), the client will transmit the headers
|
||||
* "Content-Type=application/x-java-archive" as well as
|
||||
* "Accept-Encoding=pack200-gzip". This indicates to the server that
|
||||
* the client application desires an version of the file encoded with
|
||||
* Pack200 and further compressed with gzip.
|
||||
*
|
||||
* <p>
|
||||
* The server implementation will typically check for the existence of
|
||||
* "Large.pack.gz". If that file is available, the server will
|
||||
* transmit it with the headers "Content-Encoding=pack200-gzip" and
|
||||
* "Content-Type=application/x-java-archive".
|
||||
*
|
||||
* <p>
|
||||
* If the ".pack.gz" file, is not available, then the server will
|
||||
* transmit the original ".jar" with "Content-Encoding=null" and
|
||||
* "Content-Type=application/x-java-archive".
|
||||
*
|
||||
* <p>
|
||||
* A MIME type of "application/x-java-pack200" may be specified by the
|
||||
* client application to indicate a ".pack" file is required.
|
||||
* However, this has limited capability, and is not recommended.
|
||||
*
|
||||
* <h2> Package Specification</h2>
|
||||
* Network Transfer Format Specification :<a href="http://jcp.org/en/jsr/detail?id=200">
|
||||
* http://jcp.org/en/jsr/detail?id=200</a>
|
||||
*
|
||||
* <h2> Related Documentation</h2>
|
||||
* For overviews, tutorials, examples, guides, and tool documentation, please
|
||||
* see:
|
||||
* <ul>
|
||||
*
|
||||
* <li>
|
||||
* Jar File Specification :<a href="http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html">
|
||||
* http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html</a></li>
|
||||
*
|
||||
* <li>
|
||||
* Class File Specification: Chapter 4 of
|
||||
* <em>The Java™ Virtual Machine Specification</em>
|
||||
*
|
||||
* <li>
|
||||
* Hypertext Transfer Protocol -- HTTP/1.1 : <a href="http://www.ietf.org/rfc/rfc2616.txt">
|
||||
* http://www.ietf.org/rfc/rfc2616.txt
|
||||
* </ul>
|
||||
*
|
||||
* <li>
|
||||
* @since 1.5</li>
|
||||
*/
|
||||
package com.sun.java.util.jar.pack;
|
@ -1,104 +0,0 @@
|
||||
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
|
||||
<html>
|
||||
<head>
|
||||
<!--
|
||||
|
||||
Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
|
||||
This code is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License version 2 only, as
|
||||
published by the Free Software Foundation. Oracle designates this
|
||||
particular file as subject to the "Classpath" exception as provided
|
||||
by Oracle in the LICENSE file that accompanied this code.
|
||||
|
||||
This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
version 2 for more details (a copy is included in the LICENSE file that
|
||||
accompanied this code).
|
||||
|
||||
You should have received a copy of the GNU General Public License version
|
||||
2 along with this work; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
or visit www.oracle.com if you need additional information or have any
|
||||
questions.
|
||||
-->
|
||||
</head>
|
||||
<body bgcolor="white">
|
||||
<p>
|
||||
This package provides methods to read files from a JAR file and
|
||||
to transform them to a more compact transfer format called Pack200.
|
||||
It also provides methods to receive the transmitted data and expand
|
||||
it into a JAR file equivalent to the original JAR file.
|
||||
|
||||
<p>
|
||||
The <tt>pack</tt> methods may be used by application developers
|
||||
who wish to deploy large JARs on the web. The <tt>unpack</tt> methods may be used
|
||||
by deployment applications such as Java Web Start and Java Plugin.
|
||||
|
||||
<p>
|
||||
In typical use, the packed output should be further compressed using
|
||||
a suitable tool such as gzip or <tt>java.util.zip.GZIPOutputStream</tt>.
|
||||
The resulting file (with a suffix ".pack.gz") should be hosted on a HTTP/1.1
|
||||
compliant server, which will be capable of handling "Accept-Encoding",
|
||||
as specified by the HTTP 1.1 RFC2616 specification.
|
||||
|
||||
<p>
|
||||
<b>NOTE:</b> It is recommended that the original ".jar" file be hosted
|
||||
in addition to the ".pack.gz" file, so that older client implementations
|
||||
will continue to work reliably.
|
||||
(On-demand compression by the server is not recommended.)
|
||||
|
||||
<p>
|
||||
When a client application requests a ".jar" file (call it "Large.jar"),
|
||||
the client will transmit the headers
|
||||
"Content-Type=application/x-java-archive" as well as "Accept-Encoding=pack200-gzip".
|
||||
This indicates to the server that the client application desires an version
|
||||
of the file encoded with Pack200 and further compressed with gzip.
|
||||
|
||||
<p>
|
||||
The server implementation will typically check for the existence of "Large.pack.gz".
|
||||
If that file is available, the server will transmit it with the headers
|
||||
"Content-Encoding=pack200-gzip" and "Content-Type=application/x-java-archive".
|
||||
|
||||
<p>
|
||||
If the ".pack.gz" file, is not available, then the server will transmit
|
||||
the original ".jar"
|
||||
with "Content-Encoding=null" and "Content-Type=application/x-java-archive".
|
||||
|
||||
<p>
|
||||
A MIME type of "application/x-java-pack200" may be specified by the
|
||||
client application to indicate a ".pack" file is required.
|
||||
However, this has limited capability, and is not recommended.
|
||||
|
||||
<h2> Package Specification</h2>
|
||||
Network Transfer Format Specification :<a href="http://jcp.org/en/jsr/detail?id=200">
|
||||
http://jcp.org/en/jsr/detail?id=200</a>
|
||||
|
||||
<h2> Related Documentation</h2>
|
||||
For overviews, tutorials, examples, guides, and tool documentation, please
|
||||
see:
|
||||
<ul>
|
||||
|
||||
<li>
|
||||
Jar File Specification :<a href="http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html">
|
||||
http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html</a></li>
|
||||
|
||||
<li>
|
||||
Class File Specification: Chapter 4 of
|
||||
<em>The Java™ Virtual Machine Specification</em>
|
||||
|
||||
<li>
|
||||
Hypertext Transfer Protocol -- HTTP/1.1 : <a href="http://www.ietf.org/rfc/rfc2616.txt">
|
||||
http://www.ietf.org/rfc/rfc2616.txt
|
||||
</ul>
|
||||
|
||||
<li>
|
||||
@since 1.5</li>
|
||||
|
||||
<br><!-- Put @see and @since tags down here. -->
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Provides classes related to creating and configuring secure socket
|
||||
* factories. These classes are used with the Sun reference
|
||||
* implementation of the Java Secure Socket Extension (JSSE).
|
||||
*/
|
||||
package com.sun.net.ssl;
|
@ -1,56 +0,0 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
|
||||
<html>
|
||||
<head>
|
||||
<!--
|
||||
|
||||
|
||||
Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.
|
||||
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
|
||||
This code is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License version 2 only, as
|
||||
published by the Free Software Foundation. Oracle designates this
|
||||
particular file as subject to the "Classpath" exception as provided
|
||||
by Oracle in the LICENSE file that accompanied this code.
|
||||
|
||||
This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
version 2 for more details (a copy is included in the LICENSE file that
|
||||
accompanied this code).
|
||||
|
||||
You should have received a copy of the GNU General Public License version
|
||||
2 along with this work; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
or visit www.oracle.com if you need additional information or have any
|
||||
questions.
|
||||
|
||||
-->
|
||||
|
||||
</head>
|
||||
<body bgcolor="white">
|
||||
|
||||
Provides classes related to creating and configuring secure socket factories.
|
||||
These classes are used with the Sun reference implementation of the Java
|
||||
Secure Socket Extension (JSSE).
|
||||
<!--
|
||||
<h2>Package Specification</h2>
|
||||
|
||||
##### FILL IN ANY SPECS NEEDED BY JAVA COMPATIBILITY KIT #####
|
||||
<ul>
|
||||
<li><a href="">##### REFER TO ANY FRAMEMAKER SPECIFICATION HERE #####</a>
|
||||
</ul>
|
||||
|
||||
<h2>Related Documentation</h2>
|
||||
|
||||
For overviews, tutorials, examples, guides, and tool documentation, please see:
|
||||
<ul>
|
||||
<li><a href="">##### REFER TO NON-SPEC DOCUMENTATION HERE #####</a>
|
||||
</ul>
|
||||
|
||||
-->
|
||||
|
||||
</body>
|
||||
</html>
|
49
jdk/src/java.base/share/classes/java/io/package-info.java
Normal file
49
jdk/src/java.base/share/classes/java/io/package-info.java
Normal file
@ -0,0 +1,49 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Provides for system input and output through data streams,
|
||||
* serialization and the file system.
|
||||
*
|
||||
* Unless otherwise noted, passing a null argument to a constructor or
|
||||
* method in any class or interface in this package will cause a
|
||||
* {@code NullPointerException} to be thrown.
|
||||
*
|
||||
* <h2>Package Specification</h2>
|
||||
* <ul>
|
||||
* <li><a href="../../../platform/serialization/spec/serialTOC.html"> Java Object Serialization Specification </a>
|
||||
* </ul>
|
||||
*
|
||||
* <h2>Related Documentation</h2>
|
||||
*
|
||||
* For overviews, tutorials, examples, guides, and tool documentation,
|
||||
* please see:
|
||||
* <ul>
|
||||
* <li><a href="../../../technotes/guides/serialization">Serialization Enhancements</a>
|
||||
* </ul>
|
||||
*
|
||||
* @since 1.0
|
||||
*/
|
||||
package java.io;
|
@ -1,52 +0,0 @@
|
||||
<!--
|
||||
Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
|
||||
This code is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License version 2 only, as
|
||||
published by the Free Software Foundation. Oracle designates this
|
||||
particular file as subject to the "Classpath" exception as provided
|
||||
by Oracle in the LICENSE file that accompanied this code.
|
||||
|
||||
This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
version 2 for more details (a copy is included in the LICENSE file that
|
||||
accompanied this code).
|
||||
|
||||
You should have received a copy of the GNU General Public License version
|
||||
2 along with this work; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
or visit www.oracle.com if you need additional information or have any
|
||||
questions.
|
||||
-->
|
||||
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
|
||||
<html>
|
||||
<body bgcolor="white">
|
||||
|
||||
Provides for system input and output through data streams,
|
||||
serialization and the file system.
|
||||
|
||||
Unless otherwise noted, passing a null argument to a constructor
|
||||
or method in any class or interface in this package will cause a
|
||||
<tt>NullPointerException</tt> to be thrown.
|
||||
|
||||
<h2>Package Specification</h2>
|
||||
<ul>
|
||||
<li><a href="../../../platform/serialization/spec/serialTOC.html"> Java Object Serialization Specification </a>
|
||||
</ul>
|
||||
|
||||
<h2>Related Documentation</h2>
|
||||
|
||||
For overviews, tutorials, examples, guides, and tool documentation,
|
||||
please see:
|
||||
<ul>
|
||||
<li><a href="../../../technotes/guides/serialization">Serialization Enhancements</a>
|
||||
</ul>
|
||||
|
||||
@since 1.0
|
||||
</body>
|
||||
</html>
|
140
jdk/src/java.base/share/classes/java/lang/ref/package-info.java
Normal file
140
jdk/src/java.base/share/classes/java/lang/ref/package-info.java
Normal file
@ -0,0 +1,140 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Provides reference-object classes, which support a limited degree
|
||||
* of interaction with the garbage collector. A program may use a
|
||||
* reference object to maintain a reference to some other object in
|
||||
* such a way that the latter object may still be reclaimed by the
|
||||
* collector. A program may also arrange to be notified some time
|
||||
* after the collector has determined that the reachability of a given
|
||||
* object has changed.
|
||||
*
|
||||
*<h2>Package Specification</h2>
|
||||
*
|
||||
* A <em>reference object</em> encapsulates a reference to some other
|
||||
* object so that the reference itself may be examined and manipulated
|
||||
* like any other object. Three types of reference objects are
|
||||
* provided, each weaker than the last: <em>soft</em>, <em>weak</em>,
|
||||
* and <em>phantom</em>. Each type corresponds to a different level
|
||||
* of reachability, as defined below. Soft references are for
|
||||
* implementing memory-sensitive caches, weak references are for
|
||||
* implementing canonicalizing mappings that do not prevent their keys
|
||||
* (or values) from being reclaimed, and phantom references are for
|
||||
* scheduling pre-mortem cleanup actions in a more flexible way than
|
||||
* is possible with the Java finalization mechanism.
|
||||
*
|
||||
* <p> Each reference-object type is implemented by a subclass of the
|
||||
* abstract base {@link java.lang.ref.Reference} class.
|
||||
* An instance of one of these subclasses encapsulates a single
|
||||
* reference to a particular object, called the <em>referent</em>.
|
||||
* Every reference object provides methods for getting and clearing
|
||||
* the reference. Aside from the clearing operation reference objects
|
||||
* are otherwise immutable, so no {@code set} operation is
|
||||
* provided. A program may further subclass these subclasses, adding
|
||||
* whatever fields and methods are required for its purposes, or it
|
||||
* may use these subclasses without change.
|
||||
*
|
||||
* <h3>Notification</h3>
|
||||
*
|
||||
* A program may request to be notified of changes in an object's
|
||||
* reachability by <em>registering</em> an appropriate reference
|
||||
* object with a <em>reference queue</em> at the time the reference
|
||||
* object is created. Some time after the garbage collector
|
||||
* determines that the reachability of the referent has changed to the
|
||||
* value corresponding to the type of the reference, it will add the
|
||||
* reference to the associated queue. At this point, the reference is
|
||||
* considered to be <em>enqueued</em>. The program may remove
|
||||
* references from a queue either by polling or by blocking until a
|
||||
* reference becomes available. Reference queues are implemented by
|
||||
* the {@link java.lang.ref.ReferenceQueue} class.
|
||||
*
|
||||
* <p> The relationship between a registered reference object and its
|
||||
* queue is one-sided. That is, a queue does not keep track of the
|
||||
* references that are registered with it. If a registered reference
|
||||
* becomes unreachable itself, then it will never be enqueued. It is
|
||||
* the responsibility of the program using reference objects to ensure
|
||||
* that the objects remain reachable for as long as the program is
|
||||
* interested in their referents.
|
||||
*
|
||||
* <p> While some programs will choose to dedicate a thread to
|
||||
* removing reference objects from one or more queues and processing
|
||||
* them, this is by no means necessary. A tactic that often works
|
||||
* well is to examine a reference queue in the course of performing
|
||||
* some other fairly-frequent action. For example, a hashtable that
|
||||
* uses weak references to implement weak keys could poll its
|
||||
* reference queue each time the table is accessed. This is how the
|
||||
* {@link java.util.WeakHashMap} class works. Because
|
||||
* the {@link java.lang.ref.ReferenceQueue#poll
|
||||
* ReferenceQueue.poll} method simply checks an internal data
|
||||
* structure, this check will add little overhead to the hashtable
|
||||
* access methods.
|
||||
*
|
||||
* <h3>Automatically-cleared references</h3>
|
||||
*
|
||||
* Soft and weak references are automatically cleared by the collector
|
||||
* before being added to the queues with which they are registered, if
|
||||
* any. Therefore soft and weak references need not be registered
|
||||
* with a queue in order to be useful, while phantom references do.
|
||||
* An object that is reachable via phantom references will remain so
|
||||
* until all such references are cleared or themselves become
|
||||
* unreachable.
|
||||
*
|
||||
* <a name="reachability"></a>
|
||||
* <h3>Reachability</h3>
|
||||
*
|
||||
* Going from strongest to weakest, the different levels of
|
||||
* reachability reflect the life cycle of an object. They are
|
||||
* operationally defined as follows:
|
||||
*
|
||||
* <ul>
|
||||
*
|
||||
* <li> An object is <em>strongly reachable</em> if it can be reached
|
||||
* by some thread without traversing any reference objects. A
|
||||
* newly-created object is strongly reachable by the thread that
|
||||
* created it.
|
||||
*
|
||||
* <li> An object is <em>softly reachable</em> if it is not strongly
|
||||
* reachable but can be reached by traversing a soft reference.
|
||||
*
|
||||
* <li> An object is <em>weakly reachable</em> if it is neither
|
||||
* strongly nor softly reachable but can be reached by traversing a
|
||||
* weak reference. When the weak references to a weakly-reachable
|
||||
* object are cleared, the object becomes eligible for finalization.
|
||||
*
|
||||
* <li> An object is <em>phantom reachable</em> if it is neither
|
||||
* strongly, softly, nor weakly reachable, it has been finalized, and
|
||||
* some phantom reference refers to it.
|
||||
*
|
||||
* <li> Finally, an object is <em>unreachable</em>, and therefore
|
||||
* eligible for reclamation, when it is not reachable in any of the
|
||||
* above ways.
|
||||
*
|
||||
* </ul>
|
||||
*
|
||||
* @author Mark Reinhold
|
||||
* @since 1.2
|
||||
*/
|
||||
package java.lang.ref;
|
@ -1,147 +0,0 @@
|
||||
<!--
|
||||
Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved.
|
||||
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
|
||||
This code is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License version 2 only, as
|
||||
published by the Free Software Foundation. Oracle designates this
|
||||
particular file as subject to the "Classpath" exception as provided
|
||||
by Oracle in the LICENSE file that accompanied this code.
|
||||
|
||||
This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
version 2 for more details (a copy is included in the LICENSE file that
|
||||
accompanied this code).
|
||||
|
||||
You should have received a copy of the GNU General Public License version
|
||||
2 along with this work; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
or visit www.oracle.com if you need additional information or have any
|
||||
questions.
|
||||
-->
|
||||
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
|
||||
<html>
|
||||
<body bgcolor="white">
|
||||
|
||||
|
||||
Provides reference-object classes, which support a limited degree of
|
||||
interaction with the garbage collector. A program may use a reference object
|
||||
to maintain a reference to some other object in such a way that the latter
|
||||
object may still be reclaimed by the collector. A program may also arrange to
|
||||
be notified some time after the collector has determined that the reachability
|
||||
of a given object has changed.
|
||||
|
||||
|
||||
<h2>Package Specification</h2>
|
||||
|
||||
A <em>reference object</em> encapsulates a reference to some other object so
|
||||
that the reference itself may be examined and manipulated like any other
|
||||
object. Three types of reference objects are provided, each weaker than the
|
||||
last: <em>soft</em>, <em>weak</em>, and <em>phantom</em>. Each type
|
||||
corresponds to a different level of reachability, as defined below. Soft
|
||||
references are for implementing memory-sensitive caches, weak references are
|
||||
for implementing canonicalizing mappings that do not prevent their keys (or
|
||||
values) from being reclaimed, and phantom references are for scheduling
|
||||
pre-mortem cleanup actions in a more flexible way than is possible with the
|
||||
Java finalization mechanism.
|
||||
|
||||
<p> Each reference-object type is implemented by a subclass of the abstract
|
||||
base <code>{@link java.lang.ref.Reference}</code> class. An instance of one of
|
||||
these subclasses encapsulates a single reference to a particular object, called
|
||||
the <em>referent</em>. Every reference object provides methods for getting and
|
||||
clearing the reference. Aside from the clearing operation reference objects
|
||||
are otherwise immutable, so no <code>set</code> operation is provided. A
|
||||
program may further subclass these subclasses, adding whatever fields and
|
||||
methods are required for its purposes, or it may use these subclasses without
|
||||
change.
|
||||
|
||||
|
||||
<h3>Notification</h3>
|
||||
|
||||
A program may request to be notified of changes in an object's reachability by
|
||||
<em>registering</em> an appropriate reference object with a <em>reference
|
||||
queue</em> at the time the reference object is created. Some time after the
|
||||
garbage collector determines that the reachability of the referent has changed
|
||||
to the value corresponding to the type of the reference, it will add the
|
||||
reference to the associated queue. At this point, the reference is considered
|
||||
to be <em>enqueued</em>. The program may remove references from a queue either
|
||||
by polling or by blocking until a reference becomes available. Reference
|
||||
queues are implemented by the <code>{@link java.lang.ref.ReferenceQueue}</code>
|
||||
class.
|
||||
|
||||
<p> The relationship between a registered reference object and its queue is
|
||||
one-sided. That is, a queue does not keep track of the references that are
|
||||
registered with it. If a registered reference becomes unreachable itself, then
|
||||
it will never be enqueued. It is the responsibility of the program using
|
||||
reference objects to ensure that the objects remain reachable for as long as
|
||||
the program is interested in their referents.
|
||||
|
||||
<p> While some programs will choose to dedicate a thread to removing reference
|
||||
objects from one or more queues and processing them, this is by no means
|
||||
necessary. A tactic that often works well is to examine a reference queue in
|
||||
the course of performing some other fairly-frequent action. For example, a
|
||||
hashtable that uses weak references to implement weak keys could poll its
|
||||
reference queue each time the table is accessed. This is how the <code>{@link
|
||||
java.util.WeakHashMap}</code> class works. Because the <code>{@link
|
||||
java.lang.ref.ReferenceQueue#poll ReferenceQueue.poll}</code> method simply
|
||||
checks an internal data structure, this check will add little overhead to the
|
||||
hashtable access methods.
|
||||
|
||||
|
||||
<h3>Automatically-cleared references</h3>
|
||||
|
||||
Soft and weak references are automatically cleared by the collector before
|
||||
being added to the queues with which they are registered, if any. Therefore
|
||||
soft and weak references need not be registered with a queue in order to be
|
||||
useful, while phantom references do. An object that is reachable via phantom
|
||||
references will remain so until all such references are cleared or themselves
|
||||
become unreachable.
|
||||
|
||||
|
||||
<a name="reachability"></a>
|
||||
<h3>Reachability</h3>
|
||||
|
||||
Going from strongest to weakest, the different levels of reachability reflect
|
||||
the life cycle of an object. They are operationally defined as follows:
|
||||
|
||||
<ul>
|
||||
|
||||
<li> An object is <em>strongly reachable</em> if it can be reached by some
|
||||
thread without traversing any reference objects. A newly-created object is
|
||||
strongly reachable by the thread that created it.
|
||||
|
||||
<li> An object is <em>softly reachable</em> if it is not strongly reachable but
|
||||
can be reached by traversing a soft reference.
|
||||
|
||||
<li> An object is <em>weakly reachable</em> if it is neither strongly nor
|
||||
softly reachable but can be reached by traversing a weak reference. When the
|
||||
weak references to a weakly-reachable object are cleared, the object becomes
|
||||
eligible for finalization.
|
||||
|
||||
<li> An object is <em>phantom reachable</em> if it is neither strongly, softly,
|
||||
nor weakly reachable, it has been finalized, and some phantom reference refers
|
||||
to it.
|
||||
|
||||
<li> Finally, an object is <em>unreachable</em>, and therefore eligible for
|
||||
reclamation, when it is not reachable in any of the above ways.
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
@author Mark Reinhold
|
||||
@since 1.2
|
||||
|
||||
<!--
|
||||
<h2>Related Documentation</h2>
|
||||
|
||||
For overviews, tutorials, examples, guides, and tool documentation, please see:
|
||||
<ul>
|
||||
<li><a href="">##### REFER TO NON-SPEC DOCUMENTATION HERE #####</a>
|
||||
</ul>
|
||||
-->
|
||||
</body>
|
||||
</html>
|
@ -5176,7 +5176,7 @@ public class BigDecimal extends Number implements Comparable<BigDecimal> {
|
||||
}
|
||||
|
||||
/*
|
||||
* returns true if 128 bit number <hi0,lo0> is less then <hi1,lo1>
|
||||
* returns true if 128 bit number <hi0,lo0> is less than <hi1,lo1>
|
||||
* hi0 & hi1 should be non-negative
|
||||
*/
|
||||
private static boolean longLongCompareMagnitude(long hi0, long lo0, long hi1, long lo1) {
|
||||
|
@ -0,0 +1,44 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Service-provider classes for the {@link java.nio.channels}
|
||||
* package.
|
||||
*
|
||||
* <p> Only developers who are defining new selector providers or
|
||||
* asynchronous channel providers should need to make direct use of
|
||||
* this package. </p>
|
||||
*
|
||||
* <p> Unless otherwise noted, passing a {@code null} argument to a
|
||||
* constructor or method in any class or interface in this package
|
||||
* will cause a {@link java.lang.NullPointerException
|
||||
* NullPointerException} to be thrown.
|
||||
*
|
||||
*
|
||||
* @since 1.4
|
||||
* @author Mark Reinhold
|
||||
* @author JSR-51 Expert Group
|
||||
*/
|
||||
package java.nio.channels.spi;
|
@ -1,45 +0,0 @@
|
||||
<!--
|
||||
Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved.
|
||||
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
|
||||
This code is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License version 2 only, as
|
||||
published by the Free Software Foundation. Oracle designates this
|
||||
particular file as subject to the "Classpath" exception as provided
|
||||
by Oracle in the LICENSE file that accompanied this code.
|
||||
|
||||
This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
version 2 for more details (a copy is included in the LICENSE file that
|
||||
accompanied this code).
|
||||
|
||||
You should have received a copy of the GNU General Public License version
|
||||
2 along with this work; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
or visit www.oracle.com if you need additional information or have any
|
||||
questions.
|
||||
-->
|
||||
|
||||
<!doctype html public "-//IETF//DTD HTML//EN">
|
||||
<html>
|
||||
<body bgcolor="white">
|
||||
|
||||
Service-provider classes for the <tt>{@link java.nio.channels}</tt> package.
|
||||
|
||||
<p> Only developers who are defining new selector providers or asynchronous
|
||||
channel providers should need to make direct use of this package. </p>
|
||||
|
||||
<p> Unless otherwise noted, passing a <tt>null</tt> argument to a constructor
|
||||
or method in any class or interface in this package will cause a {@link
|
||||
java.lang.NullPointerException NullPointerException} to be thrown.
|
||||
|
||||
|
||||
@since 1.4
|
||||
@author Mark Reinhold
|
||||
@author JSR-51 Expert Group
|
||||
|
||||
</body>
|
||||
</html>
|
@ -30,6 +30,7 @@ import java.nio.CharBuffer;
|
||||
import java.nio.charset.spi.CharsetProvider;
|
||||
import java.security.AccessController;
|
||||
import java.security.PrivilegedAction;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
@ -336,12 +337,10 @@ public abstract class Charset
|
||||
//
|
||||
private static Iterator<CharsetProvider> providers() {
|
||||
return new Iterator<>() {
|
||||
|
||||
ClassLoader cl = ClassLoader.getSystemClassLoader();
|
||||
ServiceLoader<CharsetProvider> sl =
|
||||
ServiceLoader.load(CharsetProvider.class, cl);
|
||||
Iterator<CharsetProvider> i = sl.iterator();
|
||||
|
||||
CharsetProvider next = null;
|
||||
|
||||
private boolean getNext() {
|
||||
@ -424,32 +423,36 @@ public abstract class Charset
|
||||
|
||||
/* The extended set of charsets */
|
||||
private static class ExtendedProviderHolder {
|
||||
static final CharsetProvider extendedProvider = extendedProvider();
|
||||
static final CharsetProvider[] extendedProviders = extendedProviders();
|
||||
// returns ExtendedProvider, if installed
|
||||
private static CharsetProvider extendedProvider() {
|
||||
return AccessController.doPrivileged(
|
||||
new PrivilegedAction<>() {
|
||||
public CharsetProvider run() {
|
||||
try {
|
||||
Class<?> epc
|
||||
= Class.forName("sun.nio.cs.ext.ExtendedCharsets");
|
||||
return (CharsetProvider)epc.newInstance();
|
||||
} catch (ClassNotFoundException x) {
|
||||
// Extended charsets not available
|
||||
// (charsets.jar not present)
|
||||
} catch (InstantiationException |
|
||||
IllegalAccessException x) {
|
||||
throw new Error(x);
|
||||
}
|
||||
return null;
|
||||
private static CharsetProvider[] extendedProviders() {
|
||||
return AccessController.doPrivileged(new PrivilegedAction<>() {
|
||||
public CharsetProvider[] run() {
|
||||
CharsetProvider[] cps = new CharsetProvider[1];
|
||||
int n = 0;
|
||||
ServiceLoader<CharsetProvider> sl =
|
||||
ServiceLoader.loadInstalled(CharsetProvider.class);
|
||||
for (CharsetProvider cp : sl) {
|
||||
if (n + 1 > cps.length) {
|
||||
cps = Arrays.copyOf(cps, cps.length << 1);
|
||||
}
|
||||
});
|
||||
cps[n++] = cp;
|
||||
}
|
||||
return n == cps.length ? cps : Arrays.copyOf(cps, n);
|
||||
}});
|
||||
}
|
||||
}
|
||||
|
||||
private static Charset lookupExtendedCharset(String charsetName) {
|
||||
CharsetProvider ecp = ExtendedProviderHolder.extendedProvider;
|
||||
return (ecp != null) ? ecp.charsetForName(charsetName) : null;
|
||||
if (!sun.misc.VM.isBooted()) // see lookupViaProviders()
|
||||
return null;
|
||||
CharsetProvider[] ecps = ExtendedProviderHolder.extendedProviders;
|
||||
for (CharsetProvider cp : ecps) {
|
||||
Charset cs = cp.charsetForName(charsetName);
|
||||
if (cs != null)
|
||||
return cs;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static Charset lookup(String charsetName) {
|
||||
@ -576,9 +579,10 @@ public abstract class Charset
|
||||
new TreeMap<>(
|
||||
ASCIICaseInsensitiveComparator.CASE_INSENSITIVE_ORDER);
|
||||
put(standardProvider.charsets(), m);
|
||||
CharsetProvider ecp = ExtendedProviderHolder.extendedProvider;
|
||||
if (ecp != null)
|
||||
CharsetProvider[] ecps = ExtendedProviderHolder.extendedProviders;
|
||||
for (CharsetProvider ecp :ecps) {
|
||||
put(ecp.charsets(), m);
|
||||
}
|
||||
for (Iterator<CharsetProvider> i = providers(); i.hasNext();) {
|
||||
CharsetProvider cp = i.next();
|
||||
put(cp.charsets(), m);
|
||||
|
@ -0,0 +1,90 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Defines charsets, decoders, and encoders, for translating between
|
||||
* bytes and Unicode characters.
|
||||
*
|
||||
* <blockquote><table cellspacing=1 cellpadding=0 summary="Summary of charsets, decoders, and encoders in this package">
|
||||
* <tr><th align="left">Class name</th><th align="left">Description</th></tr>
|
||||
* <tr><td valign=top>{@link java.nio.charset.Charset}</td>
|
||||
* <td>A named mapping between characters<br>and bytes</td></tr>
|
||||
* <tr><td valign=top>{@link java.nio.charset.CharsetDecoder}</td>
|
||||
* <td>Decodes bytes into characters</td></tr>
|
||||
* <tr><td valign=top>{@link java.nio.charset.CharsetEncoder} </td>
|
||||
* <td>Encodes characters into bytes</td></tr>
|
||||
* <tr><td valign=top>{@link java.nio.charset.CoderResult} </td>
|
||||
* <td>Describes coder results</td></tr>
|
||||
* <tr><td valign=top>{@link java.nio.charset.CodingErrorAction} </td>
|
||||
* <td>Describes actions to take when<br>coding errors are detected</td></tr>
|
||||
*
|
||||
* </table></blockquote>
|
||||
*
|
||||
* <p> A <i>charset</i> is named mapping between sequences of
|
||||
* sixteen-bit Unicode characters and sequences of bytes, in the sense
|
||||
* defined in <a
|
||||
* href="http://www.ietf.org/rfc/rfc2278.txt"><i>RFC 2278</i></a>.
|
||||
* A <i>decoder</i> is an engine which transforms bytes in a specific
|
||||
* charset into characters, and an <i>encoder</i> is an engine which
|
||||
* transforms characters into bytes. Encoders and decoders operate on
|
||||
* byte and character buffers. They are collectively referred to as
|
||||
* <i>coders</i>.
|
||||
*
|
||||
* <p> The {@link java.nio.charset.Charset} class defines methods for
|
||||
* creating coders for a given charset and for retrieving the various
|
||||
* names associated with a charset. It also defines static methods
|
||||
* for testing whether a particular charset is supported, for locating
|
||||
* charset instances by name, and for constructing a map that contains
|
||||
* every charset for which support is available in the current Java
|
||||
* virtual machine.
|
||||
*
|
||||
* <p> Most users will not use these classes directly; instead they
|
||||
* will use the existing charset-related constructors and methods in
|
||||
* the {@link java.lang.String} class, together with the existing
|
||||
* {@link java.io.InputStreamReader} and {@link
|
||||
* java.io.OutputStreamWriter} classes, all of whose implementations
|
||||
* have been reworked to make use of the charset facilities defined in
|
||||
* this package. A small number of changes have been made to the
|
||||
* {@link java.io.InputStreamReader} and {@link
|
||||
* java.io.OutputStreamWriter} classes in order to allow explicit
|
||||
* charset objects to be specified in the construction of instances of
|
||||
* those classes.
|
||||
*
|
||||
* <p> Support for new charsets can be made available via the
|
||||
* interface defined in the {@link
|
||||
* java.nio.charset.spi.CharsetProvider} class in the <tt>{@link
|
||||
* java.nio.charset.spi}</tt> package.
|
||||
*
|
||||
* <p> Unless otherwise noted, passing a <tt>null</tt> argument to a
|
||||
* constructor or method in any class or interface in this package
|
||||
* will cause a {@link java.lang.NullPointerException
|
||||
* NullPointerException} to be thrown.
|
||||
*
|
||||
*
|
||||
* @since 1.4
|
||||
* @author Mark Reinhold
|
||||
* @author JSR-51 Expert Group
|
||||
*/
|
||||
package java.nio.charset;
|
@ -1,88 +0,0 @@
|
||||
<!--
|
||||
Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
|
||||
This code is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License version 2 only, as
|
||||
published by the Free Software Foundation. Oracle designates this
|
||||
particular file as subject to the "Classpath" exception as provided
|
||||
by Oracle in the LICENSE file that accompanied this code.
|
||||
|
||||
This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
version 2 for more details (a copy is included in the LICENSE file that
|
||||
accompanied this code).
|
||||
|
||||
You should have received a copy of the GNU General Public License version
|
||||
2 along with this work; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
or visit www.oracle.com if you need additional information or have any
|
||||
questions.
|
||||
-->
|
||||
|
||||
<!doctype html public "-//IETF//DTD HTML//EN">
|
||||
<html>
|
||||
<body bgcolor="white">
|
||||
|
||||
|
||||
Defines charsets, decoders, and encoders, for translating between bytes and
|
||||
Unicode characters.
|
||||
|
||||
<blockquote><table cellspacing=1 cellpadding=0 summary="Summary of charsets, decoders, and encoders in this package">
|
||||
<tr><th><p align="left">Class name</p></th><th><p align="left">Description</p></th></tr>
|
||||
<tr><td valign=top><tt>{@link java.nio.charset.Charset}</tt></td>
|
||||
<td>A named mapping between characters<br>and bytes</td></tr>
|
||||
<tr><td valign=top><tt>{@link java.nio.charset.CharsetDecoder}</tt></td>
|
||||
<td>Decodes bytes into characters</td></tr>
|
||||
<tr><td valign=top><tt>{@link java.nio.charset.CharsetEncoder} </tt></td>
|
||||
<td>Encodes characters into bytes</td></tr>
|
||||
<tr><td valign=top><tt>{@link java.nio.charset.CoderResult} </tt></td>
|
||||
<td>Describes coder results</td></tr>
|
||||
<tr><td valign=top><tt>{@link java.nio.charset.CodingErrorAction} </tt></td>
|
||||
<td>Describes actions to take when<br>coding errors are detected</td></tr>
|
||||
|
||||
</table></blockquote>
|
||||
|
||||
<p> A <i>charset</i> is named mapping between sequences of sixteen-bit Unicode
|
||||
characters and sequences of bytes, in the sense defined in <a
|
||||
href="http://www.ietf.org/rfc/rfc2278.txt"><i>RFC 2278</i></a>. A
|
||||
<i>decoder</i> is an engine which transforms bytes in a specific charset into
|
||||
characters, and an <i>encoder</i> is an engine which transforms characters into
|
||||
bytes. Encoders and decoders operate on byte and character buffers. They are
|
||||
collectively referred to as <i>coders</i>.
|
||||
|
||||
<p> The {@link java.nio.charset.Charset} class defines methods for creating
|
||||
coders for a given charset and for retrieving the various names associated with
|
||||
a charset. It also defines static methods for testing whether a particular
|
||||
charset is supported, for locating charset instances by name, and for
|
||||
constructing a map that contains every charset for which support is available
|
||||
in the current Java virtual machine.
|
||||
|
||||
<p> Most users will not use these classes directly; instead they will use the
|
||||
existing charset-related constructors and methods in the {@link
|
||||
java.lang.String} class, together with the existing {@link
|
||||
java.io.InputStreamReader} and {@link java.io.OutputStreamWriter} classes, all
|
||||
of whose implementations have been reworked to make use of the charset
|
||||
facilities defined in this package. A small number of changes have been made
|
||||
to the {@link java.io.InputStreamReader} and {@link java.io.OutputStreamWriter}
|
||||
classes in order to allow explicit charset objects to be specified in the
|
||||
construction of instances of those classes.
|
||||
|
||||
<p> Support for new charsets can be made available via the interface defined in
|
||||
the {@link java.nio.charset.spi.CharsetProvider} class in the <tt>{@link
|
||||
java.nio.charset.spi}</tt> package.
|
||||
|
||||
<p> Unless otherwise noted, passing a <tt>null</tt> argument to a constructor
|
||||
or method in any class or interface in this package will cause a {@link
|
||||
java.lang.NullPointerException NullPointerException} to be thrown.
|
||||
|
||||
|
||||
@since 1.4
|
||||
@author Mark Reinhold
|
||||
@author JSR-51 Expert Group
|
||||
|
||||
</body>
|
||||
</html>
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 2005, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -23,21 +23,19 @@
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package sun.tools.native2ascii.resources;
|
||||
|
||||
import java.util.ListResourceBundle;
|
||||
|
||||
public class MsgNative2ascii extends ListResourceBundle {
|
||||
|
||||
public Object[][] getContents() {
|
||||
Object[][] temp = new Object[][] {
|
||||
{"err.bad.arg", "-encoding requires argument"},
|
||||
{"err.cannot.read", "{0} could not be read."},
|
||||
{"err.cannot.write", "{0} could not be written."},
|
||||
{"usage", "Usage: native2ascii" +
|
||||
" [-reverse] [-encoding encoding] [inputfile [outputfile]]"},
|
||||
};
|
||||
|
||||
return temp;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Service-provider classes for the {@link java.nio.charset} package.
|
||||
*
|
||||
* <p> Only developers who are defining new charsets should need to
|
||||
* make direct use of this package. </p>
|
||||
*
|
||||
* <p> Unless otherwise noted, passing a {@code null} argument to a
|
||||
* constructor or method in any class or interface in this package
|
||||
* will cause a {@link java.lang.NullPointerException
|
||||
* NullPointerException} to be thrown.
|
||||
*
|
||||
* @since 1.4
|
||||
* @author Mark Reinhold
|
||||
* @author JSR-51 Expert Group
|
||||
*/
|
||||
package java.nio.charset.spi;
|
@ -1,45 +0,0 @@
|
||||
<!--
|
||||
Copyright (c) 2001, 2005, Oracle and/or its affiliates. All rights reserved.
|
||||
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
|
||||
This code is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License version 2 only, as
|
||||
published by the Free Software Foundation. Oracle designates this
|
||||
particular file as subject to the "Classpath" exception as provided
|
||||
by Oracle in the LICENSE file that accompanied this code.
|
||||
|
||||
This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
version 2 for more details (a copy is included in the LICENSE file that
|
||||
accompanied this code).
|
||||
|
||||
You should have received a copy of the GNU General Public License version
|
||||
2 along with this work; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
or visit www.oracle.com if you need additional information or have any
|
||||
questions.
|
||||
-->
|
||||
|
||||
<!doctype html public "-//IETF//DTD HTML//EN">
|
||||
<html>
|
||||
<body bgcolor="white">
|
||||
|
||||
Service-provider classes for the <tt>{@link java.nio.charset}</tt> package.
|
||||
|
||||
<p> Only developers who are defining new charsets should need to make direct
|
||||
use of this package. </p>
|
||||
|
||||
<p> Unless otherwise noted, passing a <tt>null</tt> argument to a constructor
|
||||
or method in any class or interface in this package will cause a {@link
|
||||
java.lang.NullPointerException NullPointerException} to be thrown.
|
||||
|
||||
|
||||
@since 1.4
|
||||
@author Mark Reinhold
|
||||
@author JSR-51 Expert Group
|
||||
|
||||
</body>
|
||||
</html>
|
141
jdk/src/java.base/share/classes/java/nio/package-info.java
Normal file
141
jdk/src/java.base/share/classes/java/nio/package-info.java
Normal file
@ -0,0 +1,141 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Defines buffers, which are containers for data, and provides an
|
||||
* overview of the other NIO packages.
|
||||
*
|
||||
*
|
||||
* <p> The central abstractions of the NIO APIs are: </p>
|
||||
*
|
||||
* <ul>
|
||||
*
|
||||
* <li><p> <a href="#buffers"><i>Buffers</i></a>, which are containers for data;
|
||||
* </p></li>
|
||||
*
|
||||
* <li><p> <a
|
||||
* href="charset/package-summary.html"><i>Charsets</i></a> and their
|
||||
* associated <i>decoders</i> and <i>encoders</i>, <br> which
|
||||
* translate between bytes and Unicode characters; </p></li>
|
||||
*
|
||||
* <li><p> <a
|
||||
* href="channels/package-summary.html"><i>Channels</i></a> of
|
||||
* various types, which represent connections <br> to entities
|
||||
* capable of performing I/O operations; and </p></li>
|
||||
*
|
||||
* <li><p> <i>Selectors</i> and <i>selection keys</i>, which
|
||||
* together with <br> <i>selectable channels</i> define a <a
|
||||
* href="channels/package-summary.html#multiplex">multiplexed,
|
||||
* non-blocking <br> I/O</a> facility. </p></li>
|
||||
*
|
||||
* </ul>
|
||||
*
|
||||
* <p> The <tt>java.nio</tt> package defines the buffer classes, which
|
||||
* are used throughout the NIO APIs. The charset API is defined in
|
||||
* the {@link java.nio.charset} package, and the channel and selector
|
||||
* APIs are defined in the {@link java.nio.channels} package. Each of
|
||||
* these subpackages has its own service-provider (SPI) subpackage,
|
||||
* the contents of which can be used to extend the platform's default
|
||||
* implementations or to construct alternative implementations.
|
||||
*
|
||||
* <a name="buffers"> </a>
|
||||
*
|
||||
* <blockquote><table cellspacing=1 cellpadding=0 summary="Description of the various buffers">
|
||||
* <tr><th align="left">Buffers</th><th align="left">Description</th></tr>
|
||||
* <tr><td valign=top><tt>{@link java.nio.Buffer}</tt></td>
|
||||
* <td>Position, limit, and capacity;
|
||||
* <br>clear, flip, rewind, and mark/reset</td></tr>
|
||||
* <tr><td valign=top><tt> {@link java.nio.ByteBuffer}</tt></td>
|
||||
* <td>Get/put, compact, views; allocate, wrap</td></tr>
|
||||
* <tr><td valign=top><tt> {@link java.nio.MappedByteBuffer} </tt></td>
|
||||
* <td>A byte buffer mapped to a file</td></tr>
|
||||
* <tr><td valign=top><tt> {@link java.nio.CharBuffer}</tt></td>
|
||||
* <td>Get/put, compact; allocate, wrap</td></tr>
|
||||
* <tr><td valign=top><tt> {@link java.nio.DoubleBuffer}</tt></td>
|
||||
* <td> ' '</td></tr>
|
||||
* <tr><td valign=top><tt> {@link java.nio.FloatBuffer}</tt></td>
|
||||
* <td> ' '</td></tr>
|
||||
* <tr><td valign=top><tt> {@link java.nio.IntBuffer}</tt></td>
|
||||
* <td> ' '</td></tr>
|
||||
* <tr><td valign=top><tt> {@link java.nio.LongBuffer}</tt></td>
|
||||
* <td> ' '</td></tr>
|
||||
* <tr><td valign=top><tt> {@link java.nio.ShortBuffer}</tt></td>
|
||||
* <td> ' '</td></tr>
|
||||
* <tr><td valign=top><tt>{@link java.nio.ByteOrder}</tt></td>
|
||||
* <td>Typesafe enumeration for byte orders</td></tr>
|
||||
* </table></blockquote>
|
||||
*
|
||||
* <p> A <i>buffer</i> is a container for a fixed amount of data of a
|
||||
* specific primitive type. In addition to its content a buffer has a
|
||||
* <i>position</i>, which is the index of the next element to be read
|
||||
* or written, and a <i>limit</i>, which is the index of the first
|
||||
* element that should not be read or written. The base {@link
|
||||
* java.nio.Buffer} class defines these properties as well as methods
|
||||
* for <i>clearing</i>, <i>flipping</i>, and <i>rewinding</i>, for
|
||||
* <i>marking</i> the current position, and for <i>resetting</i> the
|
||||
* position to the previous mark.
|
||||
*
|
||||
* <p> There is a buffer class for each non-boolean primitive type.
|
||||
* Each class defines a family of <i>get</i> and <i>put</i> methods
|
||||
* for moving data out of and in to a buffer, methods for
|
||||
* <i>compacting</i>, <i>duplicating</i>, and <i>slicing</i> a buffer,
|
||||
* and static methods for <i>allocating</i> a new buffer as well as
|
||||
* for <i>wrapping</i> an existing array into a buffer.
|
||||
*
|
||||
* <p> Byte buffers are distinguished in that they can be used as the
|
||||
* sources and targets of I/O operations. They also support several
|
||||
* features not found in the other buffer classes:
|
||||
*
|
||||
* <ul>
|
||||
*
|
||||
* <li><p> A byte buffer can be allocated as a <a
|
||||
* href="ByteBuffer.html#direct"> <i>direct</i></a> buffer, in which
|
||||
* case the Java virtual machine will make a best effort to perform
|
||||
* native I/O operations directly upon it. </p></li>
|
||||
*
|
||||
* <li><p> A byte buffer can be created by {@link
|
||||
* java.nio.channels.FileChannel#map <i>mapping</i>} a region of a
|
||||
* file directly into memory, in which case a few additional
|
||||
* file-related operations defined in the {@link
|
||||
* java.nio.MappedByteBuffer} class are available. </p></li>
|
||||
*
|
||||
* <li><p> A byte buffer provides access to its content as either a
|
||||
* heterogeneous or homogeneous sequence of <a
|
||||
* href="ByteBuffer.html#bin"><i>binary data</i></a> of any
|
||||
* non-boolean primitive type, in either big-endian or little-endian
|
||||
* <a href="ByteOrder.html">byte order</a>. </p></li>
|
||||
*
|
||||
* </ul>
|
||||
*
|
||||
* <p> Unless otherwise noted, passing a <tt>null</tt> argument to a
|
||||
* constructor or method in any class or interface in this package
|
||||
* will cause a {@link java.lang.NullPointerException
|
||||
* NullPointerException} to be thrown.
|
||||
*
|
||||
* @since 1.4
|
||||
* @author Mark Reinhold
|
||||
* @author JSR-51 Expert Group
|
||||
*/
|
||||
package java.nio;
|
@ -1,139 +0,0 @@
|
||||
<!--
|
||||
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
|
||||
This code is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License version 2 only, as
|
||||
published by the Free Software Foundation. Oracle designates this
|
||||
particular file as subject to the "Classpath" exception as provided
|
||||
by Oracle in the LICENSE file that accompanied this code.
|
||||
|
||||
This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
version 2 for more details (a copy is included in the LICENSE file that
|
||||
accompanied this code).
|
||||
|
||||
You should have received a copy of the GNU General Public License version
|
||||
2 along with this work; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
or visit www.oracle.com if you need additional information or have any
|
||||
questions.
|
||||
-->
|
||||
|
||||
<!doctype html public "-//IETF//DTD HTML//EN">
|
||||
<html>
|
||||
<body bgcolor="white">
|
||||
|
||||
Defines buffers, which are containers for data, and provides an overview of the
|
||||
other NIO packages.
|
||||
|
||||
|
||||
<p> The central abstractions of the NIO APIs are: </p>
|
||||
|
||||
<ul>
|
||||
|
||||
<li><p> <a href="#buffers"><i>Buffers</i></a>, which are containers for data;
|
||||
</p></li>
|
||||
|
||||
<li><p> <a href="charset/package-summary.html"><i>Charsets</i></a> and their
|
||||
associated <i>decoders</i> and <i>encoders</i>, <br> which translate between
|
||||
bytes and Unicode characters; </p></li>
|
||||
|
||||
<li><p> <a href="channels/package-summary.html"><i>Channels</i></a> of
|
||||
various types, which represent connections <br> to entities capable of
|
||||
performing I/O operations; and </p></li>
|
||||
|
||||
<li><p> <i>Selectors</i> and <i>selection keys</i>, which together with <br>
|
||||
<i>selectable channels</i> define a <a
|
||||
href="channels/package-summary.html#multiplex">multiplexed, non-blocking <br>
|
||||
I/O</a> facility. </p></li>
|
||||
|
||||
</ul>
|
||||
|
||||
<p> The <tt>java.nio</tt> package defines the buffer classes, which are used
|
||||
throughout the NIO APIs. The charset API is defined in the {@link
|
||||
java.nio.charset} package, and the channel and selector APIs are defined in the
|
||||
{@link java.nio.channels} package. Each of these subpackages has its own
|
||||
service-provider (SPI) subpackage, the contents of which can be used to extend
|
||||
the platform's default implementations or to construct alternative
|
||||
implementations.
|
||||
|
||||
|
||||
<a name="buffers"> </a>
|
||||
|
||||
<blockquote><table cellspacing=1 cellpadding=0 summary="Description of the various buffers">
|
||||
<tr><th><p align="left">Buffers</p></th><th><p align="left">Description</p></th></tr>
|
||||
<tr><td valign=top><tt>{@link java.nio.Buffer}</tt></td>
|
||||
<td>Position, limit, and capacity;
|
||||
<br>clear, flip, rewind, and mark/reset</td></tr>
|
||||
<tr><td valign=top><tt> {@link java.nio.ByteBuffer}</tt></td>
|
||||
<td>Get/put, compact, views; allocate, wrap</td></tr>
|
||||
<tr><td valign=top><tt> {@link java.nio.MappedByteBuffer} </tt></td>
|
||||
<td>A byte buffer mapped to a file</td></tr>
|
||||
<tr><td valign=top><tt> {@link java.nio.CharBuffer}</tt></td>
|
||||
<td>Get/put, compact; allocate, wrap</td></tr>
|
||||
<tr><td valign=top><tt> {@link java.nio.DoubleBuffer}</tt></td>
|
||||
<td> ' '</td></tr>
|
||||
<tr><td valign=top><tt> {@link java.nio.FloatBuffer}</tt></td>
|
||||
<td> ' '</td></tr>
|
||||
<tr><td valign=top><tt> {@link java.nio.IntBuffer}</tt></td>
|
||||
<td> ' '</td></tr>
|
||||
<tr><td valign=top><tt> {@link java.nio.LongBuffer}</tt></td>
|
||||
<td> ' '</td></tr>
|
||||
<tr><td valign=top><tt> {@link java.nio.ShortBuffer}</tt></td>
|
||||
<td> ' '</td></tr>
|
||||
<tr><td valign=top><tt>{@link java.nio.ByteOrder}</tt></td>
|
||||
<td>Typesafe enumeration for byte orders</td></tr>
|
||||
</table></blockquote>
|
||||
|
||||
<p> A <i>buffer</i> is a container for a fixed amount of data of a specific
|
||||
primitive type. In addition to its content a buffer has a <i>position</i>,
|
||||
which is the index of the next element to be read or written, and a
|
||||
<i>limit</i>, which is the index of the first element that should not be read
|
||||
or written. The base {@link java.nio.Buffer} class defines these properties as
|
||||
well as methods for <i>clearing</i>, <i>flipping</i>, and <i>rewinding</i>, for
|
||||
<i>marking</i> the current position, and for <i>resetting</i> the position to
|
||||
the previous mark.
|
||||
|
||||
<p> There is a buffer class for each non-boolean primitive type. Each class
|
||||
defines a family of <i>get</i> and <i>put</i> methods for moving data out of
|
||||
and in to a buffer, methods for <i>compacting</i>, <i>duplicating</i>, and
|
||||
<i>slicing</i> a buffer, and static methods for <i>allocating</i> a new buffer
|
||||
as well as for <i>wrapping</i> an existing array into a buffer.
|
||||
|
||||
<p> Byte buffers are distinguished in that they can be used as the sources and
|
||||
targets of I/O operations. They also support several features not found in the
|
||||
other buffer classes:
|
||||
|
||||
<ul>
|
||||
|
||||
<li><p> A byte buffer can be allocated as a <a href="ByteBuffer.html#direct">
|
||||
<i>direct</i></a> buffer, in which case the Java virtual machine will make a
|
||||
best effort to perform native I/O operations directly upon it. </p></li>
|
||||
|
||||
<li><p> A byte buffer can be created by {@link
|
||||
java.nio.channels.FileChannel#map <i>mapping</i>} a region of a
|
||||
file directly into memory, in which case a few additional file-related
|
||||
operations defined in the {@link java.nio.MappedByteBuffer} class are
|
||||
available. </p></li>
|
||||
|
||||
<li><p> A byte buffer provides access to its content as either a heterogeneous
|
||||
or homogeneous sequence of <a href="ByteBuffer.html#bin"><i>binary data</i></a>
|
||||
of any non-boolean primitive type, in either big-endian or little-endian <a
|
||||
href="ByteOrder.html">byte order</a>. </p></li>
|
||||
|
||||
</ul>
|
||||
|
||||
<p> Unless otherwise noted, passing a <tt>null</tt> argument to a constructor
|
||||
or method in any class or interface in this package will cause a {@link
|
||||
java.lang.NullPointerException NullPointerException} to be thrown.
|
||||
|
||||
@since 1.4
|
||||
@author Mark Reinhold
|
||||
@author JSR-51 Expert Group
|
||||
|
||||
</body>
|
||||
</html>
|
@ -332,7 +332,7 @@ public class AttributedString {
|
||||
* @param beginIndex Index of the first character of the range.
|
||||
* @param endIndex Index of the character following the last character of the range.
|
||||
* @exception NullPointerException if <code>attribute</code> is null.
|
||||
* @exception IllegalArgumentException if beginIndex is less then 0, endIndex is
|
||||
* @exception IllegalArgumentException if beginIndex is less than 0, endIndex is
|
||||
* greater than the length of the string, or beginIndex and endIndex together don't
|
||||
* define a non-empty subrange of the string.
|
||||
*/
|
||||
@ -357,7 +357,7 @@ public class AttributedString {
|
||||
* @param endIndex Index of the character following the last
|
||||
* character of the range.
|
||||
* @exception NullPointerException if <code>attributes</code> is null.
|
||||
* @exception IllegalArgumentException if beginIndex is less then
|
||||
* @exception IllegalArgumentException if beginIndex is less than
|
||||
* 0, endIndex is greater than the length of the string, or
|
||||
* beginIndex and endIndex together don't define a non-empty
|
||||
* subrange of the string and the attributes parameter is not an
|
||||
@ -580,7 +580,7 @@ public class AttributedString {
|
||||
* @param beginIndex the index of the first character
|
||||
* @param endIndex the index of the character following the last character
|
||||
* @return an iterator providing access to the text and its attributes
|
||||
* @exception IllegalArgumentException if beginIndex is less then 0,
|
||||
* @exception IllegalArgumentException if beginIndex is less than 0,
|
||||
* endIndex is greater than the length of the string, or beginIndex is
|
||||
* greater than endIndex.
|
||||
*/
|
||||
|
47
jdk/src/java.base/share/classes/java/text/package-info.java
Normal file
47
jdk/src/java.base/share/classes/java/text/package-info.java
Normal file
@ -0,0 +1,47 @@
|
||||
/*
|
||||
* Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Provides classes and interfaces for handling text, dates, numbers,
|
||||
* and messages in a manner independent of natural languages. This
|
||||
* means your main application or applet can be written to be
|
||||
* language-independent, and it can rely upon separate,
|
||||
* dynamically-linked localized resources. This allows the flexibility
|
||||
* of adding localizations for new localizations at any time.
|
||||
*
|
||||
* <p>These classes are capable of formatting dates, numbers, and
|
||||
* messages, parsing; searching and sorting strings; and iterating
|
||||
* over characters, words, sentences, and line breaks. This package
|
||||
* contains three main groups of classes and interfaces:
|
||||
*
|
||||
* <ul>
|
||||
* <li>Classes for iteration over text
|
||||
* <li>Classes for formatting and parsing
|
||||
* <li>Classes for string collation
|
||||
* </ul>
|
||||
*
|
||||
* @since 1.1
|
||||
*/
|
||||
package java.text;
|
@ -1,65 +0,0 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
|
||||
<html>
|
||||
<head>
|
||||
<!--
|
||||
Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
|
||||
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
|
||||
This code is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License version 2 only, as
|
||||
published by the Free Software Foundation. Oracle designates this
|
||||
particular file as subject to the "Classpath" exception as provided
|
||||
by Oracle in the LICENSE file that accompanied this code.
|
||||
|
||||
This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
version 2 for more details (a copy is included in the LICENSE file that
|
||||
accompanied this code).
|
||||
|
||||
You should have received a copy of the GNU General Public License version
|
||||
2 along with this work; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
or visit www.oracle.com if you need additional information or have any
|
||||
questions.
|
||||
-->
|
||||
|
||||
</head>
|
||||
<body bgcolor="white">
|
||||
|
||||
Provides classes and interfaces for handling text, dates, numbers, and messages
|
||||
in a manner independent of natural languages. This means your main application
|
||||
or applet can be written to be language-independent, and it can rely upon
|
||||
separate, dynamically-linked localized resources. This allows the flexibility
|
||||
of adding localizations for new localizations at any time.
|
||||
<p>
|
||||
These classes are capable of formatting dates, numbers, and messages, parsing;
|
||||
searching and sorting strings; and iterating over characters, words, sentences,
|
||||
and line breaks. This package contains three main groups of classes and
|
||||
interfaces:
|
||||
<ul>
|
||||
<li>Classes for iteration over text
|
||||
<li>Classes for formatting and parsing
|
||||
<li>Classes for string collation
|
||||
</ul>
|
||||
<!--
|
||||
<h2>Package Specification</h2>
|
||||
|
||||
##### FILL IN ANY SPECS NEEDED BY JAVA COMPATIBILITY KIT #####
|
||||
<ul>
|
||||
<li><a href="">##### REFER TO ANY FRAMEMAKER SPECIFICATION HERE #####</a>
|
||||
</ul>
|
||||
|
||||
<h2>Related Documentation</h2>
|
||||
|
||||
For overviews, tutorials, examples, guides, and tool documentation, please see:
|
||||
<ul>
|
||||
<li><a href="">##### REFER TO NON-SPEC DOCUMENTATION HERE #####</a>
|
||||
</ul>
|
||||
-->
|
||||
|
||||
@since 1.1
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Service provider classes for the classes in the java.text package.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
package java.text.spi;
|
@ -1,50 +0,0 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
|
||||
<html>
|
||||
<head>
|
||||
<!--
|
||||
Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
|
||||
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
|
||||
This code is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License version 2 only, as
|
||||
published by the Free Software Foundation. Oracle designates this
|
||||
particular file as subject to the "Classpath" exception as provided
|
||||
by Oracle in the LICENSE file that accompanied this code.
|
||||
|
||||
This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
version 2 for more details (a copy is included in the LICENSE file that
|
||||
accompanied this code).
|
||||
|
||||
You should have received a copy of the GNU General Public License version
|
||||
2 along with this work; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
or visit www.oracle.com if you need additional information or have any
|
||||
questions.
|
||||
-->
|
||||
|
||||
</head>
|
||||
<body bgcolor="white">
|
||||
Service provider classes for the classes in the java.text package.
|
||||
<!--
|
||||
<h2>Package Specification</h2>
|
||||
|
||||
##### FILL IN ANY SPECS NEEDED BY JAVA COMPATIBILITY KIT #####
|
||||
<ul>
|
||||
<li><a href="">##### REFER TO ANY FRAMEMAKER SPECIFICATION HERE #####</a>
|
||||
</ul>
|
||||
|
||||
<h2>Related Documentation</h2>
|
||||
|
||||
For overviews, tutorials, examples, guides, and tool documentation, please see:
|
||||
<ul>
|
||||
<li><a href="">##### REFER TO NON-SPEC DOCUMENTATION HERE #####</a>
|
||||
</ul>
|
||||
-->
|
||||
|
||||
@since 1.6
|
||||
</body>
|
||||
</html>
|
@ -490,6 +490,16 @@ public final class HijrahChronology extends AbstractChronology implements Serial
|
||||
return yearOfEra;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the HijrahEra object from the numeric value.
|
||||
* The Hijrah calendar system has only one era covering the
|
||||
* proleptic years greater than zero.
|
||||
* This method returns the singleton HijrahEra for the value 1.
|
||||
*
|
||||
* @param eraValue the era value
|
||||
* @return the calendar system era, not null
|
||||
* @throws DateTimeException if unable to create the era
|
||||
*/
|
||||
@Override
|
||||
public HijrahEra eraOf(int eraValue) {
|
||||
switch (eraValue) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -1333,8 +1333,8 @@ public final class DateTimeFormatter {
|
||||
* If the time '23:59:60' is received, then a simple conversion is applied,
|
||||
* replacing the second-of-minute of 60 with 59. This query can be used
|
||||
* on the parse result to determine if the leap-second adjustment was made.
|
||||
* The query will return one second of excess if it did adjust to remove
|
||||
* the leap-second, and zero if not. Note that applying a leap-second
|
||||
* The query will return {@code true} if it did adjust to remove the
|
||||
* leap-second, and {@code false} if not. Note that applying a leap-second
|
||||
* smoothing mechanism, such as UTC-SLS, is the responsibility of the
|
||||
* application, as follows:
|
||||
* <pre>
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -120,9 +120,10 @@
|
||||
*
|
||||
* <h3>Duration and Period</h3>
|
||||
* <p>
|
||||
* Beyond dates and times, the API also allows the storage of period and durations of time.
|
||||
* Beyond dates and times, the API also allows the storage of periods and durations of time.
|
||||
* A {@link java.time.Duration} is a simple measure of time along the time-line in nanoseconds.
|
||||
* A {@link java.time.Period} expresses an amount of time in units meaningful to humans, such as years or hours.
|
||||
* A {@link java.time.Period} expresses an amount of time in units meaningful
|
||||
* to humans, such as years or days.
|
||||
* </p>
|
||||
*
|
||||
* <h3>Additional value types</h3>
|
||||
|
@ -73,8 +73,7 @@ import jdk.internal.util.xml.PropertiesDefaultHandler;
|
||||
* Unicode escapes as defined in section 3.3 of
|
||||
* <cite>The Java™ Language Specification</cite>;
|
||||
* only a single 'u' character is allowed in an escape
|
||||
* sequence. The native2ascii tool can be used to convert property files to and
|
||||
* from other character encodings.
|
||||
* sequence.
|
||||
*
|
||||
* <p> The {@link #loadFromXML(InputStream)} and {@link
|
||||
* #storeToXML(OutputStream, String, String)} methods load and store properties
|
||||
@ -108,9 +107,6 @@ import jdk.internal.util.xml.PropertiesDefaultHandler;
|
||||
* <p>This class is thread-safe: multiple threads can share a single
|
||||
* <tt>Properties</tt> object without the need for external synchronization.
|
||||
*
|
||||
* @see <a href="../../../technotes/tools/solaris/native2ascii.html">native2ascii tool for Solaris</a>
|
||||
* @see <a href="../../../technotes/tools/windows/native2ascii.html">native2ascii tool for Windows</a>
|
||||
*
|
||||
* @author Arthur van Hoff
|
||||
* @author Michael McCloskey
|
||||
* @author Xueming Shen
|
||||
|
@ -268,13 +268,25 @@ class JarFile extends ZipFile {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an enumeration of the zip file entries.
|
||||
* Returns an enumeration of the jar file entries.
|
||||
*
|
||||
* @return an enumeration of the jar file entries
|
||||
* @throws IllegalStateException
|
||||
* may be thrown if the jar file has been closed
|
||||
*/
|
||||
public Enumeration<JarEntry> entries() {
|
||||
return new JarEntryIterator();
|
||||
}
|
||||
|
||||
@Override
|
||||
/**
|
||||
* Returns an ordered {@code Stream} over the jar file entries.
|
||||
* Entries appear in the {@code Stream} in the order they appear in
|
||||
* the central directory of the jar file.
|
||||
*
|
||||
* @return an ordered {@code Stream} of entries in this jar file
|
||||
* @throws IllegalStateException if the jar file has been closed
|
||||
* @since 1.8
|
||||
*/
|
||||
public Stream<JarEntry> stream() {
|
||||
return StreamSupport.stream(Spliterators.spliterator(
|
||||
new JarEntryIterator(), size(),
|
||||
|
@ -0,0 +1,49 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Provides classes for reading and writing the JAR (Java ARchive)
|
||||
* file format, which is based on the standard ZIP file format with an
|
||||
* optional manifest file. The manifest stores meta-information about
|
||||
* the JAR file contents and is also used for signing JAR files.
|
||||
*
|
||||
* <h2>Package Specification</h2>
|
||||
*
|
||||
* The <code>java.util.jar</code> package is based on the following
|
||||
* specifications:
|
||||
*
|
||||
* <ul>
|
||||
* <li><b>Info-ZIP file format</b> - The JAR format is based on the Info-ZIP
|
||||
* file format. See
|
||||
* <a href="../zip/package-summary.html#package_description">java.util.zip
|
||||
* package description.</a> <p>
|
||||
* In JAR files, all file names must be encoded in the UTF-8 encoding.
|
||||
* <li><a href="../../../../technotes/guides/jar/jar.html">
|
||||
* Manifest and Signature Specification</a> - The manifest format specification.
|
||||
* </ul>
|
||||
*
|
||||
* @since 1.2
|
||||
*/
|
||||
package java.util.jar;
|
@ -1,62 +0,0 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
|
||||
<html>
|
||||
<head>
|
||||
<!--
|
||||
Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
|
||||
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
|
||||
This code is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License version 2 only, as
|
||||
published by the Free Software Foundation. Oracle designates this
|
||||
particular file as subject to the "Classpath" exception as provided
|
||||
by Oracle in the LICENSE file that accompanied this code.
|
||||
|
||||
This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
version 2 for more details (a copy is included in the LICENSE file that
|
||||
accompanied this code).
|
||||
|
||||
You should have received a copy of the GNU General Public License version
|
||||
2 along with this work; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
or visit www.oracle.com if you need additional information or have any
|
||||
questions.
|
||||
-->
|
||||
|
||||
</head>
|
||||
<body bgcolor="white">
|
||||
|
||||
Provides classes for reading and writing the JAR (Java ARchive) file
|
||||
format, which is based on the standard ZIP file format with an
|
||||
optional manifest file. The manifest stores meta-information about the
|
||||
JAR file contents and is also used for signing JAR files.
|
||||
|
||||
|
||||
<h2>Package Specification</h2>
|
||||
|
||||
The <code>java.util.jar</code> package is based on the following specifications:
|
||||
<ul>
|
||||
<li><b>Info-ZIP file format</b> - The JAR format is based on the Info-ZIP
|
||||
file format. See
|
||||
<a href="../zip/package-summary.html#package_description">java.util.zip
|
||||
package description.</a> <p>
|
||||
In JAR files, all file names must be encoded in the UTF-8 encoding.
|
||||
<li><a href="../../../../technotes/guides/jar/jar.html">
|
||||
Manifest and Signature Specification</a> - The manifest format specification.
|
||||
</ul>
|
||||
|
||||
<!--
|
||||
<h2>Related Documentation</h2>
|
||||
|
||||
For overviews, tutorials, examples, guides, and tool documentation, please see:
|
||||
<ul>
|
||||
<li><a href="">##### REFER TO NON-SPEC DOCUMENTATION HERE #####</a>
|
||||
</ul>
|
||||
-->
|
||||
|
||||
@since 1.2
|
||||
</body>
|
||||
</html>
|
52
jdk/src/java.base/share/classes/java/util/package-info.java
Normal file
52
jdk/src/java.base/share/classes/java/util/package-info.java
Normal file
@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Contains the collections framework, legacy collection classes,
|
||||
* event model, date and time facilities, internationalization, and
|
||||
* miscellaneous utility classes (a string tokenizer, a random-number
|
||||
* generator, and a bit array).
|
||||
*
|
||||
* <h2>Package Specification</h2>
|
||||
* <ul>
|
||||
* <li><a href="../../../technotes/guides/collections/overview.html"><b>Collections Framework Overview</b></a>
|
||||
* <li><a href="../../../technotes/guides/collections/reference.html"><b>
|
||||
* Collections Framework Annotated Outline</b></a>
|
||||
* </ul>
|
||||
*
|
||||
* <h2>Related Documentation</h2>
|
||||
* For overviews, tutorials, examples, guides, and tool documentation,
|
||||
* please see:
|
||||
* <ul>
|
||||
* <li><a href="http://docs.oracle.com/javase/tutorial/collections/index.html">
|
||||
* <b>Collections Framework Tutorial</b></a>
|
||||
* <li><a
|
||||
* href="../../../technotes/guides/collections/designfaq.html"><b>Collections
|
||||
* Framework Design FAQ</b></a>
|
||||
* </ul>
|
||||
*
|
||||
* @since 1.0
|
||||
*/
|
||||
package java.util;
|
@ -1,55 +0,0 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
|
||||
<html>
|
||||
<head>
|
||||
<!--
|
||||
Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
|
||||
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
|
||||
This code is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License version 2 only, as
|
||||
published by the Free Software Foundation. Oracle designates this
|
||||
particular file as subject to the "Classpath" exception as provided
|
||||
by Oracle in the LICENSE file that accompanied this code.
|
||||
|
||||
This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
version 2 for more details (a copy is included in the LICENSE file that
|
||||
accompanied this code).
|
||||
|
||||
You should have received a copy of the GNU General Public License version
|
||||
2 along with this work; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
or visit www.oracle.com if you need additional information or have any
|
||||
questions.
|
||||
-->
|
||||
|
||||
</head>
|
||||
<body bgcolor="white">
|
||||
|
||||
Contains the collections framework, legacy collection classes, event model,
|
||||
date and time facilities, internationalization, and miscellaneous utility
|
||||
classes (a string tokenizer, a random-number generator, and a bit array).
|
||||
|
||||
<h2>Package Specification</h2>
|
||||
<ul>
|
||||
<li><a href="../../../technotes/guides/collections/overview.html"><b>Collections Framework Overview</b></a>
|
||||
<li><a href="../../../technotes/guides/collections/reference.html"><b>
|
||||
Collections Framework Annotated Outline</b></a>
|
||||
</ul>
|
||||
|
||||
<h2>Related Documentation</h2>
|
||||
For overviews, tutorials, examples, guides, and tool documentation, please see:
|
||||
<ul>
|
||||
<li><a href="http://docs.oracle.com/javase/tutorial/collections/index.html">
|
||||
<b>Collections Framework Tutorial</b></a>
|
||||
<li><a
|
||||
href="../../../technotes/guides/collections/designfaq.html"><b>Collections
|
||||
Framework Design FAQ</b></a>
|
||||
</ul>
|
||||
|
||||
@since 1.0
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,56 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Classes for matching character sequences against patterns specified
|
||||
* by regular expressions.
|
||||
*
|
||||
* <p> An instance of the {@link java.util.regex.Pattern} class
|
||||
* represents a regular expression that is specified in string form in
|
||||
* a syntax similar to that used by Perl.
|
||||
*
|
||||
* <p> Instances of the {@link java.util.regex.Matcher} class are used
|
||||
* to match character sequences against a given pattern. Input is
|
||||
* provided to matchers via the {@link java.lang.CharSequence}
|
||||
* interface in order to support matching against characters from a
|
||||
* wide variety of input sources. </p>
|
||||
*
|
||||
* <p> Unless otherwise noted, passing a <tt>null</tt> argument to a
|
||||
* method in any class or interface in this package will cause a
|
||||
* {@link java.lang.NullPointerException NullPointerException} to be
|
||||
* thrown.
|
||||
*
|
||||
* <h2>Related Documentation</h2>
|
||||
*
|
||||
* <p> An excellent tutorial and overview of regular expressions is <a
|
||||
* href="http://www.oreilly.com/catalog/regex/"><i>Mastering Regular
|
||||
* Expressions</i>, Jeffrey E. F. Friedl, O'Reilly and Associates,
|
||||
* 1997.</a> </p>
|
||||
*
|
||||
* @since 1.4
|
||||
* @author Mike McCloskey
|
||||
* @author Mark Reinhold
|
||||
*/
|
||||
package java.util.regex;
|
@ -1,66 +0,0 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
|
||||
<html>
|
||||
<head>
|
||||
<!--
|
||||
Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
|
||||
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
|
||||
This code is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License version 2 only, as
|
||||
published by the Free Software Foundation. Oracle designates this
|
||||
particular file as subject to the "Classpath" exception as provided
|
||||
by Oracle in the LICENSE file that accompanied this code.
|
||||
|
||||
This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
version 2 for more details (a copy is included in the LICENSE file that
|
||||
accompanied this code).
|
||||
|
||||
You should have received a copy of the GNU General Public License version
|
||||
2 along with this work; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
or visit www.oracle.com if you need additional information or have any
|
||||
questions.
|
||||
-->
|
||||
|
||||
</head>
|
||||
<body bgcolor="white">
|
||||
|
||||
Classes for matching character sequences against patterns specified by regular
|
||||
expressions.
|
||||
|
||||
<p> An instance of the {@link java.util.regex.Pattern} class represents a
|
||||
regular expression that is specified in string form in a syntax similar to
|
||||
that used by Perl.
|
||||
|
||||
<p> Instances of the {@link java.util.regex.Matcher} class are used to match
|
||||
character sequences against a given pattern. Input is provided to matchers via
|
||||
the {@link java.lang.CharSequence} interface in order to support matching
|
||||
against characters from a wide variety of input sources. </p>
|
||||
|
||||
<p> Unless otherwise noted, passing a <tt>null</tt> argument to a method
|
||||
in any class or interface in this package will cause a
|
||||
{@link java.lang.NullPointerException NullPointerException} to be thrown.
|
||||
|
||||
<h2>Related Documentation</h2>
|
||||
|
||||
<p> An excellent tutorial and overview of regular expressions is <a
|
||||
href="http://www.oreilly.com/catalog/regex/"><i>Mastering Regular
|
||||
Expressions</i>, Jeffrey E. F. Friedl, O'Reilly and Associates, 1997.</a> </p>
|
||||
|
||||
<!--
|
||||
For overviews, tutorials, examples, guides, and tool documentation, please see:
|
||||
<ul>
|
||||
<li><a href="">##### REFER TO NON-SPEC DOCUMENTATION HERE #####</a>
|
||||
</ul>
|
||||
-->
|
||||
|
||||
@since 1.4
|
||||
@author Mike McCloskey
|
||||
@author Mark Reinhold
|
||||
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Service provider classes for the classes in the java.util package.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
package java.util.spi;
|
@ -1,50 +0,0 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
|
||||
<html>
|
||||
<head>
|
||||
<!--
|
||||
Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
|
||||
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
|
||||
This code is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License version 2 only, as
|
||||
published by the Free Software Foundation. Oracle designates this
|
||||
particular file as subject to the "Classpath" exception as provided
|
||||
by Oracle in the LICENSE file that accompanied this code.
|
||||
|
||||
This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
version 2 for more details (a copy is included in the LICENSE file that
|
||||
accompanied this code).
|
||||
|
||||
You should have received a copy of the GNU General Public License version
|
||||
2 along with this work; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
or visit www.oracle.com if you need additional information or have any
|
||||
questions.
|
||||
-->
|
||||
|
||||
</head>
|
||||
<body bgcolor="white">
|
||||
Service provider classes for the classes in the java.util package.
|
||||
<!--
|
||||
<h2>Package Specification</h2>
|
||||
|
||||
##### FILL IN ANY SPECS NEEDED BY JAVA COMPATIBILITY KIT #####
|
||||
<ul>
|
||||
<li><a href="">##### REFER TO ANY FRAMEMAKER SPECIFICATION HERE #####</a>
|
||||
</ul>
|
||||
|
||||
<h2>Related Documentation</h2>
|
||||
|
||||
For overviews, tutorials, examples, guides, and tool documentation, please see:
|
||||
<ul>
|
||||
<li><a href="">##### REFER TO NON-SPEC DOCUMENTATION HERE #####</a>
|
||||
</ul>
|
||||
-->
|
||||
|
||||
@since 1.6
|
||||
</body>
|
||||
</html>
|
@ -538,7 +538,7 @@ class ZipFile implements ZipConstants, Closeable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Return an ordered {@code Stream} over the ZIP file entries.
|
||||
* Returns an ordered {@code Stream} over the ZIP file entries.
|
||||
* Entries appear in the {@code Stream} in the order they appear in
|
||||
* the central directory of the ZIP file.
|
||||
*
|
||||
|
@ -0,0 +1,68 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Provides interfaces for Diffie-Hellman keys as defined in RSA
|
||||
* Laboratories' PKCS #3.
|
||||
*
|
||||
* <P>Note that these interfaces are intended only for key
|
||||
* implementations whose key material is accessible and
|
||||
* available. These interfaces are not intended for key implementations
|
||||
* whose key material resides in inaccessible, protected storage (such
|
||||
* as in a hardware device).
|
||||
*
|
||||
* <P>For more developer information on how to use these interfaces,
|
||||
* including information on how to design <code>Key</code> classes for
|
||||
* hardware devices, please refer to the cryptographic provider
|
||||
* developer guide:
|
||||
*
|
||||
* <ul>
|
||||
* <li><a href=
|
||||
* "{@docRoot}/../technotes/guides/security/crypto/HowToImplAProvider.html">
|
||||
* <b>How to Implement a Provider for the Java™ Cryptography Architecture
|
||||
* </b></a></li>
|
||||
* </ul>
|
||||
*
|
||||
* <h2>Package Specification</h2>
|
||||
*
|
||||
* <ul>
|
||||
* <li>PKCS #3: Diffie-Hellman Key-Agreement Standard, Version 1.4,
|
||||
* November 1993.</li>
|
||||
* </ul>
|
||||
*
|
||||
* <h2>Related Documentation</h2>
|
||||
*
|
||||
* For further documentation, please see:
|
||||
* <ul>
|
||||
* <li>
|
||||
* <a href=
|
||||
* "{@docRoot}/../technotes/guides/security/crypto/CryptoSpec.html">
|
||||
* <b>Java™ Cryptography Architecture API Specification and Reference
|
||||
* </b></a></li>
|
||||
* </ul>
|
||||
*
|
||||
* @since 1.4
|
||||
*/
|
||||
package javax.crypto.interfaces;
|
@ -1,74 +0,0 @@
|
||||
<!--
|
||||
Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
|
||||
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
|
||||
This code is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License version 2 only, as
|
||||
published by the Free Software Foundation. Oracle designates this
|
||||
particular file as subject to the "Classpath" exception as provided
|
||||
by Oracle in the LICENSE file that accompanied this code.
|
||||
|
||||
This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
version 2 for more details (a copy is included in the LICENSE file that
|
||||
accompanied this code).
|
||||
|
||||
You should have received a copy of the GNU General Public License version
|
||||
2 along with this work; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
or visit www.oracle.com if you need additional information or have any
|
||||
questions.
|
||||
-->
|
||||
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
|
||||
<html>
|
||||
|
||||
<body bgcolor="white">
|
||||
|
||||
Provides interfaces for Diffie-Hellman keys as defined in
|
||||
RSA Laboratories' PKCS #3.
|
||||
<P>
|
||||
Note that these interfaces are intended only
|
||||
for key implementations whose key material
|
||||
is accessible and available. These
|
||||
interfaces are not intended for key
|
||||
implementations whose key material resides
|
||||
in inaccessible, protected storage (such as
|
||||
in a hardware device).
|
||||
<P>
|
||||
For more developer information on how to use
|
||||
these interfaces, including information on
|
||||
how to design <code>Key</code> classes
|
||||
for hardware devices, please refer to the
|
||||
cryptographic provider developer guide:
|
||||
<ul>
|
||||
<li><a href=
|
||||
"{@docRoot}/../technotes/guides/security/crypto/HowToImplAProvider.html">
|
||||
<b>How to Implement a Provider for the Java™ Cryptography Architecture
|
||||
</b></a></li>
|
||||
</ul>
|
||||
|
||||
<h2>Package Specification</h2>
|
||||
|
||||
<ul>
|
||||
<li>PKCS #3: Diffie-Hellman Key-Agreement Standard, Version 1.4,
|
||||
November 1993.</li>
|
||||
</ul>
|
||||
|
||||
<h2>Related Documentation</h2>
|
||||
|
||||
For further documentation, please see:
|
||||
<ul>
|
||||
<li>
|
||||
<a href=
|
||||
"{@docRoot}/../technotes/guides/security/crypto/CryptoSpec.html">
|
||||
<b>Java™ Cryptography Architecture API Specification and Reference
|
||||
</b></a></li>
|
||||
</ul>
|
||||
|
||||
@since 1.4
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,68 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Provides the classes and interfaces for cryptographic
|
||||
* operations. The cryptographic operations defined in this package
|
||||
* include encryption, key generation and key agreement, and Message
|
||||
* Authentication Code (MAC) generation.
|
||||
*
|
||||
* <p>Support for encryption includes symmetric, asymmetric, block,
|
||||
* and stream ciphers. This package also supports secure streams and
|
||||
* sealed objects.
|
||||
*
|
||||
* <p>Many of the classes provided in this package are provider-based.
|
||||
* The class itself defines a programming interface to which
|
||||
* applications may write. The implementations themselves may then be
|
||||
* written by independent third-party vendors and plugged in
|
||||
* seamlessly as needed. Therefore application developers may take
|
||||
* advantage of any number of provider-based implementations without
|
||||
* having to add or rewrite code.
|
||||
*
|
||||
* <ul>
|
||||
* <li><a href="{@docRoot}/../technotes/guides/security/StandardNames.html">
|
||||
* <b>Java™ Cryptography Architecture Standard Algorithm Name
|
||||
* Documentation</b></a></li>
|
||||
* </ul>
|
||||
*
|
||||
* <h2>Related Documentation</h2>
|
||||
*
|
||||
* For further documentation, please see:
|
||||
* <ul>
|
||||
* <li>
|
||||
* <a href=
|
||||
* "{@docRoot}/../technotes/guides/security/crypto/CryptoSpec.html">
|
||||
* <b>Java™ Cryptography Architecture (JCA) Reference Guide
|
||||
* </b></a></li>
|
||||
* <li>
|
||||
* <a href=
|
||||
* "{@docRoot}/../technotes/guides/security/crypto/HowToImplAProvider.html">
|
||||
* <b>How to Implement a Provider in the Java™ Cryptography
|
||||
* Architecture </b></a></li>
|
||||
* </ul>
|
||||
*
|
||||
* @since 1.4
|
||||
*/
|
||||
package javax.crypto;
|
@ -1,76 +0,0 @@
|
||||
<!--
|
||||
Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
|
||||
This code is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License version 2 only, as
|
||||
published by the Free Software Foundation. Oracle designates this
|
||||
particular file as subject to the "Classpath" exception as provided
|
||||
by Oracle in the LICENSE file that accompanied this code.
|
||||
|
||||
This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
version 2 for more details (a copy is included in the LICENSE file that
|
||||
accompanied this code).
|
||||
|
||||
You should have received a copy of the GNU General Public License version
|
||||
2 along with this work; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
or visit www.oracle.com if you need additional information or have any
|
||||
questions.
|
||||
-->
|
||||
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
|
||||
<html>
|
||||
|
||||
<body bgcolor="white">
|
||||
|
||||
Provides the classes and interfaces for cryptographic operations. The
|
||||
cryptographic operations defined in this package include encryption,
|
||||
key generation and key agreement, and Message Authentication Code
|
||||
(MAC) generation.
|
||||
|
||||
<p>Support for encryption includes symmetric, asymmetric, block, and
|
||||
stream ciphers. This package also supports secure streams and sealed
|
||||
objects.
|
||||
|
||||
<p>Many of the classes provided in this package are provider-based. The
|
||||
class itself defines a programming interface to which applications may
|
||||
write. The implementations themselves may then be written by
|
||||
independent third-party vendors and plugged in seamlessly as needed.
|
||||
Therefore application developers may take advantage of any number of
|
||||
provider-based implementations without having to add or rewrite code.
|
||||
|
||||
<h2>Package Specification</h2>
|
||||
|
||||
<ul>
|
||||
<li><a href="{@docRoot}/../technotes/guides/security/StandardNames.html">
|
||||
<b>Java™
|
||||
Cryptography Architecture Standard Algorithm Name
|
||||
Documentation</b></a></li>
|
||||
</ul>
|
||||
|
||||
<h2>Related Documentation</h2>
|
||||
|
||||
For further documentation, please see:
|
||||
<ul>
|
||||
<li>
|
||||
<a href=
|
||||
"{@docRoot}/../technotes/guides/security/crypto/CryptoSpec.html">
|
||||
<b>Java™
|
||||
Cryptography Architecture (JCA) Reference Guide
|
||||
</b></a></li>
|
||||
<li>
|
||||
<a href=
|
||||
"{@docRoot}/../technotes/guides/security/crypto/HowToImplAProvider.html">
|
||||
<b>How to Implement a Provider in the
|
||||
Java™ Cryptography Architecture
|
||||
</b></a></li>
|
||||
</ul>
|
||||
|
||||
@since 1.4
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,74 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Provides classes and interfaces for key specifications and
|
||||
* algorithm parameter specifications.
|
||||
*
|
||||
* <p>A key specification is a transparent representation of the key
|
||||
* material that constitutes a key. A key may be specified in an
|
||||
* algorithm-specific way, or in an algorithm-independent encoding
|
||||
* format (such as ASN.1). This package contains key specifications
|
||||
* for Diffie-Hellman public and private keys, as well as key
|
||||
* specifications for DES, Triple DES, and PBE secret keys.
|
||||
*
|
||||
* <p>An algorithm parameter specification is a transparent
|
||||
* representation of the sets of parameters used with an
|
||||
* algorithm. This package contains algorithm parameter specifications
|
||||
* for parameters used with the Diffie-Hellman, DES, Triple DES, PBE,
|
||||
* RC2 and RC5 algorithms.
|
||||
*
|
||||
*
|
||||
* <ul>
|
||||
* <li>PKCS #3: Diffie-Hellman Key-Agreement Standard, Version 1.4,
|
||||
* November 1993.</li>
|
||||
* <li>PKCS #5: Password-Based Encryption Standard, Version 1.5,
|
||||
* November 1993.</li>
|
||||
* <li>Federal Information Processing Standards Publication (FIPS PUB) 46-2:
|
||||
* Data Encryption Standard (DES) </li>
|
||||
* </ul>
|
||||
*
|
||||
* <h2>Related Documentation</h2>
|
||||
*
|
||||
* For documentation that includes information about algorithm
|
||||
* parameter and key specifications, please see:
|
||||
*
|
||||
* <ul>
|
||||
* <li>
|
||||
* <a href=
|
||||
* "{@docRoot}/../technotes/guides/security/crypto/CryptoSpec.html">
|
||||
* <b>Java™ Cryptography Architecture API Specification and Reference
|
||||
* </b></a></li>
|
||||
* <li>
|
||||
* <a href=
|
||||
* "{@docRoot}/../technotes/guides/security/crypto/HowToImplAProvider.html">
|
||||
* <b>How to Implement a Provider for the
|
||||
* Java™ Cryptography Architecture
|
||||
* </b></a></li>
|
||||
* </ul>
|
||||
*
|
||||
* @since 1.4
|
||||
*/
|
||||
package javax.crypto.spec;
|
@ -1,77 +0,0 @@
|
||||
<!--
|
||||
Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
|
||||
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
|
||||
This code is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License version 2 only, as
|
||||
published by the Free Software Foundation. Oracle designates this
|
||||
particular file as subject to the "Classpath" exception as provided
|
||||
by Oracle in the LICENSE file that accompanied this code.
|
||||
|
||||
This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
version 2 for more details (a copy is included in the LICENSE file that
|
||||
accompanied this code).
|
||||
|
||||
You should have received a copy of the GNU General Public License version
|
||||
2 along with this work; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
or visit www.oracle.com if you need additional information or have any
|
||||
questions.
|
||||
-->
|
||||
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
|
||||
<html>
|
||||
|
||||
<body bgcolor="white">
|
||||
|
||||
Provides classes and interfaces for key specifications and algorithm
|
||||
parameter specifications.
|
||||
|
||||
<p>A key specification is a transparent representation of the key
|
||||
material that constitutes a key. A key may be specified in an
|
||||
algorithm-specific way, or in an algorithm-independent encoding format
|
||||
(such as ASN.1). This package contains key specifications for
|
||||
Diffie-Hellman public and private keys, as well as key specifications for DES,
|
||||
Triple DES, and PBE secret keys.
|
||||
|
||||
<p>An algorithm parameter specification is a transparent representation
|
||||
of the sets of parameters used with an algorithm. This package contains
|
||||
algorithm parameter specifications for parameters used with the
|
||||
Diffie-Hellman, DES, Triple DES, PBE, RC2 and RC5 algorithms.
|
||||
|
||||
<h2>Package Specification</h2>
|
||||
|
||||
<ul>
|
||||
<li>PKCS #3: Diffie-Hellman Key-Agreement Standard, Version 1.4,
|
||||
November 1993.</li>
|
||||
<li>PKCS #5: Password-Based Encryption Standard, Version 1.5,
|
||||
November 1993.</li>
|
||||
<li>Federal Information Processing Standards Publication (FIPS PUB) 46-2:
|
||||
Data Encryption Standard (DES) </li>
|
||||
</ul>
|
||||
|
||||
<h2>Related Documentation</h2>
|
||||
|
||||
For documentation that includes information about algorithm parameter
|
||||
and key specifications, please see:
|
||||
<ul>
|
||||
<li>
|
||||
<a href=
|
||||
"{@docRoot}/../technotes/guides/security/crypto/CryptoSpec.html">
|
||||
<b>Java™ Cryptography Architecture API Specification and Reference
|
||||
</b></a></li>
|
||||
<li>
|
||||
<a href=
|
||||
"{@docRoot}/../technotes/guides/security/crypto/HowToImplAProvider.html">
|
||||
<b>How to Implement a Provider for the
|
||||
Java™ Cryptography Architecture
|
||||
</b></a></li>
|
||||
</ul>
|
||||
|
||||
@since 1.4
|
||||
</body>
|
||||
</html>
|
33
jdk/src/java.base/share/classes/javax/net/package-info.java
Normal file
33
jdk/src/java.base/share/classes/javax/net/package-info.java
Normal file
@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Provides classes for networking applications. These classes include
|
||||
* factories for creating sockets. Using socket factories you can
|
||||
* encapsulate socket creation and configuration behavior.
|
||||
*
|
||||
* @since 1.4
|
||||
*/
|
||||
package javax.net;
|
@ -1,54 +0,0 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
|
||||
<html>
|
||||
<head>
|
||||
<!--
|
||||
Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved.
|
||||
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
|
||||
This code is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License version 2 only, as
|
||||
published by the Free Software Foundation. Oracle designates this
|
||||
particular file as subject to the "Classpath" exception as provided
|
||||
by Oracle in the LICENSE file that accompanied this code.
|
||||
|
||||
This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
version 2 for more details (a copy is included in the LICENSE file that
|
||||
accompanied this code).
|
||||
|
||||
You should have received a copy of the GNU General Public License version
|
||||
2 along with this work; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
or visit www.oracle.com if you need additional information or have any
|
||||
questions.
|
||||
-->
|
||||
|
||||
</head>
|
||||
<body bgcolor="white">
|
||||
|
||||
Provides classes for networking applications. These classes include
|
||||
factories for creating sockets. Using socket factories you can encapsulate
|
||||
socket creation and configuration behavior.
|
||||
<!--
|
||||
<h2>Package Specification</h2>
|
||||
|
||||
##### FILL IN ANY SPECS NEEDED BY JAVA COMPATIBILITY KIT #####
|
||||
<ul>
|
||||
<li><a href="">##### REFER TO ANY FRAMEMAKER SPECIFICATION HERE #####</a>
|
||||
</ul>
|
||||
|
||||
<h2>Related Documentation</h2>
|
||||
|
||||
For overviews, tutorials, examples, guides, and tool documentation, please see:
|
||||
<ul>
|
||||
<li><a href="">##### REFER TO NON-SPEC DOCUMENTATION HERE #####</a>
|
||||
</ul>
|
||||
|
||||
-->
|
||||
|
||||
@since 1.4
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,41 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Provides classes for the secure socket package. Using the secure
|
||||
* socket classes, you can communicate using SSL or a related security
|
||||
* protocol to reliably detect any errors introduced into the network
|
||||
* byte stream and to optionally encrypt the data and/or authenticate
|
||||
* the communicating peers.
|
||||
*
|
||||
* <ul>
|
||||
* <li><a href="{@docRoot}/../technotes/guides/security/StandardNames.html">
|
||||
* <b>Java™ Cryptography Architecture Standard Algorithm Name
|
||||
* Documentation</b></a></li>
|
||||
* </ul>
|
||||
*
|
||||
* @since 1.4
|
||||
*/
|
||||
package javax.net.ssl;
|
@ -1,57 +0,0 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
|
||||
<html>
|
||||
<head>
|
||||
<!--
|
||||
Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
|
||||
This code is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License version 2 only, as
|
||||
published by the Free Software Foundation. Oracle designates this
|
||||
particular file as subject to the "Classpath" exception as provided
|
||||
by Oracle in the LICENSE file that accompanied this code.
|
||||
|
||||
This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
version 2 for more details (a copy is included in the LICENSE file that
|
||||
accompanied this code).
|
||||
|
||||
You should have received a copy of the GNU General Public License version
|
||||
2 along with this work; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
or visit www.oracle.com if you need additional information or have any
|
||||
questions.
|
||||
-->
|
||||
|
||||
</head>
|
||||
<body bgcolor="white">
|
||||
|
||||
Provides classes for the secure socket package. Using the secure socket
|
||||
classes, you can communicate using SSL or a related security protocol
|
||||
to reliably detect any errors introduced into the network byte stream
|
||||
and to optionally encrypt the data and/or authenticate the communicating peers.
|
||||
|
||||
<h2>Package Specification</h2>
|
||||
|
||||
<ul>
|
||||
<li><a href="{@docRoot}/../technotes/guides/security/StandardNames.html">
|
||||
<b>Java™ Cryptography Architecture Standard Algorithm Name
|
||||
Documentation</b></a></li>
|
||||
</ul>
|
||||
|
||||
<!--
|
||||
<h2>Related Documentation</h2>
|
||||
|
||||
For overviews, tutorials, examples, guides, and tool documentation, please see:
|
||||
<ul>
|
||||
<li><a href="">##### REFER TO NON-SPEC DOCUMENTATION HERE #####</a>
|
||||
</ul>
|
||||
|
||||
-->
|
||||
|
||||
@since 1.4
|
||||
</body>
|
||||
</html>
|
@ -162,8 +162,8 @@ public abstract class Parser {
|
||||
* Possible character type values are:<br> - 0 for underscore ('_') or any
|
||||
* lower and upper case alphabetical character value;<br> - 1 for colon
|
||||
* (':') character;<br> - 2 for dash ('-') and dot ('.') or any decimal
|
||||
* digit character value;<br> - 3 for any kind of white space character<br
|
||||
* /> An ASCII (7 bit) character which does not fall in any category listed
|
||||
* digit character value;<br> - 3 for any kind of white space character<br>
|
||||
* An ASCII (7 bit) character which does not fall in any category listed
|
||||
* above is mapped to 0xff.
|
||||
*/
|
||||
private static final byte nmttyp[];
|
||||
|
@ -1,187 +0,0 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<!--
|
||||
|
||||
Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved.
|
||||
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
|
||||
This code is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License version 2 only, as
|
||||
published by the Free Software Foundation. Oracle designates this
|
||||
particular file as subject to the "Classpath" exception as provided
|
||||
by Oracle in the LICENSE file that accompanied this code.
|
||||
|
||||
This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
version 2 for more details (a copy is included in the LICENSE file that
|
||||
accompanied this code).
|
||||
|
||||
You should have received a copy of the GNU General Public License version
|
||||
2 along with this work; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
or visit www.oracle.com if you need additional information or have any
|
||||
questions.
|
||||
|
||||
-->
|
||||
</HEAD>
|
||||
<BODY BGCOLOR="white">
|
||||
<P>
|
||||
|
||||
<B> Licensee impact of JDK 1.4 reflection changes </B>
|
||||
|
||||
</P>
|
||||
<P>
|
||||
|
||||
Sun's JDK 1.4 contains a new implementation of java.lang.reflect which
|
||||
offers substantially higher performance than previous JDKs' native
|
||||
code. Licensees can at their discretion port these changes. There are
|
||||
no public API or documentation changes associated with the new
|
||||
reflection implementation aside from a few minor clarifications in the
|
||||
specifications of Method.invoke(), Constructor.newInstance(), and a
|
||||
few methods in java.lang.reflect.Field.
|
||||
|
||||
</P>
|
||||
<P>
|
||||
|
||||
The bulk of the new implementation is Java programming language code
|
||||
which generates bytecodes, and is therefore portable. If licensees
|
||||
desire to port it, the following JVM changes are required:
|
||||
|
||||
<OL>
|
||||
<LI> The following four new JVM entry points must be added:
|
||||
|
||||
<UL>
|
||||
<LI> JVM_GetClassDeclaredConstructors
|
||||
<LI> JVM_GetClassDeclaredFields
|
||||
<LI> JVM_GetClassDeclaredMethods
|
||||
<LI> JVM_GetClassAccessFlags
|
||||
</UL>
|
||||
|
||||
The first three return the declared constructors, fields, and methods
|
||||
for a given class, with an option to return only the public ones. They
|
||||
are similar in functionality to the earlier GetClassConstructors,
|
||||
GetClassFields, and GetClassMethods. JVM_GetClassDeclaredFields and
|
||||
JVM_GetClassDeclaredMethods must intern the Strings for the names of
|
||||
the Field and Method objects returned. The fouth returns the access
|
||||
flags for a given class as marked in the class file, as opposed to in
|
||||
the InnerClasses attribute if the class is an inner class, and
|
||||
therefore differs from JVM_GetClassModifiers for inner classes (most
|
||||
importantly, protected inner classes; see 4471811.)
|
||||
|
||||
<LI> The JVM's link resolver must be modified to allow all field and
|
||||
method references from subclasses of sun.reflect.MagicAccessorImpl to
|
||||
any other class (even to private members of other classes) to
|
||||
succeed. This allows setAccessible() and its associated checks to be
|
||||
implemented in Java.
|
||||
|
||||
<LI> The code which calls the verifier must skip verification for all
|
||||
subclasses of sun.reflect.MagicAccessorImpl. (It was originally
|
||||
intended that only a subset of the stub classes used for serialization
|
||||
would not pass the verifier, specifically, those subclassing
|
||||
SerializationConstructorAccessorImpl; see 4486457 for a case where
|
||||
this does not work.)
|
||||
|
||||
<LI> The stack walker for security checks must be modified to skip not
|
||||
only all Method.invoke() frames, but also any frames for which the
|
||||
class is a subclass of sun.reflect.MethodAccessorImpl.
|
||||
|
||||
<LI> The JVM entry points JVM_InvokeMethod and
|
||||
JVM_NewInstanceFromConstructor are currently still used because the
|
||||
first invocation of the bytecode-based reflection is currently slower
|
||||
than the original native code. The security checks they perform can,
|
||||
however, be disabled, as they are now performed by Java programming
|
||||
language code.
|
||||
|
||||
</OL>
|
||||
|
||||
</P>
|
||||
<P>
|
||||
|
||||
The following changes were discovered to be necessary for backward
|
||||
compatibility with certain applications (see bug 4474172):
|
||||
|
||||
<OL>
|
||||
|
||||
<LI> The existing JVM entry point JVM_LatestUserDefinedLoader
|
||||
(typically used in applications which rely on the 1.1 security
|
||||
framework) must skip reflection-related frames in its stack walk:
|
||||
specifically all frames associated with subclasses of
|
||||
sun.reflect.MethodAccessorImpl and
|
||||
sun.reflect.ConstructorAccessorImpl.
|
||||
|
||||
<LI> The new reflection implementation can cause class loading to
|
||||
occur in previously-unexpected places (namely during reflective
|
||||
calls). This can cause class loaders which contain subtle bugs to
|
||||
break. In general it is not possible to guarantee complete backward
|
||||
bug compatibility, but one kind of bug has been observed more than
|
||||
once: the inability of a user-defined loader to handle delegation to
|
||||
it for a class it has already loaded. The new reflection
|
||||
implementation is predicated on delegation working properly, as it
|
||||
loads stub classes into newly-fabricated class loaders of type
|
||||
sun.reflect.DelegatingClassLoader, one stub class per loader, to allow
|
||||
unloading of the stub classes to occur more quickly. To handle this
|
||||
kind of bug, the JVM's internal class lookup mechanism must be
|
||||
slightly modified to check for instances of
|
||||
sun.reflect.DelegatingClassLoader as the incoming class loader and
|
||||
silently traverse the "parent" field once for such loaders before
|
||||
entering the bulk of the resolution code. This avoids an upcall to
|
||||
Java programming language code which certain loaders can not handle.
|
||||
|
||||
</OL>
|
||||
|
||||
</P>
|
||||
<P>
|
||||
|
||||
The following JVM entry points may be deleted:
|
||||
|
||||
<UL>
|
||||
<LI> JVM_GetClassFields
|
||||
<LI> JVM_GetClassMethods
|
||||
<LI> JVM_GetClassConstructors
|
||||
<LI> JVM_GetClassField
|
||||
<LI> JVM_GetClassMethod
|
||||
<LI> JVM_GetClassConstructor
|
||||
<LI> JVM_NewInstance
|
||||
<LI> JVM_GetField
|
||||
<LI> JVM_GetPrimitiveField
|
||||
<LI> JVM_SetField
|
||||
<LI> JVM_SetPrimitiveField
|
||||
</UL>
|
||||
|
||||
</P>
|
||||
<P>
|
||||
|
||||
To keep using the previous reflection implementation, licensees should
|
||||
not take changes from Sun's JDK 1.4 relating specifically to the
|
||||
implementation of reflection in the following classes/methods and
|
||||
any associated native code:
|
||||
|
||||
<UL>
|
||||
<LI> java.lang.Class.newInstance0
|
||||
<LI> java.lang.Class.getClassLoader0
|
||||
<LI> java.lang.Class.getFields
|
||||
<LI> java.lang.Class.getMethods
|
||||
<LI> java.lang.Class.getDeclaredFields
|
||||
<LI> java.lang.Class.getDeclaredMethods
|
||||
<LI> java.lang.Class.getFields0
|
||||
<LI> java.lang.Class.getMethods0
|
||||
<LI> java.lang.Class.getConstructors0
|
||||
<LI> java.lang.Class.getField0
|
||||
<LI> java.lang.Class.getMethod0
|
||||
<LI> java.lang.Class.getConstructor0
|
||||
<LI> java.lang.ClassLoader.getCallerClassLoader
|
||||
<LI> java.lang.System.getCallerClass
|
||||
<LI> java.lang.reflect.AccessibleObject
|
||||
<LI> java.lang.reflect.Constructor
|
||||
<LI> java.lang.reflect.Field
|
||||
<LI> java.lang.reflect.Method
|
||||
<LI> java.lang.reflect.Modifier
|
||||
<LI> sun.misc.ClassReflector
|
||||
</UL>
|
||||
|
||||
</P>
|
||||
</HTML>
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -278,7 +278,6 @@ public class PolicyFile extends java.security.Policy {
|
||||
private boolean constructed = false;
|
||||
|
||||
private boolean expandProperties = true;
|
||||
private boolean ignoreIdentityScope = true;
|
||||
private boolean allowSystemProperties = true;
|
||||
private boolean notUtf8 = false;
|
||||
private URL url;
|
||||
@ -415,8 +414,6 @@ public class PolicyFile extends java.security.Policy {
|
||||
public String run() {
|
||||
expandProperties = "true".equalsIgnoreCase
|
||||
(Security.getProperty("policy.expandProperties"));
|
||||
ignoreIdentityScope = "true".equalsIgnoreCase
|
||||
(Security.getProperty("policy.ignoreIdentityScope"));
|
||||
allowSystemProperties = "true".equalsIgnoreCase
|
||||
(Security.getProperty("policy.allowSystemProperty"));
|
||||
notUtf8 = "false".equalsIgnoreCase
|
||||
@ -1206,31 +1203,6 @@ public class PolicyFile extends java.security.Policy {
|
||||
addPermissions(perms, cs, principals, entry);
|
||||
}
|
||||
|
||||
// Go through policyEntries gotten from identity db; sync required
|
||||
// because checkForTrustedIdentity (below) might update list
|
||||
synchronized (pi.identityPolicyEntries) {
|
||||
for (PolicyEntry entry : pi.identityPolicyEntries) {
|
||||
addPermissions(perms, cs, principals, entry);
|
||||
}
|
||||
}
|
||||
|
||||
// now see if any of the keys are trusted ids.
|
||||
if (!ignoreIdentityScope) {
|
||||
Certificate certs[] = cs.getCertificates();
|
||||
if (certs != null) {
|
||||
for (int k=0; k < certs.length; k++) {
|
||||
Object idMap = pi.aliasMapping.get(certs[k]);
|
||||
if (idMap == null &&
|
||||
checkForTrustedIdentity(certs[k], pi)) {
|
||||
// checkForTrustedIdentity added it
|
||||
// to the policy for us. next time
|
||||
// around we'll find it. This time
|
||||
// around we need to add it.
|
||||
perms.add(SecurityConstants.ALL_PERMISSION);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return perms;
|
||||
}
|
||||
|
||||
@ -1620,7 +1592,7 @@ public class PolicyFile extends java.security.Policy {
|
||||
* associated with the given code source.
|
||||
*
|
||||
* The signer certificates are those certificates that were used
|
||||
* to verifysigned code originating from the codesource location.
|
||||
* to verify signed code originating from the codesource location.
|
||||
*
|
||||
* This method assumes that in the given code source, each signer
|
||||
* certificate is followed by its supporting certificate chain
|
||||
@ -1916,17 +1888,6 @@ public class PolicyFile extends java.security.Policy {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks public key. If it is marked as trusted in
|
||||
* the identity database, add it to the policy
|
||||
* with the AllPermission.
|
||||
*/
|
||||
private boolean checkForTrustedIdentity(final Certificate cert,
|
||||
PolicyInfo myInfo)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Each entry in the policy configuration file is represented by a
|
||||
* PolicyEntry object. <p>
|
||||
@ -2282,10 +2243,6 @@ public class PolicyFile extends java.security.Policy {
|
||||
// Stores grant entries in the policy
|
||||
final List<PolicyEntry> policyEntries;
|
||||
|
||||
// Stores grant entries gotten from identity database
|
||||
// Use separate lists to avoid sync on policyEntries
|
||||
final List<PolicyEntry> identityPolicyEntries;
|
||||
|
||||
// Maps aliases to certs
|
||||
final Map<Object, Object> aliasMapping;
|
||||
|
||||
@ -2295,8 +2252,6 @@ public class PolicyFile extends java.security.Policy {
|
||||
|
||||
PolicyInfo(int numCaches) {
|
||||
policyEntries = new ArrayList<>();
|
||||
identityPolicyEntries =
|
||||
Collections.synchronizedList(new ArrayList<PolicyEntry>(2));
|
||||
aliasMapping = Collections.synchronizedMap(new HashMap<>(11));
|
||||
|
||||
pdMapping = new ProtectionDomainCache[numCaches];
|
||||
|
@ -179,7 +179,8 @@ policy.allowSystemProperty=true
|
||||
|
||||
# whether or not we look into the IdentityScope for trusted Identities
|
||||
# when encountering a 1.1 signed JAR file. If the identity is found
|
||||
# and is trusted, we grant it AllPermission.
|
||||
# and is trusted, we grant it AllPermission. Note: the default policy
|
||||
# provider (sun.security.provider.PolicyFile) does not support this property.
|
||||
policy.ignoreIdentityScope=false
|
||||
|
||||
#
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -46,6 +46,7 @@
|
||||
|
||||
|
||||
#ifdef JAVA_ARGS
|
||||
#define HAS_JAVA_ARGS JNI_TRUE
|
||||
static const char* const_progname = "java";
|
||||
static const char* const_jargs[] = JAVA_ARGS;
|
||||
/*
|
||||
@ -58,6 +59,7 @@ static const char* const_jargs[] = JAVA_ARGS;
|
||||
#endif /* APP_CLASSPATH */
|
||||
static const char* const_appclasspath[] = APP_CLASSPATH;
|
||||
#else /* !JAVA_ARGS */
|
||||
#define HAS_JAVA_ARGS JNI_FALSE
|
||||
#ifdef PROGNAME
|
||||
static const char* const_progname = PROGNAME;
|
||||
#else
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -129,6 +129,6 @@ main(int argc, char **argv)
|
||||
DOT_VERSION,
|
||||
(const_progname != NULL) ? const_progname : *margv,
|
||||
(const_launcher != NULL) ? const_launcher : *margv,
|
||||
(const_jargs != NULL) ? JNI_TRUE : JNI_FALSE,
|
||||
HAS_JAVA_ARGS,
|
||||
const_cpwildcard, const_javaw, const_ergo_class);
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -23,6 +23,9 @@
|
||||
* questions.
|
||||
*/
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <limits.h>
|
||||
|
||||
#include "jni.h"
|
||||
#include "jni_util.h"
|
||||
#include "jlong.h"
|
||||
@ -32,9 +35,6 @@
|
||||
|
||||
#include "java_io_FileInputStream.h"
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <limits.h>
|
||||
|
||||
#include "io_util_md.h"
|
||||
|
||||
/*******************************************************************/
|
||||
|
@ -111,7 +111,7 @@ Java_java_lang_System_identityHashCode(JNIEnv *env, jobject this, jobject x)
|
||||
#ifndef VENDOR /* Third party may overwrite this. */
|
||||
#define VENDOR "Oracle Corporation"
|
||||
#define VENDOR_URL "http://java.oracle.com/"
|
||||
#define VENDOR_URL_BUG "http://bugreport.sun.com/bugreport/"
|
||||
#define VENDOR_URL_BUG "http://bugreport.java.com/bugreport/"
|
||||
#endif
|
||||
|
||||
#define JAVA_MAX_SUPPORTED_VERSION 52
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -58,9 +58,9 @@ JDK_GetVersionInfo0(jdk_version_info* info, size_t info_size) {
|
||||
/* If the JDK_BUILD_NUMBER is of format bXX and XX is an integer
|
||||
* XX is the jdk_build_number.
|
||||
*/
|
||||
int len = strlen(jdk_build_string);
|
||||
size_t len = strlen(jdk_build_string);
|
||||
if (jdk_build_string[0] == 'b' && len >= 2) {
|
||||
int i = 0;
|
||||
size_t i = 0;
|
||||
for (i = 1; i < len; i++) {
|
||||
if (isdigit(jdk_build_string[i])) {
|
||||
build_number[i-1] = jdk_build_string[i];
|
||||
@ -76,7 +76,7 @@ JDK_GetVersionInfo0(jdk_version_info* info, size_t info_size) {
|
||||
}
|
||||
}
|
||||
|
||||
assert(jdk_build_number >= 0 && jdk_build_number <= 255);
|
||||
assert(jdk_build_number <= 255);
|
||||
|
||||
if (strlen(jdk_update_string) == 2 || strlen(jdk_update_string) == 3) {
|
||||
if (isdigit(jdk_update_string[0]) && isdigit(jdk_update_string[1])) {
|
||||
|
@ -157,7 +157,7 @@ JNU_ThrowByNameWithLastError(JNIEnv *env, const char *name,
|
||||
const char *defaultDetail)
|
||||
{
|
||||
char buf[256];
|
||||
int n = getLastErrorString(buf, sizeof(buf));
|
||||
size_t n = getLastErrorString(buf, sizeof(buf));
|
||||
|
||||
if (n > 0) {
|
||||
jstring s = JNU_NewStringPlatform(env, buf);
|
||||
@ -448,7 +448,7 @@ getString8859_1Chars(JNIEnv *env, jstring jstr)
|
||||
static jstring
|
||||
newString646_US(JNIEnv *env, const char *str)
|
||||
{
|
||||
int len = strlen(str);
|
||||
int len = (int)strlen(str);
|
||||
jchar buf[512];
|
||||
jchar *str1;
|
||||
jstring result;
|
||||
|
@ -286,12 +286,14 @@ releaseBytes(JNIEnv *env, jbyteArray arr, const char* parr)
|
||||
(*env)->ReleaseByteArrayElements(env, arr, (jbyte*) parr, JNI_ABORT);
|
||||
}
|
||||
|
||||
#define IOE_FORMAT "error=%d, %s"
|
||||
|
||||
static void
|
||||
throwIOException(JNIEnv *env, int errnum, const char *defaultDetail)
|
||||
{
|
||||
static const char * const format = "error=%d, %s";
|
||||
const char *detail = defaultDetail;
|
||||
char *errmsg;
|
||||
size_t fmtsize;
|
||||
jstring s;
|
||||
|
||||
if (errnum != 0) {
|
||||
@ -300,11 +302,12 @@ throwIOException(JNIEnv *env, int errnum, const char *defaultDetail)
|
||||
detail = s;
|
||||
}
|
||||
/* ASCII Decimal representation uses 2.4 times as many bits as binary. */
|
||||
errmsg = NEW(char, strlen(format) + strlen(detail) + 3 * sizeof(errnum));
|
||||
fmtsize = sizeof(IOE_FORMAT) + strlen(detail) + 3 * sizeof(errnum);
|
||||
errmsg = NEW(char, fmtsize);
|
||||
if (errmsg == NULL)
|
||||
return;
|
||||
|
||||
sprintf(errmsg, format, errnum, detail);
|
||||
snprintf(errmsg, fmtsize, IOE_FORMAT, errnum, detail);
|
||||
s = JNU_NewStringPlatform(env, errmsg);
|
||||
if (s != NULL) {
|
||||
jobject x = JNU_NewObjectByName(env, "java/io/IOException",
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -735,10 +735,10 @@ getGMTOffsetID()
|
||||
local_tm = localtime(&clock);
|
||||
if (local_tm->tm_gmtoff >= 0) {
|
||||
offset = (time_t) local_tm->tm_gmtoff;
|
||||
sign = "+";
|
||||
sign = '+';
|
||||
} else {
|
||||
offset = (time_t) -local_tm->tm_gmtoff;
|
||||
sign = "-";
|
||||
sign = '-';
|
||||
}
|
||||
sprintf(buf, (const char *)"GMT%c%02d:%02d",
|
||||
sign, (int)(offset/3600), (int)((offset%3600)/60));
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -47,7 +47,7 @@ Java_jdk_internal_jimage_concurrent_ConcurrentPReader_pread(JNIEnv *env, jclass
|
||||
DWORD nread;
|
||||
BOOL result;
|
||||
|
||||
jlong handle = (*env)->GetLongField(env, fdo, handle_fdID);
|
||||
HANDLE handle = (HANDLE)(*env)->GetLongField(env, fdo, handle_fdID);
|
||||
void *buf = (void *)jlong_to_ptr(address);
|
||||
|
||||
ZeroMemory(&ov, sizeof(ov));
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -90,7 +90,7 @@ win32Error(JNIEnv *env, const WCHAR *functionName)
|
||||
CP_UTF8,
|
||||
0,
|
||||
utf16_javaMessage,
|
||||
n, /*by creation n <= MESSAGE_LENGTH*/
|
||||
(int)n, /*by creation n <= MESSAGE_LENGTH*/
|
||||
utf8_javaMessage,
|
||||
MESSAGE_LENGTH*2,
|
||||
NULL,
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -345,6 +345,8 @@ SetupI18nProps(LCID lcid, char** language, char** script, char** country,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// GetVersionEx is deprecated; disable the warning until a replacement is found
|
||||
#pragma warning(disable : 4996)
|
||||
java_props_t *
|
||||
GetJavaProperties(JNIEnv* env)
|
||||
{
|
||||
@ -680,5 +682,5 @@ GetJavaProperties(JNIEnv* env)
|
||||
jstring
|
||||
GetStringPlatform(JNIEnv *env, nchar* wcstr)
|
||||
{
|
||||
return (*env)->NewString(env, wcstr, wcslen(wcstr));
|
||||
return (*env)->NewString(env, wcstr, (jsize)wcslen(wcstr));
|
||||
}
|
||||
|
@ -124,9 +124,9 @@ getLastErrorString(char *utf8_jvmErrorMsg, size_t cbErrorMsg)
|
||||
CP_UTF8,
|
||||
0,
|
||||
utf16_osErrorMsg,
|
||||
n,
|
||||
(int)n,
|
||||
utf8_jvmErrorMsg,
|
||||
cbErrorMsg,
|
||||
(int)cbErrorMsg,
|
||||
NULL,
|
||||
NULL);
|
||||
|
||||
|
@ -1040,7 +1040,7 @@ public class CNCtx implements javax.naming.Context {
|
||||
|
||||
/**
|
||||
* Allow access to the name parser object.
|
||||
* @param String JNDI name, is ignored since there is only one Name
|
||||
* @param name JNDI name, is ignored since there is only one Name
|
||||
* Parser object.
|
||||
* @exception NamingException --
|
||||
* @return NameParser object
|
||||
@ -1051,7 +1051,7 @@ public class CNCtx implements javax.naming.Context {
|
||||
|
||||
/**
|
||||
* Allow access to the name parser object.
|
||||
* @param Name JNDI name, is ignored since there is only one Name
|
||||
* @param name JNDI name, is ignored since there is only one Name
|
||||
* Parser object.
|
||||
* @exception NamingException --
|
||||
* @return NameParser object
|
||||
@ -1088,7 +1088,7 @@ public class CNCtx implements javax.naming.Context {
|
||||
* Record change but do not reinitialize ORB.
|
||||
*
|
||||
* @param propName The property name.
|
||||
* @param propVal The ORB.
|
||||
* @param propValue The ORB.
|
||||
* @return the previous value of this property if any.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
|
@ -35,32 +35,36 @@ import com.sun.jndi.toolkit.url.UrlUtil;
|
||||
* Extract components of a "corbaname" URL.
|
||||
*
|
||||
* The format of an corbaname URL is defined in INS 99-12-03 as follows.
|
||||
*<p>
|
||||
* <pre>{@code
|
||||
* corbaname url = "corbaname:" <corbaloc_obj> ["#" <string_name>]
|
||||
* corbaloc_obj = <obj_addr_list> ["/" <key_string>]
|
||||
* obj_addr_list = as defined in a corbaloc URL
|
||||
* key_string = as defined in a corbaloc URL
|
||||
* string_name = stringified COS name | empty_string
|
||||
*<p>
|
||||
* Characters in <string_name> are escaped as follows.
|
||||
* }</pre>
|
||||
* Characters in {@code <string_name>} are escaped as follows.
|
||||
* US-ASCII alphanumeric characters are not escaped. Any characters outside
|
||||
* of this range are escaped except for the following:
|
||||
* <pre>{@code
|
||||
* ; / : ? @ & = + $ , - _ . ! ~ * ; ( )
|
||||
* }</pre>
|
||||
* Escaped characters is escaped by using a % followed by its 2 hexadecimal
|
||||
* numbers representing the octet.
|
||||
*<p>
|
||||
* <p>
|
||||
* The corbaname URL is parsed into two parts: a corbaloc URL and a COS name.
|
||||
* The corbaloc URL is constructed by concatenation "corbaloc:" with
|
||||
* <corbaloc_obj>.
|
||||
* The COS name is <string_name> with the escaped characters resolved.
|
||||
*<p>
|
||||
* The corbaloc URL is constructed by concatenation {@code "corbaloc:"} with
|
||||
* {@code <corbaloc_obj>}.
|
||||
* The COS name is {@code <string_name>} with the escaped characters resolved.
|
||||
* <p>
|
||||
* A corbaname URL is resolved by:
|
||||
*<ol>
|
||||
*<li>Construct a corbaloc URL by concatenating "corbaloc:" and <corbaloc_obj>.
|
||||
*<li>Resolve the corbaloc URL to a NamingContext by using
|
||||
* <ol>
|
||||
* <li>Construct a corbaloc URL by concatenating {@code "corbaloc:"} and {@code <corbaloc_obj>}.
|
||||
* <li>Resolve the corbaloc URL to a NamingContext by using
|
||||
* <pre>{@code
|
||||
* nctx = ORB.string_to_object(corbalocUrl);
|
||||
*<li>Resolve <string_name> in the NamingContext.
|
||||
*</ol>
|
||||
* }</pre>
|
||||
* <li>Resolve {@code <string_name>} in the NamingContext.
|
||||
* </ol>
|
||||
*
|
||||
* @author Rosanna Lee
|
||||
*/
|
||||
|
@ -38,6 +38,7 @@ import com.sun.jndi.toolkit.url.UrlUtil;
|
||||
*
|
||||
* The format of an iiopname URL is defined in INS 98-10-11 as follows:
|
||||
*
|
||||
* <pre>
|
||||
* iiopname url = "iiopname://" [addr_list]["/" string_name]
|
||||
* addr_list = [address ","]* address
|
||||
* address = [version host [":" port]]
|
||||
@ -46,19 +47,23 @@ import com.sun.jndi.toolkit.url.UrlUtil;
|
||||
* port = number
|
||||
* major = number
|
||||
* minor = number
|
||||
* string_name = stringified name | empty_string
|
||||
* string_name = stringified name | empty_string
|
||||
* </pre>
|
||||
*
|
||||
* The default port is 9999. The default version is "1.0"
|
||||
* US-ASCII alphanumeric characters are not escaped. Any characters outside
|
||||
* of this range are escaped except for the following:
|
||||
* <pre>{@code
|
||||
* ; / : ? : @ & = + $ , - _ . ! ~ * ' ( )
|
||||
* }</pre>
|
||||
* Escaped characters is escaped by using a % followed by its 2 hexadecimal
|
||||
* numbers representing the octet.
|
||||
*
|
||||
* For backward compatibility, the "iiop" URL as defined in INS 97-6-6
|
||||
* is also supported:
|
||||
*
|
||||
* <pre>{@code
|
||||
* iiop url = "iiop://" [host [":" port]] ["/" string_name]
|
||||
* }</pre>
|
||||
* The default port is 900.
|
||||
*
|
||||
* @author Rosanna Lee
|
||||
|
@ -56,7 +56,7 @@ public class CorbaUtils {
|
||||
* object by using the javax.rmi.CORBA package.
|
||||
*<p>
|
||||
* This method effective does the following:
|
||||
*<blockquote><pre>
|
||||
* <blockquote><pre>
|
||||
* java.lang.Object stub;
|
||||
* try {
|
||||
* stub = PortableRemoteObject.toStub(remoteObj);
|
||||
@ -72,6 +72,7 @@ public class CorbaUtils {
|
||||
* // ignore 'already connected' error
|
||||
* }
|
||||
* return (javax.rmi.CORBA.Stub)stub;
|
||||
* </pre></blockquote>
|
||||
*
|
||||
* @param remoteObj The non-null remote object for
|
||||
* @param orb The non-null ORB to connect the remote object to
|
||||
|
@ -345,6 +345,7 @@ public class Agent {
|
||||
|
||||
if (jmxServer != null) {
|
||||
ConnectorBootstrap.unexportRegistry();
|
||||
ConnectorAddressLink.unexportRemote();
|
||||
|
||||
// Attempt to stop already stopped agent
|
||||
// Don't cause any errors.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -27,6 +27,7 @@ package sun.management;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.ByteOrder;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
@ -45,9 +46,26 @@ import sun.management.counter.perf.PerfInstrumentation;
|
||||
* @since 1.5
|
||||
*/
|
||||
public class ConnectorAddressLink {
|
||||
/**
|
||||
* A simple wrapper for the perf-counter backing {@linkplain ByteBuffer}
|
||||
*/
|
||||
private static final class PerfHandle {
|
||||
private ByteBuffer bb;
|
||||
|
||||
private PerfHandle(ByteBuffer bb) {
|
||||
this.bb = bb.order(ByteOrder.nativeOrder());
|
||||
}
|
||||
|
||||
private void putLong(long l) {
|
||||
this.bb = bb.clear();
|
||||
this.bb.asLongBuffer().put(l);
|
||||
}
|
||||
}
|
||||
|
||||
private static final String CONNECTOR_ADDRESS_COUNTER =
|
||||
"sun.management.JMXConnectorServer.address";
|
||||
private static final String REMOTE_CONNECTOR_STATE_COUNTER =
|
||||
"sun.management.JMXConnectorServer.remote.enabled";
|
||||
|
||||
/*
|
||||
* The format of the jvmstat counters representing the properties of
|
||||
@ -78,7 +96,9 @@ public class ConnectorAddressLink {
|
||||
* JMX remote connector counter (it will be incremented every
|
||||
* time a new out-of-the-box JMX remote connector is created).
|
||||
*/
|
||||
private static AtomicInteger counter = new AtomicInteger();
|
||||
private static final AtomicInteger counter = new AtomicInteger();
|
||||
|
||||
private static PerfHandle remotePerfHandle = null;
|
||||
|
||||
/**
|
||||
* Exports the specified connector address to the instrumentation buffer
|
||||
@ -93,7 +113,17 @@ public class ConnectorAddressLink {
|
||||
}
|
||||
Perf perf = Perf.getPerf();
|
||||
perf.createString(
|
||||
CONNECTOR_ADDRESS_COUNTER, 1, Units.STRING.intValue(), address);
|
||||
CONNECTOR_ADDRESS_COUNTER, 1, Units.STRING.intValue(), address);
|
||||
}
|
||||
|
||||
public static void unexportRemote() {
|
||||
unexport(remotePerfHandle);
|
||||
}
|
||||
|
||||
private static void unexport(PerfHandle ph) {
|
||||
if (ph != null) {
|
||||
ph.putLong(-1L);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -143,6 +173,13 @@ public class ConnectorAddressLink {
|
||||
perf.createString(REMOTE_CONNECTOR_COUNTER_PREFIX + index + "." +
|
||||
entry.getKey(), 1, Units.STRING.intValue(), entry.getValue());
|
||||
}
|
||||
if (remotePerfHandle != null) {
|
||||
remotePerfHandle.putLong(index);
|
||||
} else {
|
||||
remotePerfHandle = new PerfHandle(
|
||||
perf.createLong(REMOTE_CONNECTOR_STATE_COUNTER, 1, Units.NONE.intValue(), (long)index)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1013,7 +1013,6 @@ class WindowsPreferences extends AbstractPreferences {
|
||||
* description of the encoding algorithm.
|
||||
*/
|
||||
private static String toJavaValueString(byte[] windowsNameArray) {
|
||||
// Use modified native2ascii algorithm
|
||||
String windowsName = byteArrayToString(windowsNameArray);
|
||||
StringBuilder javaName = new StringBuilder();
|
||||
char ch;
|
||||
@ -1055,8 +1054,7 @@ class WindowsPreferences extends AbstractPreferences {
|
||||
* Encoding algorithm adds "/" character to capital letters, i.e.
|
||||
* "A" is encoded as "/A". Character '\' is encoded as '//',
|
||||
* '/' is encoded as '\'.
|
||||
* Then encoding scheme similar to jdk's native2ascii converter is used
|
||||
* to convert java string to a byte array of ASCII characters.
|
||||
* Then convert java string to a byte array of ASCII characters.
|
||||
*/
|
||||
private static byte[] toWindowsValueString(String javaName) {
|
||||
StringBuilder windowsName = new StringBuilder();
|
||||
|
@ -132,7 +132,9 @@ public interface ScriptEngine {
|
||||
*
|
||||
* @return The value returned from the execution of the script.
|
||||
*
|
||||
* @throws ScriptException if an error occurs in script.
|
||||
* @throws ScriptException if an error occurs in script. ScriptEngines should create and throw
|
||||
* <code>ScriptException</code> wrappers for checked Exceptions thrown by underlying scripting
|
||||
* implementations.
|
||||
* @throws NullPointerException if either argument is null.
|
||||
*/
|
||||
public Object eval(Reader reader , ScriptContext context) throws ScriptException;
|
||||
@ -145,7 +147,9 @@ public interface ScriptEngine {
|
||||
*
|
||||
* @return The value returned from the execution of the script.
|
||||
*
|
||||
* @throws ScriptException if error occurs in script.
|
||||
* @throws ScriptException if an error occurs in script. ScriptEngines should create and throw
|
||||
* <code>ScriptException</code> wrappers for checked Exceptions thrown by underlying scripting
|
||||
* implementations.
|
||||
* @throws NullPointerException if the argument is null.
|
||||
*/
|
||||
public Object eval(String script) throws ScriptException;
|
||||
@ -158,7 +162,9 @@ public interface ScriptEngine {
|
||||
*
|
||||
* @return The value returned by the script.
|
||||
*
|
||||
* @throws ScriptException if an error occurs in script.
|
||||
* @throws ScriptException if an error occurs in script. ScriptEngines should create and throw
|
||||
* <code>ScriptException</code> wrappers for checked Exceptions thrown by underlying scripting
|
||||
* implementations.
|
||||
* @throws NullPointerException if the argument is null.
|
||||
*/
|
||||
public Object eval(Reader reader) throws ScriptException;
|
||||
@ -177,7 +183,9 @@ public interface ScriptEngine {
|
||||
*
|
||||
* @return The value returned by the script.
|
||||
*
|
||||
* @throws ScriptException if an error occurs in script.
|
||||
* @throws ScriptException if an error occurs in script. ScriptEngines should create and throw
|
||||
* <code>ScriptException</code> wrappers for checked Exceptions thrown by underlying scripting
|
||||
* implementations.
|
||||
* @throws NullPointerException if either argument is null.
|
||||
*/
|
||||
public Object eval(String script, Bindings n) throws ScriptException;
|
||||
@ -191,7 +199,9 @@ public interface ScriptEngine {
|
||||
*
|
||||
* @return The value returned by the script.
|
||||
*
|
||||
* @throws ScriptException if an error occurs.
|
||||
* @throws ScriptException if an error occurs in script. ScriptEngines should create and throw
|
||||
* <code>ScriptException</code> wrappers for checked Exceptions thrown by underlying scripting
|
||||
* implementations.
|
||||
* @throws NullPointerException if either argument is null.
|
||||
*/
|
||||
public Object eval(Reader reader , Bindings n) throws ScriptException;
|
||||
|
@ -85,7 +85,7 @@ public class Krb5AcceptCredential
|
||||
|
||||
if (creds == null)
|
||||
throw new GSSException(GSSException.NO_CRED, -1,
|
||||
"Failed to find any Kerberos credentails");
|
||||
"Failed to find any Kerberos credentials");
|
||||
|
||||
if (name == null) {
|
||||
String fullName = creds.getName();
|
||||
|
@ -110,8 +110,10 @@ public class Config {
|
||||
* java.security.krb5.kdc not specified, error reading configuration file.
|
||||
*/
|
||||
|
||||
public static synchronized void refresh() throws KrbException {
|
||||
singleton = new Config();
|
||||
public static void refresh() throws KrbException {
|
||||
synchronized (Config.class) {
|
||||
singleton = new Config();
|
||||
}
|
||||
KdcComm.initStatic();
|
||||
EType.initStatic();
|
||||
Checksum.initStatic();
|
||||
|
@ -1059,7 +1059,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
|
||||
* (<code>acceptChanges</code>) or population. This method may also be called
|
||||
* while performing updates to the insert row.
|
||||
* <P>
|
||||
* <code>undoUpdate</code may be called at any time during the life-time of a
|
||||
* {@code undoUpdate} may be called at any time during the life-time of a
|
||||
* rowset, however after a synchronization has occurs this method has no
|
||||
* affect until further modification to the RowSet data occurs.
|
||||
*
|
||||
@ -2467,10 +2467,11 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
|
||||
* @throws SQLException if (1) the given column name is not the name of
|
||||
* a column in this rowset, (2) the cursor is not on one of
|
||||
* this rowset's rows or its insert row, or (3) the designated
|
||||
* column does not store an SQL <code>TINYINT, SMALLINT, INTEGER
|
||||
* BIGINT, REAL, FLOAT, DOUBLE, DECIMAL, NUMERIC, BIT, <b>CHAR</b>,
|
||||
* <b>VARCHAR</b></code> or <code>LONGVARCHAR<</code> value. The bold SQL type
|
||||
* designates the recommended return type.
|
||||
* column does not store an SQL {@code TINYINT, SMALLINT, INTEGER
|
||||
* BIGINT, REAL, FLOAT, DOUBLE, DECIMAL, NUMERIC, BIT, }
|
||||
* <b>{@code CHAR, VARCHAR}</b> or
|
||||
* <b>{@code LONGVARCHAR}</b> value.
|
||||
* The bold SQL type designates the recommended return type.
|
||||
*/
|
||||
public String getString(String columnName) throws SQLException {
|
||||
return getString(getColIdxByName(columnName));
|
||||
@ -7748,7 +7749,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
|
||||
* Updates the designated column with a <code>RowId</code> value. The updater
|
||||
* methods are used to update column values in the current row or the insert
|
||||
* row. The updater methods do not update the underlying database; instead
|
||||
* the <code>updateRow<code> or <code>insertRow</code> methods are called
|
||||
* the {@code updateRow} or {@code insertRow} methods are called
|
||||
* to update the database.
|
||||
*
|
||||
* @param columnIndex the first column is 1, the second 2, ...
|
||||
@ -7764,7 +7765,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
|
||||
* Updates the designated column with a <code>RowId</code> value. The updater
|
||||
* methods are used to update column values in the current row or the insert
|
||||
* row. The updater methods do not update the underlying database; instead
|
||||
* the <code>updateRow<code> or <code>insertRow</code> methods are called
|
||||
* the {@code updateRow} or {@code insertRow} methods are called
|
||||
* to update the database.
|
||||
*
|
||||
* @param columnName the name of the column
|
||||
|
@ -182,7 +182,7 @@ public class CachedRowSetWriter implements TransactionalWriter, Serializable {
|
||||
private CachedRowSetImpl crsResolve;
|
||||
|
||||
/**
|
||||
* This <code>ArrayList<code> will hold the values of SyncResolver.*
|
||||
* This {@code ArrayList} will hold the values of SyncResolver.*
|
||||
*/
|
||||
private ArrayList<Integer> status;
|
||||
|
||||
|
@ -29,29 +29,28 @@ import java.io.InputStream;
|
||||
|
||||
/**
|
||||
* The representation (mapping) in
|
||||
* the Java™ programming
|
||||
* language of an SQL
|
||||
* <code>BLOB</code> value. An SQL <code>BLOB</code> is a built-in type
|
||||
* the Java™ programming language of an SQL
|
||||
* {@code BLOB} value. An SQL {@code BLOB} is a built-in type
|
||||
* that stores a Binary Large Object as a column value in a row of
|
||||
* a database table. By default drivers implement <code>Blob</code> using
|
||||
* an SQL <code>locator(BLOB)</code>, which means that a
|
||||
* <code>Blob</code> object contains a logical pointer to the
|
||||
* SQL <code>BLOB</code> data rather than the data itself.
|
||||
* A <code>Blob</code> object is valid for the duration of the
|
||||
* a database table. By default drivers implement {@code Blob} using
|
||||
* an SQL {@code locator(BLOB)}, which means that a
|
||||
* {@code Blob} object contains a logical pointer to the
|
||||
* SQL {@code BLOB} data rather than the data itself.
|
||||
* A {@code Blob} object is valid for the duration of the
|
||||
* transaction in which is was created.
|
||||
*
|
||||
* <P>Methods in the interfaces {@link ResultSet},
|
||||
* {@link CallableStatement}, and {@link PreparedStatement}, such as
|
||||
* <code>getBlob</code> and <code>setBlob</code> allow a programmer to
|
||||
* access an SQL <code>BLOB</code> value.
|
||||
* The <code>Blob</code> interface provides methods for getting the
|
||||
* length of an SQL <code>BLOB</code> (Binary Large Object) value,
|
||||
* for materializing a <code>BLOB</code> value on the client, and for
|
||||
* {@code getBlob} and {@code setBlob} allow a programmer to
|
||||
* access an SQL {@code BLOB} value.
|
||||
* The {@code Blob} interface provides methods for getting the
|
||||
* length of an SQL {@code BLOB} (Binary Large Object) value,
|
||||
* for materializing a {@code BLOB} value on the client, and for
|
||||
* determining the position of a pattern of bytes within a
|
||||
* <code>BLOB</code> value. In addition, this interface has methods for updating
|
||||
* a <code>BLOB</code> value.
|
||||
* {@code BLOB} value. In addition, this interface has methods for updating
|
||||
* a {@code BLOB} value.
|
||||
* <p>
|
||||
* All methods on the <code>Blob</code> interface must be fully implemented if the
|
||||
* All methods on the {@code Blob} interface must be fully implemented if the
|
||||
* JDBC driver supports the data type.
|
||||
*
|
||||
* @since 1.2
|
||||
@ -60,51 +59,52 @@ import java.io.InputStream;
|
||||
public interface Blob {
|
||||
|
||||
/**
|
||||
* Returns the number of bytes in the <code>BLOB</code> value
|
||||
* designated by this <code>Blob</code> object.
|
||||
* @return length of the <code>BLOB</code> in bytes
|
||||
* Returns the number of bytes in the {@code BLOB} value
|
||||
* designated by this {@code Blob} object.
|
||||
*
|
||||
* @return length of the {@code BLOB} in bytes
|
||||
* @exception SQLException if there is an error accessing the
|
||||
* length of the <code>BLOB</code>
|
||||
* @exception SQLFeatureNotSupportedException if the JDBC driver does not support
|
||||
* this method
|
||||
* length of the {@code BLOB}
|
||||
* @exception SQLFeatureNotSupportedException if the JDBC driver
|
||||
* does not support this method
|
||||
* @since 1.2
|
||||
*/
|
||||
long length() throws SQLException;
|
||||
|
||||
/**
|
||||
* Retrieves all or part of the <code>BLOB</code>
|
||||
* value that this <code>Blob</code> object represents, as an array of
|
||||
* bytes. This <code>byte</code> array contains up to <code>length</code>
|
||||
* consecutive bytes starting at position <code>pos</code>.
|
||||
* Retrieves all or part of the {@code BLOB}
|
||||
* value that this {@code Blob} object represents, as an array of
|
||||
* bytes. This {@code byte} array contains up to {@code length}
|
||||
* consecutive bytes starting at position {@code pos}.
|
||||
*
|
||||
* @param pos the ordinal position of the first byte in the
|
||||
* <code>BLOB</code> value to be extracted; the first byte is at
|
||||
* {@code BLOB} value to be extracted; the first byte is at
|
||||
* position 1
|
||||
* @param length the number of consecutive bytes to be copied; the value
|
||||
* for length must be 0 or greater
|
||||
* @return a byte array containing up to <code>length</code>
|
||||
* consecutive bytes from the <code>BLOB</code> value designated
|
||||
* by this <code>Blob</code> object, starting with the
|
||||
* byte at position <code>pos</code>
|
||||
* for length must be 0 or greater
|
||||
* @return a byte array containing up to {@code length}
|
||||
* consecutive bytes from the {@code BLOB} value designated
|
||||
* by this {@code Blob} object, starting with the
|
||||
* byte at position {@code pos}
|
||||
* @exception SQLException if there is an error accessing the
|
||||
* <code>BLOB</code> value; if pos is less than 1 or length is
|
||||
* less than 0
|
||||
* @exception SQLFeatureNotSupportedException if the JDBC driver does not support
|
||||
* this method
|
||||
* {@code BLOB} value; if pos is less than 1 or length is
|
||||
* less than 0
|
||||
* @exception SQLFeatureNotSupportedException if the JDBC driver
|
||||
* does not support this method
|
||||
* @see #setBytes
|
||||
* @since 1.2
|
||||
*/
|
||||
byte[] getBytes(long pos, int length) throws SQLException;
|
||||
|
||||
/**
|
||||
* Retrieves the <code>BLOB</code> value designated by this
|
||||
* <code>Blob</code> instance as a stream.
|
||||
* Retrieves the {@code BLOB} value designated by this
|
||||
* {@code Blob} instance as a stream.
|
||||
*
|
||||
* @return a stream containing the <code>BLOB</code> data
|
||||
* @return a stream containing the {@code BLOB} data
|
||||
* @exception SQLException if there is an error accessing the
|
||||
* <code>BLOB</code> value
|
||||
* @exception SQLFeatureNotSupportedException if the JDBC driver does not support
|
||||
* this method
|
||||
* {@code BLOB} value
|
||||
* @exception SQLFeatureNotSupportedException if the JDBC driver
|
||||
* does not support this method
|
||||
* @see #setBinaryStream
|
||||
* @since 1.2
|
||||
*/
|
||||
@ -112,38 +112,38 @@ public interface Blob {
|
||||
|
||||
/**
|
||||
* Retrieves the byte position at which the specified byte array
|
||||
* <code>pattern</code> begins within the <code>BLOB</code>
|
||||
* value that this <code>Blob</code> object represents. The
|
||||
* search for <code>pattern</code> begins at position
|
||||
* <code>start</code>.
|
||||
* {@code pattern} begins within the {@code BLOB}
|
||||
* value that this {@code Blob} object represents.
|
||||
* The search for {@code pattern} begins at position
|
||||
* {@code start}.
|
||||
*
|
||||
* @param pattern the byte array for which to search
|
||||
* @param start the position at which to begin searching; the
|
||||
* first position is 1
|
||||
* @return the position at which the pattern appears, else -1
|
||||
* @exception SQLException if there is an error accessing the
|
||||
* <code>BLOB</code> or if start is less than 1
|
||||
* @exception SQLFeatureNotSupportedException if the JDBC driver does not support
|
||||
* this method
|
||||
* {@code BLOB} or if start is less than 1
|
||||
* @exception SQLFeatureNotSupportedException if the JDBC driver
|
||||
* does not support this method
|
||||
* @since 1.2
|
||||
*/
|
||||
long position(byte pattern[], long start) throws SQLException;
|
||||
|
||||
/**
|
||||
* Retrieves the byte position in the <code>BLOB</code> value
|
||||
* designated by this <code>Blob</code> object at which
|
||||
* <code>pattern</code> begins. The search begins at position
|
||||
* <code>start</code>.
|
||||
* Retrieves the byte position in the {@code BLOB} value
|
||||
* designated by this {@code Blob} object at which
|
||||
* {@code pattern} begins. The search begins at position
|
||||
* {@code start}.
|
||||
*
|
||||
* @param pattern the <code>Blob</code> object designating
|
||||
* the <code>BLOB</code> value for which to search
|
||||
* @param start the position in the <code>BLOB</code> value
|
||||
* @param pattern the {@code Blob} object designating
|
||||
* the {@code BLOB} value for which to search
|
||||
* @param start the position in the {@code BLOB} value
|
||||
* at which to begin searching; the first position is 1
|
||||
* @return the position at which the pattern begins, else -1
|
||||
* @exception SQLException if there is an error accessing the
|
||||
* <code>BLOB</code> value or if start is less than 1
|
||||
* @exception SQLFeatureNotSupportedException if the JDBC driver does not support
|
||||
* this method
|
||||
* {@code BLOB} value or if start is less than 1
|
||||
* @exception SQLFeatureNotSupportedException if the JDBC driver
|
||||
* does not support this method
|
||||
* @since 1.2
|
||||
*/
|
||||
long position(Blob pattern, long start) throws SQLException;
|
||||
@ -151,152 +151,155 @@ public interface Blob {
|
||||
// -------------------------- JDBC 3.0 -----------------------------------
|
||||
|
||||
/**
|
||||
* Writes the given array of bytes to the <code>BLOB</code> value that
|
||||
* this <code>Blob</code> object represents, starting at position
|
||||
* <code>pos</code>, and returns the number of bytes written.
|
||||
* Writes the given array of bytes to the {@code BLOB} value that
|
||||
* this {@code Blob} object represents, starting at position
|
||||
* {@code pos}, and returns the number of bytes written.
|
||||
* The array of bytes will overwrite the existing bytes
|
||||
* in the <code>Blob</code> object starting at the position
|
||||
* <code>pos</code>. If the end of the <code>Blob</code> value is reached
|
||||
* while writing the array of bytes, then the length of the <code>Blob</code>
|
||||
* in the {@code Blob} object starting at the position
|
||||
* {@code pos}. If the end of the {@code Blob} value is reached
|
||||
* while writing the array of bytes, then the length of the {@code Blob}
|
||||
* value will be increased to accommodate the extra bytes.
|
||||
* <p>
|
||||
* <b>Note:</b> If the value specified for <code>pos</code>
|
||||
* is greater then the length+1 of the <code>BLOB</code> value then the
|
||||
* behavior is undefined. Some JDBC drivers may throw a
|
||||
* <code>SQLException</code> while other drivers may support this
|
||||
* <b>Note:</b> If the value specified for {@code pos}
|
||||
* is greater than the length+1 of the {@code BLOB} value then the
|
||||
* behavior is undefined. Some JDBC drivers may throw an
|
||||
* {@code SQLException} while other drivers may support this
|
||||
* operation.
|
||||
*
|
||||
* @param pos the position in the <code>BLOB</code> object at which
|
||||
* @param pos the position in the {@code BLOB} object at which
|
||||
* to start writing; the first position is 1
|
||||
* @param bytes the array of bytes to be written to the <code>BLOB</code>
|
||||
* value that this <code>Blob</code> object represents
|
||||
* @param bytes the array of bytes to be written to the {@code BLOB}
|
||||
* value that this {@code Blob} object represents
|
||||
* @return the number of bytes written
|
||||
* @exception SQLException if there is an error accessing the
|
||||
* <code>BLOB</code> value or if pos is less than 1
|
||||
* @exception SQLFeatureNotSupportedException if the JDBC driver does not support
|
||||
* this method
|
||||
* {@code BLOB} value or if pos is less than 1
|
||||
* @exception SQLFeatureNotSupportedException if the JDBC driver
|
||||
* does not support this method
|
||||
* @see #getBytes
|
||||
* @since 1.4
|
||||
*/
|
||||
int setBytes(long pos, byte[] bytes) throws SQLException;
|
||||
|
||||
/**
|
||||
* Writes all or part of the given <code>byte</code> array to the
|
||||
* <code>BLOB</code> value that this <code>Blob</code> object represents
|
||||
* Writes all or part of the given {@code byte} array to the
|
||||
* {@code BLOB} value that this {@code Blob} object represents
|
||||
* and returns the number of bytes written.
|
||||
* Writing starts at position <code>pos</code> in the <code>BLOB</code>
|
||||
* value; <code>len</code> bytes from the given byte array are written.
|
||||
* Writing starts at position {@code pos} in the {@code BLOB}
|
||||
* value; {@code len} bytes from the given byte array are written.
|
||||
* The array of bytes will overwrite the existing bytes
|
||||
* in the <code>Blob</code> object starting at the position
|
||||
* <code>pos</code>. If the end of the <code>Blob</code> value is reached
|
||||
* while writing the array of bytes, then the length of the <code>Blob</code>
|
||||
* in the {@code Blob} object starting at the position
|
||||
* {@code pos}. If the end of the {@code Blob} value is reached
|
||||
* while writing the array of bytes, then the length of the {@code Blob}
|
||||
* value will be increased to accommodate the extra bytes.
|
||||
* <p>
|
||||
* <b>Note:</b> If the value specified for <code>pos</code>
|
||||
* is greater then the length+1 of the <code>BLOB</code> value then the
|
||||
* behavior is undefined. Some JDBC drivers may throw a
|
||||
* <code>SQLException</code> while other drivers may support this
|
||||
* <b>Note:</b> If the value specified for {@code pos}
|
||||
* is greater than the length+1 of the {@code BLOB} value then the
|
||||
* behavior is undefined. Some JDBC drivers may throw an
|
||||
* {@code SQLException} while other drivers may support this
|
||||
* operation.
|
||||
*
|
||||
* @param pos the position in the <code>BLOB</code> object at which
|
||||
* @param pos the position in the {@code BLOB} object at which
|
||||
* to start writing; the first position is 1
|
||||
* @param bytes the array of bytes to be written to this <code>BLOB</code>
|
||||
* @param bytes the array of bytes to be written to this {@code BLOB}
|
||||
* object
|
||||
* @param offset the offset into the array <code>bytes</code> at which
|
||||
* @param offset the offset into the array {@code bytes} at which
|
||||
* to start reading the bytes to be set
|
||||
* @param len the number of bytes to be written to the <code>BLOB</code>
|
||||
* value from the array of bytes <code>bytes</code>
|
||||
* @param len the number of bytes to be written to the {@code BLOB}
|
||||
* value from the array of bytes {@code bytes}
|
||||
* @return the number of bytes written
|
||||
* @exception SQLException if there is an error accessing the
|
||||
* <code>BLOB</code> value or if pos is less than 1
|
||||
* @exception SQLFeatureNotSupportedException if the JDBC driver does not support
|
||||
* this method
|
||||
* {@code BLOB} value or if pos is less than 1
|
||||
* @exception SQLFeatureNotSupportedException if the JDBC driver
|
||||
* does not support this method
|
||||
* @see #getBytes
|
||||
* @since 1.4
|
||||
*/
|
||||
int setBytes(long pos, byte[] bytes, int offset, int len) throws SQLException;
|
||||
|
||||
/**
|
||||
* Retrieves a stream that can be used to write to the <code>BLOB</code>
|
||||
* value that this <code>Blob</code> object represents. The stream begins
|
||||
* at position <code>pos</code>.
|
||||
* Retrieves a stream that can be used to write to the {@code BLOB}
|
||||
* value that this {@code Blob} object represents. The stream begins
|
||||
* at position {@code pos}.
|
||||
* The bytes written to the stream will overwrite the existing bytes
|
||||
* in the <code>Blob</code> object starting at the position
|
||||
* <code>pos</code>. If the end of the <code>Blob</code> value is reached
|
||||
* while writing to the stream, then the length of the <code>Blob</code>
|
||||
* in the {@code Blob} object starting at the position
|
||||
* {@code pos}. If the end of the {@code Blob} value is reached
|
||||
* while writing to the stream, then the length of the {@code Blob}
|
||||
* value will be increased to accommodate the extra bytes.
|
||||
* <p>
|
||||
* <b>Note:</b> If the value specified for <code>pos</code>
|
||||
* is greater then the length+1 of the <code>BLOB</code> value then the
|
||||
* behavior is undefined. Some JDBC drivers may throw a
|
||||
* <code>SQLException</code> while other drivers may support this
|
||||
* <b>Note:</b> If the value specified for {@code pos}
|
||||
* is greater than the length+1 of the {@code BLOB} value then the
|
||||
* behavior is undefined. Some JDBC drivers may throw an
|
||||
* {@code SQLException} while other drivers may support this
|
||||
* operation.
|
||||
*
|
||||
* @param pos the position in the <code>BLOB</code> value at which
|
||||
* @param pos the position in the {@code BLOB} value at which
|
||||
* to start writing; the first position is 1
|
||||
* @return a <code>java.io.OutputStream</code> object to which data can
|
||||
* @return a {@code java.io.OutputStream} object to which data can
|
||||
* be written
|
||||
* @exception SQLException if there is an error accessing the
|
||||
* <code>BLOB</code> value or if pos is less than 1
|
||||
* @exception SQLFeatureNotSupportedException if the JDBC driver does not support
|
||||
* this method
|
||||
* {@code BLOB} value or if pos is less than 1
|
||||
* @exception SQLFeatureNotSupportedException if the JDBC driver
|
||||
* does not support this method
|
||||
* @see #getBinaryStream
|
||||
* @since 1.4
|
||||
*/
|
||||
java.io.OutputStream setBinaryStream(long pos) throws SQLException;
|
||||
|
||||
/**
|
||||
* Truncates the <code>BLOB</code> value that this <code>Blob</code>
|
||||
* object represents to be <code>len</code> bytes in length.
|
||||
* Truncates the {@code BLOB} value that this {@code Blob}
|
||||
* object represents to be {@code len} bytes in length.
|
||||
* <p>
|
||||
* <b>Note:</b> If the value specified for <code>pos</code>
|
||||
* is greater then the length+1 of the <code>BLOB</code> value then the
|
||||
* behavior is undefined. Some JDBC drivers may throw a
|
||||
* <code>SQLException</code> while other drivers may support this
|
||||
* <b>Note:</b> If the value specified for {@code pos}
|
||||
* is greater than the length+1 of the {@code BLOB} value then the
|
||||
* behavior is undefined. Some JDBC drivers may throw an
|
||||
* {@code SQLException} while other drivers may support this
|
||||
* operation.
|
||||
*
|
||||
* @param len the length, in bytes, to which the <code>BLOB</code> value
|
||||
* that this <code>Blob</code> object represents should be truncated
|
||||
* @param len the length, in bytes, to which the {@code BLOB} value
|
||||
* that this {@code Blob} object represents should be truncated
|
||||
* @exception SQLException if there is an error accessing the
|
||||
* <code>BLOB</code> value or if len is less than 0
|
||||
* @exception SQLFeatureNotSupportedException if the JDBC driver does not support
|
||||
* this method
|
||||
* {@code BLOB} value or if len is less than 0
|
||||
* @exception SQLFeatureNotSupportedException if the JDBC driver
|
||||
* does not support this method
|
||||
* @since 1.4
|
||||
*/
|
||||
void truncate(long len) throws SQLException;
|
||||
|
||||
/**
|
||||
* This method frees the <code>Blob</code> object and releases the resources that
|
||||
* it holds. The object is invalid once the <code>free</code>
|
||||
* This method frees the {@code Blob} object and releases the resources that
|
||||
* it holds. The object is invalid once the {@code free}
|
||||
* method is called.
|
||||
* <p>
|
||||
* After <code>free</code> has been called, any attempt to invoke a
|
||||
* method other than <code>free</code> will result in a <code>SQLException</code>
|
||||
* being thrown. If <code>free</code> is called multiple times, the subsequent
|
||||
* calls to <code>free</code> are treated as a no-op.
|
||||
* After {@code free} has been called, any attempt to invoke a
|
||||
* method other than {@code free} will result in an {@code SQLException}
|
||||
* being thrown. If {@code free} is called multiple times, the subsequent
|
||||
* calls to {@code free} are treated as a no-op.
|
||||
*
|
||||
* @throws SQLException if an error occurs releasing
|
||||
* the Blob's resources
|
||||
* @exception SQLFeatureNotSupportedException if the JDBC driver does not support
|
||||
* this method
|
||||
* the Blob's resources
|
||||
* @exception SQLFeatureNotSupportedException if the JDBC driver
|
||||
* does not support this method
|
||||
* @since 1.6
|
||||
*/
|
||||
void free() throws SQLException;
|
||||
|
||||
/**
|
||||
* Returns an <code>InputStream</code> object that contains a partial <code>Blob</code> value,
|
||||
* starting with the byte specified by pos, which is length bytes in length.
|
||||
* Returns an {@code InputStream} object that contains
|
||||
* a partial {@code Blob} value, starting with the byte
|
||||
* specified by pos, which is length bytes in length.
|
||||
*
|
||||
* @param pos the offset to the first byte of the partial value to be retrieved.
|
||||
* The first byte in the <code>Blob</code> is at position 1
|
||||
* @param pos the offset to the first byte of the partial value to be
|
||||
* retrieved. The first byte in the {@code Blob} is at position 1.
|
||||
* @param length the length in bytes of the partial value to be retrieved
|
||||
* @return <code>InputStream</code> through which the partial <code>Blob</code> value can be read.
|
||||
* @throws SQLException if pos is less than 1 or if pos is greater than the number of bytes
|
||||
* in the <code>Blob</code> or if pos + length is greater than the number of bytes
|
||||
* in the <code>Blob</code>
|
||||
* @return {@code InputStream} through which
|
||||
* the partial {@code Blob} value can be read.
|
||||
* @throws SQLException if pos is less than 1 or if pos is greater
|
||||
* than the number of bytes in the {@code Blob} or if
|
||||
* pos + length is greater than the number of bytes
|
||||
* in the {@code Blob}
|
||||
*
|
||||
* @exception SQLFeatureNotSupportedException if the JDBC driver does not support
|
||||
* this method
|
||||
* @exception SQLFeatureNotSupportedException if the JDBC driver
|
||||
* does not support this method
|
||||
* @since 1.6
|
||||
*/
|
||||
InputStream getBinaryStream(long pos, long length) throws SQLException;
|
||||
|
@ -29,28 +29,28 @@ import java.io.Reader;
|
||||
|
||||
/**
|
||||
* The mapping in the Java™ programming language
|
||||
* for the SQL <code>CLOB</code> type.
|
||||
* An SQL <code>CLOB</code> is a built-in type
|
||||
* for the SQL {@code CLOB} type.
|
||||
* An SQL {@code CLOB} is a built-in type
|
||||
* that stores a Character Large Object as a column value in a row of
|
||||
* a database table.
|
||||
* By default drivers implement a <code>Clob</code> object using an SQL
|
||||
* <code>locator(CLOB)</code>, which means that a <code>Clob</code> object
|
||||
* contains a logical pointer to the SQL <code>CLOB</code> data rather than
|
||||
* the data itself. A <code>Clob</code> object is valid for the duration
|
||||
* By default drivers implement a {@code Clob} object using an SQL
|
||||
* {@code locator(CLOB)}, which means that a {@code Clob} object
|
||||
* contains a logical pointer to the SQL {@code CLOB} data rather than
|
||||
* the data itself. A {@code Clob} object is valid for the duration
|
||||
* of the transaction in which it was created.
|
||||
* <P>The <code>Clob</code> interface provides methods for getting the
|
||||
* length of an SQL <code>CLOB</code> (Character Large Object) value,
|
||||
* for materializing a <code>CLOB</code> value on the client, and for
|
||||
* searching for a substring or <code>CLOB</code> object within a
|
||||
* <code>CLOB</code> value.
|
||||
* <P>The {@code Clob} interface provides methods for getting the
|
||||
* length of an SQL {@code CLOB} (Character Large Object) value,
|
||||
* for materializing a {@code CLOB} value on the client, and for
|
||||
* searching for a substring or {@code CLOB} object within a
|
||||
* {@code CLOB} value.
|
||||
* Methods in the interfaces {@link ResultSet},
|
||||
* {@link CallableStatement}, and {@link PreparedStatement}, such as
|
||||
* <code>getClob</code> and <code>setClob</code> allow a programmer to
|
||||
* access an SQL <code>CLOB</code> value. In addition, this interface
|
||||
* has methods for updating a <code>CLOB</code> value.
|
||||
* {@code getClob} and {@code setClob} allow a programmer to
|
||||
* access an SQL {@code CLOB} value. In addition, this interface
|
||||
* has methods for updating a {@code CLOB} value.
|
||||
* <p>
|
||||
* All methods on the <code>Clob</code> interface must be fully implemented if the
|
||||
* JDBC driver supports the data type.
|
||||
* All methods on the {@code Clob} interface must be
|
||||
* fully implemented if the JDBC driver supports the data type.
|
||||
*
|
||||
* @since 1.2
|
||||
*/
|
||||
@ -59,67 +59,67 @@ public interface Clob {
|
||||
|
||||
/**
|
||||
* Retrieves the number of characters
|
||||
* in the <code>CLOB</code> value
|
||||
* designated by this <code>Clob</code> object.
|
||||
* in the {@code CLOB} value
|
||||
* designated by this {@code Clob} object.
|
||||
*
|
||||
* @return length of the <code>CLOB</code> in characters
|
||||
* @return length of the {@code CLOB} in characters
|
||||
* @exception SQLException if there is an error accessing the
|
||||
* length of the <code>CLOB</code> value
|
||||
* @exception SQLFeatureNotSupportedException if the JDBC driver does not support
|
||||
* this method
|
||||
* length of the {@code CLOB} value
|
||||
* @exception SQLFeatureNotSupportedException if the JDBC driver
|
||||
* does not support this method
|
||||
* @since 1.2
|
||||
*/
|
||||
long length() throws SQLException;
|
||||
|
||||
/**
|
||||
* Retrieves a copy of the specified substring
|
||||
* in the <code>CLOB</code> value
|
||||
* designated by this <code>Clob</code> object.
|
||||
* in the {@code CLOB} value
|
||||
* designated by this {@code Clob} object.
|
||||
* The substring begins at position
|
||||
* <code>pos</code> and has up to <code>length</code> consecutive
|
||||
* {@code pos} and has up to {@code length} consecutive
|
||||
* characters.
|
||||
*
|
||||
* @param pos the first character of the substring to be extracted.
|
||||
* The first character is at position 1.
|
||||
* The first character is at position 1.
|
||||
* @param length the number of consecutive characters to be copied;
|
||||
* the value for length must be 0 or greater
|
||||
* @return a <code>String</code> that is the specified substring in
|
||||
* the <code>CLOB</code> value designated by this <code>Clob</code> object
|
||||
* the value for length must be 0 or greater
|
||||
* @return a {@code String} that is the specified substring in
|
||||
* the {@code CLOB} value designated by this {@code Clob} object
|
||||
* @exception SQLException if there is an error accessing the
|
||||
* <code>CLOB</code> value; if pos is less than 1 or length is
|
||||
* less than 0
|
||||
* @exception SQLFeatureNotSupportedException if the JDBC driver does not support
|
||||
* this method
|
||||
* {@code CLOB} value; if pos is less than 1 or length is
|
||||
* less than 0
|
||||
* @exception SQLFeatureNotSupportedException if the JDBC driver
|
||||
* does not support this method
|
||||
* @since 1.2
|
||||
*/
|
||||
String getSubString(long pos, int length) throws SQLException;
|
||||
|
||||
/**
|
||||
* Retrieves the <code>CLOB</code> value designated by this <code>Clob</code>
|
||||
* object as a <code>java.io.Reader</code> object (or as a stream of
|
||||
* Retrieves the {@code CLOB} value designated by this {@code Clob}
|
||||
* object as a {@code java.io.Reader} object (or as a stream of
|
||||
* characters).
|
||||
*
|
||||
* @return a <code>java.io.Reader</code> object containing the
|
||||
* <code>CLOB</code> data
|
||||
* @return a {@code java.io.Reader} object containing the
|
||||
* {@code CLOB} data
|
||||
* @exception SQLException if there is an error accessing the
|
||||
* <code>CLOB</code> value
|
||||
* @exception SQLFeatureNotSupportedException if the JDBC driver does not support
|
||||
* this method
|
||||
* {@code CLOB} value
|
||||
* @exception SQLFeatureNotSupportedException if the JDBC driver
|
||||
* does not support this method
|
||||
* @see #setCharacterStream
|
||||
* @since 1.2
|
||||
*/
|
||||
java.io.Reader getCharacterStream() throws SQLException;
|
||||
|
||||
/**
|
||||
* Retrieves the <code>CLOB</code> value designated by this <code>Clob</code>
|
||||
* Retrieves the {@code CLOB} value designated by this {@code Clob}
|
||||
* object as an ascii stream.
|
||||
*
|
||||
* @return a <code>java.io.InputStream</code> object containing the
|
||||
* <code>CLOB</code> data
|
||||
* @return a {@code java.io.InputStream} object containing the
|
||||
* {@code CLOB} data
|
||||
* @exception SQLException if there is an error accessing the
|
||||
* <code>CLOB</code> value
|
||||
* @exception SQLFeatureNotSupportedException if the JDBC driver does not support
|
||||
* this method
|
||||
* {@code CLOB} value
|
||||
* @exception SQLFeatureNotSupportedException if the JDBC driver
|
||||
* does not support this method
|
||||
* @see #setAsciiStream
|
||||
* @since 1.2
|
||||
*/
|
||||
@ -127,38 +127,38 @@ public interface Clob {
|
||||
|
||||
/**
|
||||
* Retrieves the character position at which the specified substring
|
||||
* <code>searchstr</code> appears in the SQL <code>CLOB</code> value
|
||||
* represented by this <code>Clob</code> object. The search
|
||||
* begins at position <code>start</code>.
|
||||
* {@code searchstr} appears in the SQL {@code CLOB} value
|
||||
* represented by this {@code Clob} object. The search
|
||||
* begins at position {@code start}.
|
||||
*
|
||||
* @param searchstr the substring for which to search
|
||||
* @param start the position at which to begin searching; the first position
|
||||
* is 1
|
||||
* @param start the position at which to begin searching;
|
||||
* the first position is 1
|
||||
* @return the position at which the substring appears or -1 if it is not
|
||||
* present; the first position is 1
|
||||
* @exception SQLException if there is an error accessing the
|
||||
* <code>CLOB</code> value or if pos is less than 1
|
||||
* @exception SQLFeatureNotSupportedException if the JDBC driver does not support
|
||||
* this method
|
||||
* {@code CLOB} value or if pos is less than 1
|
||||
* @exception SQLFeatureNotSupportedException if the JDBC driver
|
||||
* does not support this method
|
||||
* @since 1.2
|
||||
*/
|
||||
long position(String searchstr, long start) throws SQLException;
|
||||
|
||||
/**
|
||||
* Retrieves the character position at which the specified
|
||||
* <code>Clob</code> object <code>searchstr</code> appears in this
|
||||
* <code>Clob</code> object. The search begins at position
|
||||
* <code>start</code>.
|
||||
* {@code Clob} object {@code searchstr} appears in this
|
||||
* {@code Clob} object. The search begins at position
|
||||
* {@code start}.
|
||||
*
|
||||
* @param searchstr the <code>Clob</code> object for which to search
|
||||
* @param searchstr the {@code Clob} object for which to search
|
||||
* @param start the position at which to begin searching; the first
|
||||
* position is 1
|
||||
* @return the position at which the <code>Clob</code> object appears
|
||||
* or -1 if it is not present; the first position is 1
|
||||
* @return the position at which the {@code Clob} object appears
|
||||
* or -1 if it is not present; the first position is 1
|
||||
* @exception SQLException if there is an error accessing the
|
||||
* <code>CLOB</code> value or if start is less than 1
|
||||
* @exception SQLFeatureNotSupportedException if the JDBC driver does not support
|
||||
* this method
|
||||
* {@code CLOB} value or if start is less than 1
|
||||
* @exception SQLFeatureNotSupportedException if the JDBC driver
|
||||
* does not support this method
|
||||
* @since 1.2
|
||||
*/
|
||||
long position(Clob searchstr, long start) throws SQLException;
|
||||
@ -166,90 +166,91 @@ public interface Clob {
|
||||
//---------------------------- jdbc 3.0 -----------------------------------
|
||||
|
||||
/**
|
||||
* Writes the given Java <code>String</code> to the <code>CLOB</code>
|
||||
* value that this <code>Clob</code> object designates at the position
|
||||
* <code>pos</code>. The string will overwrite the existing characters
|
||||
* in the <code>Clob</code> object starting at the position
|
||||
* <code>pos</code>. If the end of the <code>Clob</code> value is reached
|
||||
* while writing the given string, then the length of the <code>Clob</code>
|
||||
* Writes the given Java {@code String} to the {@code CLOB}
|
||||
* value that this {@code Clob} object designates at the position
|
||||
* {@code pos}. The string will overwrite the existing characters
|
||||
* in the {@code Clob} object starting at the position
|
||||
* {@code pos}. If the end of the {@code Clob} value is reached
|
||||
* while writing the given string, then the length of the {@code Clob}
|
||||
* value will be increased to accommodate the extra characters.
|
||||
* <p>
|
||||
* <b>Note:</b> If the value specified for <code>pos</code>
|
||||
* is greater then the length+1 of the <code>CLOB</code> value then the
|
||||
* behavior is undefined. Some JDBC drivers may throw a
|
||||
* <code>SQLException</code> while other drivers may support this
|
||||
* <b>Note:</b> If the value specified for {@code pos}
|
||||
* is greater than the length+1 of the {@code CLOB} value then the
|
||||
* behavior is undefined. Some JDBC drivers may throw an
|
||||
* {@code SQLException} while other drivers may support this
|
||||
* operation.
|
||||
*
|
||||
* @param pos the position at which to start writing to the <code>CLOB</code>
|
||||
* value that this <code>Clob</code> object represents;
|
||||
* The first position is 1
|
||||
* @param str the string to be written to the <code>CLOB</code>
|
||||
* value that this <code>Clob</code> designates
|
||||
* @param pos the position at which to start writing to the {@code CLOB}
|
||||
* value that this {@code Clob} object represents;
|
||||
* the first position is 1.
|
||||
* @param str the string to be written to the {@code CLOB}
|
||||
* value that this {@code Clob} designates
|
||||
* @return the number of characters written
|
||||
* @exception SQLException if there is an error accessing the
|
||||
* <code>CLOB</code> value or if pos is less than 1
|
||||
* {@code CLOB} value or if pos is less than 1
|
||||
*
|
||||
* @exception SQLFeatureNotSupportedException if the JDBC driver does not support
|
||||
* this method
|
||||
* @exception SQLFeatureNotSupportedException if the JDBC driver
|
||||
* does not support this method
|
||||
* @since 1.4
|
||||
*/
|
||||
int setString(long pos, String str) throws SQLException;
|
||||
|
||||
/**
|
||||
* Writes <code>len</code> characters of <code>str</code>, starting
|
||||
* at character <code>offset</code>, to the <code>CLOB</code> value
|
||||
* that this <code>Clob</code> represents. The string will overwrite the existing characters
|
||||
* in the <code>Clob</code> object starting at the position
|
||||
* <code>pos</code>. If the end of the <code>Clob</code> value is reached
|
||||
* while writing the given string, then the length of the <code>Clob</code>
|
||||
* Writes {@code len} characters of {@code str}, starting
|
||||
* at character {@code offset}, to the {@code CLOB} value
|
||||
* that this {@code Clob} represents.
|
||||
* The string will overwrite the existing characters
|
||||
* in the {@code Clob} object starting at the position
|
||||
* {@code pos}. If the end of the {@code Clob} value is reached
|
||||
* while writing the given string, then the length of the {@code Clob}
|
||||
* value will be increased to accommodate the extra characters.
|
||||
* <p>
|
||||
* <b>Note:</b> If the value specified for <code>pos</code>
|
||||
* is greater then the length+1 of the <code>CLOB</code> value then the
|
||||
* behavior is undefined. Some JDBC drivers may throw a
|
||||
* <code>SQLException</code> while other drivers may support this
|
||||
* <b>Note:</b> If the value specified for {@code pos}
|
||||
* is greater than the length+1 of the {@code CLOB} value then the
|
||||
* behavior is undefined. Some JDBC drivers may throw an
|
||||
* {@code SQLException} while other drivers may support this
|
||||
* operation.
|
||||
*
|
||||
* @param pos the position at which to start writing to this
|
||||
* <code>CLOB</code> object; The first position is 1
|
||||
* @param str the string to be written to the <code>CLOB</code>
|
||||
* value that this <code>Clob</code> object represents
|
||||
* @param offset the offset into <code>str</code> to start reading
|
||||
* {@code CLOB} object; The first position is 1
|
||||
* @param str the string to be written to the {@code CLOB}
|
||||
* value that this {@code Clob} object represents
|
||||
* @param offset the offset into {@code str} to start reading
|
||||
* the characters to be written
|
||||
* @param len the number of characters to be written
|
||||
* @return the number of characters written
|
||||
* @exception SQLException if there is an error accessing the
|
||||
* <code>CLOB</code> value or if pos is less than 1
|
||||
* {@code CLOB} value or if pos is less than 1
|
||||
*
|
||||
* @exception SQLFeatureNotSupportedException if the JDBC driver does not support
|
||||
* this method
|
||||
* @exception SQLFeatureNotSupportedException if the JDBC driver
|
||||
* does not support this method
|
||||
* @since 1.4
|
||||
*/
|
||||
int setString(long pos, String str, int offset, int len) throws SQLException;
|
||||
|
||||
/**
|
||||
* Retrieves a stream to be used to write Ascii characters to the
|
||||
* <code>CLOB</code> value that this <code>Clob</code> object represents,
|
||||
* starting at position <code>pos</code>. Characters written to the stream
|
||||
* {@code CLOB} value that this {@code Clob} object represents,
|
||||
* starting at position {@code pos}. Characters written to the stream
|
||||
* will overwrite the existing characters
|
||||
* in the <code>Clob</code> object starting at the position
|
||||
* <code>pos</code>. If the end of the <code>Clob</code> value is reached
|
||||
* while writing characters to the stream, then the length of the <code>Clob</code>
|
||||
* in the {@code Clob} object starting at the position
|
||||
* {@code pos}. If the end of the {@code Clob} value is reached
|
||||
* while writing characters to the stream, then the length of the {@code Clob}
|
||||
* value will be increased to accommodate the extra characters.
|
||||
* <p>
|
||||
* <b>Note:</b> If the value specified for <code>pos</code>
|
||||
* is greater then the length+1 of the <code>CLOB</code> value then the
|
||||
* behavior is undefined. Some JDBC drivers may throw a
|
||||
* <code>SQLException</code> while other drivers may support this
|
||||
* <b>Note:</b> If the value specified for {@code pos}
|
||||
* is greater than the length+1 of the {@code CLOB} value then the
|
||||
* behavior is undefined. Some JDBC drivers may throw an
|
||||
* {@code SQLException} while other drivers may support this
|
||||
* operation.
|
||||
*
|
||||
* @param pos the position at which to start writing to this
|
||||
* <code>CLOB</code> object; The first position is 1
|
||||
* {@code CLOB} object; The first position is 1
|
||||
* @return the stream to which ASCII encoded characters can be written
|
||||
* @exception SQLException if there is an error accessing the
|
||||
* <code>CLOB</code> value or if pos is less than 1
|
||||
* @exception SQLFeatureNotSupportedException if the JDBC driver does not support
|
||||
* this method
|
||||
* {@code CLOB} value or if pos is less than 1
|
||||
* @exception SQLFeatureNotSupportedException if the JDBC driver
|
||||
* does not support this method
|
||||
* @see #getAsciiStream
|
||||
*
|
||||
* @since 1.4
|
||||
@ -258,28 +259,28 @@ public interface Clob {
|
||||
|
||||
/**
|
||||
* Retrieves a stream to be used to write a stream of Unicode characters
|
||||
* to the <code>CLOB</code> value that this <code>Clob</code> object
|
||||
* represents, at position <code>pos</code>. Characters written to the stream
|
||||
* to the {@code CLOB} value that this {@code Clob} object
|
||||
* represents, at position {@code pos}. Characters written to the stream
|
||||
* will overwrite the existing characters
|
||||
* in the <code>Clob</code> object starting at the position
|
||||
* <code>pos</code>. If the end of the <code>Clob</code> value is reached
|
||||
* while writing characters to the stream, then the length of the <code>Clob</code>
|
||||
* in the {@code Clob} object starting at the position
|
||||
* {@code pos}. If the end of the {@code Clob} value is reached
|
||||
* while writing characters to the stream, then the length of the {@code Clob}
|
||||
* value will be increased to accommodate the extra characters.
|
||||
* <p>
|
||||
* <b>Note:</b> If the value specified for <code>pos</code>
|
||||
* is greater then the length+1 of the <code>CLOB</code> value then the
|
||||
* behavior is undefined. Some JDBC drivers may throw a
|
||||
* <code>SQLException</code> while other drivers may support this
|
||||
* <b>Note:</b> If the value specified for {@code pos}
|
||||
* is greater than the length+1 of the {@code CLOB} value then the
|
||||
* behavior is undefined. Some JDBC drivers may throw an
|
||||
* {@code SQLException} while other drivers may support this
|
||||
* operation.
|
||||
*
|
||||
* @param pos the position at which to start writing to the
|
||||
* <code>CLOB</code> value; The first position is 1
|
||||
* {@code CLOB} value; The first position is 1
|
||||
*
|
||||
* @return a stream to which Unicode encoded characters can be written
|
||||
* @exception SQLException if there is an error accessing the
|
||||
* <code>CLOB</code> value or if pos is less than 1
|
||||
* @exception SQLFeatureNotSupportedException if the JDBC driver does not support
|
||||
* this method
|
||||
* {@code CLOB} value or if pos is less than 1
|
||||
* @exception SQLFeatureNotSupportedException if the JDBC driver
|
||||
* does not support this method
|
||||
* @see #getCharacterStream
|
||||
*
|
||||
* @since 1.4
|
||||
@ -287,60 +288,64 @@ public interface Clob {
|
||||
java.io.Writer setCharacterStream(long pos) throws SQLException;
|
||||
|
||||
/**
|
||||
* Truncates the <code>CLOB</code> value that this <code>Clob</code>
|
||||
* designates to have a length of <code>len</code>
|
||||
* Truncates the {@code CLOB} value that this {@code Clob}
|
||||
* designates to have a length of {@code len}
|
||||
* characters.
|
||||
* <p>
|
||||
* <b>Note:</b> If the value specified for <code>pos</code>
|
||||
* is greater then the length+1 of the <code>CLOB</code> value then the
|
||||
* behavior is undefined. Some JDBC drivers may throw a
|
||||
* <code>SQLException</code> while other drivers may support this
|
||||
* <b>Note:</b> If the value specified for {@code pos}
|
||||
* is greater than the length+1 of the {@code CLOB} value then the
|
||||
* behavior is undefined. Some JDBC drivers may throw an
|
||||
* {@code SQLException} while other drivers may support this
|
||||
* operation.
|
||||
*
|
||||
* @param len the length, in characters, to which the <code>CLOB</code> value
|
||||
* @param len the length, in characters, to which the {@code CLOB} value
|
||||
* should be truncated
|
||||
* @exception SQLException if there is an error accessing the
|
||||
* <code>CLOB</code> value or if len is less than 0
|
||||
* {@code CLOB} value or if len is less than 0
|
||||
*
|
||||
* @exception SQLFeatureNotSupportedException if the JDBC driver does not support
|
||||
* this method
|
||||
* @exception SQLFeatureNotSupportedException if the JDBC driver
|
||||
* does not support this method
|
||||
* @since 1.4
|
||||
*/
|
||||
void truncate(long len) throws SQLException;
|
||||
|
||||
/**
|
||||
* This method releases the resources that the <code>Clob</code> object
|
||||
* holds. The object is invalid once the <code>free</code> method
|
||||
* This method releases the resources that the {@code Clob} object
|
||||
* holds. The object is invalid once the {@code free} method
|
||||
* is called.
|
||||
* <p>
|
||||
* After <code>free</code> has been called, any attempt to invoke a
|
||||
* method other than <code>free</code> will result in a <code>SQLException</code>
|
||||
* being thrown. If <code>free</code> is called multiple times, the subsequent
|
||||
* calls to <code>free</code> are treated as a no-op.
|
||||
* After {@code free} has been called, any attempt to invoke a
|
||||
* method other than {@code free} will result in a {@code SQLException}
|
||||
* being thrown. If {@code free} is called multiple times, the subsequent
|
||||
* calls to {@code free} are treated as a no-op.
|
||||
*
|
||||
* @throws SQLException if an error occurs releasing
|
||||
* the Clob's resources
|
||||
* the Clob's resources
|
||||
*
|
||||
* @exception SQLFeatureNotSupportedException if the JDBC driver does not support
|
||||
* this method
|
||||
* @exception SQLFeatureNotSupportedException if the JDBC driver
|
||||
* does not support this method
|
||||
* @since 1.6
|
||||
*/
|
||||
void free() throws SQLException;
|
||||
|
||||
/**
|
||||
* Returns a <code>Reader</code> object that contains a partial <code>Clob</code> value, starting
|
||||
* with the character specified by pos, which is length characters in length.
|
||||
* Returns a {@code Reader} object that contains
|
||||
* a partial {@code Clob} value, starting with the character
|
||||
* specified by pos, which is length characters in length.
|
||||
*
|
||||
* @param pos the offset to the first character of the partial value to
|
||||
* be retrieved. The first character in the Clob is at position 1.
|
||||
* @param length the length in characters of the partial value to be retrieved.
|
||||
* @return <code>Reader</code> through which the partial <code>Clob</code> value can be read.
|
||||
* @throws SQLException if pos is less than 1 or if pos is greater than the number of
|
||||
* characters in the <code>Clob</code> or if pos + length is greater than the number of
|
||||
* characters in the <code>Clob</code>
|
||||
* @return {@code Reader} through which
|
||||
* the partial {@code Clob} value can be read.
|
||||
* @throws SQLException if pos is less than 1;
|
||||
* or if pos is greater than the number of characters
|
||||
* in the {@code Clob};
|
||||
* or if pos + length is greater than the number of
|
||||
* characters in the {@code Clob}
|
||||
*
|
||||
* @exception SQLFeatureNotSupportedException if the JDBC driver does not support
|
||||
* this method
|
||||
* @exception SQLFeatureNotSupportedException if the JDBC driver
|
||||
* does not support this method
|
||||
* @since 1.6
|
||||
*/
|
||||
Reader getCharacterStream(long pos, long length) throws SQLException;
|
||||
|
@ -35,7 +35,7 @@ manager to enlist and delist resource objects (supplied by the
|
||||
resource manager driver) in JTA transactions. The driver vendor
|
||||
for a specific resource manager provides the implementation of
|
||||
this API.
|
||||
<p>
|
||||
|
||||
@since 1.4
|
||||
</body>
|
||||
</html>
|
||||
|
@ -30,7 +30,7 @@ questions.
|
||||
<body bgcolor="white">
|
||||
|
||||
Contains three exceptions thrown by the ORB machinery during unmarshalling.
|
||||
<p>
|
||||
|
||||
@since 1.3
|
||||
</body>
|
||||
</html>
|
||||
|
@ -31,7 +31,7 @@ package com.sun.tools.attach;
|
||||
* VirtualMachine#attach VirtalMachine.attach} to attach to a target virtual
|
||||
* machine.
|
||||
* This permission is also checked when an {@link
|
||||
* com.sun.tools.attach.spi.AttachProvider AttachProvider} is created. </p>
|
||||
* com.sun.tools.attach.spi.AttachProvider AttachProvider} is created.
|
||||
*
|
||||
* <p> An <code>AttachPermission</code> object contains a name (also referred
|
||||
* to as a "target name") but no actions list; you either have the
|
||||
@ -39,7 +39,7 @@ package com.sun.tools.attach;
|
||||
* The following table provides a summary description of what the
|
||||
* permission allows, and discusses the risks of granting code the
|
||||
* permission.
|
||||
* <P>
|
||||
*
|
||||
* <table border=1 cellpadding=5 summary="Table shows permission
|
||||
* target name, what the permission allows, and associated risks">
|
||||
* <tr>
|
||||
|
@ -0,0 +1,2 @@
|
||||
# NIO charset SPI extended charset provider
|
||||
sun.nio.cs.ext.ExtendedCharsets
|
@ -395,7 +395,7 @@ abstract class ISO2022
|
||||
|
||||
protected final byte maximumDesignatorLength = 4;
|
||||
|
||||
protected String SODesig,
|
||||
protected byte[] SODesig,
|
||||
SS2Desig = null,
|
||||
SS3Desig = null;
|
||||
|
||||
@ -426,21 +426,18 @@ abstract class ISO2022
|
||||
SS3DesDefined = false;
|
||||
}
|
||||
|
||||
private int unicodeToNative(char unicode, byte ebyte[])
|
||||
{
|
||||
private int unicodeToNative(char unicode, byte ebyte[]) {
|
||||
int index = 0;
|
||||
byte tmpByte[];
|
||||
char convChar[] = {unicode};
|
||||
byte convByte[] = new byte[4];
|
||||
int converted;
|
||||
|
||||
try{
|
||||
CharBuffer cc = CharBuffer.wrap(convChar);
|
||||
ByteBuffer bb = ByteBuffer.allocate(4);
|
||||
ByteBuffer bb = ByteBuffer.wrap(convByte);
|
||||
ISOEncoder.encode(cc, bb, true);
|
||||
bb.flip();
|
||||
converted = bb.remaining();
|
||||
bb.get(convByte,0,converted);
|
||||
} catch(Exception e) {
|
||||
return -1;
|
||||
}
|
||||
@ -449,9 +446,8 @@ abstract class ISO2022
|
||||
if (!SODesDefined) {
|
||||
newSODesDefined = true;
|
||||
ebyte[0] = ISO_ESC;
|
||||
tmpByte = SODesig.getBytes();
|
||||
System.arraycopy(tmpByte,0,ebyte,1,tmpByte.length);
|
||||
index = tmpByte.length+1;
|
||||
System.arraycopy(SODesig, 0, ebyte, 1, SODesig.length);
|
||||
index = SODesig.length + 1;
|
||||
}
|
||||
if (!shiftout) {
|
||||
newshiftout = true;
|
||||
@ -465,9 +461,8 @@ abstract class ISO2022
|
||||
if (!SS2DesDefined) {
|
||||
newSS2DesDefined = true;
|
||||
ebyte[0] = ISO_ESC;
|
||||
tmpByte = SS2Desig.getBytes();
|
||||
System.arraycopy(tmpByte, 0, ebyte, 1, tmpByte.length);
|
||||
index = tmpByte.length+1;
|
||||
System.arraycopy(SS2Desig, 0, ebyte, 1, SS2Desig.length);
|
||||
index = SS2Desig.length + 1;
|
||||
}
|
||||
ebyte[index++] = ISO_ESC;
|
||||
ebyte[index++] = ISO_SS2_7;
|
||||
@ -477,9 +472,8 @@ abstract class ISO2022
|
||||
if(!SS3DesDefined){
|
||||
newSS3DesDefined = true;
|
||||
ebyte[0] = ISO_ESC;
|
||||
tmpByte = SS3Desig.getBytes();
|
||||
System.arraycopy(tmpByte, 0, ebyte, 1, tmpByte.length);
|
||||
index = tmpByte.length+1;
|
||||
System.arraycopy(SS3Desig, 0, ebyte, 1, SS3Desig.length);
|
||||
index = SS3Desig.length + 1;
|
||||
}
|
||||
ebyte[index++] = ISO_ESC;
|
||||
ebyte[index++] = ISO_SS3_7;
|
||||
@ -560,7 +554,6 @@ abstract class ISO2022
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private CoderResult encodeBufferLoop(CharBuffer src,
|
||||
ByteBuffer dst)
|
||||
{
|
||||
|
@ -67,9 +67,9 @@ public class ISO2022_CN_CNS extends ISO2022 implements HistoricallyNamedCharset
|
||||
public Encoder(Charset cs)
|
||||
{
|
||||
super(cs);
|
||||
SODesig = "$)G";
|
||||
SS2Desig = "$*H";
|
||||
SS3Desig = "$+I";
|
||||
SODesig = new byte[] {'$', ')', 'G' };
|
||||
SS2Desig = new byte[] {'$', '*', 'H' };
|
||||
SS3Desig = new byte[] {'$', '+', 'I' };
|
||||
|
||||
try {
|
||||
Charset cset = Charset.forName("EUC_TW"); // CNS11643
|
||||
|
@ -68,7 +68,7 @@ public class ISO2022_CN_GB extends ISO2022 implements HistoricallyNamedCharset
|
||||
public Encoder(Charset cs)
|
||||
{
|
||||
super(cs);
|
||||
SODesig = "$)A";
|
||||
SODesig = new byte[] { '$', ')', 'A'};
|
||||
|
||||
try {
|
||||
Charset cset = Charset.forName("EUC_CN"); // GB2312
|
||||
|
@ -81,11 +81,9 @@ implements HistoricallyNamedCharset
|
||||
|
||||
private static class Encoder extends ISO2022.Encoder {
|
||||
|
||||
public Encoder(Charset cs)
|
||||
{
|
||||
public Encoder(Charset cs) {
|
||||
super(cs);
|
||||
SODesig = "$)C";
|
||||
|
||||
SODesig = new byte[] {'$', ')', 'C' };
|
||||
try {
|
||||
ISOEncoder = ksc5601_cs.newEncoder();
|
||||
} catch (Exception e) { }
|
||||
|
@ -1,144 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2005, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/**
|
||||
* This FilterReader class processes a sequence of characters from
|
||||
* a source stream containing a mixture of 7-bit ASCII data and
|
||||
* 'back-tick U' escaped sequences representing characters which have
|
||||
* the possibility of being encoded in a user specified encoding
|
||||
* The filter relies on knowing the target encoding and makes a
|
||||
* determination as to whether a given supplied character in its
|
||||
* source character stream is encodeable in the target encoding.
|
||||
* If not, it is remains in its back-tick U escaped form.
|
||||
*/
|
||||
|
||||
package sun.tools.native2ascii;
|
||||
import java.io.*;
|
||||
|
||||
|
||||
class A2NFilter extends FilterReader {
|
||||
|
||||
// maintain a trailing buffer to hold any incompleted
|
||||
// unicode escaped sequences
|
||||
private char[] trailChars = null;
|
||||
|
||||
public A2NFilter(Reader in) {
|
||||
super(in);
|
||||
}
|
||||
|
||||
public int read(char[] buf, int off, int len) throws IOException {
|
||||
int numChars = 0; // how many characters have been read
|
||||
int retChars = 0; // how many characters we'll return
|
||||
|
||||
char[] cBuf = new char[len];
|
||||
int cOffset = 0; // offset at which we'll start reading
|
||||
boolean eof = false;
|
||||
|
||||
// copy trailing chars from previous invocation to input buffer
|
||||
if (trailChars != null) {
|
||||
for (int i = 0; i < trailChars.length; i++)
|
||||
cBuf[i] = trailChars[i];
|
||||
numChars = trailChars.length;
|
||||
trailChars = null;
|
||||
}
|
||||
|
||||
int n = in.read(cBuf, numChars, len - numChars);
|
||||
if (n < 0) {
|
||||
eof = true;
|
||||
if (numChars == 0)
|
||||
return -1; // EOF;
|
||||
} else {
|
||||
numChars += n;
|
||||
}
|
||||
|
||||
for (int i = 0; i < numChars;) {
|
||||
char c = cBuf[i++];
|
||||
|
||||
if (c != '\\' || (eof && numChars <= 5)) {
|
||||
// Not a backslash, so copy and continue
|
||||
// Always pass non backslash chars straight thru
|
||||
// for regular encoding. If backslash occurs in
|
||||
// input stream at the final 5 chars then don't
|
||||
// attempt to read-ahead and de-escape since these
|
||||
// are literal occurrences of U+005C which need to
|
||||
// be encoded verbatim in the target encoding.
|
||||
buf[retChars++] = c;
|
||||
continue;
|
||||
}
|
||||
|
||||
int remaining = numChars - i;
|
||||
if (remaining < 5) {
|
||||
// Might be the first character of a unicode escape, but we
|
||||
// don't have enough characters to tell, so save it and finish
|
||||
trailChars = new char[1 + remaining];
|
||||
trailChars[0] = c;
|
||||
for (int j = 0; j < remaining; j++)
|
||||
trailChars[1 + j] = cBuf[i + j];
|
||||
break;
|
||||
}
|
||||
// At this point we have at least five characters remaining
|
||||
|
||||
c = cBuf[i++];
|
||||
if (c != 'u') {
|
||||
// Not a unicode escape, so copy and continue
|
||||
buf[retChars++] = '\\';
|
||||
buf[retChars++] = c;
|
||||
continue;
|
||||
}
|
||||
|
||||
// The next four characters are the hex part of a unicode escape
|
||||
char rc = 0;
|
||||
boolean isUE = true;
|
||||
try {
|
||||
rc = (char)Integer.parseInt(new String(cBuf, i, 4), 16);
|
||||
} catch (NumberFormatException x) {
|
||||
isUE = false;
|
||||
}
|
||||
if (isUE && Main.canConvert(rc)) {
|
||||
// We'll be able to convert this
|
||||
buf[retChars++] = rc;
|
||||
i += 4; // Align beyond the current uXXXX sequence
|
||||
} else {
|
||||
// We won't, so just retain the original sequence
|
||||
buf[retChars++] = '\\';
|
||||
buf[retChars++] = 'u';
|
||||
continue;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return retChars;
|
||||
}
|
||||
|
||||
public int read() throws IOException {
|
||||
char[] buf = new char[1];
|
||||
|
||||
if (read(buf, 0, 1) == -1)
|
||||
return -1;
|
||||
else
|
||||
return (int)buf[0];
|
||||
}
|
||||
|
||||
}
|
@ -1,375 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
*/
|
||||
|
||||
/*
|
||||
Currently javac and load() method in java.util.Properties
|
||||
supports only Latin1 encoding input.
|
||||
But in Asian platforms programmer or message translator
|
||||
uses the editor which support othere than latin1 encoding
|
||||
to specify their native language string.
|
||||
So if programmer or message translator wants to use other than
|
||||
Latin1 character in his/her program source or properties file
|
||||
they must convert the file to ASCII plus \udddd notation.
|
||||
(javac/load() modification is not appropriate due to
|
||||
time constraints for JDK1.1)
|
||||
This utility is for the purpose of that conversion.
|
||||
|
||||
NAME
|
||||
native2ascii - convert native encoding file to ascii file
|
||||
include \udddd Unicode notation
|
||||
|
||||
SYNOPSIS
|
||||
native2ascii [options] [inputfile [outputfile]]
|
||||
|
||||
DESCRIPTION
|
||||
If outputfile is not described standard output is used as
|
||||
output file, and if inputfile is not also described
|
||||
stardard input is used as input file.
|
||||
|
||||
Options
|
||||
|
||||
-reverse
|
||||
convert ascii with \udddd notation to native encoding
|
||||
|
||||
-encoding encoding_name
|
||||
Specify the encoding name which is used by conversion.
|
||||
8859_[1 - 9], JIS, EUCJIS, SJIS is currently supported.
|
||||
Default encoding is taken from System property "file.encoding".
|
||||
|
||||
*/
|
||||
|
||||
package sun.tools.native2ascii;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
import java.text.MessageFormat;
|
||||
import java.nio.charset.CharsetEncoder;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.IllegalCharsetNameException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.nio.charset.UnsupportedCharsetException;
|
||||
|
||||
/**
|
||||
* Main program of the native2ascii
|
||||
*/
|
||||
|
||||
public class Main {
|
||||
|
||||
String inputFileName = null;
|
||||
String outputFileName = null;
|
||||
File tempFile = null;
|
||||
boolean reverse = false;
|
||||
static String encodingString = null;
|
||||
static String defaultEncoding = null;
|
||||
static CharsetEncoder encoder = null;
|
||||
|
||||
/**
|
||||
* Run the converter
|
||||
*/
|
||||
public synchronized boolean convert(String argv[]) {
|
||||
List<String> v = new ArrayList<>(2);
|
||||
File outputFile = null;
|
||||
boolean createOutputFile = false;
|
||||
|
||||
// Parse arguments
|
||||
for (int i = 0; i < argv.length; i++) {
|
||||
if (argv[i].equals("-encoding")) {
|
||||
if ((i + 1) < argv.length) {
|
||||
encodingString = argv[++i];
|
||||
} else {
|
||||
error(getMsg("err.bad.arg"));
|
||||
usage();
|
||||
return false;
|
||||
}
|
||||
} else if (argv[i].equals("-reverse")) {
|
||||
reverse = true;
|
||||
} else {
|
||||
if (v.size() > 1) {
|
||||
usage();
|
||||
return false;
|
||||
}
|
||||
v.add(argv[i]);
|
||||
}
|
||||
}
|
||||
|
||||
if (encodingString == null) {
|
||||
defaultEncoding = Charset.defaultCharset().name();
|
||||
}
|
||||
char[] lineBreak = System.getProperty("line.separator").toCharArray();
|
||||
|
||||
try {
|
||||
initializeConverter();
|
||||
|
||||
if (v.size() == 1) {
|
||||
inputFileName = v.get(0);
|
||||
}
|
||||
|
||||
if (v.size() == 2) {
|
||||
inputFileName = v.get(0);
|
||||
outputFileName = v.get(1);
|
||||
createOutputFile = true;
|
||||
}
|
||||
|
||||
if (createOutputFile) {
|
||||
outputFile = new File(outputFileName);
|
||||
if (outputFile.exists() && !outputFile.canWrite()) {
|
||||
throw new Exception(formatMsg("err.cannot.write", outputFileName));
|
||||
}
|
||||
}
|
||||
|
||||
if (reverse) {
|
||||
try (BufferedReader reader = getA2NInput(inputFileName);
|
||||
Writer osw = getA2NOutput(outputFileName);) {
|
||||
String line;
|
||||
while ((line = reader.readLine()) != null) {
|
||||
osw.write(line.toCharArray());
|
||||
osw.write(lineBreak);
|
||||
if (outputFileName == null) { // flush stdout
|
||||
osw.flush();
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// N2A
|
||||
try (BufferedReader in = getN2AInput(inputFileName);
|
||||
BufferedWriter out = getN2AOutput(outputFileName);) {
|
||||
String inLine;
|
||||
while ((inLine = in.readLine()) != null) {
|
||||
out.write(inLine.toCharArray());
|
||||
out.write(lineBreak);
|
||||
if (outputFileName == null) { // flush stdout
|
||||
out.flush();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Since we are done rename temporary file to desired output file
|
||||
if (createOutputFile) {
|
||||
if (outputFile.exists()) {
|
||||
// Some win32 platforms can't handle atomic
|
||||
// rename if source and target file paths are
|
||||
// identical. To make things simple we just unconditionally
|
||||
// delete the target file before calling renameTo()
|
||||
outputFile.delete();
|
||||
}
|
||||
tempFile.renameTo(outputFile);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
error(e.toString());
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private void error(String msg){
|
||||
System.out.println(msg);
|
||||
}
|
||||
|
||||
private void usage(){
|
||||
System.out.println(getMsg("usage"));
|
||||
}
|
||||
|
||||
|
||||
private BufferedReader getN2AInput(String inFile) throws Exception {
|
||||
|
||||
InputStream forwardIn;
|
||||
if (inFile == null)
|
||||
forwardIn = System.in;
|
||||
else {
|
||||
File f = new File(inFile);
|
||||
if (!f.canRead()){
|
||||
throw new Exception(formatMsg("err.cannot.read", f.getName()));
|
||||
}
|
||||
|
||||
try {
|
||||
forwardIn = new FileInputStream(inFile);
|
||||
} catch (IOException e) {
|
||||
throw new Exception(formatMsg("err.cannot.read", f.getName()));
|
||||
}
|
||||
}
|
||||
|
||||
BufferedReader r = (encodingString != null) ?
|
||||
new BufferedReader(new InputStreamReader(forwardIn,
|
||||
encodingString)) :
|
||||
new BufferedReader(new InputStreamReader(forwardIn));
|
||||
return r;
|
||||
}
|
||||
|
||||
|
||||
private BufferedWriter getN2AOutput(String outFile) throws Exception {
|
||||
Writer output;
|
||||
BufferedWriter n2aOut;
|
||||
|
||||
if (outFile == null)
|
||||
output = new OutputStreamWriter(System.out,"US-ASCII");
|
||||
|
||||
else {
|
||||
File f = new File(outFile);
|
||||
|
||||
File tempDir = f.getParentFile();
|
||||
|
||||
if (tempDir == null)
|
||||
tempDir = new File(System.getProperty("user.dir"));
|
||||
|
||||
tempFile = File.createTempFile("_N2A",
|
||||
".TMP",
|
||||
tempDir);
|
||||
tempFile.deleteOnExit();
|
||||
|
||||
try {
|
||||
output = new FileWriter(tempFile);
|
||||
} catch (IOException e){
|
||||
throw new Exception(formatMsg("err.cannot.write", tempFile.getName()));
|
||||
}
|
||||
}
|
||||
|
||||
n2aOut = new BufferedWriter(new N2AFilter(output));
|
||||
return n2aOut;
|
||||
}
|
||||
|
||||
private BufferedReader getA2NInput(String inFile) throws Exception {
|
||||
Reader in;
|
||||
BufferedReader reader;
|
||||
|
||||
if (inFile == null)
|
||||
in = new InputStreamReader(System.in, "US-ASCII");
|
||||
else {
|
||||
File f = new File(inFile);
|
||||
if (!f.canRead()){
|
||||
throw new Exception(formatMsg("err.cannot.read", f.getName()));
|
||||
}
|
||||
|
||||
try {
|
||||
in = new FileReader(inFile);
|
||||
} catch (Exception e) {
|
||||
throw new Exception(formatMsg("err.cannot.read", f.getName()));
|
||||
}
|
||||
}
|
||||
|
||||
reader = new BufferedReader(new A2NFilter(in));
|
||||
return reader;
|
||||
}
|
||||
|
||||
private Writer getA2NOutput(String outFile) throws Exception {
|
||||
|
||||
OutputStreamWriter w = null;
|
||||
OutputStream output = null;
|
||||
|
||||
if (outFile == null)
|
||||
output = System.out;
|
||||
else {
|
||||
File f = new File(outFile);
|
||||
|
||||
File tempDir = f.getParentFile();
|
||||
if (tempDir == null)
|
||||
tempDir = new File(System.getProperty("user.dir"));
|
||||
tempFile = File.createTempFile("_N2A",
|
||||
".TMP",
|
||||
tempDir);
|
||||
tempFile.deleteOnExit();
|
||||
|
||||
try {
|
||||
output = new FileOutputStream(tempFile);
|
||||
} catch (IOException e){
|
||||
throw new Exception(formatMsg("err.cannot.write", tempFile.getName()));
|
||||
}
|
||||
}
|
||||
|
||||
w = (encodingString != null) ?
|
||||
new OutputStreamWriter(output, encodingString) :
|
||||
new OutputStreamWriter(output);
|
||||
|
||||
return (w);
|
||||
}
|
||||
|
||||
private static Charset lookupCharset(String csName) {
|
||||
if (Charset.isSupported(csName)) {
|
||||
try {
|
||||
return Charset.forName(csName);
|
||||
} catch (UnsupportedCharsetException x) {
|
||||
throw new Error(x);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static boolean canConvert(char ch) {
|
||||
return (encoder != null && encoder.canEncode(ch));
|
||||
}
|
||||
|
||||
private static void initializeConverter() throws UnsupportedEncodingException {
|
||||
Charset cs = null;
|
||||
|
||||
try {
|
||||
cs = (encodingString == null) ?
|
||||
lookupCharset(defaultEncoding):
|
||||
lookupCharset(encodingString);
|
||||
|
||||
encoder = (cs != null) ?
|
||||
cs.newEncoder() :
|
||||
null;
|
||||
} catch (IllegalCharsetNameException e) {
|
||||
throw new Error(e);
|
||||
}
|
||||
}
|
||||
|
||||
private static ResourceBundle rsrc;
|
||||
|
||||
static {
|
||||
try {
|
||||
rsrc = ResourceBundle.getBundle(
|
||||
"sun.tools.native2ascii.resources.MsgNative2ascii");
|
||||
} catch (MissingResourceException e) {
|
||||
throw new Error("Missing message file.");
|
||||
}
|
||||
}
|
||||
|
||||
private String getMsg(String key) {
|
||||
try {
|
||||
return (rsrc.getString(key));
|
||||
} catch (MissingResourceException e) {
|
||||
throw new Error("Error in message file format.");
|
||||
}
|
||||
}
|
||||
|
||||
private String formatMsg(String key, String arg) {
|
||||
String msg = getMsg(key);
|
||||
return MessageFormat.format(msg, arg);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Main program
|
||||
*/
|
||||
public static void main(String argv[]){
|
||||
Main converter = new Main();
|
||||
System.exit(converter.convert(argv) ? 0 : 1);
|
||||
}
|
||||
}
|
@ -1,74 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* This FilterWriter class takes an existing Writer and uses
|
||||
* the 'back-tick U' escape notation to escape characters which are
|
||||
* encountered within the input character based stream which
|
||||
* are outside the 7-bit ASCII range. The native platforms linefeed
|
||||
* character is emitted for each line of processed input
|
||||
*/
|
||||
|
||||
package sun.tools.native2ascii;
|
||||
import java.io.*;
|
||||
import java.nio.BufferOverflowException;
|
||||
|
||||
class N2AFilter extends FilterWriter {
|
||||
|
||||
public N2AFilter(Writer out) { super(out); }
|
||||
|
||||
public void write(char b) throws IOException {
|
||||
char[] buf = new char[1];
|
||||
buf[0] = b;
|
||||
write(buf, 0, 1);
|
||||
}
|
||||
|
||||
public void write(char[] buf, int off, int len) throws IOException {
|
||||
|
||||
String lineBreak = System.getProperty("line.separator");
|
||||
|
||||
//System.err.println ("xx Out buffer length is " + buf.length );
|
||||
for (int i = 0; i < len; i++) {
|
||||
if ((buf[i] > '\u007f')) {
|
||||
// write \udddd
|
||||
out.write('\\');
|
||||
out.write('u');
|
||||
String hex =
|
||||
Integer.toHexString(buf[i]);
|
||||
StringBuilder hex4 = new StringBuilder(hex);
|
||||
hex4.reverse();
|
||||
int length = 4 - hex4.length();
|
||||
for (int j = 0; j < length; j++) {
|
||||
hex4.append('0');
|
||||
}
|
||||
for (int j = 0; j < 4; j++) {
|
||||
out.write(hex4.charAt(3 - j));
|
||||
}
|
||||
} else
|
||||
out.write(buf[i]);
|
||||
}
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user