It's not a secret anymore!
The moose likes Java in General and the fly likes Remote File integrity Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Remote File integrity" Watch "Remote File integrity" New topic

Remote File integrity

Arun Suresh

Joined: Sep 02, 2008
Posts: 18
Hi all,

I have been checking the file integrity(calculating SHA1 cheksum) of tar files in linux server in my java code by using linux sha1sum.

Now i have to implement the same for tar files stored in remote SFTP servers (eg freeFTPd or linux native) without copying them to this server or streaming them to stdin.
I can do it after copying or by streaming to stdin of this server.but any method in which i can remotely do it?
any pointers?

Martijn Verburg

Joined: Jun 24, 2003
Posts: 3275

There's no way to do this remotely that I can think of .

Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24199

If you have sftp access, then you probably have ssh access. Connect with ssh, and run the "sum" command (or any other command of your choosing) on the file.

[Jess in Action][AskingGoodQuestions]
Arun Suresh

Joined: Sep 02, 2008
Posts: 18
thanks for the help.

connecting ssh on linux SFTP server is fine. but i need to support windows SFTP server also. how do i run any command remotely on files in that location?

any help is appreciated.

I agree. Here's the link:
subject: Remote File integrity
It's not a secret anymore!