Here you can find the source of sanitizeFilename(String name)
Parameter | Description |
---|---|
name | the string to sanitized. |
private static String sanitizeFilename(String name)
//package com.java2s; //License from project: Open Source License public class Main { /**/* w ww . j av a2 s . com*/ * Replace forbidden characters with "_" in a filename. * * @param name * the string to sanitized. * @return sanitized string. */ private static String sanitizeFilename(String name) { return name.replaceAll("[:\\\\/*?|<>]", "_"); } }