Good, I am trying to make an application in java, in which the program asks for the name of the document (in my case a pdf) and searches inside a shared folder remotely, if it exists, opens the pdf document . I am currently doing this as follows:
String NomFichero = "file://200.10.10.156/Carpeta/archivo";
if(java.awt.Desktop.isDesktopSupported()) {
try {
Desktop dk = Desktop.getDesktop();
dk.browse(new URI(NomFichero+".pdf"));
}
catch(Exception e1) {
try {
Desktop dk = Desktop.getDesktop();
dk.browse(new URI(NomFichero+".jpg"));
}
catch(Exception e2) {
JOptionPane.showMessageDialog(null,"ERROR: "+ e2.getMessage());
}
}
}
This works perfectly for me if I log in first from PC to PC, and I recognize the credential for the client team. But the idea is to already access the authentication to avoid this step.
I know of a jcifs library, it's a samba implementation, where if we can access shared folders remotely, and with the credentials in question, I use this library to access the folder at the moment edit the name of a document or delete it, but to open it frankly I can not find a method I can use.
I would appreciate much of your help. Successes!