@Override
  public synchronized boolean delete(SyndicateFSPath path)
      throws FileNotFoundException, IOException {
    if (path == null) {
      LOG.error("path is null");
      throw new IllegalArgumentException("path is null");
    }

    SyndicateFSPath absPath = getAbsolutePath(path);
    SyndicateFSFileStatus status = getFileStatus(absPath);
    if (status == null) {
      LOG.error("file not exist");
      throw new FileNotFoundException("file not exist : " + path.getPath());
    }

    if (status.isFile()) {
      Future<ClientResponse> unlinkFuture = this.client.unlink(absPath.getPath());
      if (unlinkFuture != null) {
        try {
          this.client.processUnlink(unlinkFuture);
        } catch (RestfulException ex) {
          LOG.error("exception occurred", ex);
          throw new IOException(ex);
        }
      } else {
        throw new IOException("Can not create a REST client");
      }
    } else if (status.isDirectory()) {
      Future<ClientResponse> removeDirFuture = this.client.removeDir(absPath.getPath());
      if (removeDirFuture != null) {
        try {
          this.client.processRemoveDir(removeDirFuture);
        } catch (RestfulException ex) {
          LOG.error("exception occurred", ex);
          throw new IOException(ex);
        }
      } else {
        throw new IOException("Can not create a REST client");
      }
    } else {
      LOG.error("Can not delete from unknown status");
      throw new IOException("Can not delete from unknown status");
    }

    this.filestatusCache.remove(absPath);
    return true;
  }
  @Override
  public synchronized boolean isDirectory(SyndicateFSPath path) {
    if (path == null) {
      LOG.error("path is null");
      throw new IllegalArgumentException("path is null");
    }

    SyndicateFSPath absPath = getAbsolutePath(path);
    SyndicateFSFileStatus status = null;
    try {
      status = getFileStatus(absPath);
    } catch (IOException ex) {
      LOG.error("exception occurred", ex);
    }

    if (status != null) {
      return status.isDirectory();
    }
    return false;
  }
  private synchronized SyndicateFSFileHandle createNewFile(SyndicateFSPath abspath)
      throws IOException {
    if (abspath == null) {
      LOG.error("abspath is null");
      throw new IllegalArgumentException("abspath is null");
    }

    if (abspath.getParent() != null) {
      SyndicateFSFileStatus parent = getFileStatus(abspath.getParent());
      if (parent == null) {
        LOG.error("Parent directory does not exist");
        throw new IOException("Parent directory does not exist");
      }

      if (!parent.isDirectory()) {
        LOG.error("Parent directory does not exist");
        throw new IOException("Parent directory does not exist");
      }
    }

    LOG.info("creating a file - " + abspath.getPath());

    Future<ClientResponse> openFuture = this.client.open(abspath.getPath(), "w");
    if (openFuture != null) {
      try {
        FileDescriptor fi = this.client.processOpen(openFuture);
        SyndicateFSFileStatus status = new SyndicateFSFileStatus(this, abspath);
        return new SyndicateFSFileHandle(this, status, fi, false);
      } catch (Exception ex) {
        LOG.error("exception occurred", ex);
        throw new IOException(ex);
      }
    } else {
      throw new IOException("Can not create a REST client");
    }
  }