I am working on an application in which I need to open attachments. I need to click on the "Open" button and open a pdf file. The way I do it, is by getting the content from the Server and writing it to a location on the temp directory.
However when I try to access this service from a remote machine, http://myserverIP:port/openMyAttachment, it accesses the temp directory of myserverIP instead of the local machine. It then opens the file on myserverIP.
I am using the following code to get the temp directory:
String tmp = System.getProperty("java.io.tmpdir");
JFileChooser fc = new JFileChooser();
FileSystemView fsv = fc.getFileSystemView();
File f = fsv.getDefaultDirectory();
String dir = f.getAbsolutePath();
String strDirectory = "temp~" + f.separator;
Can someone please share your thoughts? How can I get to access the temp directory on teh local machine and write the file to the local machine?