本文整理匯總了Java中java.net.URISyntaxException.getLocalizedMessage方法的典型用法代碼示例。如果您正苦於以下問題:Java URISyntaxException.getLocalizedMessage方法的具體用法?Java URISyntaxException.getLocalizedMessage怎麽用?Java URISyntaxException.getLocalizedMessage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類java.net.URISyntaxException
的用法示例。
在下文中一共展示了URISyntaxException.getLocalizedMessage方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: dbNameFromUrl
import java.net.URISyntaxException; //導入方法依賴的package包/類
/**
* @throws IllegalArgumentException url isn't valid
*/
public static String dbNameFromUrl(String url) {
try {
return new JdbcConnector(url).dbName;
} catch (URISyntaxException ex) {
throw new IllegalArgumentException(ex.getLocalizedMessage(), ex);
}
}
示例2: copyWsdlResources
import java.net.URISyntaxException; //導入方法依賴的package包/類
static File copyWsdlResources(String wsdlUrl) throws IOException {
File userDirFile = new File(WEBSVC_HOME);
File catalogFile = new File(userDirFile, WsdlUtil.getCatalogForWsdl(wsdlUrl));
File dir = catalogFile.getParentFile();
boolean success = false;
dir = catalogFile.getParentFile();
try {
FileObject dirFO = FileUtil.createFolder(dir);
URI catalog = catalogFile.toURI();
URI wsdlUri = new URL(wsdlUrl).toURI();
Retriever retriever = Retriever.getDefault();
FileObject wsdlFO = retriever.retrieveResource(dirFO, catalog, wsdlUri);
if (wsdlFO == null) {
throw new IOException(NbBundle.getMessage(WebServiceManager.class, "WSDL_COPY_ERROR"));
}
File result = FileUtil.toFile(wsdlFO);
success = true;
return result;
} catch (URISyntaxException ex) {
throw new IOException(ex.getLocalizedMessage());
} finally {
if (catalogFile.exists() && !success) {
rmDir(catalogFile.getParentFile());
}
}
}
示例3: validateBeforeNext
import java.net.URISyntaxException; //導入方法依賴的package包/類
protected void validateBeforeNext() throws WizardValidationException {
try {
HgURL url;
try {
url = repository.getUrl();
} catch (URISyntaxException ex) {
throw new WizardValidationException((JComponent) component,
ex.getMessage(),
ex.getLocalizedMessage());
}
if (support == null) {
support = new RepositoryStepProgressSupport();
component.add(support.getProgressComponent(), BorderLayout.SOUTH);
}
support.setRepositoryRoot(url);
RequestProcessor rp = Mercurial.getInstance().getRequestProcessor(url);
RequestProcessor.Task task = support.start(rp, url, NbBundle.getMessage(CloneRepositoryWizardPanel.class, "BK2012"));
task.waitFinished();
} finally {
if (support != null) { //see bug #167172
/*
* We cannot reuse the progress component because
* org.netbeans.api.progress.ProgressHandle cannot be reused.
*/
component.remove(support.getProgressComponent());
support = null;
}
}
}