Here you can find the source of isValidFileName(final String aFileName)
public static boolean isValidFileName(final String aFileName)
//package com.java2s; //License from project: Open Source License import java.io.File; import java.io.IOException; public class Main { public static boolean isValidFileName(final String aFileName) { final File aFile = new File(aFileName); boolean isValid = true; try {//from w ww .j av a2s. com if (aFile.createNewFile()) { aFile.delete(); } } catch (IOException e) { isValid = false; } return isValid; } }