• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Remote File Operations

 
Greenhorn
Posts: 7
Eclipse IDE Firefox Browser Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I've serched a lot for this operation, couldnt get hold of anything great.
My requirement is that, I would like to connect to a remote machine by passing its Hostname, UserID, Password to the program.
Once it is connected, it should be able to perform file operations like read, write, copy, etc.

When serached for the articles in Google, all I could find was fetching the data from ftp URL, accessing the file using JCIFS libraries if the same are in samba shares.
In my scenario, the files just belong to remote machine and also not shared.
Your assistance will be highly appreciated.
 
Saloon Keeper
Posts: 15484
363
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If the files are not shared, the only way to get them is through an application running on the remote machine, like an FTP server. You could even write the server yourself, with your own protocol. Just make sure to use proper encryption like Transport Layer Security.
 
Joseph M Joy
Greenhorn
Posts: 7
Eclipse IDE Firefox Browser Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@Stephan
Thanks for the response...!!!
However I am working from within a network wherein we cannot start the FTP servcies on certain servers.
Hence, can you suggest any other alternatives than accessing it through FTP?
 
Stephan van Hulst
Saloon Keeper
Posts: 15484
363
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Like I said, you can write your own server using a custom protocol (not necessarily FTP). This can be pretty simple, just make sure you don't compromise sensitive user data.
 
Joseph M Joy
Greenhorn
Posts: 7
Eclipse IDE Firefox Browser Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Stephan van Hulst wrote:Like I said, you can write your own server using a custom protocol (not necessarily FTP). This can be pretty simple, just make sure you don't compromise sensitive user data.



Stephan,
Can you provide a sample code for the custom protocol that you have stated.
 
Ranch Hand
Posts: 781
Netbeans IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Joseph M Joy wrote:
However I am working from within a network wherein we cannot start the FTP servcies on certain servers.



This would imply that you are not allowed to start any server on these servers so there is no point in writing your own server.

Can you open an ssh session to these servers?
 
Joseph M Joy
Greenhorn
Posts: 7
Eclipse IDE Firefox Browser Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

James Sabre wrote:
Can you open an ssh session to these servers?



Yes. I can.
However I suppose that ssh can be done only to a linux machine. Please advise if otherwise.
Also, please help me if you have some logic for the same.

I've presently figured out the logic to run shell scripts using ganymed-ssh2 by which I can read and manipulate data in a remote linux machine.
However the same couldn't be used for a windows machine.
 
James Sabre
Ranch Hand
Posts: 781
Netbeans IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Joseph M Joy wrote:

James Sabre wrote:
Can you open an ssh session to these servers?



Yes. I can.
However I suppose that ssh can be done only to a linux machine. Please advise if otherwise.



The operating system is not really a factor. There are ssh servers for pretty much all OS but, of course, to be usable to use an ssh server it must be installed.


Also, please help me if you have some logic for the same.
[/code]

Sorry I don't understand.

[code]
I've presently figured out the logic to run shell scripts using ganymed-ssh2 by which I can read and manipulate data in a remote linux machine.
However the same couldn't be used for a windows machine.



You don't say what sort of manipulation is required but as long as it is not complicated then I'm sure equivalent 'scripts' can be run on Windows.
 
Joseph M Joy
Greenhorn
Posts: 7
Eclipse IDE Firefox Browser Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

James Sabre wrote:
You don't say what sort of manipulation is required but as long as it is not complicated then I'm sure equivalent 'scripts' can be run on Windows.


Yes. I can use PSExec for windows and can run the DOS commands on a remote machine from Java.
However, I was thinking that as a non-standard practice.

Hence thought of asking advise.
 
What a show! What atmosphere! What fun! What a tiny ad!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic