View Javadoc
1   package edu.jiangxin.apktoolbox.file.password.recovery.checker;
2   
3   import edu.jiangxin.apktoolbox.utils.Utils;
4   import org.apache.commons.configuration2.Configuration;
5   import org.apache.logging.log4j.LogManager;
6   import org.apache.logging.log4j.Logger;
7   
8   import java.io.File;
9   
10  public abstract class FileChecker implements IChecker {
11      protected File file;
12      protected Logger logger;
13      protected Configuration conf;
14  
15      public FileChecker() {
16          logger = LogManager.getLogger(this.getClass().getSimpleName());
17          conf = Utils.getConfiguration();
18      }
19  
20      public void attachFile(File file) {
21          this.file = file;
22      }
23  
24      public boolean prepareChecker() {
25          return true;
26      }
27  
28      @Override
29      public String toString() {
30          return getDescription();
31      }
32  
33      /**
34       * Return all supported file extensions in LOWERCASE, for example: ["zip", "7z", "rar"]
35       *
36       * @return All supported file extensions in LOWERCASE
37       */
38      public abstract String[] getFileExtensions();
39  
40      public abstract String getFileDescription();
41  
42      public abstract String getDescription();
43  }