Here you can find the source of getFileName(URI uri)
public static String getFileName(URI uri)
//package com.java2s; /**/* ww w. ja va 2 s . co m*/ * Aptana Studio * Copyright (c) 2005-2011 by Appcelerator, Inc. All Rights Reserved. * Licensed under the terms of the GNU Public License (GPL) v3 (with exceptions). * Please see the license.html included with this distribution for details. * Any modifications to this file must keep this entire header intact. */ import java.net.URI; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.Path; public class Main { public static String getFileName(URI uri) { if (uri == null) { return null; } String uriPath = uri.getPath(); IPath path = Path.fromPortableString(uriPath); if (path == null) { return null; } return path.lastSegment(); } }