/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* 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.
*/
/*
* Native method support for java.util.zip.ZipFile
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <ctype.h>
#include <assert.h>
#include "jlong.h"
#include "jvm.h"
#include "jni.h"
#include "jni_util.h"
#include "zip_util.h"
#ifdef WIN32
#include "io_util_md.h"
#else
#include "io_util.h"
#endif
#include "java_util_zip_ZipFile.h"
#include "java_util_jar_JarFile.h"
#define STORED 0
{
}
static void
{
jobject x;
}
x = JNU_NewObjectByName(env,
"java/util/zip/ZipException",
if (x != NULL) {
}
}
{
char *msg = 0;
int flag = 0;
if (path != 0) {
#ifdef WIN32
if (zfd == -1) {
/* Exception already pending. */
goto finally;
}
#else
if (zfd < 0) {
goto finally;
}
#endif
}
if (zip != 0) {
} else if (msg != 0) {
} else {
}
}
return result;
}
{
}
{
}
{
}
{
if (path == 0) {
return 0;
}
} else {
}
} else {
}
}
return ptr_to_jlong(ze);
}
{
}
jint n)
{
return ptr_to_jlong(ze);
}
{
}
{
}
{
}
{
}
{
}
{
}
{
return NULL;
}
return jba;
}
{
int len = 0;
switch (type) {
break;
}
break;
break;
}
break;
break;
}
break;
}
return jba;
}
{
char *msg;
/* copy via tmp stack buffer: */
}
if (len != -1) {
}
if (len == -1) {
if (msg != 0) {
} else {
errno, "Error reading ZIP file");
}
}
return len;
}
/*
* Returns an array of strings representing the names of all entries
* that begin with "META-INF/" (case ignored). This native method is
* used in JarFile as an optimization when looking up manifest and
* signature file entries. Returns null if no entries were found.
*/
{
int i, count;
if (zfile == 0) {
"java/lang/IllegalStateException", "zip file closed");
return NULL;
}
/* count the number of valid ZIP metanames */
count = 0;
count++;
}
}
}
/* If some names were found then build array of java strings */
if (count > 0) {
if (result != 0) {
for (i = 0; i < count; i++) {
if (str == 0) {
break;
}
}
}
}
return result;
}
{
return NULL;
}
}