mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
cleanup
This commit is contained in:
@@ -14,7 +14,6 @@ import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.Enumeration;
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipInputStream;
|
||||
@@ -75,26 +74,6 @@ public class ZipUtil {
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean isSingleTopLevelDir(@NotNull Enumeration<? extends ZipEntry> zipEntries) {
|
||||
String singleTopLevelDirName = null;
|
||||
char pathDelimiterChar = '/';
|
||||
int cnt = 0;
|
||||
while (zipEntries.hasMoreElements()) {
|
||||
cnt++;
|
||||
ZipEntry zipEntry = zipEntries.nextElement();
|
||||
String name = zipEntry.getName();
|
||||
int ind = (name + pathDelimiterChar).indexOf(pathDelimiterChar);
|
||||
String topLevelFileName = name.substring(0, ind);
|
||||
if (singleTopLevelDirName == null) {
|
||||
singleTopLevelDirName = topLevelFileName;
|
||||
}
|
||||
else if (!singleTopLevelDirName.equals(topLevelFileName)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return cnt > 0;
|
||||
}
|
||||
|
||||
private static void unzipEntryToDir(@Nullable ProgressIndicator progress,
|
||||
@NotNull final ZipEntry zipEntry,
|
||||
@NotNull final File extractToDir,
|
||||
|
||||
Reference in New Issue
Block a user