当前位置: 首页>>代码示例>>Java>>正文


Java URISyntaxException.getMessage方法代码示例

本文整理汇总了Java中java.net.URISyntaxException.getMessage方法的典型用法代码示例。如果您正苦于以下问题:Java URISyntaxException.getMessage方法的具体用法?Java URISyntaxException.getMessage怎么用?Java URISyntaxException.getMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.net.URISyntaxException的用法示例。


在下文中一共展示了URISyntaxException.getMessage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: DOMRetrievalMethod

import java.net.URISyntaxException; //导入方法依赖的package包/类
/**
 * Creates a <code>DOMRetrievalMethod</code> containing the specified
 * URIReference and List of Transforms.
 *
 * @param uri the URI
 * @param type the type
 * @param transforms a list of {@link Transform}s. The list is defensively
 *    copied to prevent subsequent modification. May be <code>null</code>
 *    or empty.
 * @throws IllegalArgumentException if the format of <code>uri</code> is
 *    invalid, as specified by Reference's URI attribute in the W3C
 *    specification for XML-Signature Syntax and Processing
 * @throws NullPointerException if <code>uriReference</code>
 *    is <code>null</code>
 * @throws ClassCastException if <code>transforms</code> contains any
 *    entries that are not of type {@link Transform}
 */
public DOMRetrievalMethod(String uri, String type,
                          List<? extends Transform> transforms)
{
    if (uri == null) {
        throw new NullPointerException("uri cannot be null");
    }
    List<Transform> tempList =
        Collections.checkedList(new ArrayList<Transform>(),
                                Transform.class);
    if (transforms != null) {
        tempList.addAll(transforms);
    }
    this.transforms = Collections.unmodifiableList(tempList);
    this.uri = uri;
    if (!uri.equals("")) {
        try {
            new URI(uri);
        } catch (URISyntaxException e) {
            throw new IllegalArgumentException(e.getMessage());
        }
    }

    this.type = type;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:42,代码来源:DOMRetrievalMethod.java

示例2: createTreeRequest

import java.net.URISyntaxException; //导入方法依赖的package包/类
private HttpRequestBase createTreeRequest(Long parentId) {
    try {
        URIBuilder builder = new URIBuilder(serverParameters.getServerUrl()
                + serverParameters.getProjectTreeUrl());
        builder.addParameter("parentId", String.valueOf(parentId));

        HttpGet get = new HttpGet(builder.build());
        setDefaultHeader(get);
        if (isSecure()) {
            addAuthorizationToRequest(get);
        }
        return get;
    } catch (URISyntaxException e) {
        throw new ApplicationException(e.getMessage(), e);
    }
}
 
开发者ID:react-dev26,项目名称:NGB-master,代码行数:17,代码来源:DatasetListHandler.java

示例3: runCommand

import java.net.URISyntaxException; //导入方法依赖的package包/类
@Override
public int runCommand() {
    try {
        String url = serverParameters.getServerUrl() + getRequestUrl();
        URIBuilder builder = new URIBuilder(String.format(url, datasetId));
        if (parentId != null) {
            builder.addParameter("parentId", String.valueOf(parentId));
        }
        HttpPut put = new HttpPut(builder.build());
        setDefaultHeader(put);
        if (isSecure()) {
            addAuthorizationToRequest(put);
        }
        RequestManager.executeRequest(put);
    } catch (URISyntaxException e) {
        throw new ApplicationException(e.getMessage(), e);
    }
    return 0;
}
 
开发者ID:react-dev26,项目名称:NGB-master,代码行数:20,代码来源:DatasetMovingHandler.java

示例4: uriToPath

import java.net.URISyntaxException; //导入方法依赖的package包/类
protected Path uriToPath(URI uri) {
    String scheme = uri.getScheme();
    if ((scheme == null) || !scheme.equalsIgnoreCase(getScheme())) {
        throw new IllegalArgumentException("URI scheme is not '" + getScheme() + "'");
    }
    try {
        // only support legacy JAR URL syntax  jar:{uri}!/{entry} for now
        String spec = uri.getRawSchemeSpecificPart();
        int sep = spec.indexOf("!/");
        if (sep != -1)
            spec = spec.substring(0, sep);
        return Paths.get(new URI(spec)).toAbsolutePath();
    } catch (URISyntaxException e) {
        throw new IllegalArgumentException(e.getMessage(), e);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:ZipFileSystemProvider.java

示例5: HttpEngine

import java.net.URISyntaxException; //导入方法依赖的package包/类
/**
 * @param requestHeaders the client's supplied request headers. This class
 *     creates a private copy that it can mutate.
 * @param connection the connection used for an intermediate response
 *     immediately prior to this request/response pair, such as a same-host
 *     redirect. This engine assumes ownership of the connection and must
 *     release it when it is unneeded.
 */
public HttpEngine(OkHttpClient client, Policy policy, String method, RawHeaders requestHeaders,
    Connection connection, RetryableOutputStream requestBodyOut) throws IOException {
  this.client = client;
  this.policy = policy;
  this.method = method;
  this.connection = connection;
  this.requestBodyOut = requestBodyOut;

  try {
    uri = Platform.get().toUriLenient(policy.getURL());
  } catch (URISyntaxException e) {
    throw new IOException(e.getMessage());
  }

  this.requestHeaders = new RequestHeaders(uri, new RawHeaders(requestHeaders));
}
 
开发者ID:aabognah,项目名称:LoRaWAN-Smart-Parking,代码行数:25,代码来源:HttpEngine.java

示例6: buildUri

import java.net.URISyntaxException; //导入方法依赖的package包/类
static URI buildUri(String path, Map<String, String> params) {
    Objects.requireNonNull(path, "path must not be null");
    try {
        URIBuilder uriBuilder = new URIBuilder(path);
        for (Map.Entry<String, String> param : params.entrySet()) {
            uriBuilder.addParameter(param.getKey(), param.getValue());
        }
        return uriBuilder.build();
    } catch(URISyntaxException e) {
        throw new IllegalArgumentException(e.getMessage(), e);
    }
}
 
开发者ID:chaokunyang,项目名称:jkes,代码行数:13,代码来源:HttpClient.java

示例7: regularUpload

import java.net.URISyntaxException; //导入方法依赖的package包/类
private boolean regularUpload(CloudBlobContainer container, String fileName, PluggableMessage pluggableMessage,
		Map<String, String> customMetadata, long fileSize) throws UnableToProduceException {
	boolean status = false;
	CloudBlockBlob singleBlob;
	String containerName = container.getName();
	try {

		if (container.exists()) {
			log.info(LOGGER_KEY + "Container exists: " + containerName);
			singleBlob = container.getBlockBlobReference(fileName);

			log.info(LOGGER_KEY + "User metadata being applied ..." + customMetadata.size() + " key(s)");
			singleBlob.setMetadata((HashMap<String, String>) customMetadata);
			log.info(LOGGER_KEY + "Initiating blob upload with regular mode");

			singleBlob.upload(FileUtils.openInputStream(pluggableMessage.getData().toFile()), fileSize);
			if (singleBlob.exists())
				log.info(LOGGER_KEY + "Azure Blob upload finished successfully.");
		}
	} catch (URISyntaxException urie) {
		log.error(LOGGER_KEY + "Azure Resource URI constructed based on the containerName is invalid. "
				+ urie.getMessage());
		throw new UnableToProduceException(urie.getMessage(), urie);
	} catch (StorageException se) {
		log.error(LOGGER_KEY + "Azure Storage Service Error occurred. " + se.getMessage());
		throw new UnableToProduceException(se.getMessage(), se);
	} catch (IOException ioe) {
		log.error(LOGGER_KEY + "Azure Storage I/O exception occurred. " + ioe.getMessage());
		throw new UnableToProduceException(ioe.getMessage(), ioe);
	} finally {
		status = true;
	}
	return status;
}
 
开发者ID:cmanda,项目名称:axway-b2b-plugins,代码行数:35,代码来源:AzureBlobPluggableTransport.java

示例8: createUri

import java.net.URISyntaxException; //导入方法依赖的package包/类
private URI createUri(String uriTemplate, UriComponentsBuilder builder, UriComponents uriComponents) {
  String strUri = uriComponents.toUriString();

  if (isCrossApp(uriTemplate, builder)) {
    int idx = strUri.indexOf('/', RestConst.URI_PREFIX.length());
    strUri = strUri.substring(0, idx) + ":" + strUri.substring(idx + 1);
  }

  try {
    // Avoid further encoding (in the case of strictEncoding=true)
    return new URI(strUri);
  } catch (URISyntaxException ex) {
    throw new IllegalStateException("Could not create URI object: " + ex.getMessage(), ex);
  }
}
 
开发者ID:apache,项目名称:incubator-servicecomb-java-chassis,代码行数:16,代码来源:CseUriTemplateHandler.java

示例9: 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

示例10: withServiceEndpoint

import java.net.URISyntaxException; //导入方法依赖的package包/类
public Builder withServiceEndpoint(String serviceEndpoint) {
    try {
        this.serviceEndpoint = new URI(serviceEndpoint);
    } catch (URISyntaxException e) {
        throw new IllegalArgumentException(e.getMessage());
    }
    return this;
}
 
开发者ID:Azure,项目名称:azure-documentdb-rxjava,代码行数:9,代码来源:AsyncDocumentClient.java

示例11: createSession

import java.net.URISyntaxException; //导入方法依赖的package包/类
public void createSession(String alias, String url, Map<String, String> headers, Authentication auth, String verify,
		Boolean debug, String loggerClass, String password, boolean verifyHost, boolean selfSigned, Proxy proxy) {

	HostnameVerifier defaultHostnameVerifier = verifyHost ? null : NoopHostnameVerifier.INSTANCE;
	TrustStrategy trustStrategy = selfSigned ? new TrustSelfSignedStrategy() : null;

	if (!loggerClass.isEmpty()) {
		System.setProperty("org.apache.commons.logging.Log", loggerClass);
		System.setProperty("org.apache.commons.logging.robotlogger.log.org.apache.http", debug ? "DEBUG" : "INFO");
	}
	HttpHost target;
	try {
		target = URIUtils.extractHost(new URI(url));
	} catch (URISyntaxException e) {
		throw new RuntimeException("Parsing of URL failed. Error message: " + e.getMessage());
	}
	Session session = new Session();
	session.setProxy(proxy);
	session.setContext(this.createContext(auth, target));
	session.setClient(this.createHttpClient(auth, verify, target, false, password, null, null, proxy));
	session.setUrl(url);
	session.setHeaders(headers);
	session.setHttpHost(target);
	session.setVerify(verify);
	session.setAuthentication(auth);
	session.setPassword(password);
	session.setHostnameVerifier(defaultHostnameVerifier);
	session.setTrustStrategy(trustStrategy);
	sessions.put(alias, session);
}
 
开发者ID:Hi-Fi,项目名称:httpclient,代码行数:31,代码来源:RestClient.java

示例12: RemoteServiceProvider

import java.net.URISyntaxException; //导入方法依赖的package包/类
private RemoteServiceProvider(String identifier, String uri) {
    this.identifier = identifier;
    try {
        server = new HproseTcpServer(uri);
    } catch (URISyntaxException e) {
        e.printStackTrace();
        throw new RuntimeException(e.getMessage());
    }
    server.add("getIdentifier", this);
    server.add("shutdownProvider", this);
}
 
开发者ID:ZhangJiupeng,项目名称:Gospy,代码行数:12,代码来源:RemoteServiceProvider.java

示例13: doHttpGet

import java.net.URISyntaxException; //导入方法依赖的package包/类
private <T extends Response> T doHttpGet(URIBuilder builder, Class<T> clazz, List<Header> header) throws BitbankException, IOException {
    try {
        URI uri = builder.build();
        HttpGet httpGet = new HttpGet(uri);
        HttpClient client = HttpClientBuilder.create().setDefaultHeaders(header).build();
        return httpExecute(client, httpGet, clazz);
    } catch (URISyntaxException e) {
        throw new BitbankException(e.getMessage());
    }
}
 
开发者ID:bitbankinc,项目名称:java-bitbankcc,代码行数:11,代码来源:Bitbankcc.java

示例14: anchor

import java.net.URISyntaxException; //导入方法依赖的package包/类
BaseComponent anchor(Element el) {
    final Optional<String> href = XML.attrValue(el, "href");
    final Optional<BaseComponent> content = nonEmptyContent(el);
    final String type = XML.attrValue(el, "type").orElse("url");
    final Renderable<URI> uri;

    try {
        switch(type) {
            case "user":
                uri = new UserURI(href.orElse(""));
                break;

            case "home":
                uri = Renderable.of(Links.homeUri(href.orElse("/")));
                break;

            case "url":
                uri = Renderable.of(new URI(href.orElseThrow(() -> new MissingException("attribute", "href"))));
                break;

            default:
                throw new ValueException("Unknown anchor type '" + type + "'");
        }
    } catch(URISyntaxException e) {
        throw new ValueException(e.getMessage());
    }

    return new LinkComponent(uri, content);
}
 
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:30,代码来源:MarkupParser.java

示例15: getURI

import java.net.URISyntaxException; //导入方法依赖的package包/类
@Override
public URI getURI() {
	try {
		return this.connection.getURL().toURI();
	}
	catch (URISyntaxException ex) {
		throw new IllegalStateException("Could not get HttpURLConnection URI: " + ex.getMessage(), ex);
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:10,代码来源:SimpleBufferingClientHttpRequest.java


注:本文中的java.net.URISyntaxException.getMessage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。