Here you can find the source of getLocalName(String uri)
public static String getLocalName(String uri) throws MalformedURLException
//package com.java2s; /**/*from w w w .j a v a2s .co m*/ * (C) Copyright 2015 Zaizi Limited (http://www.zaizi.com). * * All rights reserved. This program and the accompanying materials * are made available under the terms of the GNU Lesser General Public License * (LGPL) version 3.0 which accompanies this distribution, and is available at * http://www.gnu.org/licenses/lgpl-3.0.en.html * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * **/ import java.net.MalformedURLException; public class Main { public static String getLocalName(String uri) throws MalformedURLException { if (uri.contains("/")) { int lastSlashPosition = uri.lastIndexOf("/"); return uri.substring(lastSlashPosition + 1); } else { return new String(uri); } } }