0

Solution?

-- it looks like i may be able to use the x-11 forwarding in jsch and and use the java Desktop class to launch a file browser. Not sure if this will work.

What I am trying to do is, within a java application, open a connection to a server or another computer. I have found a way to do this that opens a terminal window but what I want is a gui/explorer/finder like window that allows me to drag and drop files between the machines.

--Edit-- An example: When i use an sftp application i can open a graphical window and drag files from my computer to folders on the remote server. just like an explorer or finder window. I am looking for a way to implement this type of functionality in java. I want to open a connection to a remote machine, then open a graphical window to browse the file system

5
  • What did you look into? Creating a GUI is different to coding the actual file manipulation in the backend. Commented Feb 15, 2013 at 22:46
  • @Femaref i dont necessarily want to program the gui myself. i was thinking something like when i use the go/connect to server application in osx. i want to be able to open a window to sftp (or something similarly secure) files between machines Commented Feb 15, 2013 at 22:49
  • @Femaref feel free to point me in the right direction if you think there is a better way to phrase the question i am trying to ask Commented Feb 15, 2013 at 22:50
  • You could use sshfs to create a mount point for the remote file system on your machine, and use your normal tools. I had this working on Mac OS X and debian, works like a charm. Windows is a different beast though. Commented Feb 15, 2013 at 22:57
  • @Femaref if i must i can implement multiple connection methods depending on the environments used but i would really love to find a more simple way Commented Feb 15, 2013 at 23:07

2 Answers 2

2

You can use JSch to communicate with the server through SSH and 1. create your own GUI or 2. use X11 forwarding

Sign up to request clarification or add additional context in comments.

13 Comments

@almalki ive read a little about jSch and X11 forwarding, I have not had luck figuring out how to open a local window into the filesystem after the connection has been made
well, don't you drop platform indepency with the 2nd approach?
@MadProgrammer same question to you as i just asked almalki
@Zhedar it was my understanding that x11 works on windows and mac? was incorrect?
@Andrew Actually it wasn't shipped on my OSX 10.8.2 by default, but it should be available for those systems. If you use your application just for yourself, those dependencies would NOT be a problem, otherwise I'm not really sure about it.
|
0

you need two applications in each machine ,you can do this by TLS connection. however it need a waiting thread in costumer machine (dragable) to get file from Tls port and stream it to new location or if you want to use just gui in one machine you can old applet or java Fx instead .

1 Comment

You don't really need two applications, at least if you want to connect to a unix server - just use ssh, scp or sftp to connect to them; if you wan't multiple windows, run separate connections.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.