Here you can find the source of sanitizeToValidFilename(String name)
public static String sanitizeToValidFilename(String name)
//package com.java2s; //License from project: Open Source License public class Main { public static String sanitizeToValidFilename(String name) { String[] invalidSymbols = new String[] { "\\", "/", ":", "*", "?", "\"", "<", ">", "|" }; String sanitizedName = name; for (String currentSymbol : invalidSymbols) { sanitizedName = sanitizedName.replaceAll("[\\" + currentSymbol + "]", "_"); }/* ww w. j a v a 2s. co m*/ return sanitizedName; } }