Package org.springframework.web.context.support

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


  public void afterPropertiesSet() throws Exception {
    Assert.notNull(relativeModuleRootLocation);
  }

  public Resource getRootDirectory() {
    return new ServletContextResource(servletContext, relativeModuleRootLocation);
  }
View Full Code Here


  }
 
  public List<Resource> getApplicationModuleClassLocations(String moduleName) {
    String applicationVersionString = StringUtils.hasText(applicationVersion) ? "-" + applicationVersion : "";
    String fullResourceName = relativeModuleRootLocation + "/" + moduleName + applicationVersionString + ".jar";
    Resource servletContextResource = new ServletContextResource(servletContext, fullResourceName);
    return Collections.singletonList(servletContextResource);
  }
View Full Code Here

        Resource[] resources = new Resource[locations.size()];
   
        for (int i = 0; i < locations.size(); i++) {
            // note that this is relying on the contextClassLoader to be set up
            // correctly
            resources[i] = new ServletContextResource(servletContext, locations.get(i));
        }
        return resources;
    }
View Full Code Here

    private ServletContext servletContext;

    @Override
    protected Resource getResourceForPath(String prefix, String location, ClassLoader classLoader) {
        return new ServletContextResource(this.servletContext, prefix + location);
    }
View Full Code Here

    public void afterPropertiesSet() throws Exception {
        Assert.notNull(relativeModuleRootLocation);
    }

    public Resource getRootDirectory() {
        return new ServletContextResource(servletContext, relativeModuleRootLocation);
    }
View Full Code Here

    }
   
    public List<Resource> getApplicationModuleClassLocations(String moduleName) {
        String applicationVersionString = StringUtils.hasText(applicationVersion) ? "-" + applicationVersion : "";
        String fullResourceName = relativeModuleRootLocation + "/" + moduleName + applicationVersionString + ".jar";
        Resource servletContextResource = new ServletContextResource(servletContext, fullResourceName);
        return Collections.singletonList(servletContextResource);
    }
View Full Code Here

    public void afterPropertiesSet() throws Exception {
        Assert.notNull(relativeModuleRootLocation);
    }

    public Resource getRootDirectory() {
        return new ServletContextResource(servletContext, relativeModuleRootLocation);
    }
View Full Code Here

     */
    public List<Resource> getApplicationModuleClassLocations(String moduleName) {
        String applicationVersionString = StringUtils.hasText(applicationVersion) ? "-" + applicationVersion : "";
        String folderResourceName = relativeModuleRootLocation + "/" + moduleName;
    String fullJarResourceName = folderResourceName + applicationVersionString + ".jar";
        Resource folderResource = new ServletContextResource(servletContext, folderResourceName);
        Resource jarResource = new ServletContextResource(servletContext, fullJarResourceName);
        return Arrays.asList(folderResource,
            jarResource);
    }
View Full Code Here

     * module name. Expects libraries to be in the directory
     * WEB-INF/modules/lib/module_name
     */
    public List<Resource> getApplicationModuleLibraryLocations(String moduleName) {
        String parent = relativeModuleRootLocation + "/lib/" + moduleName;
        Resource parentResource = new ServletContextResource(servletContext, parent);
        try {
            File file = parentResource.getFile();
            if (file.exists()) {
                File[] files = file.listFiles(new ExtensionFileFilter(".jar"));
                if (files != null && files.length > 0) {
                    return Arrays.asList(ResourceUtils.getResources(files));
                }
View Full Code Here

    protected void customizeContext(ServletContext servletContext,
            ConfigurableWebApplicationContext applicationContext) {

        final String initParameter = servletContext.getInitParameter(CONFIG_LOCATION_PARAM);
        if (initParameter == null) {
            final ServletContextResource servletContextResource = new ServletContextResource(servletContext, XmlWebApplicationContext.DEFAULT_CONFIG_LOCATION);
            if (!servletContextResource.exists()) {
                applicationContext.setConfigLocation("classpath:META-INF/impala-web-empty.xml");
            }
        }
    }
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.