private static boolean isLongFilename( String filename )
	{
		if( filename.charAt( 0 ) == '.' || filename.charAt( filename.length() - 1 ) == '.' )
			return true;

		if( !filename.matches( "^\\p{ASCII}+$" ) )
			return true;

		// no matter whether it is file or directory
		int dotIdx = filename.lastIndexOf( '.' );
		String baseName = dotIdx == -1 ? filename : filename.substring( 0, dotIdx );
		String ext = dotIdx == -1 ? "" : filename.substring( dotIdx + 1 );

		String wrongSymbolsPattern = ".*[\\.\"\\/\\\\\\[\\]:;=, ]+.*";
		return baseName.length() > 8 || ext.length() > 3 || baseName.matches( wrongSymbolsPattern ) || ext.matches( wrongSymbolsPattern );
	}