WatchService close - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for WatchService close method.

This code example shows how to use the following methods:close
        } 
    } 
 
    public void close() throws IOException {
        if (watcher != null) {
            watcher.close();
        } 
    } 
 
    public long getLastModified() { 
        return lastModified;
    } 
 
    // Properties 
    //------------------------------------------------------------------------- 
 
 
    public void setRootPath(String rootPath) {
        Path path = new File(rootPath).getAbsoluteFile().toPath();
        setRoot(path);
4
CodeRank
This code example shows how to use the following methods:close
    } 
  } 
 
  public void done() { 
    try { 
      watcher.close();
    } 
    catch (IOException ignored) {}
  } 
 
//  static void usage() { 
//    System.err.println("usage: java WatchDir [-r] dir"); 
//    System.exit(-1); 
//  } 
// 
//  public static void main(String[] args) throws IOException { 
//    // parse arguments 
//    if (args.length == 0 || args.length > 2) usage(); 
//    boolean recursive = false; 
//    int dirArg = 0; 
3
CodeRank
This code example shows how to use the following methods:close
		} 
	} 
 
	protected void stopWatchService() { 
		try { 
			watchService.close();
		} catch (IOException e) {
			logger.warn("Cannot deactivate folder watcher", e);
		} 
 
		watchService = null;
	} 
 
	/** 
	 *  
	 * @param watchService 
	 * @param toWatch 
	 * @return 
	 */ 
	protected abstract AbstractWatchQueueReader buildWatchQueueReader( 
3
CodeRank
close Method Overview
Closes this watch service.
See Code Examples for other Java 8 WatchService Methods: