org.apache.maven.shared.io
Class TestUtils

java.lang.Object
  extended by org.apache.maven.shared.io.TestUtils

public final class TestUtils
extends Object


Method Summary
static String normalizeEndOfLine(String content)
          normalize EOLs to simple line feed (\\n).
static String readFile(File file)
          Deprecated. this API isn't explicit about encoding nor EOL normalization, use readPlatformFile() or readXmlFile() depending on your need, in conjunction with normalizeEndOfLine()
static String readPlatformFile(File file)
           
static String readXmlFile(File file)
           
static String toString(Throwable error)
           
static void writeFileWithEncoding(File file, String content, String encoding)
           
static void writePlatformFile(File file, String content)
           
static void writeToFile(File file, String testStr)
          Deprecated. this API isn't explicit about encoding, use writePlatformFile() or writeXmlFile() depending on your need
static void writeXmlFile(File file, String content)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

writePlatformFile

public static void writePlatformFile(File file,
                                     String content)
                              throws IOException
Throws:
IOException

writeFileWithEncoding

public static void writeFileWithEncoding(File file,
                                         String content,
                                         String encoding)
                                  throws IOException
Throws:
IOException

writeXmlFile

public static void writeXmlFile(File file,
                                String content)
                         throws IOException
Throws:
IOException

writeToFile

public static void writeToFile(File file,
                               String testStr)
                        throws IOException
Deprecated. this API isn't explicit about encoding, use writePlatformFile() or writeXmlFile() depending on your need

writes content to a file, using platform encoding.

Throws:
IOException

readFile

public static String readFile(File file)
                       throws IOException
Deprecated. this API isn't explicit about encoding nor EOL normalization, use readPlatformFile() or readXmlFile() depending on your need, in conjunction with normalizeEndOfLine()

reads content from a file and normalize EOLs to simple line feed (\\n), using platform encoding.

Throws:
IOException

readPlatformFile

public static String readPlatformFile(File file)
                               throws IOException
Throws:
IOException

readXmlFile

public static String readXmlFile(File file)
                          throws IOException
Throws:
IOException

normalizeEndOfLine

public static String normalizeEndOfLine(String content)
normalize EOLs to simple line feed (\\n).


toString

public static String toString(Throwable error)


Copyright © 2002-2007 The Apache Software Foundation. All Rights Reserved.