code: public String nameWithoutTaskID(String objectKey) {
      int index = objectKey.indexOf("-" + HADOOP_ATTEMPT);
      if (index > 0) {
        String attempt = objectKey.substring(index + 1);
        try {
          if (attempt.indexOf(".") > 0) {
            attempt = attempt.substring(0, attempt.indexOf("."));
          }
          TaskAttemptID.forName(attempt);
          String res = objectKey.replace("-" + attempt, "");
          return res;
        } catch (IllegalArgumentException e) {
          return objectKey;
        }
      }
      return objectKey;
    }
docs: Accepts any object name. If object name is of the form
  a/b/c/m.data/part-r-00000-48ae3461-203f-4dd3-b141-a45426e2d26c
  .csv-attempt_20160317132wrong_0000_m_000000_1 Then
  a/b/c/m.data/part-r-00000-48ae3461-203f-4dd3-b141-a45426e2d26c.csv is
  returned. Perform test that attempt_20160317132wrong_0000_m_000000_1 is
  valid task id identifier
  
  @param objectKey object key
  @return unified object name