Examples of lookupFile()


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

      }
   }

   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

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

      //1. resolve given path
      FileLookup fileLookup = FileLookupFactory.newInstance();
      InputStream is;
      if (localPathToSchema != null) {
         // Schema's are always stored in Infinispan
         is = fileLookup.lookupFile(localPathToSchema, null);
         if (is != null) {
            log.debugf("Using schema %s", localPathToSchema);
            return is;
         }
         if (log.isDebugEnabled()) {
View Full Code Here

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

                       localPathToSchema, SCHEMA_SYSTEM_PROPERTY, schemaPath());
         }
      }

      //2. resolve local schema path in infinispan distro
      is = fileLookup.lookupFile(schemaPath(), null);
      if (is != null) {
         log.debugf("Using schema %s", schemaPath());
         return is;
      }
      if (log.isDebugEnabled()) {
View Full Code Here

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

   private static InputStream findInputStream(String fileName, ClassLoader cl) throws FileNotFoundException {
      if (fileName == null)
         throw new NullPointerException("File name cannot be null!");
      FileLookup fileLookup = FileLookupFactory.newInstance();
      InputStream is = fileLookup.lookupFile(fileName, cl);
      if (is == null)
         throw new FileNotFoundException("File " + fileName
                 + " could not be found, either on the classpath or on the file system!");
      return is;
   }
View Full Code Here

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

   @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

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

   * @throws IOException
   * @return
   */
  public ConfigurationBuilderHolder parseFile(String filename) 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

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

   */
  public ConfigurationBuilderHolder parseFile(String filename) 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

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

   }

   public void initialize(String fileName) throws IOException {
      if (fileName == null) throw new NullPointerException("File name cannot be null!");
      FileLookup fileLookup = new FileLookup();
      InputStream is = fileLookup.lookupFile(fileName);
      if (is == null)
         throw new FileNotFoundException("File " + fileName + " could not be found, either on the classpath or on the file system!");
      initialize(is);
   }
View Full Code Here

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

   @Test
   public void testSchema() throws Exception {
      FileLookup lookup = FileLookupFactory.newInstance();
      URL schemaFile = lookup.lookupFileLocation("schema/infinispan-config-5.2.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

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

      //1. resolve given path
      FileLookup fileLookup = FileLookupFactory.newInstance();
      InputStream is = null;
      if (localPathToSchema != null) {
         // Schema's are always stored in Infinispan
         is = fileLookup.lookupFile(localPathToSchema, null);
         if (is != null) {
            log.debugf("Using schema %s", localPathToSchema);
            return is;
         }
         if (log.isDebugEnabled()) {
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.