Hulihrach icon

Untitled

Hulihrach | PRO | 07/11/14 08:25:42 PM UTC | 0 ⭐ | 321 👁️ | Never ⏰ | []
Java |

890 B

|

None

|

0 👍

/

0 👎

import java.io.*;
 
public class Main {
 
    public static void main(String[] args) {
        long totalMemory = run.totalMemory();
        String[] getServersCommand = {"ls","","servery/*/"," | grep .jar"};
        Runtime run = Runtime.getRuntime();
        Process pr = null;
        try {
            pr = run.exec(getServersCommand);
        } catch (IOException e) {
            e.printStackTrace();
        }
        try {
            pr.waitFor();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        BufferedReader buf = new BufferedReader(new InputStreamReader(pr.getInputStream()));
        String line;
        try {
            while ( ( line = buf.readLine() ) != null )
            {
                System.out.println(line);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎