Skip to content

Commit

Permalink
Move ctor.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gary Gregory committed Feb 15, 2022
1 parent 60319bd commit 39b61a4
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions src/main/java/org/apache/commons/io/FileUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,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.
*
Expand Down Expand Up @@ -2648,6 +2657,7 @@ public static List<String> readLines(final File file, final Charset charset) thr
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.
*
Expand All @@ -2666,7 +2676,6 @@ public static List<String> readLines(final File file, final String charsetName)
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));
Expand Down Expand Up @@ -3208,6 +3217,8 @@ public static void write(final File file, final CharSequence data, final boolean
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.
*
Expand All @@ -3221,8 +3232,6 @@ public static void write(final File file, final CharSequence data, final Charset
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.
*
Expand Down Expand Up @@ -3252,6 +3261,8 @@ public static void write(final File file, final CharSequence data, final String
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.
*
Expand All @@ -3269,8 +3280,6 @@ public static void write(final File file, final CharSequence data, final String
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>
Expand Down Expand Up @@ -3351,6 +3360,7 @@ public static void writeLines(final File file, final Collection<?> lines) throws
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.
Expand All @@ -3367,7 +3377,6 @@ public static void writeLines(final File file, final Collection<?> lines, final
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.
Expand Down Expand Up @@ -3579,13 +3588,4 @@ public static void writeStringToFile(final File file, final String data, final S
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

}

}

0 comments on commit 39b61a4

Please sign in to comment.