JFilechooser for a remote server
Asked Answered
C

3

5

I have a java application that, at some stage, select files from the local filesystem using JFileChooser.showOpenDialog().

Now I want it in a client-server setup. This means opening a GUI(file browser) for selecting files on the server. I have already tried several scenarios to keep using the JFileChooser, but I cant get the correct setup working.

Does anyone know how to construct a file browser on the remote server if i know the path the file browser needs to default to in advance? So for eg: if the server address is "http://sand.int.group.com:9083" and on this address the directory that i want to default to is at "/home/myDir/". How can I display the file browser window so that it lists the files located in the directory on this server?

Craigcraighead answered 7/3, 2011 at 18:59 Comment(1)
Not exactly a duplicate of #1732679, but certainly related.Melendez
A
5

JFileChooser can't load a URL. You will need to map a network share on the machine that wants to browse to the files.

Amedeo answered 7/3, 2011 at 19:13 Comment(0)
R
2

This will serve you purpose, I believe: http://vfsjfilechooser.sourceforge.net/index.html

A remote file chooser based on JFileChooser code...

Rancid answered 22/2, 2012 at 11:19 Comment(0)
G
0

AFAIK this is not working out of the box. The local JFileChooser has no idea about files located on server side.

Take WebSphere for example, with the Websphere admin tool you can deploy local EAR/WAR files to the server, IBM is doing this with a JFileChooser. But when you are going to deploy a file which is on the remote server you get a completely different UI. So it seems to be very tricky.

One possible way might be to implement your own FileSystemView, but I am not sure, this is just an idea.

Gnaw answered 7/3, 2011 at 19:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.