FileCapture capture;
if (type == PcapFile.class) {
capture = new PcapFileCapture(file, mode, null);
} else if (type == SnoopFile.class) {
capture = new SnoopFileCapture(file, mode, null);
} else {
throw new FileFormatException("Unsupported file format type, "
+ type.getName());
}