本文整理汇总了Java中java.net.MalformedURLException.toString方法的典型用法代码示例。如果您正苦于以下问题:Java MalformedURLException.toString方法的具体用法?Java MalformedURLException.toString怎么用?Java MalformedURLException.toString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.net.MalformedURLException
的用法示例。
在下文中一共展示了MalformedURLException.toString方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addRepository
import java.net.MalformedURLException; //导入方法依赖的package包/类
/**
* Add a new repository to the set of places this ClassLoader can look for
* classes to be loaded.
*
* @param repository Name of a source of classes to be loaded, such as a
* directory pathname, a JAR file pathname, or a ZIP file pathname
*
* @exception IllegalArgumentException if the specified repository is
* invalid or does not exist
*/
public void addRepository(String repository) {
if (debug >= 1)
log("addRepository(" + repository + ")");
// Add this repository to our underlying class loader
try {
URLStreamHandler streamHandler = null;
String protocol = parseProtocol(repository);
if (factory != null)
streamHandler = factory.createURLStreamHandler(protocol);
URL url = new URL(null, repository, streamHandler);
super.addURL(url);
} catch (MalformedURLException e) {
throw new IllegalArgumentException(e.toString());
}
// Add this repository to our internal list
addRepositoryInternal(repository);
}
示例2: addRepository
import java.net.MalformedURLException; //导入方法依赖的package包/类
/**
* Add a new repository to the set of places this ClassLoader can look for
* classes to be loaded.
*
* @param repository Name of a source of classes to be loaded, such as a
* directory pathname, a JAR file pathname, or a ZIP file pathname
*
* @exception IllegalArgumentException if the specified repository is
* invalid or does not exist
*/
public void addRepository(String repository) {
// Ignore any of the standard repositories, as they are set up using
// either addJar or addRepository
if (repository.startsWith("/WEB-INF/lib")
|| repository.startsWith("/WEB-INF/classes"))
return;
// Add this repository to our underlying class loader
try {
URL url = new URL(repository);
super.addURL(url);
hasExternalRepositories = true;
} catch (MalformedURLException e) {
throw new IllegalArgumentException(e.toString());
}
}
示例3: getZ
import java.net.MalformedURLException; //导入方法依赖的package包/类
public URL getZ() {
try {
return new URL((String)((Cell)getProperty("z")).o);
} catch (MalformedURLException mfue) {
throw new IllegalStateException(mfue.toString());
}
}
示例4: getHref
import java.net.MalformedURLException; //导入方法依赖的package包/类
public String getHref() {
String relativeLocation = getAttributeWithNoDefault( "href" );
if (relativeLocation.indexOf( ':' ) > 0 || relativeLocation.equals( "#" )) {
return relativeLocation;
} else {
try {
return new URL( ((HTMLDocumentImpl) getOwnerDocument()).getBaseUrl(), relativeLocation ).toExternalForm();
} catch (MalformedURLException e) {
return e.toString();
}
}
}
示例5: getHref
import java.net.MalformedURLException; //导入方法依赖的package包/类
public String getHref() {
try {
return new URL( ((HTMLDocumentImpl) getOwnerDocument()).getWindow().getUrl(), getAttributeWithNoDefault( "href" ) ).toExternalForm();
} catch (MalformedURLException e) {
return e.toString();
}
}