Class TestFileUtils
- java.lang.Object
-
- org.eclipse.aether.internal.test.util.TestFileUtils
-
public class TestFileUtils extends Object
Provides utility methods to read and write (temporary) files.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static longcopyFile(File source, File target)static FilecreateTempDir()static FilecreateTempDir(String suffix)static FilecreateTempFile(byte[] pattern, int repeat)static FilecreateTempFile(String contents)static voiddeleteFile(File file)static voiddeleteTempFiles()static booleanmkdirs(File directory)static byte[]readBytes(File file)static voidreadProps(File file, Properties props)static StringreadString(File file)static voidwriteBytes(File file, byte[] pattern, int repeat)static voidwriteProps(File file, Properties props)static voidwriteString(File file, String content)
-
-
-
Method Detail
-
deleteTempFiles
public static void deleteTempFiles() throws IOException
- Throws:
IOException
-
deleteFile
public static void deleteFile(File file) throws IOException
- Throws:
IOException
-
createTempFile
public static File createTempFile(String contents) throws IOException
- Throws:
IOException
-
createTempFile
public static File createTempFile(byte[] pattern, int repeat) throws IOException
- Throws:
IOException
-
createTempDir
public static File createTempDir() throws IOException
- Throws:
IOException
-
createTempDir
public static File createTempDir(String suffix) throws IOException
- Throws:
IOException
-
copyFile
public static long copyFile(File source, File target) throws IOException
- Throws:
IOException
-
readBytes
public static byte[] readBytes(File file) throws IOException
- Throws:
IOException
-
writeBytes
public static void writeBytes(File file, byte[] pattern, int repeat) throws IOException
- Throws:
IOException
-
readString
public static String readString(File file) throws IOException
- Throws:
IOException
-
writeString
public static void writeString(File file, String content) throws IOException
- Throws:
IOException
-
readProps
public static void readProps(File file, Properties props) throws IOException
- Throws:
IOException
-
writeProps
public static void writeProps(File file, Properties props) throws IOException
- Throws:
IOException
-
-