Skip to content

Commit de59d97

Browse files
committed
Javadoc
1 parent f2b68bb commit de59d97

1 file changed

Lines changed: 49 additions & 47 deletions

File tree

src/main/java/org/apache/commons/io/FileSystem.java

Lines changed: 49 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -244,19 +244,15 @@ final boolean isWithinLimit(final CharSequence value, final int limit, final Cha
244244
}
245245

246246
/**
247-
* <p>
248247
* Is {@code true} if this is Linux.
249-
* </p>
250248
* <p>
251249
* The field will return {@code false} if {@code OS_NAME} is {@code null}.
252250
* </p>
253251
*/
254252
private static final boolean IS_OS_LINUX = getOsMatchesName("Linux");
255253

256254
/**
257-
* <p>
258255
* Is {@code true} if this is Mac.
259-
* </p>
260256
* <p>
261257
* The field will return {@code false} if {@code OS_NAME} is {@code null}.
262258
* </p>
@@ -269,9 +265,7 @@ final boolean isWithinLimit(final CharSequence value, final int limit, final Cha
269265
private static final String OS_NAME_WINDOWS_PREFIX = "Windows";
270266

271267
/**
272-
* <p>
273268
* Is {@code true} if this is Windows.
274-
* </p>
275269
* <p>
276270
* The field will return {@code false} if {@code OS_NAME} is {@code null}.
277271
* </p>
@@ -322,9 +316,7 @@ private static boolean getOsMatchesName(final String osNamePrefix) {
322316
}
323317

324318
/**
325-
* <p>
326319
* Gets a System property, defaulting to {@code null} if the property cannot be read.
327-
* </p>
328320
* <p>
329321
* If a {@link SecurityException} is caught, the return value is {@code null} and a message is written to
330322
* {@code System.err}.
@@ -390,6 +382,7 @@ private static boolean isOsNameMatch(final String osName, final String osNamePre
390382
private static String replace(final String path, final char oldChar, final char newChar) {
391383
return path == null ? null : path.replace(oldChar, newChar);
392384
}
385+
393386
/**
394387
* Truncates a string respecting grapheme cluster boundaries.
395388
*
@@ -453,7 +446,7 @@ static CharSequence trimExtension(final CharSequence cs) {
453446
* @param maxPathLength The maximum length of the path to a file. This can include folders.
454447
* @param illegalFileNameChars Illegal characters for this file system.
455448
* @param reservedFileNames The reserved file names.
456-
* @param reservedFileNamesExtensions TODO
449+
* @param reservedFileNamesExtensions The reserved file name extensions.
457450
* @param supportsDriveLetter Whether this file system support driver letters.
458451
* @param nameSeparator The name separator, '\\' on Windows, '/' on Linux.
459452
* @param nameLengthStrategy The strategy for measuring and truncating file and path names.
@@ -479,6 +472,7 @@ static CharSequence trimExtension(final CharSequence cs) {
479472

480473
/**
481474
* Gets the file allocation block size in bytes.
475+
*
482476
* @return the file allocation block size in bytes.
483477
* @since 2.12.0
484478
*/
@@ -512,21 +506,26 @@ public int[] getIllegalFileNameCodePoints() {
512506
/**
513507
* Gets the maximum length for file names (excluding any folder path).
514508
*
515-
* <p>This limit applies only to the file name itself, excluding any parent
516-
* directories.</p>
509+
* <p>
510+
* This limit applies only to the file name itself, excluding any parent directories.
511+
* </p>
517512
*
518-
* <p>The value is expressed in Java {@code char} units (UTF-16 code units).</p>
513+
* <p>
514+
* The value is expressed in Java {@code char} units (UTF-16 code units).
515+
* </p>
519516
*
520-
* <p><strong>Note:</strong> Because many file systems enforce limits in
521-
* <em>bytes</em> using a specific encoding rather than in UTF-16 code
522-
* units, a name that fits this limit may still be rejected by the
523-
* underlying file system.</p>
517+
* <p>
518+
* <strong>Note:</strong> Because many file systems enforce limits in <em>bytes</em> using a specific encoding rather than in UTF-16 code units, a name that
519+
* fits this limit may still be rejected by the underlying file system.
520+
* </p>
524521
*
525-
* <p>Use {@link #isLegalFileName} to check whether a given name is valid
526-
* for the current file system and charset.</p>
522+
* <p>
523+
* Use {@link #isLegalFileName} to check whether a given name is valid for the current file system and charset.
524+
* </p>
527525
*
528-
* <p>However, any file name longer than this limit is guaranteed to be
529-
* invalid on the current file system.</p>
526+
* <p>
527+
* However, any file name longer than this limit is guaranteed to be invalid on the current file system.
528+
* </p>
530529
*
531530
* @return the maximum file name length in characters.
532531
*/
@@ -537,20 +536,23 @@ public int getMaxFileNameLength() {
537536
/**
538537
* Gets the maximum length for file paths (may include folders).
539538
*
540-
* <p>This value is inclusive of all path components and separators.
541-
* For a limit of each path component see {@link #getMaxFileNameLength()}.</p>
539+
* <p>
540+
* This value is inclusive of all path components and separators. For a limit of each path component see {@link #getMaxFileNameLength()}.
541+
* </p>
542542
*
543-
* <p>The value is expressed in Java {@code char} units (UTF-16 code units)
544-
* and represents the longest path that can be safely passed to Java
545-
* {@link java.io.File} and {@link java.nio.file.Path} APIs.</p>
543+
* <p>
544+
* The value is expressed in Java {@code char} units (UTF-16 code units) and represents the longest path that can be safely passed to Java
545+
* {@link java.io.File} and {@link java.nio.file.Path} APIs.
546+
* </p>
546547
*
547-
* <p><strong>Note:</strong> many operating systems and file systems enforce
548-
* path length limits in <em>bytes</em> using a specific encoding, rather than
549-
* in UTF-16 code units. As a result, a path that fits within this limit may
550-
* still be rejected by the underlying platform.</p>
548+
* <p>
549+
* <strong>Note:</strong> many operating systems and file systems enforce path length limits in <em>bytes</em> using a specific encoding, rather than in
550+
* UTF-16 code units. As a result, a path that fits within this limit may still be rejected by the underlying platform.
551+
* </p>
551552
*
552-
* <p>Conversely, any path longer than this limit is guaranteed to fail with
553-
* at least some operating system API calls.</p>
553+
* <p>
554+
* Conversely, any path longer than this limit is guaranteed to fail with at least some operating system API calls.
555+
* </p>
554556
*
555557
* @return the maximum file path length in characters.
556558
*/
@@ -599,7 +601,7 @@ public boolean isCaseSensitive() {
599601
* Tests if the given character is illegal in a file name, {@code false} otherwise.
600602
*
601603
* @param c
602-
* the character to test
604+
* the character to test.
603605
* @return {@code true} if the given character is illegal in a file name, {@code false} otherwise.
604606
*/
605607
private boolean isIllegalFileNameChar(final int c) {
@@ -617,8 +619,8 @@ private boolean isIllegalFileNameChar(final int c) {
617619
* </ul>
618620
*
619621
* @param candidate
620-
* A candidate file name (without a path) like {@code "filename.ext"} or {@code "filename"}
621-
* @return {@code true} if the candidate name is legal
622+
* A candidate file name (without a path) like {@code "filename.ext"} or {@code "filename"}.
623+
* @return {@code true} if the candidate name is legal.
622624
*/
623625
public boolean isLegalFileName(final CharSequence candidate) {
624626
return isLegalFileName(candidate, Charset.defaultCharset());
@@ -635,10 +637,10 @@ public boolean isLegalFileName(final CharSequence candidate) {
635637
* </ul>
636638
*
637639
* @param candidate
638-
* A candidate file name (without a path) like {@code "filename.ext"} or {@code "filename"}
640+
* A candidate file name (without a path) like {@code "filename.ext"} or {@code "filename"}.
639641
* @param charset
640-
* The charset to use when the file name length is measured in bytes
641-
* @return {@code true} if the candidate name is legal
642+
* The charset to use when the file name length is measured in bytes.
643+
* @return {@code true} if the candidate name is legal.
642644
* @since 2.21.0
643645
*/
644646
public boolean isLegalFileName(final CharSequence candidate, final Charset charset) {
@@ -653,7 +655,7 @@ public boolean isLegalFileName(final CharSequence candidate, final Charset chars
653655
* Tests whether the given string is a reserved file name.
654656
*
655657
* @param candidate
656-
* the string to test
658+
* the string to test.
657659
* @return {@code true} if the given string is a reserved file name.
658660
*/
659661
public boolean isReservedFileName(final CharSequence candidate) {
@@ -664,8 +666,8 @@ public boolean isReservedFileName(final CharSequence candidate) {
664666
/**
665667
* Converts all separators to the Windows separator of backslash.
666668
*
667-
* @param path the path to be changed, null ignored
668-
* @return the updated path
669+
* @param path the path to be changed, null ignored.
670+
* @return the updated path.
669671
* @since 2.12.0
670672
*/
671673
public String normalizeSeparators(final String path) {
@@ -698,10 +700,10 @@ public boolean supportsDriveLetter() {
698700
* </ul>
699701
*
700702
* @param candidate
701-
* A candidate file name (without a path) like {@code "filename.ext"} or {@code "filename"}
703+
* A candidate file name (without a path) like {@code "filename.ext"} or {@code "filename"}.
702704
* @param replacement
703-
* Illegal characters in the candidate name are replaced by this character
704-
* @return a String without illegal characters
705+
* Illegal characters in the candidate name are replaced by this character.
706+
* @return a String without illegal characters.
705707
*/
706708
public String toLegalFileName(final String candidate, final char replacement) {
707709
return toLegalFileName(candidate, replacement, Charset.defaultCharset());
@@ -717,12 +719,12 @@ public String toLegalFileName(final String candidate, final char replacement) {
717719
* </ul>
718720
*
719721
* @param candidate
720-
* A candidate file name (without a path) like {@code "filename.ext"} or {@code "filename"}
722+
* A candidate file name (without a path) like {@code "filename.ext"} or {@code "filename"}.
721723
* @param replacement
722-
* Illegal characters in the candidate name are replaced by this character
724+
* Illegal characters in the candidate name are replaced by this character.
723725
* @param charset
724-
* The charset to use when the file name length is measured in bytes
725-
* @return a String without illegal characters
726+
* The charset to use when the file name length is measured in bytes.
727+
* @return a String without illegal characters.
726728
* @since 2.21.0
727729
*/
728730
public String toLegalFileName(final String candidate, final char replacement, final Charset charset) {

0 commit comments

Comments
 (0)