src/org/ohmage/domain/campaign/Campaign.java
private static FilePrompt processOFile(
			final String id,
			final String condition, 
			final String unit, 
			final String text,
			final String explanationText, 
			final boolean skippable, 
			final String skipLabel,
			final String displayLabel,
			final String defaultValue,
			final Map<String, LabelValuePair> properties, 
			final int index) 
			throws DomainException {
		
		Long maxFileSize = null;
		try {
			LabelValuePair maxFilesizeVlp =
				properties.get(MediaPrompt.XML_KEY_MAX_FILESIZE);  // optional
			
			if(maxFilesizeVlp != null) {
				maxFileSize = 
					Long.decode(maxFilesizeVlp.getLabel());
			}
		}
		catch(NumberFormatException e) {
			throw new DomainException(
					"The '" +
						MediaPrompt.XML_KEY_MAX_FILESIZE +
						"' property is not an integer: " +
						id, 
					e);
		}
		
		if(defaultValue != null) {
			throw new DomainException(
					"Default values are not allowed for file prompts: " +
						id);
		}

		return new FilePrompt(
			id,
			condition,
			unit,
			text,
			explanationText,
			skippable,
			skipLabel,
			displayLabel,
			index,
			maxFileSize);
	}
/**
	 * Processes a ohmage file prompt and returns a FilePrompt object.
	 * 
	 * @param id The prompt's unique identifier.
	 * 
	 * @param condition The condition value.
	 * 
	 * @param unit The prompt's visualization unit.
	 * 
	 * @param text The prompt's text value.
	 * 
	 * @param explanationText The prompt's explanation text value.
	 * 
	 * @param skippable Whether or not this prompt is skippable.
	 * 
	 * @param skipLabel The label to show to skip this prompt.
	 * 
	 * @param displayLabel The label for this display type.
	 * 
	 * @param defaultValue The default value given in the XML.
	 * 
	 * @param properties The properties defined in the XML for this prompt.
	 * 
	 * @param index The index of this prompt in its collection of survey items.
	 * 
	 * @return A FilePrompt object.
	 * 
	 * @throws DomainException Thrown if the required properties are missing or
	 * 						   if any of the parameters are invalid.
	 */
Processes a ohmage file prompt and returns a FilePrompt object.

@param id The prompt's unique identifier.

@param condition The condition value.

@param unit The prompt's visualization unit.

@param text The prompt's text value.

@param explanationText The prompt's explanation text value.

@param skippable Whether or not this prompt is skippable.

@param skipLabel The label to show to skip this prompt.

@param displayLabel The label for this display type.

@param defaultValue The default value given in the XML.

@param properties The properties defined in the XML for this prompt.

@param index The index of this prompt in its collection of survey items.

@return A FilePrompt object.

@throws DomainException Thrown if the required properties are missing or
if any of the parameters are invalid.
Processes a ohmage file prompt and returns a FilePrompt object . @param id The prompt ' s unique identifier . @param condition The condition value . @param unit The prompt ' s visualization unit . @param text The prompt ' s text value . @param explanationText The prompt ' s explanation text value . @param skippable Whether or not this prompt is skippable . @param skipLabel The label to show to skip this prompt . @param displayLabel The label for this display type . @param defaultValue The default value given in the XML . @param properties The properties defined in the XML for this prompt . @param index The index of this prompt in its collection of survey items . @return A FilePrompt object . @throws DomainException Thrown if the required properties are missing or if any of the parameters are invalid .
private static FilePrompt processOFile(
			final String id,
			final String condition, 
			final String unit, 
			final String text,
			final String explanationText, 
			final boolean skippable, 
			final String skipLabel,
			final String displayLabel,
			final String defaultValue,
			final Map<String, LabelValuePair> properties, 
			final int index) 
			throws DomainException {
		Long maxFileSize = null;
		try {
			LabelValuePair maxFilesizeVlp =
				properties.get(MediaPrompt.XML_KEY_MAX_FILESIZE);  
			if(maxFilesizeVlp != null) {
				maxFileSize = 
					Long.decode(maxFilesizeVlp.getLabel());
			}
		}
		catch(NumberFormatException e) {
			throw new DomainException(
					"The '" +
						MediaPrompt.XML_KEY_MAX_FILESIZE +
						"' property is not an integer: " +
						id, 
					e);
		}
		if(defaultValue != null) {
			throw new DomainException(
					"Default values are not allowed for file prompts: " +
						id);
		}
		return new FilePrompt(
			id,
			condition,
			unit,
			text,
			explanationText,
			skippable,
			skipLabel,
			displayLabel,
			index,
			maxFileSize);
	}
private static FilePrompt processOFile ( final String id , final String condition , final String unit , final String text , final String explanationText , final boolean skippable , final String skipLabel , final String displayLabel , final String defaultValue , final Map < String , LabelValuePair > properties , final int index ) throws DomainException { Long maxFileSize = null ; try { LabelValuePair maxFilesizeVlp = properties . get ( MediaPrompt . XML_KEY_MAX_FILESIZE ) ; if ( maxFilesizeVlp != null ) { maxFileSize = Long . decode ( maxFilesizeVlp . getLabel ( ) ) ; } } catch ( NumberFormatException e ) { throw new DomainException ( "The '" + MediaPrompt . XML_KEY_MAX_FILESIZE + "' property is not an integer: " + id , e ) ; } if ( defaultValue != null ) { throw new DomainException ( "Default values are not allowed for file prompts: " + id ) ; } return new FilePrompt ( id , condition , unit , text , explanationText , skippable , skipLabel , displayLabel , index , maxFileSize ) ; }
Processes a ohmage file prompt and returns a FilePrompt object.
Processes a ohmage file prompt and returns a FilePrompt object .
// optional