private File getTestDataRootDir() { CodeSource source = getClass().getProtectionDomain().getCodeSource(); if (source != null) { URL location = source.getLocation(); try { File classesDir = SdkUtils.urlToFile(location); return classesDir.getParentFile().getAbsoluteFile().getParentFile().getParentFile(); } catch (MalformedURLException e) { fail(e.getLocalizedMessage()); } } return null; }
/** @see AbstractGridFormat#getReader(Object, Hints) */ @Override public ImageMosaicReader getReader(Object source, Hints hints) { try { if (hints == null) { hints = new Hints(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER, Boolean.TRUE); } final ImageMosaicReader reader = new ImageMosaicReader(source, hints); return reader; } catch (MalformedURLException e) { if (LOGGER.isLoggable(Level.WARNING)) LOGGER.log(Level.WARNING, e.getLocalizedMessage(), e); return null; } catch (IOException e) { if (LOGGER.isLoggable(Level.FINE)) LOGGER.log(Level.FINE, e.getLocalizedMessage(), e); return null; } }
new StringBuffer( "impossible to get a reader for the provided source. The error is ") .append(e.getLocalizedMessage()) .toString()); return null;
@Override public URL getPersistenceUnitRootUrl() { if( url != null ) { return url; } try { return new URL("http://localhost"); } catch(MalformedURLException e) { throw new IllegalArgumentException("Invalid persistence unit root url: "+e.getLocalizedMessage()); } }
public void run() { fieldUrl.requestFocus(); JOptionPane.showMessageDialog(parentComponent, "The workflow location " + url + " is invalid\n" + e1.getLocalizedMessage(), "Invalid URL", JOptionPane.ERROR_MESSAGE); setVisible(true); } });
@Override public void malformedScriptURL(HtmlPage htmlPage, String url, MalformedURLException malformedURLException) { treeLogger.log(TreeLogger.ERROR, "Malformed Script URL: " + malformedURLException.getLocalizedMessage()); }
public DeployableUnitWrapper(URL url, String name) { try { gatherInfoFromURL(url); // Only for WildFly if (this.fileName.contentEquals("content")) { this.fileName = name; } } catch (MalformedURLException e) { logger.error(e.getLocalizedMessage(), e); } }
@Override public void malformedScriptURL(HtmlPage htmlPage, String url, MalformedURLException malformedURLException) { treeLogger.log(TreeLogger.ERROR, "Malformed Script URL: " + malformedURLException.getLocalizedMessage()); }
private ArtifactRef createFolderRef(final File file) { try { return new ArtifactRef(defaultArtifactId, file.toURI().toURL()); } catch (final MalformedURLException e) { LOG.debug("Cannot transform file '{}' to an URL: " + e.getLocalizedMessage()); return null; } }
@Override public void setUserObject(Object o) { String userUri = o.toString(); try { setServerUrl(new URL(userUri)); update(); } catch(MalformedURLException ex) { LOGGER.error(ex.getLocalizedMessage(),ex); } } /**
/** * Sets the configuration file for this manager. * * @param configUri The URI for this manager. */ public void setConfiguration(final String configUri) { try { setConfiguration(new URL(configUri)); } catch (final MalformedURLException e) { getLogger().warn(e.getLocalizedMessage(), e); } }
/** * Sets the configuration file for this manager. * * @param configUri The URI for this manager. */ public void setConfiguration(final String configUri) { try { setConfiguration(new URL(configUri)); } catch (final MalformedURLException e) { getLogger().warn(e.getLocalizedMessage(), e); } }
private static URL getURL(String urlString) { URL result = null; try { result = new URL(urlString); } catch (MalformedURLException e) { Policy.getLog().log(new Status(IStatus.ERROR, Policy.JFACE, e.getLocalizedMessage(), e)); } return result; } }
/** * Sets the configuration file for this manager. * * @param configUri The URI for this manager. */ public void setConfiguration(final String configUri) { try { setConfiguration(new URL(configUri)); } catch (final MalformedURLException e) { getLogger().warn(e.getLocalizedMessage(), e); } }
@Override public URL convert(CLIConverterInvocation c) throws OptionValidatorException { try { return new URL(c.getInput()); } catch (MalformedURLException e) { throw new OptionValidatorException(e.getLocalizedMessage()); } }
@Override public URL convert(CLIConverterInvocation c) throws OptionValidatorException { try { return new URL(c.getInput()); } catch (MalformedURLException e) { throw new OptionValidatorException(e.getLocalizedMessage()); } }
public static String getWebsiteContent(String urlString) { if (urlString != null) { try { return remoteDownloader.downloadFileFromUrlUsingNio(urlString); } catch (MalformedURLException e) { Log.write(LoggerType.ERROR, "Could not retrieve Google Play Store information", e.getLocalizedMessage()); } } return ""; }
@Override public URL getURL() { try { return new URL(URL_PROTOCOL, null, -1, getResourceName(), new MyURLStreamHandler()); } catch (MalformedURLException e) { throw new FacesException(e.getLocalizedMessage(), e); } }
@Override public void set(String val) throws InvalidConfigValueException { FreenetURI uri; try { uri = new FreenetURI(val); } catch (MalformedURLException e) { throw new InvalidConfigValueException(l10n( "invalidRevocationURI", "error", e.getLocalizedMessage())); } setRevocationURI(uri); } }
public static AtomLink createSelfLink(UriInfo uriInfo) { String url = null; try { url = UriUtil.urlAsString(uriInfo, true); } catch (MalformedURLException mue) { LOG.info("Failed to convert url " + mue.getLocalizedMessage()); } AtomLink self = new AtomLink(); self.setRelation(RelationshipType.SELF.toString()); self.setHyperlink(url); self.setMimeType(Constants.PSU_CONTENT_TYPE_V1); return self; }