private synchronized void setFilePathPrefix()

in src/main/java/com/microsoft/azure/datalake/store/ADLStoreClient.java [1207:1220]


    private synchronized void setFilePathPrefix(String prefix) throws IOException {
        if (prefix==null || prefix.equals("")) throw new IllegalArgumentException("prefix cannot be empty or null");
        if (prefix.equals("/")) return; // no prefix

        if (prefix.contains("//")) throw new IllegalArgumentException("prefix cannot contain empty path element " + prefix);
        if (prefix.charAt(0) != '/') prefix = "/" + prefix;
        if (prefix.charAt(prefix.length()-1) == '/') prefix = prefix.substring(0, prefix.length()-1);

        try {
            pathPrefix = (new URI(null, null, prefix, null)).toASCIIString();
        } catch (URISyntaxException ex) {
            throw new IllegalArgumentException("Invalid path prefix: " + prefix);
        }
    }