Results 1 to 1 of 1
Thread: java rsh header
- 04-05-2012, 04:47 AM #1
Member
- Join Date
- Mar 2012
- Posts
- 18
- Rep Power
- 0
java rsh header
hi,
i have a simple program which will go to other machine using rsh
code :
import ????????????
public class Rsh extends Rexec {
Rsh rsh = new Rsh("192.168.1.104", "pc2", "nithia","ls -la", false);
try
{
rsh.connect();
rsh.execute();
InputStream input = rsh.getInputStream();
int in = input.read();
StringBuffer buffer = new StringBuffer();
if(in == 0)
{
buffer.append("Success! Remote host returned: \n");
}
else
{
buffer.append("Failure! Remote host returned: \n");
}
while((in = input.read()) != -1)
{
buffer.append((char)in);
}
System.out.println(buffer.toString());
}
catch(Exception e)
{
System.out.println(e);
}
}
it is a very simply program but i don't know what header need to be import .
can anyone tell me about this ? thanks in advance for the reply
Similar Threads
-
Jaxb2.0 dont set the header with java version 1.6.0_10
By jainshasha in forum XMLReplies: 0Last Post: 07-11-2011, 06:58 AM -
How to create a header from an sql select query in java
By renu in forum New To JavaReplies: 1Last Post: 06-21-2011, 04:55 PM -
Getting X-Mailer header in java imap mail api
By goelvivek in forum NetworkingReplies: 0Last Post: 04-09-2011, 12:24 PM -
java.io.StreamCorruptedException: invalid stream header:EFBFBDEF on linux
By lachhman das in forum Advanced JavaReplies: 0Last Post: 05-17-2010, 02:45 PM -
java.io.IOException: invalid header field
By osval in forum Advanced JavaReplies: 1Last Post: 08-06-2007, 11:09 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks