• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java TkVersioned类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中org.takes.tk.TkVersioned的典型用法代码示例。如果您正苦于以下问题:Java TkVersioned类的具体用法?Java TkVersioned怎么用?Java TkVersioned使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

TkVersioned类属于org.takes.tk包,在下文中一共展示了TkVersioned类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: make

点赞 2

import org.takes.tk.TkVersioned; //导入依赖的package包/类
/**
 * Ctor.
 * @param base Base
 * @return Takes
 * @throws IOException If fails
 */
private static Take make(final Base base) throws IOException {
    if (!"UTF-8".equals(Charset.defaultCharset().name())) {
        throw new IllegalStateException(
            String.format(
                "default encoding is %s", Charset.defaultCharset()
            )
        );
    }
    return new TkWithHeaders(
        new TkVersioned(
            new TkMeasured(
                new TkGzip(
                    new TkFlash(
                        new TkAppFallback(
                            new TkAppAuth(
                                new TkForward(
                                    TkApp.regex(base)
                                )
                            )
                        )
                    )
                )
            )
        ),
        String.format("X-Wring-Revision: %s", TkApp.REV),
        "Vary: Cookie"
    );
}
 

开发者ID:yegor256,
项目名称:wring,
代码行数:35,
代码来源:TkApp.java

示例2: make

点赞 2

import org.takes.tk.TkVersioned; //导入依赖的package包/类
/**
 * Ctor.
 * @param base Base
 * @return Take
 * @throws IOException If fails
 */
private static Take make(final Base base) throws IOException {
    if (!"UTF-8".equals(Charset.defaultCharset().name())) {
        throw new IllegalStateException(
            String.format(
                "default encoding is %s", Charset.defaultCharset()
            )
        );
    }
    return new TkWithHeaders(
        new TkVersioned(
            new TkMeasured(
                new TkFlash(
                    new TkAppFallback(
                        new TkForward(
                            new TkAppAuth(
                                TkApp.regex(base)
                            )
                        )
                    )
                )
            )
        ),
        String.format("X-Thindeck-Version: %s", TkApp.VERSION),
        "Vary: Cookie"
    );
}
 

开发者ID:yegor256,
项目名称:thindeck,
代码行数:33,
代码来源:TkApp.java

示例3: app

点赞 2

import org.takes.tk.TkVersioned; //导入依赖的package包/类
/**
 * Ctor.
 * @param base Base
 * @return App
 * @throws IOException If fails
 */
private static Take app(final Base base) throws IOException {
    return new TkWithHeaders(
        new TkVersioned(
            new TkMeasured(
                new TkFlash(
                    TkApp.auth(
                        TkApp.safe(
                            new TkForward(
                                new TkGzip(
                                    new TkFork(
                                        new FkRegex("/robots.txt", ""),
                                        new FkRegex(
                                            "/org/takes/.+\\.xsl",
                                            new TkClasspath()
                                        ),
                                        new FkRegex(
                                            "/xsl/[a-z\\-]+\\.xsl",
                                            new TkWithType(
                                                TkApp.refresh("./src/main/xsl"),
                                                "text/xsl"
                                            )
                                        ),
                                        new FkRegex(
                                            "/css/[a-z]+\\.css",
                                            new TkWithType(
                                                TkApp.refresh("./src/main/scss"),
                                                "text/css"
                                            )
                                        ),
                                        new FkRegex(
                                            "/images/[a-z]+\\.svg",
                                            new TkWithType(
                                                TkApp.refresh("./src/main/resources"),
                                                "image/svg+xml"
                                            )
                                        ),
                                        new FkRegex(
                                            "/images/[a-z]+\\.png",
                                            new TkWithType(
                                                TkApp.refresh("./src/main/resources"),
                                                "image/png"
                                            )
                                        ),
                                        new FkRegex("/", new TkIndex()),
                                        new FkRegex("/scripts", new TkScripts(base)),
                                        new FkRegex("/script", new TkScript(base)),
                                        new FkRegex("/save", new TkSave(base)),
                                        new FkRegex("/delete", new TkDelete(base)),
                                        new FkRegex("/flush", new TkFlush(base)),
                                        new FkRegex("/pay", new TkPay(base)),
                                        new FkRegex("/delete-log", new TkDeleteLog(base)),
                                        new FkRegex("/logs", new TkLogs(base)),
                                        new FkRegex("/log", new TkLog()),
                                        new FkRegex("/log-link", new TkLogLink(base))
                                    )
                                )
                            )
                        )
                    )
                )
            )
        ),
        new Sprintf("X-ThreeCopies-Revision: %s", TkApp.REV).toString(),
        "Vary: Cookie"
    );
}
 

开发者ID:yegor256,
项目名称:threecopies,
代码行数:73,
代码来源:TkApp.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)