ppkarwasz commented on code in PR #781:
URL: https://github.com/apache/commons-io/pull/781#discussion_r2328364784
##########
src/main/java/org/apache/commons/io/FileSystem.java:
##########
@@ -380,23 +396,45 @@ public int[] getIllegalFileNameCodePoints() {
}
/**
- * Gets the maximum length for file names. The file name does not include
folders.
+ * Gets the maximum length for file names (excluding any folder path).
+ *
+ * <p><strong>Note:</strong> This excludes any folder path. The unit
depends on the
+ * filesystem or OS; see {@link #getLengthUnit()} to check whether the
value is in
+ * bytes or UTF-16 characters.</p>
*
- * @return the maximum length for file names.
+ * @return the maximum file name length.
Review Comment:
I don't know what the original intention was, but `char`s seems the only
length unit useful for users.
The maximum length is always reachable by using ASCII characters, I just
added a note in
https://github.com/apache/commons-io/pull/781/commits/9a1e9e41df93bf2e2c442637e9c5ba2c78d7dc72
that satisfying the limit in `char`s might not be enough.
##########
src/main/java/org/apache/commons/io/FileSystem.java:
##########
@@ -380,23 +396,45 @@ public int[] getIllegalFileNameCodePoints() {
}
/**
- * Gets the maximum length for file names. The file name does not include
folders.
+ * Gets the maximum length for file names (excluding any folder path).
+ *
+ * <p><strong>Note:</strong> This excludes any folder path. The unit
depends on the
+ * filesystem or OS; see {@link #getLengthUnit()} to check whether the
value is in
+ * bytes or UTF-16 characters.</p>
*
- * @return the maximum length for file names.
+ * @return the maximum file name length.
*/
public int getMaxFileNameLength() {
return maxFileNameLength;
}
/**
- * Gets the maximum length of the path to a file. This can include folders.
+ * Gets the maximum length for file paths (may include folders).
*
- * @return the maximum length of the path to a file.
+ * <p><strong>Note:</strong> This may include folder names as well as the
file name.
+ * The unit is the same as {@link #getMaxFileNameLength()} and can be
obtained
+ * from {@link #getLengthUnit()}.</p>
+ *
+ * @return the maximum file path length.
Review Comment:
Fixed in
https://github.com/apache/commons-io/pull/781/commits/9a1e9e41df93bf2e2c442637e9c5ba2c78d7dc72
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]