File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes How to unzip a file on a remote unix server using java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to unzip a file on a remote unix server using java" Watch "How to unzip a file on a remote unix server using java" New topic
Author

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

Jobin Babu
Greenhorn

Joined: Oct 20, 2006
Posts: 7
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 ]


SCJP 5 - SCWCD 5
Peter Chase
Ranch Hand

Joined: Oct 30, 2001
Posts: 1970
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.


Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.
Jobin Babu
Greenhorn

Joined: Oct 20, 2006
Posts: 7
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

Joined: Feb 25, 2007
Posts: 1638

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


apigee, a better way to API!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to unzip a file on a remote unix server using java
 
Similar Threads
UnZipping Occurs in Server System only
Uploading and using a file from a web page
ftp
install junit on unix box
applet-servlet communication