Here you can find the source of encodeDownloadFileName(String s)
public static String encodeDownloadFileName(String s)
//package com.java2s; //License from project: Apache License import java.net.URLEncoder; public class Main { public static String encodeDownloadFileName(String s) { try {// www . j ava 2 s . c o m return URLEncoder.encode(s, "UTF-8").replaceAll("\\+", "%20"); } catch (Exception e) { // ignore } return ""; } }