Here you can find the source of readProperties(final URL url)
private static Properties readProperties(final URL url)
//package com.java2s; /******************************************************************************* * Copyright (c) 2008, 2012 Sonatype Inc. and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors:// w ww . j a v a 2 s . c o m * Sonatype Inc. - initial API and implementation *******************************************************************************/ import java.io.IOException; import java.io.InputStream; import java.net.URL; import java.util.Properties; public class Main { private static Properties readProperties(final URL url) { Properties listProps = new Properties(); InputStream stream = null; try { stream = url.openStream(); listProps.load(stream); } catch (IOException e) { throw new RuntimeException(e); } finally { try { if (stream != null) { stream.close(); } } catch (IOException e) { throw new RuntimeException(e); } } return listProps; } }