maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bentm...@apache.org
Subject svn commit: r792232 - /maven/shared/trunk/maven-verifier/src/main/java/org/apache/maven/it/Verifier.java
Date Wed, 08 Jul 2009 17:13:55 GMT
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>.



Mime
View raw message