package imeifinder;
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
/**
*
* @author nurhak.kaya
*/
public class IMEIFinder {
public static void main(String[] args) {
try {
FileInputStream fis = new FileInputStream(
"2011-11-15_runtime.log");
DataInputStream dis = new DataInputStream(fis);
BufferedReader br = new BufferedReader(new InputStreamReader(dis));
String strLine;
ArrayList list = new ArrayList();
while ((strLine = br.readLine()) != null) {
if (strLine.contains("<faultstring>An object referred to was not found")) {
try {
String s = strLine.substring(strLine.indexOf('(', 0)
+ 1, strLine.indexOf(')', 0));
if (list.contains(s)) {
continue;
} else {
System.out.println(s);
list.add(s);
}
} catch (Exception ex) {
continue;
}
}
}
dis.close();
System.out.println("******************");
System.out.println(list.size());
} catch (Exception e) {
System.err.println("Error: " + e.getMessage());
}
}
}
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
/**
*
* @author nurhak.kaya
*/
public class IMEIFinder {
public static void main(String[] args) {
try {
FileInputStream fis = new FileInputStream(
"2011-11-15_runtime.log");
DataInputStream dis = new DataInputStream(fis);
BufferedReader br = new BufferedReader(new InputStreamReader(dis));
String strLine;
ArrayList list = new ArrayList();
while ((strLine = br.readLine()) != null) {
if (strLine.contains("<faultstring>An object referred to was not found")) {
try {
String s = strLine.substring(strLine.indexOf('(', 0)
+ 1, strLine.indexOf(')', 0));
if (list.contains(s)) {
continue;
} else {
System.out.println(s);
list.add(s);
}
} catch (Exception ex) {
continue;
}
}
}
dis.close();
System.out.println("******************");
System.out.println(list.size());
} catch (Exception e) {
System.err.println("Error: " + e.getMessage());
}
}
}
Comments
Post a Comment