Here you can find the source of getPassword(final URI uri)
Parameter | Description |
---|---|
uri | a parameter |
public static String getPassword(final URI uri)
//package com.java2s; /*// ww w .j av a 2 s. co m * Copyright (c) 2014 Stephan D. Cote' - All rights reserved. * * This program and the accompanying materials are made available under the * terms of the MIT License which accompanies this distribution, and is * available at http://creativecommons.org/licenses/MIT/ * * Contributors: * Stephan D. Cote * - Initial concept and initial implementation */ import java.net.URI; public class Main { /** * Method getPassword * * @param uri * * @return TODO Complete Documentation */ public static String getPassword(final URI uri) { String retval = null; if (uri != null) { final String userInfo = uri.getUserInfo(); if ((userInfo != null) && (userInfo.length() > 0)) { if (userInfo.indexOf(':') > -1) { retval = userInfo.substring(userInfo.indexOf(':') + 1); } if ((retval != null) && (retval.length() > 0)) { return retval; } } } return retval; } }