public static void main(String[] args) throws IOException, InterruptedException, NumberFormatException {
...
String url = args[0];
int startHodiny = Integer.parseInt(args[1]);
int startMinuty = Integer.parseInt(args[2]);
int stopHodiny = Integer.parseInt(args[3]);
int stopMinuty = Integer.parseInt(args[4]);
while (true) {
...
if (startHodiny == actHodiny && startMinuty == actMinuty) {
...
start(url, stopHodiny, stopMinuty);
} else {
...
}
}
}
public static void start(String address, int h, int m) throws IOException {
URL url = new URL(address);
...
}