gpt4 book ai didi

org.apache.catalina.WebResource.isVirtual()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-26 12:41:05 27 4
gpt4 key购买 nike

本文整理了Java中org.apache.catalina.WebResource.isVirtual()方法的一些代码示例,展示了WebResource.isVirtual()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebResource.isVirtual()方法的具体详情如下:
包路径:org.apache.catalina.WebResource
类名称:WebResource
方法名:isVirtual

WebResource.isVirtual介绍

[英]Indicates if this resource is required for applications to correctly scan the file structure but that does not exist in either the main or any additional WebResourceSet. For example, if an external directory is mapped to /WEB-INF/lib in an otherwise empty web application, /WEB-INF will be represented as a virtual resource.
[中]指示应用程序是否需要此资源才能正确扫描文件结构,但该资源在主WebResourceSet或任何其他WebResourceSet中都不存在。例如,如果一个外部目录映射到一个空的WEB应用程序中的/WEB-INF/lib,/WEB-INF将被表示为一个虚拟资源。

代码示例

代码示例来源:origin: org.apache.tomcat/tomcat-catalina

@Override
public boolean isVirtual() {
  Boolean cachedIsVirtual = this.cachedIsVirtual;
  if (cachedIsVirtual == null) {
    cachedIsVirtual = Boolean.valueOf(webResource.isVirtual());
    this.cachedIsVirtual = cachedIsVirtual;
  }
  return cachedIsVirtual.booleanValue();
}

代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core

@Override
public boolean isVirtual() {
  Boolean cachedIsVirtual = this.cachedIsVirtual;
  if (cachedIsVirtual == null) {
    cachedIsVirtual = Boolean.valueOf(webResource.isVirtual());
    this.cachedIsVirtual = cachedIsVirtual;
  }
  return cachedIsVirtual.booleanValue();
}

代码示例来源:origin: codefollower/Tomcat-Research

@Override
public boolean isVirtual() {
  Boolean cachedIsVirtual = this.cachedIsVirtual;
  if (cachedIsVirtual == null) {
    cachedIsVirtual = Boolean.valueOf(webResource.isVirtual());
    this.cachedIsVirtual = cachedIsVirtual;
  }
  return cachedIsVirtual.booleanValue();
}

代码示例来源:origin: codefollower/Tomcat-Research

protected final WebResource getResourceInternal(String path,
    boolean useClassLoaderResources) {
  WebResource result = null;
  WebResource virtual = null;
  WebResource mainEmpty = null;
  for (ArrayList<WebResourceSet> list : allResources) {
    for (WebResourceSet webResourceSet : list) {
      if (useClassLoaderResources || !webResourceSet.getClassLoaderOnly()) {
        result = webResourceSet.getResource(path);
        if (result.exists()) {
          return result;
        }
        if (virtual == null) {
          if (result.isVirtual()) {
            virtual = result;
          } else if (main.equals(webResourceSet)) {
            mainEmpty = result;
          }
        }
      }
    }
  }
  // Use the first virtual result if no real result was found
  if (virtual != null) {
    return virtual;
  }
  // Default is empty resource in main resources
  return mainEmpty;
}

代码示例来源:origin: org.apache.tomcat/tomcat-catalina

protected final WebResource getResourceInternal(String path,
    boolean useClassLoaderResources) {
  WebResource result = null;
  WebResource virtual = null;
  WebResource mainEmpty = null;
  for (List<WebResourceSet> list : allResources) {
    for (WebResourceSet webResourceSet : list) {
      if (!useClassLoaderResources &&  !webResourceSet.getClassLoaderOnly() ||
          useClassLoaderResources && !webResourceSet.getStaticOnly()) {
        result = webResourceSet.getResource(path);
        if (result.exists()) {
          return result;
        }
        if (virtual == null) {
          if (result.isVirtual()) {
            virtual = result;
          } else if (main.equals(webResourceSet)) {
            mainEmpty = result;
          }
        }
      }
    }
  }
  // Use the first virtual result if no real result was found
  if (virtual != null) {
    return virtual;
  }
  // Default is empty resource in main resources
  return mainEmpty;
}

代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core

protected final WebResource getResourceInternal(String path,
    boolean useClassLoaderResources) {
  WebResource result = null;
  WebResource virtual = null;
  WebResource mainEmpty = null;
  for (List<WebResourceSet> list : allResources) {
    for (WebResourceSet webResourceSet : list) {
      if (!useClassLoaderResources &&  !webResourceSet.getClassLoaderOnly() ||
          useClassLoaderResources && !webResourceSet.getStaticOnly()) {
        result = webResourceSet.getResource(path);
        if (result.exists()) {
          return result;
        }
        if (virtual == null) {
          if (result.isVirtual()) {
            virtual = result;
          } else if (main.equals(webResourceSet)) {
            mainEmpty = result;
          }
        }
      }
    }
  }
  // Use the first virtual result if no real result was found
  if (virtual != null) {
    return virtual;
  }
  // Default is empty resource in main resources
  return mainEmpty;
}

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com