本文整理汇总了Java中org.apache.http.util.Asserts.notBlank方法的典型用法代码示例。如果您正苦于以下问题:Java Asserts.notBlank方法的具体用法?Java Asserts.notBlank怎么用?Java Asserts.notBlank使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.http.util.Asserts
的用法示例。
在下文中一共展示了Asserts.notBlank方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: GroupsIOApiClient
import org.apache.http.util.Asserts; //导入方法依赖的package包/类
/**
* More in-depth constructor to override the defaults.
*
* @param hostname
* - the base hostname (e.g. api.groups.io) to use
* @param version
* - the API version (e.g. v1) to use
* @param apiKey
* - TODO: Update with details once published.
* @param email
* - the email of the user to log in as
* @param domain
* - the domain name to connect with
* @param twoFactor
* - the appropriate two-factor code to use
*/
public GroupsIOApiClient(
final String hostname,
final String version,
final String apiKey,
final String email,
final String domain,
final Integer twoFactor)
{
Asserts.notBlank(apiKey, "apiKey");
Asserts.notBlank(email, "email");
this.hostname = hostname;
this.version = version;
this.apiKey = apiKey;
this.email = email;
this.domain = domain;
this.twoFactor = twoFactor;
}
示例2: ClientForSync
import org.apache.http.util.Asserts; //导入方法依赖的package包/类
public ClientForSync(String propPath) throws IOException {
Properties p = PropertiesUtils.load(propPath);
RemoteSyncConfig.init(p);
store = p.getProperty("client.store");
Asserts.notBlank(store, "can not found config for client.store");
Asserts.check(new File(store).isDirectory(), "not exist store folder:" + store);
workspace = p.getProperty("client.workspace", store);
Asserts.check(new File(workspace).isDirectory(), "not exist workspace folder:" + workspace);
interval = Long.parseLong(p.getProperty("client.sync.interval", "10000"));
Asserts.check(interval >= 0, "client.sync.interval must great then 0");
// 524288 = 1024 * 512
block_size = Integer.parseInt(p.getProperty("client.block.size", "524288"));
RemoteSyncConfig.checkBockSize(block_size);
folders = new ArrayList<ClientFolder>();
for (Object item : p.keySet().toArray()) {
if (item.toString().startsWith(PORP_KEY_PREFIX)) {
folders.add(new ClientFolder(item.toString().substring(PORP_KEY_PREFIX.length()), store, this.workspace,
(String) p.get(item), block_size));
}
}
Asserts.check(folders.size() != 0, "can not find any client folders");
runner = new ClientSyncRunner(this);
}
示例3: formatPath
import org.apache.http.util.Asserts; //导入方法依赖的package包/类
public static String formatPath(String path) {
Asserts.notBlank(path, "can as blank path :" + path);
path = path.replace("\\", "/");
if (path.startsWith("/")) {
path = path.substring(1);
}
return path;
}