code: public void init() throws WatchException{
  		//获取目录或文件路径
  		if(false ==Files.exists(this.path, LinkOption.NOFOLLOW_LINKS)) {
  			final Path lastPathEle = FileUtil.getLastPathEle(this.path);
  			if(null != lastPathEle) {
  				final String lastPathEleStr = lastPathEle.toString();
  				//带有点表示有扩展名，按照未创建的文件对待。Linux下.d的为目录，排除之
  				if(StrUtil.contains(lastPathEleStr, StrUtil.C_DOT) && false ==StrUtil.endWithIgnoreCase(lastPathEleStr, ".d")) {
  					this.filePath = this.path;
  					this.path = this.filePath.getParent();
  				}
  			}
  			
  			//创建不存在的目录或父目录
  			try {
  				Files.createDirectories(this.path);
  			} catch (IOException e) {
  				throw new IORuntimeException(e);
  			}
  		}else if(Files.isRegularFile(this.path, LinkOption.NOFOLLOW_LINKS)){
  			this.filePath = this.path;
  			this.path = this.filePath.getParent();
  		}
  		
  		//初始化监听
  		try {
  			watchService = FileSystems.getDefault().newWatchService();
  		} catch (IOException e) {
  			throw new WatchException(e);
  		}
  		
  		isClosed = false;
  	}
docs: 初始化<br>
  初始化包括：
  <pre>
  1、解析传入的路径，判断其为目录还是文件
  2、创建{@link WatchService} 对象
  </pre>
  
  @throws WatchException 监听异常，IO异常时抛出此异常