code: public static String fileNameFromString( final String    text )
      {
          String    value = text.replace( ' ', '_' );
  
          if ( value.length() < 48 )
          {
              return value;
          }
  
          return value.substring( 0, 47 );
      }
docs: This method takes a string and converts it into a filename by replacing
  any spaces with underscores and then also truncating it if it is over
  a certain length.  At the time of the writing of this comment that was 48
  characters which was chosen by pulling a number out of my brain.
  
  @param text Text to convert to usable filename
  @return usable filename