本文整理汇总了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;
}
}
}