本文整理了Java中org.apache.http.util.Args.notBlank()
方法的一些代码示例,展示了Args.notBlank()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Args.notBlank()
方法的具体详情如下:
包路径:org.apache.http.util.Args
类名称:Args
方法名:notBlank
暂无
代码示例来源:origin: apache/storm
/**
* Construct an Elasticsearch endpoint from the provided index, type and
* id.
* @param index - required; name of Elasticsearch index
* @param type - optional; name of Elasticsearch type
* @param id - optional; Elasticsearch document ID
* @return the index, type and id concatenated with '/'.
*/
static String getEndpoint(String index, String type, String id) {
requireNonNull(index);
notBlank(index, "index");
StringBuilder sb = new StringBuilder();
sb.append("/").append(index);
if (!(type == null || type.isEmpty())) {
sb.append("/").append(type);
}
if (!(id == null || id.isEmpty())) {
sb.append("/").append(id);
}
return sb.toString();
}
代码示例来源:origin: ibinti/bugvm
/**
* @since 4.4
*/
public MultipartEntityBuilder setMimeSubtype(final String subType) {
Args.notBlank(subType, "MIME subtype");
this.contentType = ContentType.create("multipart/" + subType);
return this;
}
代码示例来源:origin: com.bugvm/bugvm-rt
/**
* @since 4.4
*/
public MultipartEntityBuilder setMimeSubtype(final String subType) {
Args.notBlank(subType, "MIME subtype");
this.contentType = ContentType.create("multipart/" + subType);
return this;
}
代码示例来源:origin: org.apache.httpcomponents/fluent-hc
InternalHttpRequest(final String method, final URI requestURI) {
Args.notBlank(method, "Method");
Args.notNull(requestURI, "Request URI");
this.method = method;
this.uri = requestURI;
this.aborted = new AtomicBoolean(false);
this.cancellableRef = new AtomicReference<Cancellable>(null);
}
代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.apache.httpcomponents.httpclient
InternalHttpRequest(final String method, final URI requestURI) {
Args.notBlank(method, "Method");
Args.notNull(requestURI, "Request URI");
this.method = method;
this.uri = requestURI;
this.aborted = new AtomicBoolean(false);
this.cancellableRef = new AtomicReference<Cancellable>(null);
}
代码示例来源:origin: ibinti/bugvm
public static RequestBuilder create(final String method) {
Args.notBlank(method, "HTTP method");
return new RequestBuilder(method);
}
代码示例来源:origin: Nextdoor/bender
public static RequestBuilder create(final String method) {
Args.notBlank(method, "HTTP method");
return new RequestBuilder(method);
}
代码示例来源:origin: org.apache.httpcomponents/httpclient-android
public static RequestBuilder create(final String method) {
Args.notBlank(method, "HTTP method");
return new RequestBuilder(method);
}
代码示例来源:origin: com.bugvm/bugvm-rt
public static RequestBuilder create(final String method) {
Args.notBlank(method, "HTTP method");
return new RequestBuilder(method);
}
代码示例来源:origin: top.wboost/common-web
public static HttpRequestBuilder create(final String method) {
Args.notBlank(method, "HTTP method");
return new HttpRequestBuilder(method);
}
代码示例来源:origin: com.hynnet/httpclient
public static RequestBuilder create(final String method) {
Args.notBlank(method, "HTTP method");
return new RequestBuilder(method);
}
代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.apache.httpcomponents.httpclient
public static RequestBuilder create(final String method) {
Args.notBlank(method, "HTTP method");
return new RequestBuilder(method);
}
代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded
public static RequestBuilder create(final String method) {
Args.notBlank(method, "HTTP method");
return new RequestBuilder(method);
}
代码示例来源:origin: org.apache.httpcomponents/httpclient-android
/**
* Creates a new instance of {@link ContentType}.
*
* @param mimeType MIME type. It may not be <code>null</code> or empty. It may not contain
* characters <">, <;>, <,> reserved by the HTTP specification.
* @param charset charset.
* @return content type
*/
public static ContentType create(final String mimeType, final Charset charset) {
final String type = Args.notBlank(mimeType, "MIME type").toLowerCase(Locale.US);
Args.check(valid(type), "MIME type may not contain reserved characters");
return new ContentType(type, charset);
}
代码示例来源:origin: ibinti/bugvm
/**
* Creates a new instance of {@link ContentType}.
*
* @param mimeType MIME type. It may not be {@code null} or empty. It may not contain
* characters {@code <">, <;>, <,>} reserved by the HTTP specification.
* @param charset charset.
* @return content type
*/
public static ContentType create(final String mimeType, final Charset charset) {
final String type = Args.notBlank(mimeType, "MIME type").toLowerCase(Locale.ROOT);
Args.check(valid(type), "MIME type may not contain reserved characters");
return new ContentType(type, charset);
}
代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.apache.httpcomponents.httpcore
/**
* Creates a new instance of {@link ContentType}.
*
* @param mimeType MIME type. It may not be <code>null</code> or empty. It may not contain
* characters <">, <;>, <,> reserved by the HTTP specification.
* @param charset charset.
* @return content type
*/
public static ContentType create(final String mimeType, final Charset charset) {
final String type = Args.notBlank(mimeType, "MIME type").toLowerCase(Locale.ENGLISH);
Args.check(valid(type), "MIME type may not contain reserved characters");
return new ContentType(type, charset);
}
代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded
/**
* Creates a new instance of {@link ContentType}.
*
* @param mimeType MIME type. It may not be {@code null} or empty. It may not contain
* characters {@code <">, <;>, <,>} reserved by the HTTP specification.
* @param charset charset.
* @return content type
*/
public static ContentType create(final String mimeType, final Charset charset) {
final String normalizedMimeType = Args.notBlank(mimeType, "MIME type").toLowerCase(Locale.ROOT);
Args.check(valid(normalizedMimeType), "MIME type may not contain reserved characters");
return new ContentType(normalizedMimeType, charset);
}
代码示例来源:origin: ibinti/bugvm
public CookieOrigin(final String host, final int port, final String path, final boolean secure) {
super();
Args.notBlank(host, "Host");
Args.notNegative(port, "Port");
Args.notNull(path, "Path");
this.host = host.toLowerCase(Locale.ROOT);
this.port = port;
if (!TextUtils.isBlank(path)) {
this.path = path;
} else {
this.path = "/";
}
this.secure = secure;
}
代码示例来源:origin: com.bugvm/bugvm-rt
/**
* Creates a new instance of {@link ContentType}.
*
* @param mimeType MIME type. It may not be {@code null} or empty. It may not contain
* characters {@code <">, <;>, <,>} reserved by the HTTP specification.
* @param charset charset.
* @return content type
*/
public static ContentType create(final String mimeType, final Charset charset) {
final String type = Args.notBlank(mimeType, "MIME type").toLowerCase(Locale.ROOT);
Args.check(valid(type), "MIME type may not contain reserved characters");
return new ContentType(type, charset);
}
代码示例来源:origin: Nextdoor/bender
/**
* Creates a new instance of {@link ContentType}.
*
* @param mimeType MIME type. It may not be {@code null} or empty. It may not contain
* characters {@code <">, <;>, <,>} reserved by the HTTP specification.
* @param charset charset.
* @return content type
*/
public static ContentType create(final String mimeType, final Charset charset) {
final String type = Args.notBlank(mimeType, "MIME type").toLowerCase(Locale.ROOT);
Args.check(valid(type), "MIME type may not contain reserved characters");
return new ContentType(type, charset);
}
内容来源于网络,如有侵权,请联系作者删除!