• 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
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

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

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 1970
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Bartender
Posts: 1638
IntelliJ IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic