You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2022/02/18 13:33:54 UTC
[commons-io] branch master updated: Move ctor.
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-io.git
The following commit(s) were added to refs/heads/master by this push:
new 39b61a4 Move ctor.
39b61a4 is described below
commit 39b61a422e6bf87c47f15883a5b2f0d785e560fb
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Feb 15 13:52:11 2022 -0500
Move ctor.
---
src/main/java/org/apache/commons/io/FileUtils.java | 30 +++++++++++-----------
1 file changed, 15 insertions(+), 15 deletions(-)
diff --git a/src/main/java/org/apache/commons/io/FileUtils.java b/src/main/java/org/apache/commons/io/FileUtils.java
index 217e1e3..40568d5 100644
--- a/src/main/java/org/apache/commons/io/FileUtils.java
+++ b/src/main/java/org/apache/commons/io/FileUtils.java
@@ -195,6 +195,15 @@ public class FileUtils {
public static final File[] EMPTY_FILE_ARRAY = {};
/**
+ * Instances should NOT be constructed in standard programming.
+ * @deprecated Will be private in 3.0.
+ */
+ @Deprecated
+ public FileUtils() { //NOSONAR
+
+ }
+
+ /**
* Copies the given array and adds StandardCopyOption.COPY_ATTRIBUTES.
*
* @param copyOptions sorted copy options.
@@ -2648,6 +2657,7 @@ public class FileUtils {
return Files.readAllLines(file.toPath(), charset);
}
+
/**
* Reads the contents of a file line by line to a List of Strings. The file is always closed.
*
@@ -2666,7 +2676,6 @@ public class FileUtils {
return readLines(file, Charsets.toCharset(charsetName));
}
-
private static void requireAbsent(final File file, final String name) throws FileExistsException {
if (file.exists()) {
throw new FileExistsException(String.format("File element in parameter '%s' already exists: '%s'", name, file));
@@ -3208,6 +3217,8 @@ public class FileUtils {
write(file, data, Charset.defaultCharset(), append);
}
+ // Private method, must be invoked will a directory parameter
+
/**
* Writes a CharSequence to a file creating the file if it does not exist.
*
@@ -3221,8 +3232,6 @@ public class FileUtils {
write(file, data, charset, false);
}
- // Private method, must be invoked will a directory parameter
-
/**
* Writes a CharSequence to a file creating the file if it does not exist.
*
@@ -3252,6 +3261,8 @@ public class FileUtils {
write(file, data, charsetName, false);
}
+ // Must be called with a directory
+
/**
* Writes a CharSequence to a file creating the file if it does not exist.
*
@@ -3269,8 +3280,6 @@ public class FileUtils {
write(file, data, Charsets.toCharset(charsetName), append);
}
- // Must be called with a directory
-
/**
* Writes a byte array to a file creating the file if it does not exist.
* <p>
@@ -3351,6 +3360,7 @@ public class FileUtils {
writeLines(file, null, lines, null, false);
}
+
/**
* Writes the {@code toString()} value of each item in a collection to
* the specified {@code File} line by line.
@@ -3367,7 +3377,6 @@ public class FileUtils {
writeLines(file, null, lines, null, append);
}
-
/**
* Writes the {@code toString()} value of each item in a collection to
* the specified {@code File} line by line.
@@ -3579,13 +3588,4 @@ public class FileUtils {
writeStringToFile(file, data, Charsets.toCharset(charsetName), append);
}
- /**
- * Instances should NOT be constructed in standard programming.
- * @deprecated Will be private in 3.0.
- */
- @Deprecated
- public FileUtils() { //NOSONAR
-
- }
-
}