remove code used to generate test files
@@ -552,64 +552,4 @@ public class TikaCLITest {
String content = outContent.toString(UTF_8.name());
assertFalse(content.contains("org.apache.tika.parser.executable.Executable"));
}
-
- @Test
- public void testFileNameNormalization() throws Exception {
- File z = new File("C:/data/testZip_zeroByte.zip");
- OutputStream os = new FileOutputStream(z);
- ZipOutputStream outputStream = new ZipOutputStream(os);
- ZipEntry zipEntry = new ZipEntry("dang\u0000erous.pl");
- outputStream.putNextEntry(zipEntry);
- byte[] bytes = "hello world1".getBytes(StandardCharsets.UTF_8);
- outputStream.write(bytes, 0,bytes.length);
- outputStream.closeEntry();
- outputStream.flush();
- outputStream.close();
-
- z = new File("C:/data/testZip_absolutePath.zip");
- os = new FileOutputStream(z);
- outputStream = new ZipOutputStream(os);
- zipEntry = new ZipEntry("C:/dangerous/dont/touch.pl");
- outputStream.putNextEntry(zipEntry);
- bytes = "hello world2".getBytes(StandardCharsets.UTF_8);
- outputStream.write(bytes, 0,bytes.length);
- outputStream.closeEntry();
- zipEntry = new ZipEntry("/dangerous/dont/touch.pl");
- outputStream.putNextEntry(zipEntry);
- bytes = "hello world3".getBytes(StandardCharsets.UTF_8);
- outputStream.write(bytes, 0,bytes.length);
- outputStream.closeEntry();
-
- outputStream.flush();
- outputStream.close();
-
- z = new File("C:/data/testZip_relative.zip");
- os = new FileOutputStream(z);
- outputStream = new ZipOutputStream(os);
- zipEntry = new ZipEntry("../../../dangerous/dont/touch.pl");
- outputStream.putNextEntry(zipEntry);
- bytes = "hello world3".getBytes(StandardCharsets.UTF_8);
- outputStream.write(bytes, 0,bytes.length);
- outputStream.closeEntry();
- outputStream.flush();
- outputStream.close();
-
- z = new File("C:/data/testZip_overlappingNames.zip");
- os = new FileOutputStream(z);
- outputStream = new ZipOutputStream(os);
- zipEntry = new ZipEntry("f1.txt");
- outputStream.putNextEntry(zipEntry);
- bytes = "hello world4".getBytes(StandardCharsets.UTF_8);
- outputStream.write(bytes, 0,bytes.length);
- outputStream.closeEntry();
-
- zipEntry = new ZipEntry("../../../f1.txt");
- outputStream.putNextEntry(zipEntry);
- bytes = "hello world5".getBytes(StandardCharsets.UTF_8);
- outputStream.write(bytes, 0,bytes.length);
- outputStream.closeEntry();
-
- outputStream.flush();
- outputStream.close();
- }
}
