Package org.springframework.web.context.support

Examples of org.springframework.web.context.support.ServletContextResource


        String brokerURI = context.getInitParameter(INIT_PARAM_BROKER_URI);
        if (brokerURI == null) {
            brokerURI = "activemq.xml";
        }
        context.log("Loading ActiveMQ Broker configuration from: " + brokerURI);
        Resource resource = new ServletContextResource(context, brokerURI);
        BrokerFactoryBean factory = new BrokerFactoryBean(resource);
        try {
            factory.afterPropertiesSet();
        } catch (Exception e) {
            context.log("Failed to create broker: " + e, e);
View Full Code Here


   * @return context path
   */
  private String getContextPath(Resource rootFile) {
    String contextPath = null;
    if (rootFile instanceof ServletContextResource) {
      ServletContextResource servletResource = (ServletContextResource) rootFile;
      contextPath = servletResource.getServletContext().getContextPath();
      if ("/".equals(contextPath)) {
        contextPath = "/root";
      }
    } else if (resources instanceof IScope) {
      contextPath = ((IScope) resources).getContextPath();
View Full Code Here

            }

        }

        try {
            ServletContextResource resource = new ServletContextResource(sc, iconClassFile);
            FileUtils.writeLines(resource.getFile(), cssList);
        } catch (Exception e) {
            LogUtils.logError("gen icon error", e);
            return "生成失败:" + e.getMessage();
        }
View Full Code Here

            + kurentoPropertiesDir);
        inputStream = new FileInputStream(kurentoPropertiesDir
            + kurentoProperties);
      } else {
        // Third, look for properties in Servlet Context
        ServletContextResource servletContextResource = new ServletContextResource(
            ctx, "/WEB-INF" + kurentoProperties);
        if (servletContextResource.exists()) {
          log.info("Found custom properties in Servlet Context: /WEB-INF"
              + kurentoProperties);
          inputStream = servletContextResource.getInputStream();
        }
      }

      if (inputStream != null) {
        Properties properties = new Properties();
View Full Code Here

   * Return the file timestamp for the given resource.
   * @param resourceUrl the URL of the resource
   * @return the file timestamp in milliseconds, or -1 if not determinable
   */
  protected long getFileTimestamp(String resourceUrl) {
    ServletContextResource resource = new ServletContextResource(getServletContext(), resourceUrl);
    try {
      long lastModifiedTime = resource.lastModified();
      if (logger.isDebugEnabled()) {
        logger.debug("Last-modified timestamp of " + resource + " is " + lastModifiedTime);
      }
      return lastModifiedTime;
    }
View Full Code Here

   * Return the file timestamp for the given resource.
   * @param resourceUrl the URL of the resource
   * @return the file timestamp in milliseconds, or -1 if not determinable
   */
  protected long getFileTimestamp(String resourceUrl) {
    ServletContextResource resource = new ServletContextResource(getServletContext(), resourceUrl);
    try {
      long lastModifiedTime = resource.lastModified();
      if (logger.isDebugEnabled()) {
        logger.debug("Last-modified timestamp of " + resource + " is " + lastModifiedTime);
      }
      return lastModifiedTime;
    }
View Full Code Here

    @Override
    public void init(ServletConfig config) throws ServletException {
        super.init(config);
        appHandler = new ResourceHttpRequestHandler();

        ServletContextResource composerRoot = new ServletContextResource(config.getServletContext(), "/composer/**");
        appHandler.setApplicationContext(getWebApplicationContext());
        appHandler.setLocations((List)Arrays.asList(composerRoot));

    }
View Full Code Here

            brokerURI = "activemq.xml";
        }

        log("Loading ActiveMQ Broker configuration from: " + brokerURI);

        Resource resource = new ServletContextResource(context, brokerURI);
        return SpringBrokerContainerFactory.newInstance(resource);
    }
View Full Code Here

  @Override
  protected Resource getResourceByPath(String path) {
    if (getServletContext() == null) {
      return new ClassPathContextResource(path, getClassLoader());
    }
    return new ServletContextResource(getServletContext(), path);
  }
View Full Code Here

        String brokerURI = context.getInitParameter(INIT_PARAM_BROKER_URI);
        if (brokerURI == null) {
            brokerURI = "activemq.xml";
        }
        context.log("Loading ActiveMQ Broker configuration from: " + brokerURI);
        Resource resource = new ServletContextResource(context, brokerURI);
        return SpringBrokerContainerFactory.newInstance(resource);
    }
View Full Code Here

TOP

Related Classes of org.springframework.web.context.support.ServletContextResource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.