Package org.infinispan.commons.util

Examples of org.infinispan.commons.util.FileLookup.lookupFile()


        throws ParsingException, FileNotFoundException {
        CheckArg.isNotNull(resourcePathOrJsonContentString, "resourcePathOrJsonContentString");
        FileLookup factory = FileLookupFactory.newInstance();
        InputStream stream = factory.lookupFile(resourcePathOrJsonContentString, Thread.currentThread().getContextClassLoader());
        if (stream == null) {
            stream = factory.lookupFile(resourcePathOrJsonContentString, RepositoryConfiguration.class.getClassLoader());
        }
        if (stream != null) {
            Document doc = Json.read(stream);
            return new RepositoryConfiguration(doc, withoutExtension(resourcePathOrJsonContentString));
        }
View Full Code Here


    }

    public void importBuiltIns( Problems problems ) throws IOException {
        for (String resource : BUILT_INS) {
            FileLookup factory = FileLookupFactory.newInstance();
            InputStream stream = factory.lookupFile(resource, Thread.currentThread().getContextClassLoader());
            if (stream == null) {
                stream = factory.lookupFile(resource, getClass().getClassLoader());
            }
            importFrom(stream, problems, resource);
        }
View Full Code Here

    public void importBuiltIns( Problems problems ) throws IOException {
        for (String resource : BUILT_INS) {
            FileLookup factory = FileLookupFactory.newInstance();
            InputStream stream = factory.lookupFile(resource, Thread.currentThread().getContextClassLoader());
            if (stream == null) {
                stream = factory.lookupFile(resource, getClass().getClassLoader());
            }
            importFrom(stream, problems, resource);
        }
    }
View Full Code Here

   * @throws IOException
   * @return
   */
  public ConfigurationBuilderHolder parseFile(String filename, String transportOverrideResource) throws IOException {
    FileLookup fileLookup = FileLookupFactory.newInstance();
    InputStream is = fileLookup.lookupFile( filename, searchConfigClassloader );
    if ( is == null ) {
      is = fileLookup.lookupFile( filename, userDeploymentClassloader );
      if ( is == null ) {
        throw new FileNotFoundException( filename );
      }
View Full Code Here

   */
  public ConfigurationBuilderHolder parseFile(String filename, String transportOverrideResource) throws IOException {
    FileLookup fileLookup = FileLookupFactory.newInstance();
    InputStream is = fileLookup.lookupFile( filename, searchConfigClassloader );
    if ( is == null ) {
      is = fileLookup.lookupFile( filename, userDeploymentClassloader );
      if ( is == null ) {
        throw new FileNotFoundException( filename );
      }
    }
    try {
View Full Code Here

   @Test
   public void testSchema() throws Exception {
      FileLookup lookup = FileLookupFactory.newInstance();
      URL schemaFile = lookup.lookupFileLocation("schema/infinispan-config-6.0.xsd", Thread.currentThread().getContextClassLoader());
      Source xmlFile = new StreamSource(lookup.lookupFile("configs/all.xml", Thread.currentThread().getContextClassLoader()));
      SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI).newSchema(schemaFile).newValidator().validate(xmlFile);
   }

   public void testEvictionWithoutStrategy() {
      ConfigurationBuilder cb = new ConfigurationBuilder();
View Full Code Here

      }
   }

   public ConfigurationBuilderHolder parseFile(String filename) throws IOException {
      FileLookup fileLookup = new FileLookup();
      InputStream is = fileLookup.lookupFile(filename, cl.get());
      if (is == null) {
         throw new FileNotFoundException(filename);
      }
      try {
         return parse(is);
View Full Code Here

   @Test
   public void testSchema() throws Exception {
      FileLookup lookup = new FileLookup();
      URL schemaFile = lookup.lookupFileLocation("schema/infinispan-config-7.0.xsd", Thread.currentThread().getContextClassLoader());
      Source xmlFile = new StreamSource(lookup.lookupFile("configs/unified/all.xml", Thread.currentThread().getContextClassLoader()));
      SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI).newSchema(schemaFile).newValidator().validate(xmlFile);
   }

   public void testEvictionWithoutStrategy() {
      ConfigurationBuilder cb = new ConfigurationBuilder();
View Full Code Here

   @Test
   public void testSchema() throws Exception {
      FileLookup lookup = new FileLookup();
      URL schemaFile = lookup.lookupFileLocation("schema/infinispan-config-7.0.xsd", Thread.currentThread().getContextClassLoader());
      Source xmlFile = new StreamSource(lookup.lookupFile("configs/unified/all.xml", Thread.currentThread().getContextClassLoader()));
      SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI).newSchema(schemaFile).newValidator().validate(xmlFile);
   }

   public void testEvictionWithoutStrategy() {
      ConfigurationBuilder cb = new ConfigurationBuilder();
View Full Code Here

   }

   private String findConfigFile(String configFile) {
      FileLookup fl = FileLookupFactory.newInstance();
      if (configFile != null) {
         InputStream inputStream = fl.lookupFile(configFile, Thread.currentThread().getContextClassLoader());
         try {
            if (inputStream != null)
               return configFile;
         } finally {
            Util.close(inputStream);
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.