Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to unzip a file on a remote unix server using java

 
Jobin Babu
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wanted to zip a file on my local system, then I have to upload the file on server and finally i have to unzip the file on server.
I have written code to zip the file on my local system and upload the file through FTP on server and it was working. Now i wanted to unzip the file on a remote unix server and if there is some exception while unzipping the file, i wanted to say to the client system. I know how to unzip a file on my local system but i do not know how to implement on server side from client machine.

Can any one please tell me how to unzip the file on a remote unix server using java from client system. Is there any API available to unzip a file on server side from client system.?

Please help me on this

Thanks in advance
[ July 01, 2008: Message edited by: Jobin Babu ]
 
Peter Chase
Ranch Hand
Posts: 1970
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java cannot magically unzip a file on a remote system, to which it does not have direct filesystem access. And I presume you do not have such access, or you would not have used FTP to upload the file.

Unix machines have various facilities for allowing remote systems to execute commands. For instance, "rsh". However, these are often disabled, due to the security risk.

Alternatively, if you can install software on the remote Unix system, you could install a Java program whose job is to do unzipping. You could send requests to it via a TCP socket (possibly via higher-level protocol like RMI, CORBA, Web service...).

If there's no built-in and enabled remote-execution service on the Unix machine, and you can't install your own on it, you're stuck.
 
Jobin Babu
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply Peter.

Can we able connect the unix server through telnet using java and unzip the file on the server. Unzipping a file works on unix server using unzip command.
Can you please tell me how to make a connection through telnet using java and execute a command through telnet?
 
Nitesh Kant
Bartender
Posts: 1638
IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jobin:
Can you please tell me how to make a connection through telnet using java and execute a command through telnet?


Googling "java telnet" gives a lot of open source/freeware utilities to do telnet/ssh using java.
Do some research and let us know which one you chose and why
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic