Here you can find the source of sanitizeFilename(String fileName)
static protected String sanitizeFilename(String fileName)
//package com.java2s; // of the GNU General Public License version 3. public class Main { static protected String sanitizeFilename(String fileName) { if (fileName == null) { return null; }// w ww . j av a 2 s . c o m return fileName.replaceAll("/", ".").replaceAll("[\\[|\\]]", " ").replaceAll(" ", ""); } }