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

x33g5p2x  于2022-01-18 转载在 其他  
字(4.5k)|赞(0)|评价(0)|浏览(146)

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

Context.getConfigFile介绍

[英]Return the path to a file to save this Context information.
[中]返回文件的路径以保存此上下文信息。

代码示例

代码示例来源:origin: psi-probe/psi-probe

@Override
public File getConfigFile(Context context) {
 URL configUrl = context.getConfigFile();
 if (configUrl != null) {
  try {
   URI configUri = configUrl.toURI();
   if ("file".equals(configUri.getScheme())) {
    return new File(configUri.getPath());
   }
  } catch (URISyntaxException ex) {
   logger.error("Could not convert URL to URI: '{}'", configUrl, ex);
  }
 }
 return null;
}

代码示例来源:origin: org.glassfish.main.web/web-core

/**
 * Process the default configuration file, if it exists.
 */
protected void contextConfig() {
  if( defaultContextXml==null ) getDefaultContextXml();
  if (!context.getOverride()) {
    processContextConfig(new File(getBaseDir()), defaultContextXml);
  }
  if (context.getConfigFile() != null)
    processContextConfig(new File(context.getConfigFile()), null);
}

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

/**
 * Get explicit writer for context (context.getConfigFile()).
 *
 * @param context
 * @return The file mover
 * @throws IOException
 */
protected StoreFileMover getConfigFileWriter(Context context)
    throws Exception {
  URL configFile = context.getConfigFile();
  StoreFileMover mover = null;
  if (configFile != null) {
    File config = new File(configFile.toURI());
    if (!config.isAbsolute()) {
      config = new File(System.getProperty("catalina.base"),
          config.getPath());
    }
    // Open an output writer for the new configuration file
    mover = new StoreFileMover("", config.getCanonicalPath(),
        getRegistry().getEncoding());
  }
  return mover;
}

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

if (context.getConfigFile() != null) {
  processContextConfig(digester, context.getConfigFile());

代码示例来源:origin: tomcat/catalina

/**
 * Process the default configuration file, if it exists.
 */
protected void contextConfig() {
  
  // Open the default web.xml file, if it exists
  if( defaultContextXml==null && context instanceof StandardContext ) {
    defaultContextXml = ((StandardContext)context).getDefaultContextXml();
  }
  // set the default if we don't have any overrides
  if( defaultContextXml==null ) getDefaultContextXml();
  if (!context.getOverride()) {
    processContextConfig(new File(getBaseDir()), defaultContextXml);
    processContextConfig(getConfigBase(), getHostConfigPath(Constants.HostContextXml));
  }
  if (context.getConfigFile() != null)
    processContextConfig(new File(context.getConfigFile()), null);
  
}

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

if (context.getConfigFile() != null)
  processContextConfig(digester, context.getConfigFile());

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

if (context.getConfigFile() != null) {
  processContextConfig(digester, context.getConfigFile());

代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9

if (context.getConfigFile() != null)
  processContextConfig(context.getConfigFile());

代码示例来源:origin: org.glassfish.main.web/web-core

(File) context.getServletContext().getAttribute
  (ServletContext.TEMPDIR);
String configFile = context.getConfigFile();
host.removeChild(context);

代码示例来源:origin: org.glassfish.main.web/web-core

String configFileName = context.getConfigFile();
if (configFileName != null) {
  File configFile = new File(configFileName);

代码示例来源:origin: org.apache.catalina/com.springsource.org.apache.catalina

if (context.getConfigFile() != null)
  processContextConfig(digester, context.getConfigFile());

代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9

if (context.getConfigFile() != null)
  processContextConfig(context.getConfigFile());

代码示例来源:origin: com.ovea.tajin.server/tajin-server-tomcat7

if (context.getConfigFile() != null)
  processContextConfig(context.getConfigFile());

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

@Override
public synchronized void store(Context aContext) {
  URL configFile = aContext.getConfigFile();
  if (configFile != null) {
    try {
      StoreDescription desc = null;
      desc = getRegistry().findDescription(aContext.getClass());
      if (desc != null) {
        boolean old = desc.isStoreSeparate();
        try {
          desc.setStoreSeparate(true);
          desc.getStoreFactory().store(null, -2, aContext);
        } finally {
          desc.setStoreSeparate(old);
        }
      }
    } catch (Exception e) {
      log.error(e);
    }
  } else
    log.error("Missing configFile at Context " + aContext.getPath());
}

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

if (context.getConfigFile() != null) {
  processContextConfig(digester, context.getConfigFile(), null);

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

Context aContext = (Context) mserver.getAttribute(objectName,
    "managedResource");
URL configFile = aContext.getConfigFile();
if (configFile != null) {
  try {

相关文章

微信公众号

最新文章

更多

Context类方法