本文整理汇总了Java中org.apache.catalina.WebResourceSet类的典型用法代码示例。如果您正苦于以下问题:Java WebResourceSet类的具体用法?Java WebResourceSet怎么用?Java WebResourceSet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WebResourceSet类属于org.apache.catalina包,在下文中一共展示了WebResourceSet类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createMainResourceSet
import org.apache.catalina.WebResourceSet; //导入依赖的package包/类
@Override
protected WebResourceSet createMainResourceSet() {
final Path docBase = config.docBase();
assert docBase.isAbsolute();
final String docBaseStr = docBase.toString();
getContext().setDocBase(docBaseStr);
if (Files.isDirectory(docBase)) {
return new DirResourceSet(this, "/", docBaseStr, "/");
}
final Optional<String> jarRootOpt = config.jarRoot();
if (jarRootOpt.isPresent()) { // If docBase is a JAR file
final String jarRoot = jarRootOpt.get();
if ("/".equals(jarRoot)) {
return new JarResourceSet(this, "/", docBaseStr, "/");
} else {
return new JarSubsetResourceSet(this, "/", docBaseStr, "/", jarRoot);
}
}
throw new IllegalArgumentException(sm.getString("standardRoot.startInvalidMain", docBaseStr));
}
示例2: setResources
import org.apache.catalina.WebResourceSet; //导入依赖的package包/类
@Override
public void setResources(final WebResourceRoot resources) {
this.resources = resources;
if (StandardRoot.class.isInstance(resources)) {
final List<WebResourceSet> jars = (List<WebResourceSet>) Reflections.get(resources, "jarResources");
if (jars != null && !jars.isEmpty()) {
final Iterator<WebResourceSet> jarIt = jars.iterator();
while (jarIt.hasNext()) {
final WebResourceSet set = jarIt.next();
if (set.getBaseUrl() == null) {
continue;
}
final File file = URLs.toFile(set.getBaseUrl());
try {
if (file.exists() && (!TomEEClassLoaderEnricher.validateJarFile(file) || !jarIsAccepted(file))) {
// need to remove this resource
LOGGER.warning("Removing " + file.getAbsolutePath() + " since it is offending");
jarIt.remove();
}
} catch (final IOException e) {
// ignore
}
}
}
}
}
示例3: getFirstJarWarResourceSetAtJarResources
import org.apache.catalina.WebResourceSet; //导入依赖的package包/类
private JarWarResourceSet getFirstJarWarResourceSetAtJarResources(WebResourceRoot resources) {
JarWarResourceSet result = null;
for (WebResourceSet resourceSet :resources.getJarResources()) {
if (resourceSet instanceof JarWarResourceSet) {
result = (JarWarResourceSet) resourceSet;
break;
}
}
return result;
}
示例4: mainFile
import org.apache.catalina.WebResourceSet; //导入依赖的package包/类
private URL mainFile(WebResourceRoot resources) {
URL result = null;
for (WebResourceSet resourceSet :resources.getJarResources()) {
if (resourceSet instanceof JarWarResourceSet) {
result = resourceSet.getBaseUrl();
break;
}
}
return result;
}
示例5: addJarResources
import org.apache.catalina.WebResourceSet; //导入依赖的package包/类
@Override
public void addJarResources(WebResourceSet webResourceSet) {
if (this.jarResources == null) {
this.jarResources = new ArrayList<>();
}
this.jarResources.add(webResourceSet);
}
示例6: addPreResources
import org.apache.catalina.WebResourceSet; //导入依赖的package包/类
@Override
public void addPreResources(WebResourceSet webResourceSet) {
throw new UnsupportedOperationException(NOT_SUPPORTED_YET);
}
示例7: getPreResources
import org.apache.catalina.WebResourceSet; //导入依赖的package包/类
@Override
public WebResourceSet[] getPreResources() {
throw new UnsupportedOperationException(NOT_SUPPORTED_YET);
}
示例8: getJarResources
import org.apache.catalina.WebResourceSet; //导入依赖的package包/类
@Override
public WebResourceSet[] getJarResources() {
return this.jarResources.toArray(new WebResourceSet[this.jarResources.size()]);
}
示例9: addPostResources
import org.apache.catalina.WebResourceSet; //导入依赖的package包/类
@Override
public void addPostResources(WebResourceSet webResourceSet) {
throw new UnsupportedOperationException(NOT_SUPPORTED_YET);
}
示例10: getPostResources
import org.apache.catalina.WebResourceSet; //导入依赖的package包/类
@Override
public WebResourceSet[] getPostResources() {
throw new UnsupportedOperationException(NOT_SUPPORTED_YET);
}
示例11: init
import org.apache.catalina.WebResourceSet; //导入依赖的package包/类
public void init(WebResourceSet... webResourcesSet) throws LifecycleException {
for (WebResourceSet webResourceSet : webResourcesSet) {
this.webResourceRoot.addJarResources(webResourceSet);
}
}
示例12: getPreResources
import org.apache.catalina.WebResourceSet; //导入依赖的package包/类
@Override
public WebResourceSet[] getPreResources() {
return new WebResourceSet[0];
}
示例13: getJarResources
import org.apache.catalina.WebResourceSet; //导入依赖的package包/类
@Override
public WebResourceSet[] getJarResources() {
return new WebResourceSet[0];
}
示例14: getPostResources
import org.apache.catalina.WebResourceSet; //导入依赖的package包/类
@Override
public WebResourceSet[] getPostResources() {
return new WebResourceSet[0];
}
示例15: addPreResources
import org.apache.catalina.WebResourceSet; //导入依赖的package包/类
@Override
public void addPreResources(final WebResourceSet webResourceSet) {
delegate.addPreResources(webResourceSet);
}