How can I get it to print output of inputstream?

Please forgive me for running two similar thread but the other thread ahs strayed from primal concern of coding.
Some help with the code please???
I have set up an inputstream and outputstream to the "ftp process" of java.lang.Runtime I have sent the command "dir" to ftp.
But How can I get it to print all the files etc of the "dir" sent to ftp process?
Also I have just read that it is perhaps better to buffer the STREAMS.
How do I do this for outputsteam? I think I have some clue to do for inputstream with bufferedreader?
import java.lang.*;
import java.io.*;
public class RuntimeFTP{
public static void main(String[] arg){
Runtime rt = Runtime.getRuntime();
String[] callAndArgs = { "ftp.exe", "jaguar.wmin.ac.uk" };
Process process = null;
OutputStream os = null;
InputStream is = null;
String login = "w0109699";
String password = "11041976";
String dircommand = "dir";
byte[] barraylogin = login.getBytes();
byte[] barraypassword = password.getBytes();
byte[] barraydircommand = dircommand.getBytes();
try
process = rt.exec(callAndArgs);
process.waitFor();
System.out.println("Process exit code is: " + process.exitValue() );
catch(IOException e)
System.err.println("IOException starting process!");
catch(InterruptedException e)
System.out.println("Interrupted waiting for process!");
try
os = process.getOutputStream();
os.write(barraylogin);
os.write(barraypassword);
os.write(barraydircommand);
catch(IOException io)
System.out.println("io exception write to outputstream");
try
is = process.getInputStream();
while (is.read() != -1)
How can I print the data to the user
i.e all the data obtained from the "dir" command sent to ftp?????????
catch(IOException io)
System.out.println("io exception read fron inputstream");

the above code does not work so I have abondaned it.
I want to integrate an ftp program into a program I am working on. I have scoured the net for reuse able code and come across a "t or Linlyn ftp program" which claims is easily integrate able into larger applications.
The problem is did does not seem to work and gives me errors. I would be grateful if someone could tell me why I am getting the error, here is the error:
C:\My_DL_Dap\ftp in java>appletviewer t.java
Warning: <applet> tag requires width attribute.
java.security.AccessControlException: access denied (java.net.SocketPermission j
aguar.wmin.ac.uk resolve)
at java.security.AccessControlContext.checkPermission(AccessControlConte
xt.java:270)
at java.security.AccessController.checkPermission(AccessController.java:
401)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:542)
at java.lang.SecurityManager.checkConnect(SecurityManager.java:1042)
at java.net.InetAddress.getAllByName0(InetAddress.java:909)
at java.net.InetAddress.getAllByName0(InetAddress.java:890)
at java.net.InetAddress.getAllByName(InetAddress.java:884)
at java.net.InetAddress.getByName(InetAddress.java:814)
at java.net.InetSocketAddress.<init>(InetSocketAddress.java:109)
at java.net.Socket.<init>(Socket.java:118)
at Linlyn.ftpConnect(t.java:326)
at Linlyn.<init>(t.java:236)
at t.init(t.java:83)
at sun.applet.AppletPanel.run(AppletPanel.java:341)
at java.lang.Thread.run(Thread.java:536)
I would also be grateful if someone could try out the program and tell me if it works for them, then I could determine if it is because ftp clients are being blocked by my server. The ftp program is very small, here is the url:
http://www.afu.com/jdownload.html
1) compile the code
2) fill in everywhere it requests "your-server" "username" and "password"
3) to run appletviewer t.java

Similar Messages

  • Downloaded iTunes 11.0.2.26,the print CD jewel case does not print right,all the songs listed are printed in about a 1/2in. space,how can I get it to print right

    Downloaded iTunes 11.0.2.26,the print CD jewel case does not print right,all the songs listed are printed in about a 1/2in. space,how can I get it to print right

    I recently upgraded to itunes 11.0.1.12 and that fixed the CD Jewel Case Insert song titles problem. Thanks itunes. It's working great!!.

  • PDF's print two sided.  How can I get them to print on single pages?

    PDF's print two sided.  There is no option shown.  How can I get thelm to print on single pages?

    1: Go into iTunes.
    2: Right click on the song and choose 'Get Info' (or press cmd+i on a Mac).
    3: In 'Info' change the album name to the one you want it to go into, when you start typeing it should automatically come up.
    4: Check that the disk number and track number is correct.  It should be automatic.
    4: Press OK.
    You should see it go into the album now.

  • How can I get my network printer to print in color?

    I have a Dell 3110cn color printer on my network. Since I did the Maverick update the printer will no longer print in color only b&w. It's using a generic printer driver. I had no problems before the update. It's a great workhorse printer. How can I get this connected properly?

    Bruce777 solved this for me, thank you Bruce! My printer now works perfectly on my new wifi network!
    Bruce's  instructions, for anyone else having the same issue:
    - delete any previously set up printers
    - scrub old hp software and update software to get the hp 2.8 drivers
    - remove the usb cable from the printer if you have one connected
    - reset the printer network to hpsetup (hold down the power button and press network button 2x and then cancel 3x, release power button.)
    - print out the wireless network test report (hold down the network button and press the update button 2x). verify the network name / ssid is hsetup
    - got to sys prefs > network and change the mac wireless network to hpsetup
    - go to the sys pref > print scan
    - add the HP 8000 printer
    - click on the options and supplies button and click on the Show Printer Webpage
    - click on the networking tab > wireless in the left pane > start network wizard and change the network from hpsetup to your network
    - finish (this page may freeze up.  close the browser)
    - go back to the sys prefs and change the wireless network back to your networt
    - go to the printer and print out the wireless network test report (press network button and update button 2x).  Check that the SSID is your network
    - go to sys prefs > print scan > select your printer > options & supplies > show printer webpage > network info (check ssid and compare to wireless network test report)
    - try printing something to your printer.  It might take a little time the first print.

  • How can I get all the print on my screen to be larger?

    How can I get all of the print on my screen to be larger?

    Thank you for helping me with the size of the print on my screen. The suggestion you made works well with the email font. I really wanted all the print on my computer to be larger. (Some of the print seems to be way too small.) Someone suggested I change the resolution settings. I did this, and changed it to 1024 X 640. That changed the size of the font on the toolbar at the top of the page, and that is what I really wanted, as well as all the other print on my screen. Nonetheless, I would like to thank you for your very helpful and prompt reply to my question.
    Sincerely,
    Wayne10

  • How can I get my Hp printer to download?

    How can I get my HP F380 printer to download?

    Ok, let's try this first...
    Safe Boot from the HD, (holding Shift key down at bootup), run Disk Utility in Applications>Utilities, then highlight your drive, click on Repair Permissions.
    Any devices that previously appeared in your Printer List and Fax List will need to be added again after resetting the printing system.
    Resetting the printing system in Mac OS X 10.5.x+++
        1.    To use the Reset Printing System feature in Mac OS X 10.5.x, follow these steps:
        2.    Choose System Preferences from the Apple menu.
        3.    Choose Print & Fax from the View menu.
        4.    Control-click on list of printers on the left side of the window, then choose "Reset printing system" from the contextual menu. If you don't see a list of printers, Control-click on the text "Click + to add a printer or fax" and select "Reset printing system..." 
   
  As an alternative, if you currently have one or more printers listed, you can Option-click the "-" (Remove printer) button.
    http://support.apple.com/kb/ht1341
    Reboot.
    Then try installing the driver again, I think with the printer plugged in is OK.

  • How can I get gridlines to print on my template that I created in Numbers?

    I am trying to create a template in Numbers and I want the gridlines to print.  The drop downs for x-axis and y-axis under Chart inspector are shaded gray and are not able to be clicked on.  How can I get those gridlines to print?

    Suzy1107 wrote:
    Its a spreadsheet that looks like excel, has two columns at the top and 49 rows at the left side
    You seem to be looking in the Chart Inspector for formatting options for the table. Use the Table Inspector, or the Format Bar for Table Cell Border format options.
    I have circled the border format controls in the Format Bar in the attached screen shot:
    Regards,
    Jerry

  • I have an iPad 3 and when trying to print Pages documents from EpsoniPrint there is a border, how can I get it to print normal without sending it to my Mac?

    I have both quickoffice and pages on my iPad, and when I try to print from either of those through EpsoniPrint they don't print "normal".  And pages prints with a border around it.  How can I adjust that or is there a better app for printing via wireless?  I have an epson 510, so it's wireless capable but not AirPrint.

    If you have a Mac I would recommend that your install Printopia. Here is a link to it:
    http://www.ecamm.com/mac/printopia/
    With Printopia, any printer that you can connect to your Mac will appear on your iPad as long as they are on the same wi-fi network. Try Printopia to see if that border goes away. Good luck!

  • How can I get my wireless printer to join my wifi network?

    Since HP Setup Assistant doesn't work with Mavericks, is there another way to get my wireless printer connected to my new wifi network? This printer (HP Officejet Pro 8000 A809) worked just fine with Mavericks on my old wifi network. But my DSL provider recently installed a new router, so I have a new wifi network, which  works just fine with everything else.
    I was able to get my two Airport Expresses to join my new network, using Airport Utility, but I'm stumped as to how to get my printer to join the new network without the aid of HP Setup Assistant.
    Following the advice of Shlomi, I managed to reset my printer so that it now appears in my list of wifi networks under Devices, as hpsetup. But that's as far as I got. Any help would be most approeciated.
    This question was solved.
    View Solution.

    Bruce777 solved this for me, thank you Bruce! My printer now works perfectly on my new wifi network!
    Bruce's  instructions, for anyone else having the same issue:
    - delete any previously set up printers
    - scrub old hp software and update software to get the hp 2.8 drivers
    - remove the usb cable from the printer if you have one connected
    - reset the printer network to hpsetup (hold down the power button and press network button 2x and then cancel 3x, release power button.)
    - print out the wireless network test report (hold down the network button and press the update button 2x). verify the network name / ssid is hsetup
    - got to sys prefs > network and change the mac wireless network to hpsetup
    - go to the sys pref > print scan
    - add the HP 8000 printer
    - click on the options and supplies button and click on the Show Printer Webpage
    - click on the networking tab > wireless in the left pane > start network wizard and change the network from hpsetup to your network
    - finish (this page may freeze up.  close the browser)
    - go back to the sys prefs and change the wireless network back to your networt
    - go to the printer and print out the wireless network test report (press network button and update button 2x).  Check that the SSID is your network
    - go to sys prefs > print scan > select your printer > options & supplies > show printer webpage > network info (check ssid and compare to wireless network test report)
    - try printing something to your printer.  It might take a little time the first print.

  • How can I get iPhoto to print date on photo?

    is it possible to get iphoto to print the date on a photo?

    No.
    In order of price here are some suggestions:
    Seashore (free)
    The Gimp (free)
    Graphic Coverter ($45 approx)
    Acorn ($50 approx)
    Pixelmator ($50 approx)
    Photoshop Elements ($75 approx)
    There are many, many other options. Search on MacUpdate. You can set Photoshop (or any image editor) as an external editor in iPhoto. (Preferences -> General -> Edit Photo: Choose from the Drop Down Menu.) This way, when you double click a pic to edit in iPhoto it will open automatically in Photoshop or your Image Editor, and when you save it it's sent back to iPhoto automatically. This is the only way that edits made in another application will be displayed in iPhoto.

  • How can I get two-sided print on Canon Pixma IP3000  with Snow Leopard?

    I've just upgraded to Snow Leopard and find that duplex printing is no longer available. How do I get it back?

    You should have a menu item called Duplex Printing and Margin. This is part of the v10.26 driver that is provided via Software Update.
    This was the same menu item that was available with the v4.8.3 driver that was included with OS X 10.5. If you were not using this menu previously with 10.5 then maybe you were using the iP3000 Gutenprint driver?
    Pahu

  • How can I get my Canadian printer to accept German cartridges?

    I am in Germany with my printer and I just purchased cartridges for my HP Photosmart 3210 All-in-One printer, which is out of warranty. I get the message from my printer that it will not accept these cartridges. From the HP site, I learn that even though the box says these cartridges are compatible with the 3210, this is a lie, because European cartridges are not compatible with North American printers.
    There is apparently a simple procedure that the support rep can do with me to set up my computer to accept these cartridges. But there is no possibility for me to call, there is no phone number, I can buy extended support but this is unfair, it says on the box that these cartridges are compatible with the 3210, I paid 50 Euros for the cartridges, I put one in the printer so I cannot return them now, and I have no way to get in touch with HP. What kind of service is this????

    I have to agree. I'm in Switzerland...have to use my Swiss com phone or my Verizon-USA phone, both of which will charge me HUGE (like $1.50/min.) to call support in the USA. I did call the Swiss one and the message was in German...and of course I speak English and some Spanish. I looked up the compatible product online before I bought the cartridges-which are VERY expensive in Switzerland. I'm in the middle of my dissertation-trying to print out data infomration so I can write about it...but can't.
    Why can't I do this via chat? It won't let me contact online tech support because my warranty for the printer has expired...BUT the cartridges have one as well and they are BRAND NEW!! The link the regular chat person supplied to me  takes me to to the Swiss page in...you guessed it...GERMAN.
    Anyone know how to get help onine to regionalize??????

  • How can I get a newEpson Printer Utility?

    I deleted all the printers except my Epson Stylus Photo 820. I was trying to create more room on my hard drive and fix the slow down I have been experiencing. I also emptied the trash.
    Since then I can't clean my printer ink jets because the Printer Utilility no longer works.
    I tried getting the print drivers from my Tiger installation disc, but I can't because the OS on my computer is newer than on the disc.
    The printer works, but the output is poor because the jets need cleaning.

    You can download the drivers here. (Be sure to select the appropriate one for your OS version and Intel vs. PPC).
    You do not need the Print Utility to clean the nozzles - you can run a nozzle clean directly from the printer, by pressing and holding the Maintenance button (the middle one of the three) for 3 seconds.
    Hope this helps...

  • How can I get a frame accurate output to tape using Premiere Pro CS6 and a Blackmagic Decklink Extre

    i can set the frame offeset inside the Export to tape tool (which BTW is horrible, you can't scrub, you MUST use ":" or ";" in the timecode fiellds or the deck just goes to the beginning of the tape etc), but I'm still 12 frames off.  there is a frame offset in the Blackmagic device control settings, but that does nothing for the output to tape.
    I don't want to have to export a quicktime and then open it in Final Cut to output to tape, the whole object is to get away from FCP because it's a horrible ghorrible program.....TIA
    This particular system is an 8core Nehelem Mac Pro with 32GB of ram, OS 10.7.5. 

    I don't know what AppleTV can handle as far as bit rate is concerned, but increase the bit rate as high as it will let you. You are taking DV which is 25Mb/s and compressing it. If you're making an H.264, you should get great results needing no more than 6Mb/s. Bear in mind, the higher the bit rate, the larger the file size.

  • How can I get Mac to print wirelessly?

    I have a g5 iMac and a g4 IMac that connect to the internet via a wireless Belkin router. I have two HP printers (a laserjet and an officejet) connected with an ethernet cable to the router.
    The g4 machine quickly identified both printers as "Internet printers" so I added them and was able to print wirelessly to both printers.
    The g5 machine is able to print wirelessly to the officejet, but does not "see" the laserjet when I attempt to add it. I have tried everything, including setting up the printer manually by entering its IP address, and I can add the printer this way but I can't print.
    What the g5 sees is both printers under "Bonjour Shared" kind, but if I select these and add them, it is unable to print (I either get a message that says "connecting to printer", which can last for hours, or I get a message indicating "Job accepted" but still nothing prints).
    Before I switched Internet providers, both Macs could print wirelessly to both printers (I recently switched from a DSL provider to a cable provider, and then back to my old DSL provider).

    I am confused. Neither iMac of which you speak will run Mac OS X 6.4 Snow Leopard, but that is the OS you profile.
    What versions of Mac OS X are these old Macs actually running? Do you think that folks who have these Macs would be a better crowd to ask for assistance than folks with architecturally different Macs? We here have Intel Macs. Most of us have Snow Leopard. You are asking for help with two old PPC Macs, neither if which can actually run Snow Leopard.
    Just an idea.
    Dah•veed

Maybe you are looking for