本文整理了Java中java.net.MalformedURLException.getLocalizedMessage()
方法的一些代码示例,展示了MalformedURLException.getLocalizedMessage()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MalformedURLException.getLocalizedMessage()
方法的具体详情如下:
包路径:java.net.MalformedURLException
类名称:MalformedURLException
方法名:getLocalizedMessage
暂无
代码示例来源:origin: athkalia/Just-Another-Android-App
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;
}
代码示例来源:origin: geotools/geotools
/** @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;
}
}
代码示例来源:origin: geotools/geotools
new StringBuffer(
"impossible to get a reader for the provided source. The error is ")
.append(e.getLocalizedMessage())
.toString());
return null;
代码示例来源:origin: OpenAttestation/OpenAttestation
@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());
}
}
代码示例来源:origin: net.sf.taverna.t2.ui-activities/dataflow-activity-ui
public void run() {
fieldUrl.requestFocus();
JOptionPane.showMessageDialog(parentComponent,
"The workflow location " + url
+ " is invalid\n"
+ e1.getLocalizedMessage(),
"Invalid URL",
JOptionPane.ERROR_MESSAGE);
setVisible(true);
}
});
代码示例来源:origin: net.wetheinter/gwt-user
@Override
public void malformedScriptURL(HtmlPage htmlPage, String url,
MalformedURLException malformedURLException) {
treeLogger.log(TreeLogger.ERROR,
"Malformed Script URL: " + malformedURLException.getLocalizedMessage());
}
代码示例来源:origin: org.mobicents.servers.jainslee.core/common
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);
}
}
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
@Override
public void malformedScriptURL(HtmlPage htmlPage, String url,
MalformedURLException malformedURLException) {
treeLogger.log(TreeLogger.ERROR,
"Malformed Script URL: " + malformedURLException.getLocalizedMessage());
}
代码示例来源:origin: de.smartics.properties/smartics-properties-resource-filesystem
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;
}
}
代码示例来源:origin: org.orbisgis/mapeditor
@Override
public void setUserObject(Object o) {
String userUri = o.toString();
try {
setServerUrl(new URL(userUri));
update();
} catch(MalformedURLException ex) {
LOGGER.error(ex.getLocalizedMessage(),ex);
}
}
/**
代码示例来源:origin: com.github.abashev/commons-vfs2
/**
* 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);
}
}
代码示例来源:origin: org.apache.commons/commons-vfs2
/**
* 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);
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface
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;
}
}
代码示例来源:origin: apache/commons-vfs
/**
* 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);
}
}
代码示例来源:origin: org.wildfly.core/wildfly-cli
@Override
public URL convert(CLIConverterInvocation c) throws OptionValidatorException {
try {
return new URL(c.getInput());
} catch (MalformedURLException e) {
throw new OptionValidatorException(e.getLocalizedMessage());
}
}
代码示例来源:origin: wildfly/wildfly-core
@Override
public URL convert(CLIConverterInvocation c) throws OptionValidatorException {
try {
return new URL(c.getInput());
} catch (MalformedURLException e) {
throw new OptionValidatorException(e.getLocalizedMessage());
}
}
代码示例来源:origin: droidefense/engine
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 "";
}
代码示例来源:origin: com.github.albfernandez.richfaces/richfaces-core
@Override
public URL getURL() {
try {
return new URL(URL_PROTOCOL, null, -1, getResourceName(), new MyURLStreamHandler());
} catch (MalformedURLException e) {
throw new FacesException(e.getLocalizedMessage(), e);
}
}
代码示例来源:origin: freenet/fred
@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);
}
}
代码示例来源:origin: edu.psu.swe.commons/commons-jaxrs
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;
}
内容来源于网络,如有侵权,请联系作者删除!