@@ -55,6 +55,7 @@ private TestFileUtils() {
55
55
// hide constructor
56
56
}
57
57
58
+ @ Deprecated
58
59
public static void deleteTempFiles () throws IOException {
59
60
deleteFile (TMP );
60
61
}
@@ -95,6 +96,7 @@ private static boolean del(File file) {
95
96
return false ;
96
97
}
97
98
99
+ @ Deprecated
98
100
public static boolean mkdirs (File directory ) {
99
101
if (directory == null ) {
100
102
return false ;
@@ -118,10 +120,20 @@ public static boolean mkdirs(File directory) {
118
120
return (parentDir != null && (mkdirs (parentDir ) || parentDir .exists ()) && canonDir .mkdir ());
119
121
}
120
122
123
+ /**
124
+ * @throws IOException if an I/O error occurs
125
+ * @deprecated use @TempDir (JUnit 5) Or TemporaryFolder (JUnit 4) instead
126
+ */
127
+ @ Deprecated
121
128
public static File createTempFile (String contents ) throws IOException {
122
129
return createTempFile (contents .getBytes (StandardCharsets .UTF_8 ), 1 );
123
130
}
124
131
132
+ @ Deprecated
133
+ /**
134
+ * @throws IOException if an I/O error occurs
135
+ * @deprecated use @TempDir (JUnit 5) Or TemporaryFolder (JUnit 4) instead
136
+ */
125
137
public static File createTempFile (byte [] pattern , int repeat ) throws IOException {
126
138
mkdirs (TMP );
127
139
File tmpFile = File .createTempFile ("tmpfile-" , ".data" , TMP );
@@ -134,7 +146,7 @@ public static File createTempFile(byte[] pattern, int repeat) throws IOException
134
146
*
135
147
* @return the temporary directory
136
148
* @throws IOException if an I/O error occurs
137
- * @deprecated use @TempDir (JUnit 5} Or TemporaryFolder (JUnit 4) instead
149
+ * @deprecated use @TempDir (JUnit 5) Or TemporaryFolder (JUnit 4) instead
138
150
*/
139
151
@ Deprecated
140
152
public static File createTempDir () throws IOException {
@@ -146,7 +158,7 @@ public static File createTempDir() throws IOException {
146
158
*
147
159
* @return the temporary directory
148
160
* @throws IOException if an I/O error occurs
149
- * @deprecated use {@code @TempDir) (JUnit 5} Or {@code TemporaryFolder} (JUnit 4) instead
161
+ * @deprecated use {@code @TempDir) (JUnit 5) Or {@code TemporaryFolder} (JUnit 4) instead
150
162
*/
151
163
@ Deprecated
152
164
public static File createTempDir (String suffix ) throws IOException {
@@ -235,6 +247,7 @@ public static byte[] readBytes(File file) throws IOException {
235
247
}
236
248
}
237
249
250
+ @ Deprecated
238
251
public static void writeBytes (File file , byte [] pattern , int repeat ) throws IOException {
239
252
file .deleteOnExit ();
240
253
file .getParentFile ().mkdirs ();
@@ -262,10 +275,12 @@ public static String readString(File file) throws IOException {
262
275
return new String (content , StandardCharsets .UTF_8 );
263
276
}
264
277
278
+ @ Deprecated
265
279
public static void writeString (File file , String content ) throws IOException {
266
280
writeBytes (file , content .getBytes (StandardCharsets .UTF_8 ), 1 );
267
281
}
268
282
283
+ @ Deprecated
269
284
public static void writeString (File file , String content , long timestamp ) throws IOException {
270
285
writeBytes (file , content .getBytes (StandardCharsets .UTF_8 ), 1 );
271
286
file .setLastModified (timestamp );
0 commit comments