Package java.nio.file

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


                                break;
                        }

                        listado();
                    }
                    if (!claveBusqueda.reset()){
                        // Reseteamos la clave
                    }
                }
            } catch (    InterruptedException | NullPointerException e){
                System.out.println(e);
View Full Code Here


                        LOGGER.info("Last modified: {}", child.toFile().lastModified());

                    }
                }

                if (key.reset() == false) {
                    if (LOGGER.isInfoEnabled()) {
                        LOGGER.info("[{}] Key '{}' is invalid", mySessionHashCode, key);
                    }

                    myKeys.remove(key);
View Full Code Here

            continue;
          }
        }

        /* Reset the Key to get more events later */
        if (!key.reset()) {
          try {
            handleDirectoryDeleted(key, (Path) key.watchable());
          } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
View Full Code Here

        .filter(path -> isDirectory(path, NOFOLLOW_LINKS))
        .forEach(this::registerAll);

      if(shouldDelete) compiler.clear();
      compiler.compileAll();
      key.reset();
    }
  }

  private WatchKey getKey() {
    try {
View Full Code Here

          }
        }
      }

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

        // all directories are inaccessible
View Full Code Here

        }
      }
    }

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

      // all directories are inaccessible
      if (keys.isEmpty()) {
View Full Code Here

                    listener = watchKeyMapping.get( key ).getListener();
                }
                for ( WatchEvent< ? > event : key.pollEvents() ) {
                    listener.PathChanged( event );
                }
                key.reset();
            }
            catch ( InterruptedException e ) {
                running = false;
            }
        }
View Full Code Here

            List<WatchEvent<?>> watchEvents = key.pollEvents();
            for (WatchEvent<?> event : watchEvents) {
              WatchEvent<Path> ev = cast(event);
              if(ev.context().equals(messages)) {
                generate();
                key.reset();
              }
            }
          } else {
            try {
              Thread.sleep(100);
View Full Code Here

            watcher.handleDeleteEvent(key, (Path) event.context());
          }
        }

        /* Reset the Key to get more events later */
        if (!key.reset()) {
          for (DirectoryWatcher watcher : watchers) {
            watcher.handleKeyInvalid(key);
          }
        }
      }
View Full Code Here

                  {
                     logger.log(Level.INFO, "Detected changes in repository [" + events.iterator().next().context()
                              + "].");
                     dirty = true;
                  }
                  key.reset();
                  key = watcher.poll();
               }

               if (dirty)
               {
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.