code: protected String generateFileName(int subBucket, String oldName) {
          int dotPos = oldName.lastIndexOf(".");
          int slashPos = Math.max(oldName.lastIndexOf("/"), oldName.lastIndexOf("\\"));
          String prefix;
          String suffix;
          if (dotPos > slashPos) {
  
              prefix = oldName.substring(0, dotPos);
              suffix = oldName.substring(dotPos);
          } else {
              prefix = oldName;
              suffix = "";
          }
          return prefix + "_" + subBucket + suffix;
      }
docs: generates a new filename for a subbucket from the given oldName
  
  @param subBucket
  @param oldName
  @return