java.net.MalformedURLException.getLocalizedMessage()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(6.4k)|赞(0)|评价(0)|浏览(127)

本文整理了Java中java.net.MalformedURLException.getLocalizedMessage()方法的一些代码示例,展示了MalformedURLException.getLocalizedMessage()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MalformedURLException.getLocalizedMessage()方法的具体详情如下:
包路径:java.net.MalformedURLException
类名称:MalformedURLException
方法名:getLocalizedMessage

MalformedURLException.getLocalizedMessage介绍

暂无

代码示例

代码示例来源:origin: athkalia/Just-Another-Android-App

  1. private File getTestDataRootDir() {
  2. CodeSource source = getClass().getProtectionDomain().getCodeSource();
  3. if (source != null) {
  4. URL location = source.getLocation();
  5. try {
  6. File classesDir = SdkUtils.urlToFile(location);
  7. return classesDir.getParentFile().getAbsoluteFile().getParentFile().getParentFile();
  8. } catch (MalformedURLException e) {
  9. fail(e.getLocalizedMessage());
  10. }
  11. }
  12. return null;
  13. }

代码示例来源:origin: geotools/geotools

  1. /** @see AbstractGridFormat#getReader(Object, Hints) */
  2. @Override
  3. public ImageMosaicReader getReader(Object source, Hints hints) {
  4. try {
  5. if (hints == null) {
  6. hints = new Hints(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER, Boolean.TRUE);
  7. }
  8. final ImageMosaicReader reader = new ImageMosaicReader(source, hints);
  9. return reader;
  10. } catch (MalformedURLException e) {
  11. if (LOGGER.isLoggable(Level.WARNING))
  12. LOGGER.log(Level.WARNING, e.getLocalizedMessage(), e);
  13. return null;
  14. } catch (IOException e) {
  15. if (LOGGER.isLoggable(Level.FINE)) LOGGER.log(Level.FINE, e.getLocalizedMessage(), e);
  16. return null;
  17. }
  18. }

代码示例来源:origin: geotools/geotools

  1. new StringBuffer(
  2. "impossible to get a reader for the provided source. The error is ")
  3. .append(e.getLocalizedMessage())
  4. .toString());
  5. return null;

代码示例来源:origin: OpenAttestation/OpenAttestation

  1. @Override
  2. public URL getPersistenceUnitRootUrl() {
  3. if( url != null ) { return url; }
  4. try {
  5. return new URL("http://localhost");
  6. }
  7. catch(MalformedURLException e) {
  8. throw new IllegalArgumentException("Invalid persistence unit root url: "+e.getLocalizedMessage());
  9. }
  10. }

代码示例来源:origin: net.sf.taverna.t2.ui-activities/dataflow-activity-ui

  1. public void run() {
  2. fieldUrl.requestFocus();
  3. JOptionPane.showMessageDialog(parentComponent,
  4. "The workflow location " + url
  5. + " is invalid\n"
  6. + e1.getLocalizedMessage(),
  7. "Invalid URL",
  8. JOptionPane.ERROR_MESSAGE);
  9. setVisible(true);
  10. }
  11. });

代码示例来源:origin: net.wetheinter/gwt-user

  1. @Override
  2. public void malformedScriptURL(HtmlPage htmlPage, String url,
  3. MalformedURLException malformedURLException) {
  4. treeLogger.log(TreeLogger.ERROR,
  5. "Malformed Script URL: " + malformedURLException.getLocalizedMessage());
  6. }

代码示例来源:origin: org.mobicents.servers.jainslee.core/common

  1. public DeployableUnitWrapper(URL url, String name) {
  2. try {
  3. gatherInfoFromURL(url);
  4. // Only for WildFly
  5. if (this.fileName.contentEquals("content")) {
  6. this.fileName = name;
  7. }
  8. }
  9. catch (MalformedURLException e) {
  10. logger.error(e.getLocalizedMessage(), e);
  11. }
  12. }

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

  1. @Override
  2. public void malformedScriptURL(HtmlPage htmlPage, String url,
  3. MalformedURLException malformedURLException) {
  4. treeLogger.log(TreeLogger.ERROR,
  5. "Malformed Script URL: " + malformedURLException.getLocalizedMessage());
  6. }

代码示例来源:origin: de.smartics.properties/smartics-properties-resource-filesystem

  1. private ArtifactRef createFolderRef(final File file)
  2. {
  3. try
  4. {
  5. return new ArtifactRef(defaultArtifactId, file.toURI().toURL());
  6. }
  7. catch (final MalformedURLException e)
  8. {
  9. LOG.debug("Cannot transform file '{}' to an URL: "
  10. + e.getLocalizedMessage());
  11. return null;
  12. }
  13. }

代码示例来源:origin: org.orbisgis/mapeditor

  1. @Override
  2. public void setUserObject(Object o) {
  3. String userUri = o.toString();
  4. try {
  5. setServerUrl(new URL(userUri));
  6. update();
  7. } catch(MalformedURLException ex) {
  8. LOGGER.error(ex.getLocalizedMessage(),ex);
  9. }
  10. }
  11. /**

代码示例来源:origin: com.github.abashev/commons-vfs2

  1. /**
  2. * Sets the configuration file for this manager.
  3. *
  4. * @param configUri The URI for this manager.
  5. */
  6. public void setConfiguration(final String configUri) {
  7. try {
  8. setConfiguration(new URL(configUri));
  9. } catch (final MalformedURLException e) {
  10. getLogger().warn(e.getLocalizedMessage(), e);
  11. }
  12. }

代码示例来源:origin: org.apache.commons/commons-vfs2

  1. /**
  2. * Sets the configuration file for this manager.
  3. *
  4. * @param configUri The URI for this manager.
  5. */
  6. public void setConfiguration(final String configUri) {
  7. try {
  8. setConfiguration(new URL(configUri));
  9. } catch (final MalformedURLException e) {
  10. getLogger().warn(e.getLocalizedMessage(), e);
  11. }
  12. }

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface

  1. private static URL getURL(String urlString) {
  2. URL result = null;
  3. try {
  4. result = new URL(urlString);
  5. } catch (MalformedURLException e) {
  6. Policy.getLog().log(new Status(IStatus.ERROR, Policy.JFACE, e.getLocalizedMessage(), e));
  7. }
  8. return result;
  9. }
  10. }

代码示例来源:origin: apache/commons-vfs

  1. /**
  2. * Sets the configuration file for this manager.
  3. *
  4. * @param configUri The URI for this manager.
  5. */
  6. public void setConfiguration(final String configUri) {
  7. try {
  8. setConfiguration(new URL(configUri));
  9. } catch (final MalformedURLException e) {
  10. getLogger().warn(e.getLocalizedMessage(), e);
  11. }
  12. }

代码示例来源:origin: org.wildfly.core/wildfly-cli

  1. @Override
  2. public URL convert(CLIConverterInvocation c) throws OptionValidatorException {
  3. try {
  4. return new URL(c.getInput());
  5. } catch (MalformedURLException e) {
  6. throw new OptionValidatorException(e.getLocalizedMessage());
  7. }
  8. }

代码示例来源:origin: wildfly/wildfly-core

  1. @Override
  2. public URL convert(CLIConverterInvocation c) throws OptionValidatorException {
  3. try {
  4. return new URL(c.getInput());
  5. } catch (MalformedURLException e) {
  6. throw new OptionValidatorException(e.getLocalizedMessage());
  7. }
  8. }

代码示例来源:origin: droidefense/engine

  1. public static String getWebsiteContent(String urlString) {
  2. if (urlString != null) {
  3. try {
  4. return remoteDownloader.downloadFileFromUrlUsingNio(urlString);
  5. } catch (MalformedURLException e) {
  6. Log.write(LoggerType.ERROR, "Could not retrieve Google Play Store information", e.getLocalizedMessage());
  7. }
  8. }
  9. return "";
  10. }

代码示例来源:origin: com.github.albfernandez.richfaces/richfaces-core

  1. @Override
  2. public URL getURL() {
  3. try {
  4. return new URL(URL_PROTOCOL, null, -1, getResourceName(), new MyURLStreamHandler());
  5. } catch (MalformedURLException e) {
  6. throw new FacesException(e.getLocalizedMessage(), e);
  7. }
  8. }

代码示例来源:origin: freenet/fred

  1. @Override
  2. public void set(String val) throws InvalidConfigValueException {
  3. FreenetURI uri;
  4. try {
  5. uri = new FreenetURI(val);
  6. } catch (MalformedURLException e) {
  7. throw new InvalidConfigValueException(l10n(
  8. "invalidRevocationURI", "error",
  9. e.getLocalizedMessage()));
  10. }
  11. setRevocationURI(uri);
  12. }
  13. }

代码示例来源:origin: edu.psu.swe.commons/commons-jaxrs

  1. public static AtomLink createSelfLink(UriInfo uriInfo) {
  2. String url = null;
  3. try {
  4. url = UriUtil.urlAsString(uriInfo, true);
  5. } catch (MalformedURLException mue) {
  6. LOG.info("Failed to convert url " + mue.getLocalizedMessage());
  7. }
  8. AtomLink self = new AtomLink();
  9. self.setRelation(RelationshipType.SELF.toString());
  10. self.setHyperlink(url);
  11. self.setMimeType(Constants.PSU_CONTENT_TYPE_V1);
  12. return self;
  13. }

相关文章