Package java.nio.file

Examples of java.nio.file.WatchKey.reset()


        handleFileChange(kind,
                         new File(iosServerConfiguration.getAppFolderToMonitor(),
                                  filePath.getFileName().toString()));
      }

      boolean valid = key.reset();
      if (!valid) {
        log.warning("Can't monitor folder anymore; has it been deleted?");
        stop();
      }
    }
View Full Code Here


            }
          }
        }
      }

      watchKey.reset();
    }
  }

  @Override
  public void destroy()
View Full Code Here

              // Record changed files.
              changedFiles.add(changedPath.toFile().getAbsoluteFile());
            }

            // Ensures that future change events will be seen.
            if (!watchKey.reset()) {
              pathsByWatchKey.remove(watchKey);
            }
          }
        }
      } catch (RuntimeException e) {
View Full Code Here

                  // do nothing... there's no way to communicate deletions
                }
              }
            }
          }
          watchKey.reset();
        }
      } catch (InterruptedException e) {
        // ignore
      }
        }
View Full Code Here

            key.cancel();
         }
         else
         {
            // reset key and remove from set if directory no longer accessible
            boolean valid = key.reset();
            if (!valid)
            {
               keys.remove(key);
            }
         }
View Full Code Here

               resourceMonitor.onPathModify(child);
            }
         }

         // reset key and remove from set if directory no longer accessible
         boolean valid = key.reset();
         if (!valid)
         {
            keys.remove(key);
         }
      }
View Full Code Here

                  handleFileDeleted(file);
                }
              }
            }
          } finally {
            wk.reset();
          }
        }
      } catch (InterruptedException e) {
        /*
         * ignore we just take the next iteration or break
View Full Code Here

                for (WatchEvent<?> event : watchKey.pollEvents()) {
                    System.out.println(String.format("%s event on %s",
                            event.kind(), event.context()));
                }
            } while (watchKey.reset());
        } catch (Exception e) {
        }
    }
}
View Full Code Here

                            if (filename.equals(path.getFileName())){
                                this.strategy.reloadPythonModule();
                            }
                        }
                    }
                    key.reset();
                }
            } catch (JFException e) {
            } catch (IOException e) {
                java.lang.System.console().printf(e.toString());
            } catch (InterruptedException e) {
View Full Code Here

    while (!stopped) {
      if (watchKey != null) {

        processWatchKey(watchKey);

        if (!watchKey.reset()) {
          LOG.warn("WatchKey for {} no longer valid", watchDirectory);
          break;
        }
      }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.