You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by be...@apache.org on 2009/07/08 19:13:55 UTC

svn commit: r792232 - /maven/shared/trunk/maven-verifier/src/main/java/org/apache/maven/it/Verifier.java

Author: bentmann
Date: Wed Jul  8 17:13:55 2009
New Revision: 792232

URL: http://svn.apache.org/viewvc?rev=792232&view=rev
Log:
o Added util method to write simple text files

Modified:
    maven/shared/trunk/maven-verifier/src/main/java/org/apache/maven/it/Verifier.java

Modified: maven/shared/trunk/maven-verifier/src/main/java/org/apache/maven/it/Verifier.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-verifier/src/main/java/org/apache/maven/it/Verifier.java?rev=792232&r1=792231&r2=792232&view=diff
==============================================================================
--- maven/shared/trunk/maven-verifier/src/main/java/org/apache/maven/it/Verifier.java (original)
+++ maven/shared/trunk/maven-verifier/src/main/java/org/apache/maven/it/Verifier.java Wed Jul  8 17:13:55 2009
@@ -842,6 +842,20 @@
     }
 
     /**
+     * Writes a text file with the specified contents. The contents will be encoded using UTF-8.
+     * 
+     * @param path The path to the file, relative to the base directory, must not be <code>null</code>.
+     * @param contents The contents to write, must not be <code>null</code>.
+     * @throws IOException If the file could not be written.
+     * @since 1.2
+     */
+    public void writeFile( String path, String contents )
+        throws IOException
+    {
+        FileUtils.fileWrite( new File( getBasedir(), path ).getAbsolutePath(), "UTF-8", contents );
+    }
+
+    /**
      * Filters a text file by replacing some user-defined tokens.
      * 
      * @param srcPath The path to the input file, relative to the base directory, must not be <code>null</code>.