package com.l7tech.server.util.res;

import com.l7tech.gateway.common.audit.Audit;
import com.l7tech.util.CausedIOException;
import com.l7tech.util.ExceptionUtils;
import java.io.IOException;
import java.security.GeneralSecurityException;
import java.util.Map;

class a extends ResourceGetter<R, M> {
   final Exception val$exception;

   a(Audit var1, Exception var2) {
      super(var1);
      this.val$exception = var2;
   }

   @Override
   public void close() {
   }

   @Override
   public Object getResource(Object var1, Map<String, Object> var2) throws IOException, ResourceGetter.InvalidMessageException, ResourceGetter.UrlNotFoundException, ResourceGetter.MalformedResourceUrlException, ResourceGetter.UrlNotPermittedException, ResourceGetter.ResourceIOException, ResourceGetter.ResourceParseException, GeneralSecurityException {
      try {
         if (this.val$exception instanceof IOException) {
            throw (IOException)this.val$exception;
         }
      } catch (IOException var6) {
         throw a(var6);
      }

      try {
         if (this.val$exception instanceof ResourceGetter.InvalidMessageException) {
            throw (ResourceGetter.InvalidMessageException)this.val$exception;
         }
      } catch (IOException var10) {
         throw a(var10);
      }

      try {
         if (this.val$exception instanceof ResourceGetter.UrlNotFoundException) {
            throw (ResourceGetter.UrlNotFoundException)this.val$exception;
         }
      } catch (IOException var5) {
         throw a(var5);
      }

      try {
         if (this.val$exception instanceof ResourceGetter.MalformedResourceUrlException) {
            throw (ResourceGetter.MalformedResourceUrlException)this.val$exception;
         }
      } catch (IOException var9) {
         throw a(var9);
      }

      try {
         if (this.val$exception instanceof ResourceGetter.UrlNotPermittedException) {
            throw (ResourceGetter.UrlNotPermittedException)this.val$exception;
         }
      } catch (IOException var4) {
         throw a(var4);
      }

      try {
         if (this.val$exception instanceof ResourceGetter.ResourceIOException) {
            throw (ResourceGetter.ResourceIOException)this.val$exception;
         }
      } catch (IOException var8) {
         throw a(var8);
      }

      try {
         if (this.val$exception instanceof ResourceGetter.ResourceParseException) {
            throw (ResourceGetter.ResourceParseException)this.val$exception;
         }
      } catch (IOException var3) {
         throw a(var3);
      }

      try {
         if (this.val$exception instanceof GeneralSecurityException) {
            throw (GeneralSecurityException)this.val$exception;
         }
      } catch (IOException var7) {
         throw a(var7);
      }

      throw new CausedIOException(ExceptionUtils.getMessage(this.val$exception), this.val$exception);
   }

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