src/jpm/dg/Util.java
/**
	 * 
	 * @param fileName
	 * @return True if and only if the filename given is valid.
	 */
@param fileName
@return True if and only if the filename given is valid.
@param fileName @return True if and only if the filename given is valid .
public static String isValidFileName(String fileName) {
		String errorMessage = "";
		if (fileName.equals(null) || fileName.equals("")) {
			return "Filenames cannot be empty";
		}
		String illegals = "";
		for (int i = 0; i < fileName.length(); i++) {
			for (int j = 0; j < ILLEGAL_CHARACTERS.length; j++) {
				if (fileName.charAt(i) == ILLEGAL_CHARACTERS[j]) {
					illegals += fileName.charAt(i) + ", ";
				}
			}
		}
		if (illegals.length() != 0) {
			errorMessage = "Illegal characters: "
					+ illegals.substring(0, illegals.length() - 2);
		}
		return errorMessage;
	}
public static String isValidFileName ( String fileName ) { String errorMessage = "" ; if ( fileName . equals ( null ) || fileName . equals ( "" ) ) { return "Filenames cannot be empty" ; } String illegals = "" ; for ( int i = 0 ; i < fileName . length ( ) ; i ++ ) { for ( int j = 0 ; j < ILLEGAL_CHARACTERS . length ; j ++ ) { if ( fileName . charAt ( i ) == ILLEGAL_CHARACTERS [ j ] ) { illegals += fileName . charAt ( i ) + ", " ; } } } if ( illegals . length ( ) != 0 ) { errorMessage = "Illegal characters: " + illegals . substring ( 0 , illegals . length ( ) - 2 ) ; } return errorMessage ; }
@param fileName
 @return True if and only if the filename given is valid.
@param fileName @return True if and only if the filename given is valid .