I am trying to get all files and folders from /data/data folder in rooted android device from java. I have command that works correctly in windows cmd:

```
adb -s <device name> shell su -c ls /data/data/

```

[![example](https://i.stack.imgur.com/6y68K.png)](https://i.stack.imgur.com/6y68K.png)

I try to execute this command in java, everything seems ok but the line 

```
p.waitFor(); 

```

never returns.

```
public ArrayList<String> execute(String command) {
    ArrayList<String> line = new ArrayList<String>();
    try {
        ProcessBuilder pb = new ProcessBuilder(adbPath + "adb.exe ", command);
        pb.redirectErrorStream(true);
        Process p = pb.start();
        p.waitFor();
        BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream()));
        String tmp;
        while ((tmp = in.readLine()) != null) {
            line.add(tmp);
        }
        line.removeAll(Arrays.asList("", null));
    }
    catch (Exception ex) {
        ex.printStackTrace();
    }
    return line;
}
//adbPath = C:\Users\redra_000\AppData\Local\Android\sdk\platform-tools\
//command = -s E7AZCY935671 shell su -c ls /data/data/

```

What am i doing wrong?