I need to capture network traffic using Java and get the File type. eg: IF it is xmlHTTPrequest the File type is XHR.
Depends on what you actually want to do. But if you want a whole machine network sniffer (something like what whireshark is doing), libpcap or winpcap is probably what you're searching for. There is also a java library which handles the low level stuff: pcap4j