本文整理匯總了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();
}
}