1

I'm trying to do a remote filechooser. I read a lot of information but I don't get it. The best site I've seen is (https://code.google.com/p/otrosvfsbrowser/) because is exactly what I want but I don't fine more information. Are Someone of you using this tool? where are any example code? I already use JSCH library to transfer via SFTP, but I want a tool to choose the remote path. I'm starting in Java. sorry for my English.

Charlio
  • 78
  • 2
  • 8

1 Answers1

3

You can check example code on Usage page You can just create dialog and register action on approve:

JOtrosVfsBrowserDialog jOtrosVfsBrowserDialog = new JOtrosVfsBrowserDialog();
Action a = new AbstractAction("Select file") {
  @Override
  public void actionPerformed(ActionEvent actionEvent) {

    if (JOtrosVfsBrowserDialog.ReturnValue.Approve.equals(jOtrosVfsBrowserDialog.showOpenDialog(TestDialog.this,"title"))){
        String friendlyUrl = jOtrosVfsBrowserDialog.getSelectedFile().getName().getFriendlyURI();
    }
  }
};
KrzyH
  • 4,256
  • 1
  • 31
  • 43
  • thanks @KrzyH ! I already try this but only allow me to view in my local machine. It doesn't show me the possibility to view the files from the remote places. – Charlio Nov 18 '14 at 08:21
  • try to open url like sftp://user@host.com:/path/ – KrzyH Nov 18 '14 at 10:13