Here you can find the source of sanitizeFilename(String filename)
public static String sanitizeFilename(String filename)
//package com.java2s; //License from project: Open Source License public class Main { public static String sanitizeFilename(String filename) { return filename.replaceAll("[^a-zA-Z0-9.-]", "_"); }/*from www . j ava 2 s . c o m*/ }