code: public File createDumpFile(final File dir, final String extension, final String urlString, final String additionalInfo) {
  		URI uri = URI.create(urlString);
  		String path = uri.getPath();
  		if (path == null) {
  			log.warn("Cannot create dump file for URI: " + uri);
  			return null;
  		}
  
  		String name = PATTERN_FIRST_LAST_SLASH.matcher(path).replaceAll("$1");
  		name = PATTERN_ILLEGAL_CHARS.matcher(name).replaceAll("_");
  
  		Key key = Key.get(dir.getPath(), extension);
  		MutableInt counter = countersMap.get(key);
  		if (counter == null) {
  			counter = new MutableInt();
  			countersMap.put(key, counter);
  		}
  
  		int counterValue = counter.intValue();
  		counter.increment();
  
  		StringBuilder sb = new StringBuilder();
  		sb.append(String.format("%04d", counterValue));
  		sb.append('_');
  		sb.append(name);
  		if (StringUtils.isNotBlank(additionalInfo)) {
  			sb.append("_");
  			sb.append(additionalInfo);
  		}
  		sb.append(".");
  		sb.append(extension);
  
  		return new File(dir, sb.toString());
  	}
docs: Computes the best file to save the response to the current page.