private boolean verify(Path resolvedPath) {
    ZipFile zipFile = null;
    try {
      File file = resolvedPath.toAbsolutePath().toFile();
      checkArgument(!file.isDirectory());
      checkArgument(file.length() > 0);
      zipFile = new ZipFile(file);
    } catch (Exception e) {
      LOG.info("Verification failed ", e);
      return false;
    } finally {
      Closeables.closeSilently(zipFile);
    }
    return true;
  }
Sanity check to validate if the detected path is a valid archive file
is not a directory, also check that the file is not empty

@param resolvedPath
@return
ambari-server/src/main/java/org/apache/ambari/server/view/ViewDirectoryWatcher.java