[Schmitzm-commits] r1595 - trunk/schmitzm-core/src/main/java/de/schmitzm/io

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Sat May 28 22:42:30 CEST 2011


Author: alfonx
Date: 2011-05-28 22:42:30 +0200 (Sat, 28 May 2011)
New Revision: 1595

Modified:
   trunk/schmitzm-core/src/main/java/de/schmitzm/io/IOUtil.java
Log:


Modified: trunk/schmitzm-core/src/main/java/de/schmitzm/io/IOUtil.java
===================================================================
--- trunk/schmitzm-core/src/main/java/de/schmitzm/io/IOUtil.java	2011-05-28 20:42:02 UTC (rev 1594)
+++ trunk/schmitzm-core/src/main/java/de/schmitzm/io/IOUtil.java	2011-05-28 20:42:30 UTC (rev 1595)
@@ -1535,9 +1535,15 @@
 
 	public static void zipFile(File inputFile, ZipOutputStream zos, File cutOff)
 			throws IOException {
-		zipFile(inputFile, zos, cutOff.getAbsolutePath().length());
+		
+		String absolutePath = cutOff.getAbsolutePath();
+		int l = absolutePath.length();
+		if (!absolutePath.endsWith(File.separator))
+			l++;
+		
+		zipFile(inputFile, zos, l);
 	}
-
+	
 	/**
 	 * Returns a n md5 hash as a String for the given {@link File} parameter.
 	 * The file parameter may not point to a directory!



More information about the Schmitzm-commits mailing list