Class TestFileUtils
java.lang.Object
org.eclipse.aether.internal.test.util.TestFileUtils
Provides utility methods to read and write (temporary) files.
-
Method Summary
Modifier and TypeMethodDescriptionstatic long
static File
Deprecated.use @TempDir (JUnit 5) Or TemporaryFolder (JUnit 4) insteadstatic File
createTempDir
(String suffix) Deprecated.use@TempDir
(JUnit 5) orTemporaryFolder
(JUnit 4) insteadstatic File
createTempFile
(byte[] pattern, int repeat) Deprecated.static File
createTempFile
(String contents) Deprecated.use @TempDir (JUnit 5) Or TemporaryFolder (JUnit 4) insteadstatic void
deleteFile
(File file) static void
Deprecated.static boolean
Deprecated.static byte[]
Deprecated.useFiles.readAllBytes(Path)
insteadstatic void
readProps
(File file, Properties props) static String
readString
(File file) static void
writeBytes
(File file, byte[] pattern, int repeat) Deprecated.static void
writeProps
(File file, Properties props) static void
writeString
(File file, String content) Deprecated.static void
writeString
(File file, String content, long timestamp) Deprecated.
-
Method Details
-
deleteTempFiles
Deprecated.- Throws:
IOException
-
deleteFile
- Throws:
IOException
-
mkdirs
Deprecated. -
createTempFile
Deprecated.use @TempDir (JUnit 5) Or TemporaryFolder (JUnit 4) instead- Throws:
IOException
- if an I/O error occurs
-
createTempFile
Deprecated.- Throws:
IOException
-
createTempDir
Deprecated.use @TempDir (JUnit 5) Or TemporaryFolder (JUnit 4) insteadCreates a temporary directory.- Returns:
- the temporary directory
- Throws:
IOException
- if an I/O error occurs
-
createTempDir
Deprecated.use@TempDir
(JUnit 5) orTemporaryFolder
(JUnit 4) insteadCreates a temporary directory.- Returns:
- the temporary directory
- Throws:
IOException
- if an I/O error occurs
-
copyFile
- Throws:
IOException
-
readBytes
Deprecated.useFiles.readAllBytes(Path)
insteadReads the contents of a file into a byte array.- Parameters:
file
- the file to read- Returns:
- the contents of the file as a byte array
- Throws:
IOException
- if an I/O error occurs
-
writeBytes
Deprecated.- Throws:
IOException
-
readString
- Throws:
IOException
-
writeString
Deprecated.- Throws:
IOException
-
writeString
@Deprecated public static void writeString(File file, String content, long timestamp) throws IOException Deprecated.- Throws:
IOException
-
readProps
- Throws:
IOException
-
writeProps
- Throws:
IOException
-