src/org/ohmage/request/image/ImageBatchZipReadRequest.java
@Override
	public void service() {
		LOGGER.info("Servicing a image ZIP read request.");
		
		// We only need the prompt response.
		Collection<SurveyResponse.ColumnKey> promptResponseColumn =
				new ArrayList<SurveyResponse.ColumnKey>(1);
		promptResponseColumn.add(SurveyResponse.ColumnKey.PROMPT_RESPONSE);
		
		super.service(
				promptResponseColumn, 
				"photo",
				null,
				false, 
				0, 
				Long.MAX_VALUE);
		if(isFailed()) {
			return;
		}
		
		LOGGER.info("Gathering the UUIDs from the survey responses.");
		Collection<UUID> imageIds = new HashSet<UUID>();
		for(SurveyResponse surveyResponse : getSurveyResponses()) {
			imageIds.addAll(getImageIds(surveyResponse.getResponses().values()));
		}
		
		LOGGER.info("Getting the URL for each UUID.");
		try {
			for(UUID imageId : imageIds) {
				URL imageUrl = ImageServices.instance().getImageUrl(imageId);
				if(imageUrl == null) {
					LOGGER.debug(
							"The image doesn't have a URL: " + 
								imageId.toString());
				}
				else {
					imageUrls.put(imageId, imageUrl);
				}
			}
		}
		catch(ServiceException e) {
			e.failRequest(this);
			e.logException(LOGGER);
		}
	}
/**
	 * Gathers all of the image IDs and their associated URLs.
	 */
Gathers all of the image IDs and their associated URLs.
Gathers all of the image IDs and their associated URLs .
@Override
	public void service() {
		LOGGER.info("Servicing a image ZIP read request.");
		Collection<SurveyResponse.ColumnKey> promptResponseColumn =
				new ArrayList<SurveyResponse.ColumnKey>(1);
		promptResponseColumn.add(SurveyResponse.ColumnKey.PROMPT_RESPONSE);
		super.service(
				promptResponseColumn, 
				"photo",
				null,
				false, 
				0, 
				Long.MAX_VALUE);
		if(isFailed()) {
			return;
		}
		LOGGER.info("Gathering the UUIDs from the survey responses.");
		Collection<UUID> imageIds = new HashSet<UUID>();
		for(SurveyResponse surveyResponse : getSurveyResponses()) {
			imageIds.addAll(getImageIds(surveyResponse.getResponses().values()));
		}
		LOGGER.info("Getting the URL for each UUID.");
		try {
			for(UUID imageId : imageIds) {
				URL imageUrl = ImageServices.instance().getImageUrl(imageId);
				if(imageUrl == null) {
					LOGGER.debug(
							"The image doesn't have a URL: " + 
								imageId.toString());
				}
				else {
					imageUrls.put(imageId, imageUrl);
				}
			}
		}
		catch(ServiceException e) {
			e.failRequest(this);
			e.logException(LOGGER);
		}
	}
@ Override public void service ( ) { LOGGER . info ( "Servicing a image ZIP read request." ) ; Collection < SurveyResponse . ColumnKey > promptResponseColumn = new ArrayList < SurveyResponse . ColumnKey > ( 1 ) ; promptResponseColumn . add ( SurveyResponse . ColumnKey . PROMPT_RESPONSE ) ; super . service ( promptResponseColumn , "photo" , null , false , 0 , Long . MAX_VALUE ) ; if ( isFailed ( ) ) { return ; } LOGGER . info ( "Gathering the UUIDs from the survey responses." ) ; Collection < UUID > imageIds = new HashSet < UUID > ( ) ; for ( SurveyResponse surveyResponse : getSurveyResponses ( ) ) { imageIds . addAll ( getImageIds ( surveyResponse . getResponses ( ) . values ( ) ) ) ; } LOGGER . info ( "Getting the URL for each UUID." ) ; try { for ( UUID imageId : imageIds ) { URL imageUrl = ImageServices . instance ( ) . getImageUrl ( imageId ) ; if ( imageUrl == null ) { LOGGER . debug ( "The image doesn't have a URL: " + imageId . toString ( ) ) ; } else { imageUrls . put ( imageId , imageUrl ) ; } } } catch ( ServiceException e ) { e . failRequest ( this ) ; e . logException ( LOGGER ) ; } }
Gathers all of the image IDs and their associated URLs.
Gathers all of the image IDs and their associated URLs .
// We only need the prompt response.