diff --git a/src/main/java/net/lingala/zip4j/headers/HeaderReader.java b/src/main/java/net/lingala/zip4j/headers/HeaderReader.java index 0f3f8de0..466cc424 100755 --- a/src/main/java/net/lingala/zip4j/headers/HeaderReader.java +++ b/src/main/java/net/lingala/zip4j/headers/HeaderReader.java @@ -191,11 +191,6 @@ private CentralDirectory readCentralDirectory(RandomAccessFile zip4jRaf, RawIO r byte[] fileNameBuff = new byte[fileNameLength]; zip4jRaf.readFully(fileNameBuff); String fileName = decodeStringWithCharset(fileNameBuff, fileHeader.isFileNameUTF8Encoded(), charset); - - if (fileName.contains(":\\")) { - fileName = fileName.substring(fileName.indexOf(":\\") + 2); - } - fileHeader.setFileName(fileName); } else { fileHeader.setFileName(null); @@ -560,11 +555,6 @@ public LocalFileHeader readLocalFileHeader(InputStream inputStream, Charset char readFully(inputStream, fileNameBuf); String fileName = decodeStringWithCharset(fileNameBuf, localFileHeader.isFileNameUTF8Encoded(), charset); - - if (fileName.contains(":" + System.getProperty("file.separator"))) { - fileName = fileName.substring(fileName.indexOf(":" + System.getProperty("file.separator")) + 2); - } - localFileHeader.setFileName(fileName); localFileHeader.setDirectory(fileName.endsWith("/") || fileName.endsWith("\\")); } else { diff --git a/src/main/java/net/lingala/zip4j/tasks/AbstractExtractFileTask.java b/src/main/java/net/lingala/zip4j/tasks/AbstractExtractFileTask.java index 67d1ce20..9815c886 100644 --- a/src/main/java/net/lingala/zip4j/tasks/AbstractExtractFileTask.java +++ b/src/main/java/net/lingala/zip4j/tasks/AbstractExtractFileTask.java @@ -164,7 +164,7 @@ private File determineOutputFile(FileHeader fileHeader, String outputPath, Strin outputFileName = newFileName; } else { // replace all slashes with file separator - outputFileName = getFileNameWithSystemFileSeparators(fileHeader.getFileName()); + outputFileName = fileHeader.getFileName(); } return new File(outputPath + FILE_SEPARATOR + outputFileName);