本文整理匯總了Java中org.takes.facets.auth.TkSecure類的典型用法代碼示例。如果您正苦於以下問題:Java TkSecure類的具體用法?Java TkSecure怎麽用?Java TkSecure使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
TkSecure類屬於org.takes.facets.auth包,在下文中一共展示了TkSecure類的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: regex
import org.takes.facets.auth.TkSecure; //導入依賴的package包/類
/**
* Regex takes.
* @param base Base
* @return Takes
* @throws IOException If fails
*/
private static Take regex(final Base base) throws IOException {
return 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 FkAnonymous(
new TkFork(
new FkRegex("/", new TkIndex(base))
)
),
new FkAuthenticated(
new TkSecure(
new TkFork(
new FkRegex("/", new TkEvents(base)),
new FkRegex("/favicon", new TkFavicon(base)),
new FkRegex("/pipes", new TkPipes(base)),
new FkRegex("/pipe-add", new TkPipeAdd(base)),
new FkRegex("/pipe-delete", new TkPipeDelete(base)),
new FkRegex("/event-delete", new TkEventDelete(base)),
new FkRegex("/event-down", new TkEventDown(base))
)
)
)
);
}