Skip to content

Commit

Permalink
Normalize spelling
Browse files Browse the repository at this point in the history
Note that "UNIX" is a trademark, "Unix" is not
  • Loading branch information
garydgregory committed Dec 6, 2024
1 parent 9e224a5 commit eb402e3
Show file tree
Hide file tree
Showing 10 changed files with 59 additions and 59 deletions.
8 changes: 4 additions & 4 deletions src/main/java/org/apache/commons/io/FileSystemUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public class FileSystemUtils {
* FileSystemUtils.freeSpace("/volume"); // *nix
* </pre>
*
* @param path the path to get free space for, not null, not empty on UNIX
* @param path the path to get free space for, not null, not empty on Unix
* @return the amount of free drive space on the drive or volume
* @throws IOException if an I/O error occurs.
* @throws IllegalArgumentException if the path is invalid.
Expand Down Expand Up @@ -116,7 +116,7 @@ public static long freeSpaceKb(final long timeout) throws IOException {
* FileSystemUtils.freeSpaceKb("/volume"); // *nix
* </pre>
*
* @param path the path to get free space for, not null, not empty on UNIX
* @param path the path to get free space for, not null, not empty on Unix
* @return the amount of free drive space on the drive or volume in kilobytes
* @throws IOException if an I/O error occurs.
* @throws IllegalArgumentException if the path is invalid.
Expand All @@ -136,7 +136,7 @@ public static long freeSpaceKb(final String path) throws IOException {
* FileSystemUtils.freeSpaceKb("/volume"); // *nix
* </pre>
*
* @param path the path to get free space for, not null, not empty on UNIX
* @param path the path to get free space for, not null, not empty on Unix
* @param timeout ignored.
* @return the amount of free drive space on the drive or volume in kilobytes
* @throws IOException if an I/O error occurs.
Expand All @@ -157,7 +157,7 @@ public static long freeSpaceKb(final String path, final long timeout) throws IOE
* FileSystemUtils.freeSpace("/volume"); // *nix
* </pre>
*
* @param pathStr the path to get free space for, not null, not empty on UNIX
* @param pathStr the path to get free space for, not null, not empty on Unix
* @return the amount of free drive space on the drive or volume
* @throws IOException if an I/O error occurs.
* @throws IllegalArgumentException if the path is invalid.
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/apache/commons/io/FileUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -3122,7 +3122,7 @@ private static SuffixFileFilter toSuffixFileFilter(final String... extensions) {
}

/**
* Implements behavior similar to the UNIX "touch" utility. Creates a new file with size 0, or, if the file exists, just
* Implements behavior similar to the Unix "touch" utility. Creates a new file with size 0, or, if the file exists, just
* updates the file's modified time. This method throws an IOException if the last modified date
* of the file cannot be set. It creates parent directories if they do not exist.
*
Expand Down
68 changes: 34 additions & 34 deletions src/main/java/org/apache/commons/io/FilenameUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* ever accesses the file system, or depends on whether a path points to a file that exists.
* <p>
* When dealing with file names, you can hit problems when moving from a Windows
* based development machine to a UNIX based production machine.
* based development machine to a Unix based production machine.
* This class aims to help avoid those problems.
* </p>
* <p>
Expand All @@ -42,7 +42,7 @@
* {@link File#File(java.io.File, String) File(File,String)}.
* </p>
* <p>
* Most methods in this class are designed to work the same on both UNIX and Windows.
* Most methods in this class are designed to work the same on both Unix and Windows.
* Those that don't include 'System', 'Unix', or 'Windows' in their name.
* </p>
* <p>
Expand All @@ -63,7 +63,7 @@
* <li>the extension - txt</li>
* </ul>
* <p>
* Given an absolute UNIX path such as /dev/project/file.txt they are:
* Given an absolute Unix path such as /dev/project/file.txt they are:
* </p>
* <ul>
* <li>the full file name, or just file name - /dev/project/file.txt</li>
Expand All @@ -87,7 +87,7 @@
* <li>the extension - txt</li>
* </ul>
* <p>
* Given an absolute UNIX path such as /dev/project/file.txt they are:
* Given an absolute Unix path such as /dev/project/file.txt they are:
* </p>
* <ul>
* <li>the full path, full file name, or just file name - /dev/project/file.txt</li>
Expand All @@ -107,7 +107,7 @@
* that do not end with a separator as files, not directories.
* </p>
* <p>
* This class only supports UNIX and Windows style names.
* This class only supports Unix and Windows style names.
* Prefixes are matched as follows:
* </p>
* <pre>
Expand Down Expand Up @@ -154,7 +154,7 @@ public class FilenameUtils {
public static final String EXTENSION_SEPARATOR_STR = Character.toString(EXTENSION_SEPARATOR);

/**
* The UNIX separator character.
* The Unix separator character.
*/
private static final char UNIX_NAME_SEPARATOR = '/';

Expand Down Expand Up @@ -205,7 +205,7 @@ public class FilenameUtils {
* Otherwise, the paths will be joined, normalized and returned.
* </p>
* <p>
* The output will be the same on both UNIX and Windows except
* The output will be the same on both Unix and Windows except
* for the separator character.
* </p>
* <pre>
Expand Down Expand Up @@ -524,7 +524,7 @@ public static boolean equalsNormalized(final String fileName1, final String file
* after both have been normalized.
* <p>
* Both file names are first passed to {@link #normalize(String)}.
* The check is then performed case-sensitively on UNIX and
* The check is then performed case-sensitively on Unix and
* case-insensitively on Windows.
* </p>
*
Expand All @@ -541,7 +541,7 @@ public static boolean equalsNormalizedOnSystem(final String fileName1, final Str
* Checks whether two file names are equal using the case rules of the system.
* <p>
* No processing is performed on the file names other than comparison.
* The check is case-sensitive on UNIX and case-insensitive on Windows.
* The check is case-sensitive on Unix and case-insensitive on Windows.
* </p>
*
* @param fileName1 the first file name, may be null
Expand Down Expand Up @@ -594,7 +594,7 @@ private static int getAdsCriticalOffset(final String fileName) {
/**
* Gets the base name, minus the full path and extension, from a full file name.
* <p>
* This method will handle a path in either UNIX or Windows format.
* This method will handle a path in either Unix or Windows format.
* The text after the last forward or backslash and before the last dot is returned.
* </p>
* <pre>
Expand Down Expand Up @@ -661,7 +661,7 @@ public static String getExtension(final String fileName) throws IllegalArgumentE
/**
* Gets the full path (prefix + path) from a full file name.
* <p>
* This method will handle a file in either UNIX or Windows format.
* This method will handle a file in either Unix or Windows format.
* The method is entirely text based, and returns the text before and
* including the last forward or backslash.
* </p>
Expand Down Expand Up @@ -694,7 +694,7 @@ public static String getFullPath(final String fileName) {
* Gets the full path (prefix + path) from a full file name,
* excluding the final directory separator.
* <p>
* This method will handle a file in either UNIX or Windows format.
* This method will handle a file in either Unix or Windows format.
* The method is entirely text based, and returns the text before the
* last forward or backslash.
* </p>
Expand Down Expand Up @@ -726,7 +726,7 @@ public static String getFullPathNoEndSeparator(final String fileName) {
/**
* Gets the name minus the path from a full file name.
* <p>
* This method will handle a file in either UNIX or Windows format.
* This method will handle a file in either Unix or Windows format.
* The text after the last forward or backslash is returned.
* </p>
* <pre>
Expand Down Expand Up @@ -754,7 +754,7 @@ public static String getName(final String fileName) {
/**
* Gets the path from a full file name, which excludes the prefix and the name.
* <p>
* This method will handle a file in either UNIX or Windows format.
* This method will handle a file in either Unix or Windows format.
* The method is entirely text based, and returns the text before and
* including the last forward or backslash.
* </p>
Expand Down Expand Up @@ -785,7 +785,7 @@ public static String getPath(final String fileName) {
* Gets the path (which excludes the prefix) from a full file name, and
* also excluding the final directory separator.
* <p>
* This method will handle a file in either UNIX or Windows format.
* This method will handle a file in either Unix or Windows format.
* The method is entirely text based, and returns the text before the
* last forward or backslash.
* </p>
Expand Down Expand Up @@ -815,7 +815,7 @@ public static String getPathNoEndSeparator(final String fileName) {
/**
* Gets the prefix such as {@code C:/} or {@code ~/} from a full file name,
* <p>
* This method will handle a file in either UNIX or Windows format.
* This method will handle a file in either Unix or Windows format.
* The prefix includes the first slash in the full file name where applicable.
* </p>
* <pre>
Expand All @@ -836,7 +836,7 @@ public static String getPathNoEndSeparator(final String fileName) {
* </pre>
* <p>
* The output will be the same irrespective of the machine that the code is running on.
* ie. both UNIX and Windows prefixes are matched regardless.
* ie. both Unix and Windows prefixes are matched regardless.
* </p>
*
* @param fileName the file name, null returns null
Expand All @@ -861,7 +861,7 @@ public static String getPrefix(final String fileName) {
/**
* Returns the length of the file name prefix, such as {@code C:/} or {@code ~/}.
* <p>
* This method will handle a file in either UNIX or Windows format.
* This method will handle a file in either Unix or Windows format.
* </p>
* <p>
* The prefix length includes the first slash in the full file name
Expand Down Expand Up @@ -890,7 +890,7 @@ public static String getPrefix(final String fileName) {
* </pre>
* <p>
* The output will be the same irrespective of the machine that the code is running on.
* ie. both UNIX and Windows prefixes are matched regardless.
* ie. both Unix and Windows prefixes are matched regardless.
* </p>
* <p>
* Note that a leading // (or \\) is used to indicate a UNC name on Windows.
Expand Down Expand Up @@ -966,7 +966,7 @@ public static int getPrefixLength(final String fileName) {
* Returns the index of the last extension separator character, which is a dot.
* <p>
* This method also checks that there is no directory separator after the last dot. To do this it uses
* {@link #indexOfLastSeparator(String)} which will handle a file in either UNIX or Windows format.
* {@link #indexOfLastSeparator(String)} which will handle a file in either Unix or Windows format.
* </p>
* <p>
* The output will be the same irrespective of the machine that the code is running on, with the
Expand Down Expand Up @@ -1003,7 +1003,7 @@ public static int indexOfExtension(final String fileName) throws IllegalArgument
/**
* Returns the index of the last directory separator character.
* <p>
* This method will handle a file in either UNIX or Windows format.
* This method will handle a file in either Unix or Windows format.
* The position of the last forward or backslash is returned.
* <p>
* The output will be the same irrespective of the machine that the code is running on.
Expand Down Expand Up @@ -1256,7 +1256,7 @@ private static boolean isValidHostName(final String name) {
* Normalizes a path, removing double and single dot path steps.
* <p>
* This method normalizes a path to a standard format.
* The input may contain separators in either UNIX or Windows format.
* The input may contain separators in either Unix or Windows format.
* The output will contain separators in the format of the system.
* <p>
* A trailing slash will be retained.
Expand All @@ -1265,7 +1265,7 @@ private static boolean isValidHostName(final String name) {
* A double dot will cause that path segment and the one before to be removed.
* If the double dot has no parent path segment, {@code null} is returned.
* <p>
* The output will be the same on both UNIX and Windows except
* The output will be the same on both Unix and Windows except
* for the separator character.
* <pre>
* /foo// --&gt; /foo/
Expand Down Expand Up @@ -1300,7 +1300,7 @@ public static String normalize(final String fileName) {
* Normalizes a path, removing double and single dot path steps.
* <p>
* This method normalizes a path to a standard format.
* The input may contain separators in either UNIX or Windows format.
* The input may contain separators in either Unix or Windows format.
* The output will contain separators in the format specified.
* <p>
* A trailing slash will be retained.
Expand All @@ -1310,7 +1310,7 @@ public static String normalize(final String fileName) {
* If the double dot has no parent path segment to work with, {@code null}
* is returned.
* <p>
* The output will be the same on both UNIX and Windows except
* The output will be the same on both Unix and Windows except
* for the separator character.
* <pre>
* /foo// --&gt; /foo/
Expand All @@ -1331,11 +1331,11 @@ public static String normalize(final String fileName) {
* ~/foo/../bar/ --&gt; ~/bar/
* ~/../bar --&gt; null
* </pre>
* The output will be the same on both UNIX and Windows including
* The output will be the same on both Unix and Windows including
* the separator character.
*
* @param fileName the file name to normalize, null returns null
* @param unixSeparator {@code true} if a UNIX separator should
* @param unixSeparator {@code true} if a Unix separator should
* be used or {@code false} if a Windows separator should be used.
* @return the normalized fileName, or null if invalid
* @throws IllegalArgumentException if the file name contains the null character ({@code U+0000})
Expand All @@ -1350,7 +1350,7 @@ public static String normalize(final String fileName, final boolean unixSeparato
* and removing any final directory separator.
* <p>
* This method normalizes a path to a standard format.
* The input may contain separators in either UNIX or Windows format.
* The input may contain separators in either Unix or Windows format.
* The output will contain separators in the format of the system.
* <p>
* A trailing slash will be removed.
Expand All @@ -1360,7 +1360,7 @@ public static String normalize(final String fileName, final boolean unixSeparato
* If the double dot has no parent path segment to work with, {@code null}
* is returned.
* <p>
* The output will be the same on both UNIX and Windows except
* The output will be the same on both Unix and Windows except
* for the separator character.
* <pre>
* /foo// --&gt; /foo
Expand Down Expand Up @@ -1396,7 +1396,7 @@ public static String normalizeNoEndSeparator(final String fileName) {
* and removing any final directory separator.
* <p>
* This method normalizes a path to a standard format.
* The input may contain separators in either UNIX or Windows format.
* The input may contain separators in either Unix or Windows format.
* The output will contain separators in the format specified.
* <p>
* A trailing slash will be removed.
Expand All @@ -1406,7 +1406,7 @@ public static String normalizeNoEndSeparator(final String fileName) {
* If the double dot has no parent path segment to work with, {@code null}
* is returned.
* <p>
* The output will be the same on both UNIX and Windows including
* The output will be the same on both Unix and Windows including
* the separator character.
* <pre>
* /foo// --&gt; /foo
Expand All @@ -1429,7 +1429,7 @@ public static String normalizeNoEndSeparator(final String fileName) {
* </pre>
*
* @param fileName the file name to normalize, null returns null
* @param unixSeparator {@code true} if a UNIX separator should
* @param unixSeparator {@code true} if a Unix separator should
* be used or {@code false} if a Windows separator should be used.
* @return the normalized fileName, or null if invalid
* @throws IllegalArgumentException if the file name contains the null character ({@code U+0000})
Expand Down Expand Up @@ -1500,7 +1500,7 @@ public static String separatorsToSystem(final String path) {
}

/**
* Converts all separators to the UNIX separator of forward slash.
* Converts all separators to the Unix separator of forward slash.
*
* @param path the path to be changed, null ignored.
* @return the new path.
Expand Down Expand Up @@ -1697,7 +1697,7 @@ public static boolean wildcardMatch(final String fileName, final String wildcard
* The wildcard matcher uses the characters '?' and '*' to represent a
* single or multiple (zero or more) wildcard characters.
* This is the same as often found on DOS/Unix command lines.
* The check is case-sensitive on UNIX and case-insensitive on Windows.
* The check is case-sensitive on Unix and case-insensitive on Windows.
* <pre>
* wildcardMatch("c.txt", "*.txt") --&gt; true
* wildcardMatch("c.txt", "*.jpg") --&gt; false
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/apache/commons/io/IOCase.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* Enumeration of IO case sensitivity.
* <p>
* Different filing systems have different rules for case-sensitivity.
* Windows is case-insensitive, UNIX is case-sensitive.
* Windows is case-insensitive, Unix is case-sensitive.
* </p>
* <p>
* This class captures that difference, providing an enumeration to
Expand Down Expand Up @@ -52,11 +52,11 @@ public enum IOCase {

/**
* The constant for case sensitivity determined by the current operating system.
* Windows is case-insensitive when comparing file names, UNIX is case-sensitive.
* Windows is case-insensitive when comparing file names, Unix is case-sensitive.
* <p>
* <strong>Note:</strong> This only caters for Windows and Unix. Other operating
* systems (e.g. OSX and OpenVMS) are treated as case-sensitive if they use the
* UNIX file separator and case-insensitive if they use the Windows file separator
* Unix file separator and case-insensitive if they use the Windows file separator
* (see {@link File#separatorChar}).
* </p>
* <p>
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/apache/commons/io/IOUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public class IOUtils {
public static final char DIR_SEPARATOR = File.separatorChar;

/**
* The UNIX directory separator character '{@value}'.
* The Unix directory separator character '{@value}'.
*/
public static final char DIR_SEPARATOR_UNIX = '/';

Expand Down Expand Up @@ -187,7 +187,7 @@ public class IOUtils {
public static final String LINE_SEPARATOR = System.lineSeparator();

/**
* The UNIX line separator string.
* The Unix line separator string.
*
* @see StandardLineSeparator#LF
*/
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/apache/commons/io/file/PathUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -1689,7 +1689,7 @@ static Set<FileVisitOption> toFileVisitOptionSet(final FileVisitOption... fileVi
}

/**
* Implements behavior similar to the UNIX "touch" utility. Creates a new file with size 0, or, if the file exists, just updates the file's modified time.
* Implements behavior similar to the Unix "touch" utility. Creates a new file with size 0, or, if the file exists, just updates the file's modified time.
* this method creates parent directories if they do not exist.
*
* @param file the file to touch.
Expand Down
Loading

0 comments on commit eb402e3

Please sign in to comment.