Advertisement
Guest User

Untitled

a guest
Mar 27th, 2017
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. @RestController
  2. public class MyRestController {
  3. @RequestMapping(path = "some/path", method = RequestMethod.POST)
  4. public StubObject get(@RequestBody StubObject stubObject) throws IOException, InterruptedException {
  5. ProcessBuilder pb = new ProcessBuilder(stubObject.getParameters());
  6. Process p = pb.start();
  7. String result = IOUtils.toString(p.getInputStream(), "UTF-8");
  8. p.waitFor();
  9. return new StubObject(result);
  10. }
  11. ...
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement