當前位置: 首頁>>代碼示例>>Java>>正文


Java URISyntaxException.getLocalizedMessage方法代碼示例

本文整理匯總了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);
    }
}
 
開發者ID:pgcodekeeper,項目名稱:pgcodekeeper,代碼行數:11,代碼來源:JdbcConnector.java

示例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());
        }
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:30,代碼來源:WebServiceManager.java

示例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;
        }
    }

}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:32,代碼來源:CloneRepositoryWizardPanel.java


注:本文中的java.net.URISyntaxException.getLocalizedMessage方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。