You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2020/12/30 08:46:50 UTC
[GitHub] [commons-io] abchaubey opened a new pull request #179: IO-600: fix getPrefixLength method for Linux filename
abchaubey opened a new pull request #179:
URL: https://github.com/apache/commons-io/pull/179
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [commons-io] coveralls commented on pull request #179: IO-600: fix getPrefixLength method for Linux filename
Posted by GitBox <gi...@apache.org>.
coveralls commented on pull request #179:
URL: https://github.com/apache/commons-io/pull/179#issuecomment-752386109
[](https://coveralls.io/builds/36001724)
Coverage decreased (-0.07%) to 88.644% when pulling **4b4ab3bfc2a8cb5b962661b5aac770bf1b8785cf on abchaubey:master** into **a31f5cfcd87d9c2daef0a77c8065c69b602d09cf on apache:master**.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [commons-io] garydgregory commented on a change in pull request #179: IO-600: fix getPrefixLength method for Linux filename
Posted by GitBox <gi...@apache.org>.
garydgregory commented on a change in pull request #179:
URL: https://github.com/apache/commons-io/pull/179#discussion_r550199697
##########
File path: src/main/java/org/apache/commons/io/FilenameUtils.java
##########
@@ -665,7 +665,10 @@ public static int getPrefixLength(final String fileName) {
if (ch1 == ':') {
ch0 = Character.toUpperCase(ch0);
if (ch0 >= 'A' && ch0 <= 'Z') {
- if (len == 2 || isSeparator(fileName.charAt(2)) == false) {
+ if (len == 2 && !FileSystem.getCurrent().supportsDriveLetter()) {
Review comment:
The last step is to document this in the Javadoc for the method.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [commons-io] coveralls edited a comment on pull request #179: IO-600: fix getPrefixLength method for Linux filename
Posted by GitBox <gi...@apache.org>.
coveralls edited a comment on pull request #179:
URL: https://github.com/apache/commons-io/pull/179#issuecomment-752386109
[](https://coveralls.io/builds/36011954)
Coverage decreased (-0.01%) to 88.704% when pulling **278b76d0dcc22b0c5845d79dd867cd907ed9f4d9 on abchaubey:master** into **a31f5cfcd87d9c2daef0a77c8065c69b602d09cf on apache:master**.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [commons-io] abchaubey commented on a change in pull request #179: IO-600: fix getPrefixLength method for Linux filename
Posted by GitBox <gi...@apache.org>.
abchaubey commented on a change in pull request #179:
URL: https://github.com/apache/commons-io/pull/179#discussion_r550366215
##########
File path: src/main/java/org/apache/commons/io/FilenameUtils.java
##########
@@ -665,7 +665,10 @@ public static int getPrefixLength(final String fileName) {
if (ch1 == ':') {
ch0 = Character.toUpperCase(ch0);
if (ch0 >= 'A' && ch0 <= 'Z') {
- if (len == 2 || isSeparator(fileName.charAt(2)) == false) {
+ if (len == 2 && !FileSystem.getCurrent().supportsDriveLetter()) {
Review comment:
Updated Javadoc
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [commons-io] abchaubey commented on a change in pull request #179: IO-600: fix getPrefixLength method for Linux filename
Posted by GitBox <gi...@apache.org>.
abchaubey commented on a change in pull request #179:
URL: https://github.com/apache/commons-io/pull/179#discussion_r550222159
##########
File path: src/main/java/org/apache/commons/io/FilenameUtils.java
##########
@@ -665,7 +665,10 @@ public static int getPrefixLength(final String fileName) {
if (ch1 == ':') {
ch0 = Character.toUpperCase(ch0);
if (ch0 >= 'A' && ch0 <= 'Z') {
- if (len == 2 || isSeparator(fileName.charAt(2)) == false) {
+ if (len == 2 && !FileSystem.getCurrent().supportsDriveLetter()) {
Review comment:
adding this in under Unix section :
* C: --> "" --> valid filename as only null byte and / are reserved characters
Let me know your thoughts, thanks
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [commons-io] garydgregory commented on a change in pull request #179: IO-600: fix getPrefixLength method for Linux filename
Posted by GitBox <gi...@apache.org>.
garydgregory commented on a change in pull request #179:
URL: https://github.com/apache/commons-io/pull/179#discussion_r550254270
##########
File path: src/main/java/org/apache/commons/io/FilenameUtils.java
##########
@@ -665,7 +665,10 @@ public static int getPrefixLength(final String fileName) {
if (ch1 == ':') {
ch0 = Character.toUpperCase(ch0);
if (ch0 >= 'A' && ch0 <= 'Z') {
- if (len == 2 || isSeparator(fileName.charAt(2)) == false) {
+ if (len == 2 && !FileSystem.getCurrent().supportsDriveLetter()) {
Review comment:
Well, our current Javadoc is lame because while this methods returns an `int`, the Javadoc shows `String` examples as 'output' which is not so helpful IMO, so if you can fix the Javadoc to show what the `int` value is now for all the example strings, that would be appreciated.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [commons-io] garydgregory merged pull request #179: [IO-600] Fix getPrefixLength method for Linux filename
Posted by GitBox <gi...@apache.org>.
garydgregory merged pull request #179:
URL: https://github.com/apache/commons-io/pull/179
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org