Win a copy of Pro Spring MVC with WebFlux: Web Development in Spring Framework 5 and Spring Boot 2 this week in the Spring forum!
  • 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
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

Convert proc.HasExited from C#.Net to Java

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I have a C#.Net console app code that transfers files between linux and windows ftp servers.

The code's behavior is that I automatically open a console to display status of the file transfer. While transferring files to and from the windows server, I need to display an indicator that the file transfer is on-going (using symbols that look like they are moving or turning) . These symbols are as follows : "|" --> "/" --> "-" --> "\" --> "|"

There had been no problem displaying the said "indicator/symbols" in C#.Net using the following codes :



My problem started when I converted the said codes into java using the following :



Above code is perfectly working.
Problem is I don't know how to display the "animated" characters anymore.
I suddenly don't know (and I badly need help on) how to convert this :



Do you have any idea as to what I can use for the line "if (proc.HasExited)" in java so that I could move forward?

Sorry for the long explanation.
I really, really need help.

Thank you very much in advance!
 
Sheriff
Posts: 22208
117
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can use Process' waitFor method. But before you do, read When Runtime.exec() won't.

I also suggest using ProcessBuilder instead of Runtime.exec to start your Process.
 
Marshal
Posts: 72969
330
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Question too difficult for this forum, so I shall move it.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic