File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JavaFX and the fly likes storing files at ftp server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JavaFX
Bookmark "storing files at ftp server" Watch "storing files at ftp server" New topic
Author

storing files at ftp server

Andrey Kuzmenko
Greenhorn

Joined: Mar 23, 2010
Posts: 6
does somebody know how to store files at ftp server from javafx code ?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42264
    
  64
I thought it was possible to use arbitrary Java libraries from within JavaFX code, like Apache Commons Net (which contains an FTP client); not so?


Ping & DNS - my free Android networking tools app
Andrey Kuzmenko
Greenhorn

Joined: Mar 23, 2010
Posts: 6
Ulf Dittmer wrote:I thought it was possible to use arbitrary Java libraries from within JavaFX code, like Apache Commons Net (which contains an FTP client); not so?


The problem is that application must be run at client's computer. He has java without any additional libraries. Or may be the only way(if there is no such standard library) is to write application that will download such library?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42264
    
  64
The client must somehow download the application jar file anyway, mustn't it? Why not bundle the all required classes with it, either as a separate jar file, or as part of the application jar file?
Andrey Kuzmenko
Greenhorn

Joined: Mar 23, 2010
Posts: 6
i put my_game.html and my_game.jar on the server and call it with
swt.browser.getUrl("server adress/ my game.html") from client's java code. My game has to return value and i didn't find the way to do this. So i thought that it can save result on the server, and i will take result from client's code. I understand that such solution is ugly, but i don't know another. Are you sure, that in my solution i can put ftp library to my_game.jar ? Or may be you can help me to find another solution for this problem?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42264
    
  64
I don't fully understand what you're trying to do, but nothing stops you from making the Commons Net library part of the game's jar file.

Since you just want to return a "value" -and not an actual file- have you considered making an HTTP call from the application to a server URL?
Andrey Kuzmenko
Greenhorn

Joined: Mar 23, 2010
Posts: 6
But server doesn't run any code.. How can it reply? (may be i don't understand smth, but i can build such interaction only in the case, that server runs java code)
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42264
    
  64
Well, if the server does not speak HTTP, then FTP seems to be the only remaining option.
Andrey Kuzmenko
Greenhorn

Joined: Mar 23, 2010
Posts: 6
thank you, i'll do so
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: storing files at ftp server