I tested it & wrote the following code
 Process p;
 try {
 p = Runtime.getRuntime().exec("appcfg.cmd --no_cookies update 
..\\HelloGAE\\war");
                String line;
                   OutputStream outputStream = p.getOutputStream();

         PrintStream printStream = new PrintStream(outputStream);
         printStream.println("[email protected]");
         printStream.flush();
         printStream.println("xxxx");
         printStream.flush();
         printStream.close();
         BufferedReader input = new BufferedReader(new InputStreamReader(p.
getInputStream()));
         while((line=input.readLine()) != null){
             System.out.println(line);
         }
                 input.close();

 } catch (IOException e) {

 // TODO Auto-generated catch block
 e.printStackTrace();
 } 


and the o/p is as the following
Beginning interaction for server default...
Email: Password for [email protected]: 
java.lang.NullPointerException
Unable to update app: null

this means that the email is read, while the password is not read, because 
it throws Null pointer Exception.
so do u have a solution for this problem.


On Friday, June 28, 2013 5:27:56 PM UTC+2, Vinny P wrote:
>
> On Friday, June 28, 2013 4:42:22 AM UTC-5, [email protected] wrote:
>
>> many thanks. I did as u told me.
>> and now I succeed in running appcfg using Runtime class. however, after 
>> the appcfg.cmd is run, it prompt user to enter his Email and Password & I 
>> need my java application to give the appcfg the required input (i.e., Email 
>> and password). so I don't know how I can do this?? 
>>
>>
> You need to extract an InputStream and OutputStream from the Runtime 
> Process, then use those streams to read and write from/to AppCfg. Here's a 
> code example: http://stackoverflow.com/a/7715334 . Basically you extract 
> a Process object from Runtime.exec(), then the Process object has access to 
> the error, out and in streams (documentation: 
> http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Runtime.html ).
>
>
> -----------------
> -Vinny P
> Technology & Media Advisor
> Chicago, IL
>
> App Engine Code Samples: http://www.learntogoogleit.com
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to