GetDirEntry.java revision 0
321N/A/*
321N/A * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved.
321N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
321N/A *
940N/A * This code is free software; you can redistribute it and/or modify it
940N/A * under the terms of the GNU General Public License version 2 only, as
178N/A * published by the Free Software Foundation.
178N/A *
178N/A * This code is distributed in the hope that it will be useful, but WITHOUT
224N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
295N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
295N/A * version 2 for more details (a copy is included in the LICENSE file that
295N/A * accompanied this code).
824N/A *
824N/A * You should have received a copy of the GNU General Public License version
824N/A * 2 along with this work; if not, write to the Free Software Foundation,
824N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
824N/A *
824N/A * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
824N/A * CA 95054 USA or visit www.sun.com if you need additional information or
824N/A * have any questions.
824N/A */
824N/A
824N/A/* @test
824N/A @bug 4206838
824N/A @summary getEntry() will search for a directory
824N/A even without an ending '/'.
824N/A */
824N/A
824N/Aimport java.io.*;
824N/Aimport java.util.zip.*;
824N/A
824N/Apublic class GetDirEntry {
178N/A public static void main(String args[]) throws Exception {
1928N/A ZipFile zf = new ZipFile(new File(System.getProperty("test.src", "."),
1928N/A "input.jar"));
1928N/A ZipEntry ze = zf.getEntry("META-INF");
1928N/A if (ze == null) {
1928N/A throw new Exception("failed to find a directory entry");
1928N/A }
178N/A zf.close();
178N/A }
178N/A}
224N/A