Using wget in java application

Hello.
I want use 'wget' command from my Java application
for 'wget' i created command as String type.
Here is it
String url_str=wget --post-data "year=2009&month=08&day=01&time=0&profile=1&start=0&stop=1000&step=50&par=&format=0&vars=01&vars=02" http://testsite.com/cgi/script.cgi -O /home/user/test_wget.txt
then i use it in exec method
try{
Runtime rt = Runtime.getRuntime();
Process p = rt.exec(url_str);
p.waitFor();
BufferedReader r = new BufferedReader(
new InputStreamReader(p.getErrorStream()));
String s;
while ((s = r.readLine())!=null) {
System.out.println( s );
r.close();
catch (IOException e){
     // TODO Auto-generated catch block
     e.printStackTrace();
catch ( InterruptedException e ) {
     e.printStackTrace();
after running the file test_wget.txt hold
Error
Wrong key: not alpha/numerical characters
however, if i use my url_str from Linux command line
test_wget.txt is hold usefull data.
So, how working correct with wget from Java application?
Thanks for any replys

So, how working correct with wget from Java application?You don't use it; you use Apache HttpClient in stead which can do exactly the same and more without you needing to call platform specific command line tools.
In any case if you must go down this path, read this article front to back:
http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html

Similar Messages

  • Tutorial to use  JFreeChart in Java Application

    Dear Friends,
    Can anyone Please help me to provide a complete tutorial on using JFreeChart in Java Applicaion.That is, How can I use JFreeChart in Java Application.
    Thank u.

    http://www.jfree.org/jfreechart/devguide.html

  • Can we wrap a RFC as webservice  and use from external java application ?

    Hi Friends ,
                         Our scenario is  call a webservice ( wrapped form of RFC)  from a external  java application  which will pass the input to that webservice and get back the result  .
                          How XI will play a role here ?
                          Can we wrap a rfc as web service  ?
                           Any blogs for that ?
                          Can you please give a brief details about this ?
                          Expecting yoour asap
    Best Regards .,
    V.Rangarajan

    Hi
    Can we wrap a rfc as web service ?
    Yes.
    <i>To use the SAP Web AS 6.40 you need to build a wrapper in the 6.40 system. This is a remote function call (RFC) enabled function module with the same interface or a similar interface that internally calls the required RFC-enabled function module in the old 4.6x system via RFC. The wrapper then can be exposed to the outside world as a Web service. Another option is to use the Integration Broker capabilities for calling Web services in an older system.</i>
    How XI will play a role here ?
    XI will pass the input to the external java application and get back the result to the webservice
    regards
    krishna

  • Pl help ! ! Opening a servlet URL using stand aline java application

    Hi Guys, I have a standalone java application. This application will get executed after some by some thread. What I want to do is when this java application is executed, automatically open a URL in internet explorer which is of my servler/jsp and pass the parameters to this servlet/jsp. This servler jsp will intern use EJB and other services to get the data and display it.
    How should I automatically open a IE window and pass parameters using this standalone application.
    Pl help ! ! !
    thanks , Ava

    do you want to open internet explorer, or just access the servlet without internet explorer?
    if you want to use internet explorer, you'd want to use
    Runtime.exec,
    if you want to access the Servlet w/o ie, you would use
    URL, and HttpURLConnection classes

  • How to use Entrust with java application on unix platform

    Hi all,
    i have question regarding the use of Entrust with java application on unix
    1)I want to use Entrust for encryption/decryption of the file in my core java application on unix platform.
    What should be requiremnet for the same and how it is implemented?.
    2) I want to Use Entrust for Authentication purpose in my java based web application on unix platform.
    What are requirements for Entrust Authentication and how it is implemented ?

    any one has solution?

  • How to use pda with java application

    hi all,
    i m new to J2ME technology. i have never worked on it. now i want to create java application which communicates with PDA.
    can anyone pls provide me the tutorial link for the same. i m looking in the google but till now i have not got any thing which will give me example of java applicatiion with PDA.
    pls help me out guys.
    thnx in adv.
    regards
    ritu

    hello all,
    i am new to PDA developemt
    i want to create a application in java for PDA using win CE tomcatspring framework
    pls send me some site that have sample code for creating applincation for PDA using java.
    thanks

  • Reducing memory use in large Java application

    Hello,
    I've read through many of the threads on memory optimization in Java and am still puzzled about one thing:
    I've got a large Java application that uses around 45,000 kb of memory (according to the Windows Task Manager) when it first starts up. If I reduce the program window and then restore it, the memory use comes down to about 25,000 kb, and stays down, even when the program is in regular use.
    Two questions about this:
    1) Why does reducing and restoring the program have this effect?
    2) Is there any way I can duplicate this effect automatically, so that the program starts off using the smaller amount of memory?
    And a final question: does anyone have any recommendations regarding the several commercial products that are available for optimizing memory use in Java apps?
    Many thanks!
    David Porter

    this effect (minimize application window, rsize it again) is not a Java but a Windows problem. It also works for pure WIndows applications - try it out!
    reducing memory size is not a question of 3rd party java apps or APIS but the JVM and the coding style of the application programmer.

  • Printing PDF by using ActiveX in java application

    Hi All,
    I'm working on an application that creates pdf documents. The aim is to make a silent printing of these documents so without any user action.
    I tried several solution. I tried PrintJob from javax.print and Desktop from java.awt. I'm not satisfy by these both solution.
    So now I would like to use Acrobat through the COM interface.
    Could you indicate to me where I can find a documentation or some examples of implementtion about this interface and its usage into java. I googled but I found not example of implementaiton ?
    Thanks
    S.

    Ok .... .
    I tried in java by using jacob the following code to use Acrobat but I found no information regarding the call of the Acrobat functions (open file, print file, ...)
    My exemple is :  
    ComThread.InitSTA();
    ActiveXComponent oAcroPDF = new ActiveXComponent("AcroPDF.PDF");
      try {
       oAcroPDF.invoke("LoadFile", fileName);
       oAcroPDF.invoke("PrintAll");

  • Probleme with my InterMedia used in my JAVA application

    Hi,
    I wanted to import my OrdImage to my Java code using this code :
    OrdImage imgObj = (OrdImage) rset.getORAData(1, OrdImage.getORADataFactory() );
    But it doesnt know the method OrdImage.getORADataFactory(), when I checked all the methods available in my OrdImage Class, there is no getORADataFactory(), there is only getFactory() which didnt work, is there other methods or codes to deal with my probleme ?
    Thanks

    Try to reset the phone by holding the sleep and home button for about 10sec, until the Apple logo comes back again. You will not lose any data by resetting, but it can cure some glitches.
    If this does not help, setting it up as new device would be the next step:
    How to erase your iOS device and then set it up as a new device or restore it from backups

  • How to use beans in java application server 8.1?

    i created a bean to use in a jsp page. then i copied the jsp page to "domains/domain1/docroot " directory and the class file to the "domains/domain1/lib/classes" folder. But now i can only access the jsp page the bean is not included in it. how can i do this without using deploying tool?

    Can you repost this question in the AppServer forum?
    http://swforum.sun.com/jive/category.jspa?categoryID=35

  • How to access(connect) BI Data in webdynpro for java applications

    Hi ,
    is there any way to access and display the BI data in portal using webdynpro for java applications like we did in Visual composer.
    if not how to integrate the BI data in webdynpro applications ?
    Regards,
    Govindu

    Hi,
    Yes there are ways to do it. But may your scenario and the scenario for which I have done may differ.
    You can use openhub to get the data in a flat file and then read it into weddynpro through a java service OR
    You can use DBlink(which i have done).
    Please refer the link below:
    [Link|Data from BW to Oracle.;
    This I have done in NW04s. Not sure whether a better solution is available in the newer release.
    Hope it helps.
    Regards,
    Manoj

  • How to get Formatted Mail Content through Java Application

    I am using a mail sending function in my applet code which is listed below:
    Main content is fetched from a format tool bar in JSP Page and it is passed as parameter to applet and it is used inside the mail content.
    Same content when passed and executed in a JSP page, the formatted content is not lost and it is included in mail content as what it is fetched from Format Tool Bar.
    Format is lost when it is used inside the Java Application mail sending function.
    The below code I have used to send mail:
    package com;
    import java.util.HashSet;
    import java.util.Properties;
    import java.util.Set;
    import javax.mail.BodyPart;
    import javax.mail.Message;
    import javax.mail.Multipart;
    import javax.mail.Session;
    import javax.mail.Transport;
    import javax.mail.internet.InternetAddress;
    import javax.mail.internet.MimeBodyPart;
    import javax.mail.internet.MimeMessage;
    import javax.mail.internet.MimeMultipart;
    class mailsendClass
    public void sendmail(String from,String host,boolean debug,String msgText)
         try
              Set tomailsid = new HashSet();
              Set ccmailsid = new HashSet();
              //to mail ids           
              tomailsid.add("[email protected]" );          
              tomailsid.add("[email protected]" );
              tomailsid.add("[email protected]" );
              //cc mail ids
              ccmailsid.add("[email protected]" );
              ccmailsid.add("[email protected]" );
              String mailarray[]= (String[])tomailsid.toArray(new String[tomailsid.size()]);
              String ccmailID[]= (String[])ccmailsid.toArray(new String[ccmailsid.size()]);
              Properties props = new Properties();
              //props.put("mail.smtp.port","425");
              props.setProperty("mail.smtp.host", host);
              if (debug) props.setProperty("mail.debug", ""+debug);
              Session session = Session.getInstance(props, null);
              session.setDebug(debug);
              String mailsubject = "Mail Subject";
              // create a message
              Message msg = new MimeMessage(session);
              msg.setFrom(new InternetAddress(from));
              javax.mail.internet.InternetAddress[] toAddress=new javax.mail.internet.InternetAddress[mailarray.length];
              for (int i=0;i<mailarray.length ;i++ )
              toAddress=new javax.mail.internet.InternetAddress(mailarray[i]);
              System.out.println ("id inside to address loop " + i + " is "+ mailarray[i]);
              System.out.println ("toAddress " + i + " is "+ toAddress[i]);
              msg.setRecipients(Message.RecipientType.TO, toAddress);
              msg.setSubject(mailsubject);
              try
                   javax.mail.internet.InternetAddress[] CCAddress=new javax.mail.internet.InternetAddress[ccmailID.length];
                   for (int i=0;i<ccmailID.length ;i++ )
                        CCAddress[i]=new javax.mail.internet.InternetAddress(ccmailID[i]);
                        System.out.println("CC Array is ===> " +CCAddress[i] );//          
              msg.setRecipients(Message.RecipientType.CC,CCAddress);
              catch(Exception ss)
                   System.out.println("CC mail Exception is ====>"+ ss);     
                   msg.setSentDate(new java.util.Date());
    //          Multipart multipart = new MimeMultipart("relative");
                   Multipart multipart = new MimeMultipart("alternative");
              BodyPart messageBodyPart = new MimeBodyPart();
              messageBodyPart.setContent(msgText, "text/html");
    //          messageBodyPart.setContent(msgText, "text/plain");
              multipart.addBodyPart(messageBodyPart);          
                   msg.setContent(multipart);
              Transport.send( msg );
         catch (Exception e)
              System.out.println("The Exception is ------>"+e);
    public class SendMail {
    public static void main(String[] args)
         System.out.println("before Mail Send ");
         mailsendClass mail = new mailsendClass();
         String from="[email protected]";
         String host="172.16.2.6";
         String msgText="<p><strong>Index</strong><br />I have posted the following PDFs (Second Pages) as mentioned to start producing the Index:<br />• Engage<br />• Chapters 1–6<br /><a title='ftp:///Index' href='ftp://index/'>ftp:///Index</a><strong><br />XML Coding - Files with errors</strong><br />• Engage<br />• Chapters 1–6<br /><a title='ftp:///XML_Coding_Need%20Fixing' href='ftp://xml_coding_need%20fixing/'>ftp:///XML_Coding_Need%20Fixing</a></p>";
         mail.sendmail(from,host,true,msgText);
         System.out.println("after Mail Send ");
    Content placed in format tool bar is as follows:
    Index
    I have posted the following PDFs (Second Pages) as mentioned to start producing the Index:
    • Engage
    • Chapters 1–6
    ftp:///Index
    XML Coding - Files with errors
    • Engage
    • Chapters 1–6
    ftp:///XML_Coding_Need%20Fixing
    Content fetched from format tool bar inside JSP page is as follows:
    <p><strong>Index</strong>
    I have posted the following PDFs (Second Pages) as mentioned to start producing the Index:
    &bull; Engage
    &bull; Chapters 1&ndash;6
    <a title="ftp:///Index" href="ftp://index/">ftp:///Index</a><strong>
    XML Coding - Files with errors</strong>
    &bull; Engage
    &bull; Chapters 1&ndash;6
    <a title="ftp:///XML_Coding_Need%20Fixing" href="ftp://xml_coding_need%20fixing/">ftp:///XML_Coding_Need%20Fixing</a></p>
    Fetched Content inside Java Application through parameter and it will use as input for mail content is as follows:
    <p><strong>Index</strong>
    I have posted the following PDFs (Second Pages) as mentioned to start producing the Index:
    • Engage
    • Chapters 1–6
    <a title="ftp:///Index" href="ftp://index/">ftp:///Index</a><strong>
    XML Coding - Files with errors</strong>
    • Engage
    • Chapters 1–6
    <a title="ftp:///XML_Coding_Need%20Fixing" href="ftp://xml_coding_need%20fixing/">ftp:///XML_Coding_Need%20Fixing</a></p>
    Actual mail received after Java Application execution is as follows:
    Index
    I have posted the following PDFs (Second Pages) as mentioned to start producing the Index:
    ? Engage
    ? Chapters 1?6
    ftp:///Index
    XML Coding - Files with errors
    ? Engage
    ? Chapters 1?6
    ftp:///XML_Coding_Need%20Fixing
    Unicode characters in the mail content are replaced by “?”.
    In the function listed above I have used the MIME Setting as
    Multipart multipart = new MimeMultipart("alternative");
    I have tried by using “relative” MIME format also as
    Multipart multipart = new MimeMultipart("relative");
    But I am not getting the actual format passed as input to the Java Application in the mail content.
    Can anybody let us know how to overcome this problem?
    Thanks in advance.

    You need to really understand how the different multiparts work instead of just guessing.
    But for your application, you don't need a multipart at all. Just use msg.setText(msgText, null, "html");
    Although that doesn't explain your problem, it will simplify your program.
    How are you determining that the mail received doesn't have the formatting? Are you viewing it in a
    mail reader (e.g., Outlook)? Or are you fetching it with JavaMail?
    Are you using an Exchange server? Exchange will often reformat your message to what it thinks you meant.

  • Packaging dll files in java application

    Hi all,
    I am working on an application where I use some dll files from my java application. Now I would like to package the application so that end users can easily install and use them. the Java application is currently packaged as a jar file. How to i package the dll files? Where should I copy these files to on a target system.
    I tried packaging my application and installing it. But I get the following error: "Exception in thread "main" java.lang.UnsatisfiedLinkError". How do I resolve this error.
    Thanks for advance,
    Abdel

    Make sure that the dll files is in the library path.
    VM option example:
    -Djava.library.path=.\dll

  • Thai font support on solaris 2.6 sun os 5.6 sparc for java application

    how to install new fonts on solaris 2.6 sparc sun os 5.6. what are the necessary changes we have to make inorder to use new fonts in a java application. the requirement is to install thai language fonts that will be used by a java application to print online/batch job using text/postscript documents. advise on how to do it. kindly mail me at <[email protected]>
    thanks in advanse

    It is recommended for you to upgrade the JDK version to the J2SE 1.2.x versions which provides better support for the Thai fonts.
    You can download the localised version of Thai JDK 1.2.x for Solaris from :
    http://www.sun.com.sg/developers/thailand/index.html

  • Java applications on EP server

    Hi EP Experts,
    I would like to know following things.
    1. How do I migrate Java applications on Portal server? (one way using JAVA PDK)
    2. What are the different problems that are faced during migration of Java code to EP server
    3. Do we need to import specific libraries that are used specific for Java applications and are not available with WAS/EP?
    If any one has similar migration experience please share the problems that are faced and if possible solutions you got for any.
    Thank you,
    Chintamani Chitnis

    Hi,
    Check this document
    http://help.sap.com/saphelp_erp2004/helpdata/en/88/bdfc3f48ecc742e10000000a1550b0/frameset.htm
    Regards,
    Ganesh N

Maybe you are looking for

  • MIS report : Daily Cumulative Report for contract in SD module

    Hi All,            Do you have any idea about MIS report in SD module.actually my requirement is that i have to generate daily cumulative report for contract. that means at time i am selecting ten plants and correspondingly sum of  total quantity,ave

  • Dynamically embed  View in ViewContainerUIElement

    Hi all, Iam trying to create a ViewContainerUI element at runtime and want to add an existing view to the ViewContainer dynamically. Please let me know how can I embed a view dynamically in a view container. Component Controller : //Dynamic view cont

  • Accounts Payable Rapid Mart Performance Issue

    We are currently running the SAP AP Rapid Mart 3.2 and facing a performance issue on the SAP side for the data flows: DF_VendFinDocFactOpenDelta_SAP and DF_VendFinDocFactClearDelta_SAP.  These data flows pull from the same tables and one of them bein

  • How do you date and time stamp pictures and videos using a EOS Rebel T3?

    I am needing to utilize date and time stamping on videos and photos in my work.  The pictures and videos must display time, a date, and reference number.  I have gone through the cd, owner's manuel and software manuel and I am unclear if I can perfor

  • Help Required - Need to add current user as superuser

    Is there a way to add my user account to the superuser group in Solaris 10? I need to install some pretty heavy software which involves unpacking and repacking war files so would like to be superuser throughout. I am using a VM and am not concerned w