Skip to content

Commit 71c9124

Browse files
authored
Deprecate methods that are completely unused or not used outside this… (#1581)
* Deprecate methods that are completely unused or not used outside this class
1 parent 10079fa commit 71c9124

File tree

1 file changed

+17
-2
lines changed
  • maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util

1 file changed

+17
-2
lines changed

maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestFileUtils.java

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ private TestFileUtils() {
5555
// hide constructor
5656
}
5757

58+
@Deprecated
5859
public static void deleteTempFiles() throws IOException {
5960
deleteFile(TMP);
6061
}
@@ -95,6 +96,7 @@ private static boolean del(File file) {
9596
return false;
9697
}
9798

99+
@Deprecated
98100
public static boolean mkdirs(File directory) {
99101
if (directory == null) {
100102
return false;
@@ -118,10 +120,20 @@ public static boolean mkdirs(File directory) {
118120
return (parentDir != null && (mkdirs(parentDir) || parentDir.exists()) && canonDir.mkdir());
119121
}
120122

123+
/**
124+
* @throws IOException if an I/O error occurs
125+
* @deprecated use @TempDir (JUnit 5) Or TemporaryFolder (JUnit 4) instead
126+
*/
127+
@Deprecated
121128
public static File createTempFile(String contents) throws IOException {
122129
return createTempFile(contents.getBytes(StandardCharsets.UTF_8), 1);
123130
}
124131

132+
@Deprecated
133+
/**
134+
* @throws IOException if an I/O error occurs
135+
* @deprecated use @TempDir (JUnit 5) Or TemporaryFolder (JUnit 4) instead
136+
*/
125137
public static File createTempFile(byte[] pattern, int repeat) throws IOException {
126138
mkdirs(TMP);
127139
File tmpFile = File.createTempFile("tmpfile-", ".data", TMP);
@@ -134,7 +146,7 @@ public static File createTempFile(byte[] pattern, int repeat) throws IOException
134146
*
135147
* @return the temporary directory
136148
* @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
138150
*/
139151
@Deprecated
140152
public static File createTempDir() throws IOException {
@@ -146,7 +158,7 @@ public static File createTempDir() throws IOException {
146158
*
147159
* @return the temporary directory
148160
* @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
150162
*/
151163
@Deprecated
152164
public static File createTempDir(String suffix) throws IOException {
@@ -235,6 +247,7 @@ public static byte[] readBytes(File file) throws IOException {
235247
}
236248
}
237249

250+
@Deprecated
238251
public static void writeBytes(File file, byte[] pattern, int repeat) throws IOException {
239252
file.deleteOnExit();
240253
file.getParentFile().mkdirs();
@@ -262,10 +275,12 @@ public static String readString(File file) throws IOException {
262275
return new String(content, StandardCharsets.UTF_8);
263276
}
264277

278+
@Deprecated
265279
public static void writeString(File file, String content) throws IOException {
266280
writeBytes(file, content.getBytes(StandardCharsets.UTF_8), 1);
267281
}
268282

283+
@Deprecated
269284
public static void writeString(File file, String content, long timestamp) throws IOException {
270285
writeBytes(file, content.getBytes(StandardCharsets.UTF_8), 1);
271286
file.setLastModified(timestamp);

0 commit comments

Comments
 (0)