/** * Returns an URL object for the given URL specification. * * @param specification * the URL specification. * @return * an URL object; if the URL is of "classpath://" type, it will return an URL * whose connection will be opened by a specialised stream handler. * @throws MalformedURLException */ public static URL makeURL(String specification) throws MalformedURLException { logger.trace("retrieving URL for specification: '{}'", specification); if(specification.startsWith("classpath:")) { logger.trace("URL is of type 'classpath'"); return new URL(null, specification, new ClassPathURLStreamHandler()); } logger.trace("URL is of normal type"); return new URL(specification); }
/** * Returns an URL object for the given URL specification. * * @param specification * the URL specification. * @return * an URL object; if the URL is of "classpath://" type, it will return an URL * whose connection will be opened by a specialised stream handler. * @throws MalformedURLException */ public static URL makeURL(String specification) throws MalformedURLException { logger.trace("retrieving URL for specification: '{}'", specification); if(specification.startsWith("classpath:")) { logger.trace("URL is of type 'classpath'"); return new URL(null, specification, new ClassPathURLStreamHandler()); } logger.trace("URL is of normal type"); return new URL(specification); }
/** * Returns an URL object for the given URL specification. * * @param specification * the URL specification. * @return * an URL object; if the URL is of "classpath://" type, it will return an URL * whose connection will be opened by a specialised stream handler. * @throws MalformedURLException */ public static URL makeURL(String specification) throws MalformedURLException { logger.trace("retrieving URL for specification: '{}'", specification); if(specification.startsWith("classpath:")) { logger.trace("URL is of type 'classpath'"); return new URL(null, specification, new ClassPathURLStreamHandler()); } logger.trace("URL is of normal type"); return new URL(specification); }