[
https://issues.apache.org/jira/browse/HDFS-17248?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17782516#comment-17782516
]
ASF GitHub Bot commented on HDFS-17248:
---------------------------------------
GauthamBanasandra commented on code in PR #6249:
URL: https://github.com/apache/hadoop/pull/6249#discussion_r1381474325
##########
hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DFSUtilClient.java:
##########
@@ -661,9 +661,12 @@ public static boolean isValidName(String src) {
String[] components = StringUtils.split(src, '/');
for (int i = 0; i < components.length; i++) {
String element = components[i];
+ // For Windows, we must allow the : in the drive letter.
+ if (Shell.WINDOWS && i == 1 && element.contains(":")) {
Review Comment:
Could you please make an `endsWith` check for `:` instead of
`element.contains`?
> Fix DFSUtilClient.ValidName ERROR
> ---------------------------------
>
> Key: HDFS-17248
> URL: https://issues.apache.org/jira/browse/HDFS-17248
> Project: Hadoop HDFS
> Issue Type: Bug
> Reporter: liuguanghua
> Priority: Minor
> Labels: pull-request-available
>
> assertFalse(DFSUtil.isValidName("/foo/:/bar")); will be error when HDFS-17246
> merged.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]