gpt4 book ai didi

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

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

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

WebResourceSet.getClassLoaderOnly介绍

[英]Are resources provided by this resource set only intended for use by calls to WebResourceRoot#getClassLoaderResource(String).
[中]此资源集提供的资源仅供调用WebResourceRoot#getClassLoaderResource(字符串)使用。

代码示例

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

@Override
public List<URL> getBaseUrls() {
  List<URL> result = new ArrayList<>();
  for (List<WebResourceSet> list : allResources) {
    for (WebResourceSet webResourceSet : list) {
      if (!webResourceSet.getClassLoaderOnly()) {
        URL url = webResourceSet.getBaseUrl();
        if (url != null) {
          result.add(url);
        }
      }
    }
  }
  return result;
}

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

@Override
public List<URL> getBaseUrls() {
  List<URL> result = new ArrayList<>();
  for (List<WebResourceSet> list : allResources) {
    for (WebResourceSet webResourceSet : list) {
      if (!webResourceSet.getClassLoaderOnly()) {
        URL url = webResourceSet.getBaseUrl();
        if (url != null) {
          result.add(url);
        }
      }
    }
  }
  return result;
}

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

@Override
public List<URL> getBaseUrls() {
  List<URL> result = new ArrayList<>();
  for (List<WebResourceSet> list : allResources) {
    for (WebResourceSet webResourceSet : list) {
      if (!webResourceSet.getClassLoaderOnly()) {
        URL url = webResourceSet.getBaseUrl();
        if (url != null) {
          result.add(url);
        }
      }
    }
  }
  return result;
}

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

@Override
public Set<String> listWebAppPaths(String path) {
  path = validate(path);
  // Set because we don't want duplicates
  Set<String> result = new HashSet<>();
  for (List<WebResourceSet> list : allResources) {
    for (WebResourceSet webResourceSet : list) {
      if (!webResourceSet.getClassLoaderOnly()) {
        result.addAll(webResourceSet.listWebAppPaths(path));
      }
    }
  }
  if (result.size() == 0) {
    return null;
  }
  return result;
}

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

private String[] list(String path, boolean validate) {
  if (validate) {
    path = validate(path);
  }
  // Set because we don't want duplicates
  // LinkedHashSet to retain the order. It is the order of the
  // WebResourceSet that matters but it is simpler to retain the order
  // over all of the JARs.
  HashSet<String> result = new LinkedHashSet<>();
  for (List<WebResourceSet> list : allResources) {
    for (WebResourceSet webResourceSet : list) {
      if (!webResourceSet.getClassLoaderOnly()) {
        String[] entries = webResourceSet.list(path);
        for (String entry : entries) {
          result.add(entry);
        }
      }
    }
  }
  return result.toArray(new String[result.size()]);
}

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

@Override
public Set<String> listWebAppPaths(String path) {
  path = validate(path);
  // Set because we don't want duplicates
  HashSet<String> result = new HashSet<>();
  for (ArrayList<WebResourceSet> list : allResources) {
    for (WebResourceSet webResourceSet : list) {
      if (!webResourceSet.getClassLoaderOnly()) {
        result.addAll(webResourceSet.listWebAppPaths(path));
      }
    }
  }
  if (result.size() == 0) {
    return null;
  }
  return result;
}

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

@Override
public Set<String> listWebAppPaths(String path) {
  path = validate(path);
  // Set because we don't want duplicates
  Set<String> result = new HashSet<>();
  for (List<WebResourceSet> list : allResources) {
    for (WebResourceSet webResourceSet : list) {
      if (!webResourceSet.getClassLoaderOnly()) {
        result.addAll(webResourceSet.listWebAppPaths(path));
      }
    }
  }
  if (result.size() == 0) {
    return null;
  }
  return result;
}

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

private String[] list(String path, boolean validate) {
  if (validate) {
    path = validate(path);
  }
  // Set because we don't want duplicates
  // LinkedHashSet to retain the order. It is the order of the
  // WebResourceSet that matters but it is simpler to retain the order
  // over all of the JARs.
  HashSet<String> result = new LinkedHashSet<>();
  for (ArrayList<WebResourceSet> list : allResources) {
    for (WebResourceSet webResourceSet : list) {
      if (!webResourceSet.getClassLoaderOnly()) {
        String[] entries = webResourceSet.list(path);
        for (String entry : entries) {
          result.add(entry);
        }
      }
    }
  }
  return result.toArray(new String[result.size()]);
}

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

private String[] list(String path, boolean validate) {
  if (validate) {
    path = validate(path);
  }
  // Set because we don't want duplicates
  // LinkedHashSet to retain the order. It is the order of the
  // WebResourceSet that matters but it is simpler to retain the order
  // over all of the JARs.
  HashSet<String> result = new LinkedHashSet<>();
  for (List<WebResourceSet> list : allResources) {
    for (WebResourceSet webResourceSet : list) {
      if (!webResourceSet.getClassLoaderOnly()) {
        String[] entries = webResourceSet.list(path);
        for (String entry : entries) {
          result.add(entry);
        }
      }
    }
  }
  return result.toArray(new String[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.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;
}

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