本文整理汇总了Java中org.osgl.util.S.notBlank方法的典型用法代码示例。如果您正苦于以下问题:Java S.notBlank方法的具体用法?Java S.notBlank怎么用?Java S.notBlank使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.osgl.util.S
的用法示例。
在下文中一共展示了S.notBlank方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initStorageService
import org.osgl.util.S; //导入方法依赖的package包/类
@Override
protected IStorageService initStorageService(String id, App app, Map<String, String> conf) {
conf = calibrate(conf, "storage.fs.");
FileSystemService ss = new FileSystemService(conf);
ss.setKeyNameProvider(UploadFileStorageService.ACT_STORAGE_KEY_NAME_PROVIDER);
String home = conf.get(CONF_HOME_DIR);
String url = ss.getStaticWebEndpoint();
if (null != url) {
if (!url.endsWith("/")) {
url = url + "/";
}
if (S.notBlank(url) && !url.startsWith("http") && !url.startsWith("//")) {
App.instance().router().addMapping(H.Method.GET, url, new FileGetter(new File(home)), RouteSource.BUILD_IN);
}
}
return ss;
}
示例2: toString
import org.osgl.util.S; //导入方法依赖的package包/类
@Override
public String toString() {
StringBuilder sb = S.builder(type());
if (S.notBlank(name)) {
sb.append("(").append(name).append(")");
}
C.List<Object> list = C.newList();
if (null != valueLoader) {
list.append(valueLoader);
} else {
list.append(qualifiers).append(elementLoaders).append(filters);
if (null != mapKey) {
list.append(mapKey);
}
}
if (null != scope) {
list.append(scope.getSimpleName());
}
if (!list.isEmpty()) {
sb.append("@[").append(S.join(", ", list)).append("]");
}
return sb.toString();
}
示例3: resolveWithContextMethodPath
import org.osgl.util.S; //导入方法依赖的package包/类
public final String resolveWithContextMethodPath(ActContext context) {
String methodPath = context.methodPath();
String path = context.templatePath();
String[] sa = path.split("\\.");
int level = sa.length + 1;
S.Buffer sb;
if (S.notBlank(methodPath)) {
while (--level > 0) {
methodPath = S.beforeLast(methodPath, ".");
}
sb = S.newBuffer(methodPath);
} else {
sb = S.newBuffer();
}
if (!path.startsWith("/")) {
sb.append("/");
}
path = sb.append(path).toString().replace('.', '/');
return resolveTemplatePath(path, context);
}
示例4: SftpConfig
import org.osgl.util.S; //导入方法依赖的package包/类
public SftpConfig(Map conf) {
host = getConf(CONF_HOST, conf);
username = getConf(CONF_USERNAME, conf);
password = getConf(CONF_PASSWORD, conf);
E.invalidConfigurationIf(S.anyEmpty(host, username), "missing configuration of host or username or password");
String s = getConf(CONF_PORT, conf);
if (S.notBlank(s)) {
port = Integer.parseInt(s);
}
s = getConf(CONF_BYPASS_HOST_KEY_CHECKING, conf);
if (S.notBlank(s)) {
byPassHostKeyChecking = Boolean.parseBoolean(s);
}
s = getConf(CONF_CONTEXT_PATH, conf);
if (S.notBlank(s)) {
contextPath = regulateContextPath(s);
}
}
示例5: call
import org.osgl.util.S; //导入方法依赖的package包/类
protected void call(String path) {
if (path.startsWith("http:") || path.startsWith("//")) {
// we don't process absolute path
p(path);
return;
}
if (Act.isDev()) {
if (!path.startsWith("/")) {
path = '/' + path;
}
path = path + (path.contains("?") ? '&' : '?');
path = path + "ts=" + $.ms();
} else {
String checksum = checksumManager.checksumOf(path);
if (!path.startsWith("/")) {
path = '/' + path;
}
if (S.notBlank(checksum)) {
String sep = path.contains("?") ? "&" : "?";
path = S.concat(path, sep, "checksum=", checksum);
}
}
p(path);
}
示例6: listJobs
import org.osgl.util.S; //导入方法依赖的package包/类
/**
* List all jobs in the job manager
* @return a list of {@link Job jobs}
*/
@Command(value = "act.job.list", help = "List jobs")
@PropertySpec(Job.BRIEF_VIEW)
@TableView
public List<Job> listJobs(@Optional(lead = "-q") final String q, JobManager jobManager) {
C.List<Job> jobs = jobManager.jobs().append(jobManager.virtualJobs()).unique(_UNIQ_JOB_FILTER);
if (S.notBlank(q)) {
jobs = jobs.filter(new $.Predicate<Job>() {
@Override
public boolean test(Job job) {
return job.toString().contains(q);
}
});
}
return jobs;
}
示例7: line
import org.osgl.util.S; //导入方法依赖的package包/类
private static String line(ActionContext actionContext) {
String cmd = null;
S.Buffer sb = S.buffer();
for (String s : actionContext.paramKeys()) {
if ("cmd".equals(s)) {
cmd = actionContext.paramVal(s);
} else if (s.startsWith("-")) {
String val = actionContext.paramVal(s);
if (S.notBlank(val)) {
val = val.replaceAll("[\n\r]+", "<br/>").trim();
if (val.contains(" ")) {
char quote = val.contains("\"") ? '\'' : '\\';
val = S.wrap(val, quote);
}
if (s.contains(",")) {
s = S.before(s, ",");
}
sb.append(s).append(" ").append(val).append(" ");
}
}
}
E.illegalArgumentIf(null == cmd, "cmd param required");
return S.builder(cmd).append(" ").append(sb.toString()).toString();
}
示例8: urlContext
import org.osgl.util.S; //导入方法依赖的package包/类
public String urlContext() {
if (null != parent) {
if (S.notBlank(urlContext) && urlContext.length() > 1 && urlContext.startsWith("/")) {
return urlContext;
}
String parentContextPath = parent.urlContext();
if (null == urlContext) {
return parentContextPath;
}
if (null == parentContextPath) {
return urlContext;
}
S.Buffer sb = S.newBuffer(parentContextPath);
if (parentContextPath.endsWith("/")) {
sb.deleteCharAt(sb.length() - 1);
}
if (!urlContext.startsWith("/")) {
sb.append("/");
}
sb.append(urlContext);
return sb.toString();
}
return urlContext;
}
示例9: applyContentSecurityPolicy
import org.osgl.util.S; //导入方法依赖的package包/类
public ActionContext applyContentSecurityPolicy() {
RequestHandler handler = handler();
if (null != handler) {
boolean disableCSP = handler.disableContentSecurityPolicy();
if (disableCSP) {
return this;
}
String csp = handler.contentSecurityPolicy();
if (S.notBlank(csp)) {
H.Response resp = resp();
resp.addHeaderIfNotAdded(CONTENT_SECURITY_POLICY, csp);
}
}
applyGlobalCspSetting();
return this;
}
示例10: configureDbStyle
import org.osgl.util.S; //导入方法依赖的package包/类
private DBStyle configureDbStyle(DataSourceConfig dsConfig) {
Map<String, String> conf = this.config.rawConf;
String style = conf.get("platform");
if (null == style) {
style = conf.get("style");
}
if (null == style) {
style = dsConfig.url;
}
if (S.notBlank(style)) {
style = style.trim().toLowerCase();
if (style.contains("oracle")) {
return new OracleStyle();
} else if (style.contains("mysql") || style.contains("maria")) {
return new MySqlStyle();
} else if (style.contains("postgres") || style.contains("pgsql")) {
return new PostgresStyle();
} else if (style.contains("h2")) {
return new H2Style();
} else if (style.contains("sqlserver")) {
return new SqlServerStyle();
} else if (style.contains("db2")) {
return new DB2SqlStyle();
} else if (style.contains("sqlite")) {
return new SQLiteStyle();
}
}
throw new UnsupportedOperationException("Unknown database style: " + style);
}
示例11: ssKey
import org.osgl.util.S; //导入方法依赖的package包/类
private static String ssKey(String className, String fieldName) {
StringBuilder sb = S.builder();
sb.append($.notNull(className));
if (S.notBlank(fieldName)) {
sb.append(":");
sb.append(fieldName);
}
return sb.toString();
}
示例12: delete
import org.osgl.util.S; //导入方法依赖的package包/类
public void delete(ISObject sobj) {
String id = sobj.getAttribute(ISObject.ATTR_SS_ID);
IStorageService ss = storageService(id);
String contextPath = sobj.getAttribute(ISObject.ATTR_SS_CTX);
if (S.notBlank(contextPath)) {
ss = ss.subFolder(contextPath);
}
ss.remove(sobj.getKey());
}
示例13: list
import org.osgl.util.S; //导入方法依赖的package包/类
@GetAction
public Iterable<Product> list(String q) {
if (S.notBlank(q)) {
return dao.findBy("name", Pattern.compile(q, Pattern.CASE_INSENSITIVE));
}
return dao.findAll();
}
示例14: list
import org.osgl.util.S; //导入方法依赖的package包/类
@GetAction("/list")
public Iterable<TodoItem> list(String q) {
if (S.notBlank(q)) {
return dao.findBy("desc like", q);
}
return dao.findAll();
}
示例15: onMessage
import org.osgl.util.S; //导入方法依赖的package包/类
@WsAction("msg")
public void onMessage(String message, WebSocketContext context) {
// suppress blank lines
if (S.notBlank(message)) {
context.sendToPeers(message);
}
}