hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niels Basjes (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HADOOP-7945) Document that Path objects do not support ":" in them.
Date Sun, 01 Jan 2012 20:47:30 GMT

    [ https://issues.apache.org/jira/browse/HADOOP-7945?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13178228#comment-13178228
] 

Niels Basjes commented on HADOOP-7945:
--------------------------------------

Quick shot: Simply add another check to the already existing checkPathArg method in the Path
class.
I.e. something like this (I never tested this code):

diff --git hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/Path.java
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/Path.java
index 81c79db..e135efb 100644
--- hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/Path.java
+++ hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/Path.java
@@ -90,7 +90,13 @@ public class Path implements Comparable {
     if( path.length() == 0 ) {
        throw new IllegalArgumentException(
            "Can not create a Path from an empty string");
-    }   
+    }
+    if( path.contains(":") ) {
+      throw new IllegalArgumentException(
+          "Can not create Path because Path is limited by URI semantics "+
+          "in the sense that one cannot create files whose names include "+
+          "characters such as \":\" etc.");
+    }
   }
   
   /** Construct a path from a String.  Path strings are URIs, but with



                
> Document that Path objects do not support ":" in them.
> ------------------------------------------------------
>
>                 Key: HADOOP-7945
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7945
>             Project: Hadoop Common
>          Issue Type: Improvement
>    Affects Versions: 0.20.0
>            Reporter: Harsh J
>            Priority: Critical
>              Labels: newbie
>
> Until HADOOP-3257 is fixed, this particular exclusion should be documented. This is a
major upsetter to many beginners.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message