Author: bodewig
Date: Fri Aug 28 04:26:11 2009
New Revision: 808748

URL: http://svn.apache.org/viewvc?rev=808748&view=rev
Log:
port fallbacktoutf8 from <zip>

Modified:
    
ant/sandbox/antlibs/compress/trunk/src/main/org/apache/ant/compress/taskdefs/Zip.java

Modified: 
ant/sandbox/antlibs/compress/trunk/src/main/org/apache/ant/compress/taskdefs/Zip.java
URL: 
http://svn.apache.org/viewvc/ant/sandbox/antlibs/compress/trunk/src/main/org/apache/ant/compress/taskdefs/Zip.java?rev=808748&r1=808747&r2=808748&view=diff
==============================================================================
--- 
ant/sandbox/antlibs/compress/trunk/src/main/org/apache/ant/compress/taskdefs/Zip.java
 (original)
+++ 
ant/sandbox/antlibs/compress/trunk/src/main/org/apache/ant/compress/taskdefs/Zip.java
 Fri Aug 28 04:26:11 2009
@@ -36,6 +36,7 @@
     private int level = Deflater.DEFAULT_COMPRESSION;
     private String comment = "";
     private boolean keepCompression = false;
+    private boolean fallBackToUTF8 = false;
 
     public Zip() {
         setFactory(new ZipStreamFactory() {
@@ -47,6 +48,7 @@
                                                                         
encoding);
                     o.setLevel(level);
                     o.setComment(comment);
+                    o.setFallbackToUTF8(fallBackToUTF8);
                     return o;
                 }
             });
@@ -114,4 +116,14 @@
     public void setKeepCompression(boolean keep) {
         keepCompression = keep;
     }
+
+    /**
+     * Whether to fall back to UTF-8 if a name cannot be enoded using
+     * the specified encoding.
+     *
+     * <p>Defaults to false.</p>
+     */
+    public void setFallBackToUTF8(boolean b) {
+        fallBackToUTF8 = b;
+    }
 }
\ No newline at end of file


Reply via email to