package com.l7tech.server.service.resolution;

import com.l7tech.common.io.DocumentReferenceProcessor.ReferenceCustomizer;
import com.l7tech.common.io.DocumentReferenceProcessor.ReferenceInfo;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.Collection;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.xml.sax.SAXException;

class m implements ReferenceCustomizer {
   final Collection val$referencedSchemaElements;
   final k this$0;

   m(k var1, Collection var2) {
      this.this$0 = var1;
      this.val$referencedSchemaElements = var2;
   }

   public String customize(Document var1, Node var2, String var3, ReferenceInfo var4) {
      if (var4.getReferenceUrl() != null) {
         try {
            URI var5 = new URI(var3);
            String var6 = var5.resolve(new URI(var4.getReferenceUrl())).toString();
            String var7 = this.this$0.resolveSchema(var6);

            try {
               if (var7 != null) {
                  this.val$referencedSchemaElements.add(this.this$0.a(var6, var7));
               }
            } catch (IOException var8) {
               throw a(var8);
            }
         } catch (IOException var9) {
         } catch (URISyntaxException var10) {
         } catch (SAXException var11) {
         }
      }

      return null;
   }

   private static IOException a(IOException var0) {
      return var0;
   }
}
