I am taking a file name via filenamechooser and sending it it my desired method for processing but the problem is that it is not accepting the filename.I am using JPcap for opening up the file.When i hard code it ,It gives me perfect results but when i send the file name it gives me exception.Here is my code
JpcapCaptor captor = JpcapCaptor.openFile("E:\\10.pcap");
I took the printing statement of this file and it gives me this
System.out.println("E:\\10.pcap");
on Console i get this
E:\10.pcap
but when i send this filename from my GUI to this openfile function it gives me this exception although when i take the printing statement of this filename it is also the same E:\10.pcap
SEVERE: null
java.io.IOException: E:\10.pcap
: Invalid argument
at jpcap.JpcapCaptor.openFile(JpcapCaptor.java:93)
at dpi.Functions.PortBasedAnalysis(Functions.java:52)
at dpi.GraphicalInterface.jButton1MouseClicked(GraphicalInterface.java:104)
at dpi.GraphicalInterface.access$000(GraphicalInterface.java:25)
at dpi.GraphicalInterface$1.mouseClicked(GraphicalInterface.java:49)
at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:253)
at java.awt.Component.processMouseEvent(Component.java:6041)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3260)
at java.awt.Component.processEvent(Component.java:5803)
at java.awt.Container.processEvent(Container.java:2058)
at java.awt.Component.dispatchEventImpl(Component.java:4410)
at java.awt.Container.dispatchEventImpl(Container.java:2116)
at java.awt.Component.dispatchEvent(Component.java:4240)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3995)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
at java.awt.Container.dispatchEventImpl(Container.java:2102)
at java.awt.Window.dispatchEventImpl(Window.java:2429)
at java.awt.Component.dispatchEvent(Component.java:4240)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)