Here you can find the source of getPathSegments(URI uri)
public static String[] getPathSegments(URI uri)
//package com.java2s; //License from project: Apache License import java.net.URI; public class Main { public static String[] getPathSegments(URI uri) { return uri.getPath().split("/"); }/*from w ww .ja v a 2 s . c o m*/ }