gpt4 book ai didi

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

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

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

WebResource.getWebappPath介绍

[英]The path of this resource relative to the web application root. If the resource is a directory, the return value will end in '/'.
[中]此资源相对于web应用程序根的路径。如果资源是目录,返回值将以“/”结尾。

代码示例

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

/**
 * Get the readme file as a string.
 */
protected String getReadme(WebResource directory) {
  if (readmeFile != null) {
    WebResource resource = resources.getResource(
        directory.getWebappPath() + readmeFile);
    if (resource.isFile()) {
      StringWriter buffer = new StringWriter();
      InputStream is = resource.getInputStream();
      copyRange(new InputStreamReader(is),
          new PrintWriter(buffer));
      return buffer.toString();
    } else {
      if (debug > 10)
        log("readme '" + readmeFile + "' not found");
      return null;
    }
  }
  return null;
}

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

String[] entries = resources.list(resource.getWebappPath());
String directoryWebappPath = resource.getWebappPath();

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

directory.getWebappPath() + localXsltFile);
if (resource.isFile()) {
  InputStream is = resource.getInputStream();

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

String[] entries = resources.list(resource.getWebappPath());
String directoryWebappPath = resource.getWebappPath();

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

String[] entries = resources.list(resource.getWebappPath());
String directoryWebappPath = resource.getWebappPath();

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

String[] entries = resources.list(resource.getWebappPath());
String directoryWebappPath = resource.getWebappPath();

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

directory.getWebappPath() + readmeFile);
if (resource.isFile()) {
  StringWriter buffer = new StringWriter();

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

String[] entries = resources.list(resource.getWebappPath());
String directoryWebappPath = resource.getWebappPath();

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

String[] entries = resources.list(resource.getWebappPath());
String directoryWebappPath = resource.getWebappPath();

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

directory.getWebappPath() + readmeFile);
if (resource.isFile()) {
  StringWriter buffer = new StringWriter();

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

directory.getWebappPath() + localXsltFile);
if (resource.isFile()) {
  InputStream is = resource.getInputStream();

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

if (!destResource.exists() && !destResource.getWebappPath().endsWith("/")) {
  int lastSlash = destResource.getWebappPath().lastIndexOf('/');
  if (lastSlash > 0) {
    String parent = destResource.getWebappPath().substring(0, lastSlash);
    WebResource parentResource = resources.getResource(parent);
    if (!parentResource.isDirectory()) {

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

directory.getWebappPath() + localXsltFile);
if (resource.isFile()) {
  InputStream is = resource.getInputStream();

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

if (!destResource.exists() && !destResource.getWebappPath().endsWith("/")) {
  int lastSlash = destResource.getWebappPath().lastIndexOf('/');
  if (lastSlash > 0) {
    String parent = destResource.getWebappPath().substring(0, lastSlash);
    WebResource parentResource = resources.getResource(parent);
    if (!parentResource.isDirectory()) {

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

WebResource[] webResources =
    webResource.getWebResourceRoot().listResources(
        webResource.getWebappPath());
for (WebResource r : webResources) {
  processAnnotationsWebResource(r, fragment, handlesTypesOnly);
} catch (IOException e) {
  log.error(sm.getString("contextConfig.inputStreamWebResource",
      webResource.getWebappPath()),e);
} catch (ClassFormatException e) {
  log.error(sm.getString("contextConfig.inputStreamWebResource",
      webResource.getWebappPath()),e);
} finally {
  if (is != null) {

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

protected void processAnnotationsWebResource(WebResource webResource,
    WebXml fragment, boolean handlesTypesOnly,
    Map<String,JavaClassCacheEntry> javaClassCache) {
  if (webResource.isDirectory()) {
    WebResource[] webResources =
        webResource.getWebResourceRoot().listResources(
            webResource.getWebappPath());
    if (webResources.length > 0) {
      if (log.isDebugEnabled()) {
        log.debug(sm.getString(
            "contextConfig.processAnnotationsWebDir.debug",
            webResource.getURL()));
      }
      for (WebResource r : webResources) {
        processAnnotationsWebResource(r, fragment, handlesTypesOnly, javaClassCache);
      }
    }
  } else if (webResource.isFile() &&
      webResource.getName().endsWith(".class")) {
    try (InputStream is = webResource.getInputStream()) {
      processAnnotationsStream(is, fragment, handlesTypesOnly, javaClassCache);
    } catch (IOException e) {
      log.error(sm.getString("contextConfig.inputStreamWebResource",
          webResource.getWebappPath()),e);
    } catch (ClassFormatException e) {
      log.error(sm.getString("contextConfig.inputStreamWebResource",
          webResource.getWebappPath()),e);
    }
  }
}

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

protected void processAnnotationsWebResource(WebResource webResource,
    WebXml fragment, boolean handlesTypesOnly,
    Map<String,JavaClassCacheEntry> javaClassCache) {
  if (webResource.isDirectory()) {
    WebResource[] webResources =
        webResource.getWebResourceRoot().listResources(
            webResource.getWebappPath());
    if (webResources.length > 0) {
      if (log.isDebugEnabled()) {
        log.debug(sm.getString(
            "contextConfig.processAnnotationsWebDir.debug",
            webResource.getURL()));
      }
      for (WebResource r : webResources) {
        processAnnotationsWebResource(r, fragment, handlesTypesOnly, javaClassCache);
      }
    }
  } else if (webResource.isFile() &&
      webResource.getName().endsWith(".class")) {
    try (InputStream is = webResource.getInputStream()) {
      processAnnotationsStream(is, fragment, handlesTypesOnly, javaClassCache);
    } catch (IOException e) {
      log.error(sm.getString("contextConfig.inputStreamWebResource",
          webResource.getWebappPath()),e);
    } catch (ClassFormatException e) {
      log.error(sm.getString("contextConfig.inputStreamWebResource",
          webResource.getWebappPath()),e);
    }
  }
}

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