Here you can find the source of getLocalPart(String uri)
Parameter | Description |
---|---|
uri | the uri to crop |
public static String getLocalPart(String uri)
//package com.java2s; /*************************************** * ViPER * * The Video Processing * * Evaluation Resource * * * * Distributed under the GPL license * * Terms available at gnu.org. * * * * Copyright University of Maryland, * * College Park. * ***************************************/ import java.net.*; public class Main { /**//from w ww . j a v a2 s .co m * Get the local part of the uri, if possible. Otherwise, * returns the whole uri. * @param uri the uri to crop * @return the local part of the uri */ public static String getLocalPart(String uri) { try { URI u = new URI(uri); String lname = u.getFragment(); if (lname == null) { lname = u.getPath(); } return lname; } catch (URISyntaxException e) { return uri; } } }