Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static boolean isFileExistsWithWait(String filePath, int timeout) {
- int counter = 0;
- File file = new File(filePath);
- while (!file.exists() || counter < timeout * 1000) {
- TimeMeasure.delay(POLLING_TIMEOUT, TimeUnit.MILLISECONDS);
- counter = + POLLING_TIMEOUT;
- }
- return file.exists();
- }
- // передават ьс миллисекундах
- public static boolean isFileExistsWithWait(String filePath, int timeout) {
- int counter = 0;
- File file = new File(filePath);
- while (!file.exists() || counter < timeout) {
- TimeMeasure.delay(POLLING_TIMEOUT, TimeUnit.MILLISECONDS);
- counter = + POLLING_TIMEOUT;
- }
- return file.exists();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement