gpt4 book ai didi

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

转载 作者:知者 更新时间:2024-03-24 01:15:05 26 4
gpt4 key购买 nike

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

WebResourceSet.getResource介绍

[英]Obtain the object that represents the resource at the given path. Note the resource at that path may not exist.
[中]获取表示给定路径上的资源的对象。请注意,该路径上的资源可能不存在。

代码示例

代码示例来源:origin: org.springframework.boot/spring-boot

@Override
public WebResource getResource(String path) {
  if (path.startsWith("/org/springframework/boot")) {
    return new EmptyResource(getRoot(), path);
  }
  return this.delegate.getResource(path);
}

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

private boolean preResourceExists(String path) {
  for (WebResourceSet webResourceSet : preResources) {
    WebResource webResource = webResourceSet.getResource(path);
    if (webResource.exists()) {
      return true;
    }
  }
  return false;
}

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

private boolean preResourceExists(String path) {
  for (WebResourceSet webResourceSet : preResources) {
    WebResource webResource = webResourceSet.getResource(path);
    if (webResource.exists()) {
      return true;
    }
  }
  return false;
}

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

private boolean preResourceExists(String path) {
  for (WebResourceSet webResourceSet : preResources) {
    WebResource webResource = webResourceSet.getResource(path);
    if (webResource.exists()) {
      return true;
    }
  }
  return false;
}

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

protected WebResource[] getResourcesInternal(String path,
    boolean useClassLoaderResources) {
  List<WebResource> result = new ArrayList<>();
  for (List<WebResourceSet> list : allResources) {
    for (WebResourceSet webResourceSet : list) {
      if (useClassLoaderResources || !webResourceSet.getClassLoaderOnly()) {
        WebResource webResource = webResourceSet.getResource(path);
        if (webResource.exists()) {
          result.add(webResource);
        }
      }
    }
  }
  if (result.size() == 0) {
    result.add(main.getResource(path));
  }
  return result.toArray(new WebResource[result.size()]);
}

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

protected WebResource[] getResourcesInternal(String path,
    boolean useClassLoaderResources) {
  List<WebResource> result = new ArrayList<>();
  for (List<WebResourceSet> list : allResources) {
    for (WebResourceSet webResourceSet : list) {
      if (useClassLoaderResources || !webResourceSet.getClassLoaderOnly()) {
        WebResource webResource = webResourceSet.getResource(path);
        if (webResource.exists()) {
          result.add(webResource);
        }
      }
    }
  }
  if (result.size() == 0) {
    result.add(main.getResource(path));
  }
  return result.toArray(new WebResource[result.size()]);
}

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

private WebResource[] getResources(String path,
    boolean useClassLoaderResources) {
  path = validate(path);
  ArrayList<WebResource> result = new ArrayList<>();
  for (ArrayList<WebResourceSet> list : allResources) {
    for (WebResourceSet webResourceSet : list) {
      if (useClassLoaderResources || !webResourceSet.getClassLoaderOnly()) {
        WebResource webResource = webResourceSet.getResource(path);
        if (webResource.exists()) {
          result.add(webResource);
        }
      }
    }
  }
  if (result.size() == 0) {
    result.add(main.getResource(path));
  }
  return result.toArray(new WebResource[result.size()]);
}

代码示例来源: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.apache.tomee/tomee-catalina

final WebResource classes = wr.getResource("/WEB-INF/classes/");
  if (classes != null) {
    final String path = classes.getCanonicalPath();
} else if (baseFile.exists() && baseFile.getName().endsWith(".jar") && wr.getResource("/WEB-INF/classes/").exists()) {
  try {
    cp.add(baseFile.getCanonicalPath());

代码示例来源: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;
}

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