Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Program stop
- try {
- String body = hce.post("Request URL",
- "comand+data+params");
- System.out.println(body);
- if (body.contains(""status":200")) {
- System.out.println("Success");
- }
- } catch (IOException ioe) {
- ioe.printStackTrace();
- }
- try {
- Path path = Paths.get("CommandsData");
- int lineCount = (int) Files.lines(path).count();
- System.out.println("Number of lines:" + lineCount);
- String[] strBuf = new String[lineCount];
- FileReader fr = new FileReader("CommandsData");
- BufferedReader reader = new BufferedReader(fr);
- for (int i = 0; i < lineCount; i++)
- {
- strBuf[i] = reader.readLine();
- System.out.println(strBuf[i]);
- }
- reader.close();
- Random random = new Random();
- System.out.println("Random strings");
- System.out.println(strBuf[random.nextInt(lineCount)]);
- System.out.println(strBuf[random.nextInt(lineCount)]);
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
Add Comment
Please, Sign In to add comment