MCPcopy Index your code
hub / github.com/cSploit/android / fromFile

Method fromFile

cSploit/src/org/csploit/android/core/KnownIssues.java:31–58  ·  view source on GitHub ↗

load known issues from a file. the file must contains one integer per line. lines stating with '#' are ignored. @param file path to the file to load

(String file)

Source from the content-addressed store, hash-verified

29 * @param file path to the file to load
30 */
31 public void fromFile(String file) {
32 String line = null;
33
34 try {
35 BufferedReader reader = new BufferedReader(new FileReader(file));
36
37 while((line = reader.readLine()) != null) {
38 line = line.trim();
39
40 if(line.isEmpty() || line.startsWith("#"))
41 continue;
42
43 Integer issue = Integer.parseInt(line);
44
45 if(!foundIssues.contains(issue)) {
46 foundIssues.add(issue);
47 Logger.info(String.format("issue #%d loaded from file", issue));
48 }
49 }
50
51 } catch (FileNotFoundException e) {
52 // ignored
53 } catch (IOException e) {
54 Logger.warning(String.format("unable to read from '%s': %s", file, e.getMessage()));
55 } catch (NumberFormatException e) {
56 Logger.error(String.format("unable to parse '%s' as number.", line));
57 }
58 }
59
60 /**
61 * check if {@code issue} has been found on this device

Callers 2

startCoreDaemonMethod · 0.80
buildIntentMethod · 0.80

Calls 6

infoMethod · 0.95
warningMethod · 0.95
errorMethod · 0.95
isEmptyMethod · 0.80
formatMethod · 0.80
addMethod · 0.45

Tested by

no test coverage detected