maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bentm...@apache.org
Subject svn commit: r965106 - /maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/format/FileFormatter.java
Date Sat, 17 Jul 2010 16:44:19 GMT
Author: bentmann
Date: Sat Jul 17 16:44:18 2010
New Revision: 965106

URL: http://svn.apache.org/viewvc?rev=965106&view=rev
Log:
[MASSEMBLY-490] Assembly fails with 'Too many files' error when converting line endings.

Modified:
    maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/format/FileFormatter.java

Modified: maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/format/FileFormatter.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/format/FileFormatter.java?rev=965106&r1=965105&r2=965106&view=diff
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/format/FileFormatter.java
(original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/format/FileFormatter.java
Sat Jul 17 16:44:18 2010
@@ -24,6 +24,7 @@ import org.apache.maven.plugin.assembly.
 import org.apache.maven.shared.filtering.MavenFilteringException;
 import org.codehaus.plexus.logging.Logger;
 import org.codehaus.plexus.util.FileUtils;
+import org.codehaus.plexus.util.IOUtil;
 
 import java.io.File;
 import java.io.FileNotFoundException;
@@ -97,9 +98,10 @@ public class FileFormatter
     private File formatLineEndings( String lineEndingChars, File source, File tempRoot )
         throws AssemblyFormattingException
     {
+        Reader contentReader = null;
         try
         {
-            Reader contentReader = new FileReader( source );
+            contentReader = new FileReader( source );
 
             File target = FileUtils.createTempFile( source.getName() + ".", ".formatted",
tempRoot );
 
@@ -115,5 +117,9 @@ public class FileFormatter
         {
             throw new AssemblyFormattingException( "Error line formatting file '" + source
+ "': " + e.getMessage(), e );
         }
+        finally
+        {
+            IOUtil.close( contentReader );
+        }
     }
 }



Mime
View raw message