etc/zipLengthCheck/check.sh | 9 ++
etc/zipLengthCheck/src/main/java/org/rhq/devUtil/zipCheck/ZipCheck.java | 34
++++++++++
2 files changed, 43 insertions(+)
New commits:
commit c0c77ccae0468b9e2707b43640b07c9dec02dbd1
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Mon Aug 26 11:20:47 2013 +0200
Remove imports for apache logging, add a start script
diff --git a/etc/zipLengthCheck/check.sh b/etc/zipLengthCheck/check.sh
new file mode 100644
index 0000000..a927bc4
--- /dev/null
+++ b/etc/zipLengthCheck/check.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+if [ ! -d target ]
+then
+ mkdir target
+fi
+
+javac -sourcepath src/main/java -d target src/main/java/org/rhq/devUtil/zipCheck/*
+java -cp target org.rhq.devUtil.zipCheck.ZipCheck $*
\ No newline at end of file
diff --git a/etc/zipLengthCheck/src/main/java/org/rhq/devUtil/zipCheck/ZipCheck.java
b/etc/zipLengthCheck/src/main/java/org/rhq/devUtil/zipCheck/ZipCheck.java
new file mode 100644
index 0000000..2573bc2
--- /dev/null
+++ b/etc/zipLengthCheck/src/main/java/org/rhq/devUtil/zipCheck/ZipCheck.java
@@ -0,0 +1,34 @@
+package org.rhq.devUtil.zipCheck;
+
+import java.util.Enumeration;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipFile;
+
+
+/**
+ * Util to check path lengths inside zip files, as especially windows has issues with
long paths
+ * @author Heiko W. Rupp
+ */
+public class ZipCheck {
+
+ private static final int WARN_LENGTH = 245;
+
+ public static void main(String[] args) throws Exception {
+
+ if (args.length<1) {
+ System.err.println("Usage: ZipCheck <file.zip>");
+ System.exit(1);
+ }
+
+ ZipFile file = new ZipFile(args[0]);
+ Enumeration<? extends ZipEntry> entries = file.entries();
+ while (entries.hasMoreElements()) {
+ ZipEntry entry = entries.nextElement();
+ String name = entry.getName();
+ if (name.length()> WARN_LENGTH) {
+ System.err.printf("Long path: %4d : %s\n", name.length(),
name);
+ }
+ }
+ file.close();
+ }
+}
Show replies by date