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


Java S.notBlank方法代码示例

本文整理汇总了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;
}
 
开发者ID:actframework,项目名称:act-storage,代码行数:18,代码来源:FileSystemStoragePlugin.java

示例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();
}
 
开发者ID:osglworks,项目名称:java-di,代码行数:24,代码来源:BeanSpec.java

示例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);
}
 
开发者ID:actframework,项目名称:actframework,代码行数:21,代码来源:TemplatePathResolver.java

示例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);
    }
}
 
开发者ID:osglworks,项目名称:java-sftp,代码行数:22,代码来源:SftpConfig.java

示例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);
}
 
开发者ID:actframework,项目名称:actframework,代码行数:25,代码来源:Tags.java

示例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;
}
 
开发者ID:actframework,项目名称:actframework,代码行数:20,代码来源:JobAdmin.java

示例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();
}
 
开发者ID:actframework,项目名称:actframework,代码行数:25,代码来源:CliOverHttpContext.java

示例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;
}
 
开发者ID:actframework,项目名称:actframework,代码行数:25,代码来源:ControllerClassMetaInfo.java

示例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;
}
 
开发者ID:actframework,项目名称:actframework,代码行数:17,代码来源:ActionContext.java

示例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);
}
 
开发者ID:actframework,项目名称:act-beetlsql,代码行数:30,代码来源:BeetlSqlService.java

示例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();
}
 
开发者ID:actframework,项目名称:act-storage,代码行数:10,代码来源:StorageServiceManager.java

示例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());
}
 
开发者ID:actframework,项目名称:act-storage,代码行数:10,代码来源:StorageServiceManager.java

示例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();
}
 
开发者ID:actframework,项目名称:act-demo-apps,代码行数:8,代码来源:ProductController.java

示例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();
}
 
开发者ID:actframework,项目名称:act-demo-apps,代码行数:8,代码来源:Todo.java

示例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);
    }
}
 
开发者ID:actframework,项目名称:act-demo-apps,代码行数:8,代码来源:ChatApp.java


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