package com.mojang.launcher.versions;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;

public class ExtractRules {
   private List<String> exclude = new ArrayList();

   public ExtractRules() {
   }

   public ExtractRules(String... exclude) {
      if (exclude != null) {
         Collections.addAll(this.exclude, exclude);
      }

   }

   public ExtractRules(ExtractRules rules) {
      Iterator var2 = rules.exclude.iterator();

      while(var2.hasNext()) {
         String exclude = (String)var2.next();
         this.exclude.add(exclude);
      }

   }

   public List<String> getExcludes() {
      return this.exclude;
   }

   public boolean shouldExtract(String path) {
      if (this.exclude != null) {
         Iterator var2 = this.exclude.iterator();

         while(var2.hasNext()) {
            String rule = (String)var2.next();
            if (path.startsWith(rule)) {
               return false;
            }
         }
      }

      return true;
   }
}
