Examples of ResourceLoader


Examples of org.raml.parser.loader.ResourceLoader

        new Validator().validate(args);
    }

    private void validate(String[] resources) throws FileNotFoundException
    {
        ResourceLoader loader = new DefaultResourceLoader();
        for (String ramlResource : resources)
        {
            System.out.format("Validation Results for %s:\n", ramlResource);
            String ramlResourceToFetch = ramlResource;
            if (ramlResource.startsWith("/"))
            {
                ramlResourceToFetch = "file://" + ramlResource;
            }
            List<ValidationResult> results = new ArrayList<ValidationResult>();
            InputStream content = loader.fetchResource(ramlResourceToFetch);
            if (content != null)
            {
                results = RamlValidationService.createDefault().validate(content, ramlResourceToFetch);
            }
            else
View Full Code Here

Examples of org.springframework.core.io.ResourceLoader

    // Set bean properties from init parameters.
    try {
      PropertyValues pvs = new FilterConfigPropertyValues(filterConfig, this.requiredProperties);
      BeanWrapper bw = PropertyAccessorFactory.forBeanPropertyAccess(this);
      ResourceLoader resourceLoader = new ServletContextResourceLoader(filterConfig.getServletContext());
      bw.registerCustomEditor(Resource.class, new ResourceEditor(resourceLoader));
      initBeanWrapper(bw);
      bw.setPropertyValues(pvs, true);
    } catch (BeansException ex) {
      String msg = "Failed to set bean properties on filter '" + filterConfig.getFilterName() + "': "
View Full Code Here

Examples of org.springframework.core.io.ResourceLoader

            return context;
        } catch (ClassNotFoundException e) {
            // create generic application context
            GenericApplicationContext context = new GenericApplicationContext(parent);
            context.setClassLoader(classLoader);
            ResourceLoader resourceLoader = new DefaultResourceLoader(classLoader);
            context.setResourceLoader(resourceLoader);
            BeanDefinitionReader reader = new XmlBeanDefinitionReader(context);
            for (String resource : resources) {
                reader.loadBeanDefinitions(resourceLoader.getResource(resource));
            }
            context.refresh();
            return context;
        }
View Full Code Here

Examples of org.springframework.core.io.ResourceLoader

  public BeanDefinition parse(Element element, ParserContext parser) {

    try {

      Environment environment = parser.getDelegate().getEnvironment();
      ResourceLoader resourceLoader = parser.getReaderContext().getResourceLoader();
      BeanDefinitionRegistry registry = parser.getRegistry();

      XmlRepositoryConfigurationSource configSource = new XmlRepositoryConfigurationSource(element, parser, environment);
      RepositoryConfigurationDelegate delegate = new RepositoryConfigurationDelegate(configSource, resourceLoader,
          environment);
View Full Code Here

Examples of org.springframework.core.io.ResourceLoader

  private final CustomRepositoryImplementationDetector customImplementationDetector;

  protected CdiRepositoryExtensionSupport() {

    Environment environment = new StandardEnvironment();
    ResourceLoader resourceLoader = new PathMatchingResourcePatternResolver(getClass().getClassLoader());
    MetadataReaderFactory metadataReaderFactory = new CachingMetadataReaderFactory(resourceLoader);

    this.customImplementationDetector = new CustomRepositoryImplementationDetector(metadataReaderFactory, environment,
        resourceLoader);
  }
View Full Code Here

Examples of org.springframework.core.io.ResourceLoader

        applicationContext = new XmlWebApplicationContext();
        applicationContext.setConfigLocations(new String[]{
                "file:src/main/webapp/WEB-INF/cas-servlet.xml",
                "file:src/main/webapp/WEB-INF/deployerConfigContext.xml",
        "file:src/main/webapp/WEB-INF/spring-configuration/*.xml"});
        applicationContext.setServletContext(new MockServletContext(new ResourceLoader() {
            @Override
            public Resource getResource(final String location) {
                return new FileSystemResource("src/main/webapp" + location);
            }

View Full Code Here

Examples of org.springframework.core.io.ResourceLoader

*/
public class GenericWebContextLoader extends AbstractContextLoader {
    protected final MockServletContext servletContext;

    public GenericWebContextLoader(String warRootDir, boolean isClasspathRelative) {
        ResourceLoader resourceLoader = isClasspathRelative ? new DefaultResourceLoader() : new FileSystemResourceLoader();
        this.servletContext = initServletContext(warRootDir, resourceLoader);
    }
View Full Code Here

Examples of org.springframework.core.io.ResourceLoader

    private JavaMailEmailDispatcher dispatcher;

    private SimpleSmtpServer server;

    protected void setUp() throws Exception {
        ResourceLoader loader = new ClassPathResourceLoader();
        VelocityTemplateEngine engine = new VelocityTemplateEngine(loader);
        engine.afterPropertiesSet();
        BasicTemplateResolver resolver = new BasicTemplateResolver(engine, loader);

        dispatcher = new JavaMailEmailDispatcher();
View Full Code Here

Examples of org.springframework.core.io.ResourceLoader

      System.setProperty(LogFactory.FACTORY_PROPERTY, "org.apache.commons.logging.impl.Log4jFactory");
        PropertyConfigurator.configure("log4j.properties");
       
      AbstractApplicationContext context = new ClassPathXmlApplicationContext("/applicationContext-repository.xml");
       
        ResourceLoader loader = new DefaultResourceLoader();
        Resource resource = loader.getResource("test.file");
       
        JcrService service = (JcrService)context.getBean("jcrService");

        service.saveSmth();
       
View Full Code Here

Examples of org.springframework.core.io.ResourceLoader

    public void testRole1To4Roles() throws Exception {
        List<String> ROLE1TO4_EXPECTED_ROLES = Arrays.asList(new String[] { "Role1", "Role2", "Role3", "Role4" });
        final Resource webXml = new ClassPathResource("webxml/Role1-4.web.xml");
        WebXmlMappableAttributesRetriever rolesRetriever = new WebXmlMappableAttributesRetriever();

        rolesRetriever.setResourceLoader(new ResourceLoader() {
            public ClassLoader getClassLoader() {
                return Thread.currentThread().getContextClassLoader();
            }

            public Resource getResource(String location) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.