curator-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ericzundel <...@git.apache.org>
Subject [GitHub] curator pull request: CURATOR-33 recursive TreeCache recipe
Date Fri, 18 Jul 2014 10:20:43 GMT
Github user ericzundel commented on a diff in the pull request:

    https://github.com/apache/curator/pull/17#discussion_r15104749
  
    --- Diff: curator-client/src/main/java/org/apache/curator/utils/ZKPaths.java ---
    @@ -112,6 +113,34 @@ public static PathAndNode getPathAndNode(String path)
         }
     
         /**
    +     * Given a full path, return the the individual parts, without slashes.
    +     * The root path will return an empty list.
    +     *
    +     * @param path the path
    +     * @return an array of parts
    +     */
    +    public static List<String> split(String path)
    +    {
    +        PathUtils.validatePath(path);
    +        if (path.length() == 1) {
    +            return Collections.emptyList();
    +        }
    +        int lastPos = 1;
    +        List<String> parts = new ArrayList<String>();
    +        while (true)
    +        {
    +            int nextPos = path.indexOf('/', lastPos);
    --- End diff --
    
    Do you want to use file.separator system property (or File.separatorChar)  


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message