Package java.nio.file

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


                      LOG.warn("WatchService Overflow occurred");
                        continue;
                    }
            WatchEvent<Path> pathWatchEvent = cast(watchEvent);
            Path name = pathWatchEvent.context();
            Path dir = (Path) watchKey.watchable();
            Path child = dir.resolve(name).toAbsolutePath();
            File childFile = child.toFile();
            if(individualWatchedFiles.contains(child)){
              if(kind == StandardWatchEventKinds.ENTRY_CREATE){
                fireOnNew(childFile);
View Full Code Here


            WatchEvent<Path> ev = (WatchEvent<Path>) event;
            Path name = ev.context();
            ResourceMonitorImpl resourceMonitor = keys.get(key);
            if (resourceMonitor == null)
            {
               log.finest("WatchKey not recognized " + name + " - " + key.watchable() + "> " + kind);
               continue;
            }
            Path resourcePath = resourceMonitor.getResourcePath();
            Path child = resourcePath.resolve(name);
            log.log(Level.FINE, String.format("%s: %s %s %s\n", event.kind().name(), child, key, keys.keySet()));
View Full Code Here

            WatchEvent<Path> ev = (WatchEvent<Path>) event;
            Path name = ev.context();
            ResourceMonitorImpl resourceMonitor = keys.get(key);
            if (resourceMonitor == null)
            {
               log.severe("WatchKey not recognized " + name + " - " + key.watchable() + "> " + kind);
               continue;
            }
            Path resourcePath = resourceMonitor.getResourcePath();
            Path child = resourcePath.resolve(name);
            log.log(Level.FINE, String.format("%s: %s %s %s\n", event.kind().name(), child, key, keys.keySet()));
View Full Code Here

        if (kind == StandardWatchEventKinds.OVERFLOW) {
          continue;
        }

       
        Path dirPath = (Path)key.watchable();
        Path fullPath = dirPath.resolve((Path) event.context());
       

        ImportFile importer = new ImportFile();
       
View Full Code Here

                    ConnectorChangeSet connectorChangeSet = connector.newConnectorChangedSet();
                    for (WatchEvent<?> watchEvent : watchKey.pollEvents()) {
                        WatchEvent.Kind<?> kind = watchEvent.kind();

                        Path eventPath = ((WatchEvent<Path>)watchEvent).context();
                        Path resolvedPath = ((Path)watchKey.watchable()).resolve(eventPath);
                        File resolvedFile = resolvedPath.toFile();

                        if (connector.isExcluded(resolvedFile)) {
                            continue;
                        }
View Full Code Here

        }

        /* 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

            WatchEvent<Path> ev = (WatchEvent<Path>) event;
            Path name = ev.context();
            ResourceMonitorImpl resourceMonitor = keys.get(key);
            if (resourceMonitor == null)
            {
               log.finest("WatchKey not recognized " + name + " - " + key.watchable() + "> " + kind);
               continue;
            }
            Path resourcePath = resourceMonitor.getResourcePath();
            Path child = resourcePath.resolve(name);
            log.log(Level.FINE, String.format("%s: %s %s %s\n", event.kind().name(), child, key, keys.keySet()));
View Full Code Here

            WatchEvent<Path> ev = (WatchEvent<Path>) event;
            Path name = ev.context();
            ResourceMonitorImpl resourceMonitor = keys.get(key);
            if (resourceMonitor == null)
            {
               log.finest("WatchKey not recognized " + name + " - " + key.watchable() + "> " + kind);
               continue;
            }
            Path resourcePath = resourceMonitor.getResourcePath();
            Path child = resourcePath.resolve(name);
            log.log(Level.FINE, String.format("%s: %s %s %s\n", event.kind().name(), child, key, keys.keySet()));
View Full Code Here

                if (filename == null) {
                    continue;
                }

                // Only way to get full path (http://stackoverflow.com/a/7802029/2257172)
                Path fullPath = ((Path)key.watchable()).resolve(filename);

                synchronized(this) {
                    StyleSource style = styleMap.get(fullPath);
                    SourceEntry rule = ruleMap.get(fullPath);
                    if (style != null) {
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.