code: public static long[] parseMetafileName(String path) {
      String[] groundSeparated = StringUtils.split(path, '_');
      if (groundSeparated.length != 3) { // blk, blkid, genstamp.meta
        throw new IllegalArgumentException("Not a valid meta file name");
      }
      String[] dotSeparated = StringUtils.split(groundSeparated[2], '.');
      if (dotSeparated.length != 2) {
        throw new IllegalArgumentException("Not a valid meta file name");
      }
      return new long[] { Long.parseLong(groundSeparated[1]),
          Long.parseLong(dotSeparated[0]) };
    }
docs: Returns array of two longs: the first one is the block id, and the second
  one is genStamp. The method workds under assumption that metafile name has
  the following format: "blk_<blkid>_<gensmp>.meta"