8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /**
25 * @test
26 * @bug 6374379
27 * @library /test/lib
28 * @summary Verify that we can read zip file names > 255 chars long
29 */
30
31 import java.io.*;
32 import java.util.jar.*;
33 import java.util.Stack;
34 import jdk.test.lib.util.FileUtils;
35
36 public class ReadLongZipFileName {
37 private static String entryName = "testFile.txt";;
38
39 public static void realMain(String args[]) {
40 String longDirName = "abcdefghijklmnopqrstuvwx"; // 24 chars.
41 String jarFileName = "areallylargejarfilename.jar"; // 27 chars.
42 File file = null;
43 File myJarFile = null;
44 int currentFileLength = 0;
45 int minRequiredLength = 600; // long enough to definitely fail.
46 Stack<File> directories = new Stack<File>();
47
|
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /**
25 * @test
26 * @bug 6374379
27 * @library /test/lib
28 * @build jdk.test.lib.Platform
29 * jdk.test.lib.Utils
30 * jdk.test.lib.Asserts
31 * jdk.test.lib.JDKToolFinder
32 * jdk.test.lib.JDKToolLauncher
33 * jdk.test.lib.process.*
34 * jdk.test.lib.util.FileUtils
35 * @run main ReadLongZipFileName
36 * @summary Verify that we can read zip file names > 255 chars long
37 */
38
39 import java.io.*;
40 import java.util.jar.*;
41 import java.util.Stack;
42 import jdk.test.lib.util.FileUtils;
43
44 public class ReadLongZipFileName {
45 private static String entryName = "testFile.txt";;
46
47 public static void realMain(String args[]) {
48 String longDirName = "abcdefghijklmnopqrstuvwx"; // 24 chars.
49 String jarFileName = "areallylargejarfilename.jar"; // 27 chars.
50 File file = null;
51 File myJarFile = null;
52 int currentFileLength = 0;
53 int minRequiredLength = 600; // long enough to definitely fail.
54 Stack<File> directories = new Stack<File>();
55
|