@Test public void urlIsCreatedFromFilePath() { URL url = converter.convert("/path/to/something"); assertThat(url.getPath(), endsWith("/path/to/something")); }
public URL convert(String value) { if (isBlank(value)) { throw new ParameterException(getErrorString("a blank value", "a valid URL")); } try { return URLUtil.parseURL(value); } catch (IllegalArgumentException e) { throw new ParameterException(getErrorString(value, "a valid URL")); } }
UrlConverter extends BaseConverter<URL> { public URL convert(String value) { if (isBlank(value)) { throw new ParameterException(getErrorString("a blank value", "a valid URL")); } try { return URLUtil.parseURL(value); } catch (IllegalArgumentException e) { throw new ParameterException(getErrorString(value, "a valid URL")); } } }
UrlConverter extends BaseConverter<URL> { public URL convert(String value) { if (isBlank(value)) { throw new ParameterException(getErrorString("a blank value", "a valid URL")); } try { return URLUtil.parseURL(value); } catch (IllegalArgumentException e) { throw new ParameterException(getErrorString(value, "a valid URL")); } } UrlConverter(String optionName); }
UrlConverter extends BaseConverter<URL> { public URL convert(String value) { if (isBlank(value)) { throw new ParameterException(getErrorString("a blank value", "a valid URL")); } try { return URLUtil.parseURL(value); } catch (IllegalArgumentException e) { throw new ParameterException(getErrorString(value, "a valid URL")); } } UrlConverter(String optionName); URL convert(String value); }
UrlConverter extends BaseConverter<URL> { public URL convert(String value) { if (isBlank(value)) { throw new ParameterException(getErrorString("a blank value", "a valid URL")); } try { return URLUtil.parseURL(value); } catch (IllegalArgumentException e) { throw new ParameterException(getErrorString(value, "a valid URL")); } } UrlConverter(String optionName); URL convert(String value);  }