public URI getLocation() throws Exception {
    if (typ == Type.DATABASE) {
      String location = database.getLocationUri();
      return location == null ? null : new URI(location);
    }

    if (typ == Type.TABLE) {
      Path path = t.getDataLocation();
      return path == null ? null : path.toUri();
    }

    if (typ == Type.PARTITION) {
      Path path = p.getDataLocation();
      return path == null ? null : path.toUri();
    }

    if (typ == Type.DFS_DIR || typ == Type.LOCAL_DIR) {
      return d.toUri();
    }

    return null;
  }
Get the location of the entity.
ql/src/java/org/apache/hadoop/hive/ql/hooks/Entity.java