/*
* 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.
*
* 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 6374379
* @summary Verify that we can read zip file names > 255 chars long
*/
public class ReadLongZipFileName {
int currentFileLength = 0;
try {
// Create a directory structure long enough that the filename will
// put us over the minRequiredLength.
do {
// Create a new Jar file: use jar instead of zip to make sure long
// names work for both zip and jar subclass.
new BufferedOutputStream(
fail("Jar file does not exist.");
}
} catch (IOException e) {
unexpected(e, "Problem creating the Jar file.");
}
try {
try {
fail("Read past expected EOF");
} catch (IOException e) {
pass();
}
readJarFile.close();
+ " characters long");
} catch (IOException e) {
unexpected(e, "Test failed - problem reading the Jar file back in.");
}
}
while (! directories.empty()) {
}
}
//--------------------- Infrastructure ---------------------------
else fail(x + " not equal to " + y);}
}