src/org/ohmage/domain/Image.java
public boolean sizeExists(final Size size) throws DomainException {
		// Validate the parameters.
		if(size == null) {
			throw new DomainException("The size is null.");
		}
		
		// Get the original file's URL.
		URL originalUrl = imageData.get(ORIGINAL).getUrl();
		
		// If the original file was not built with a URL, then the variants may
		// or may not exist, but we have no way of checking.
		if(originalUrl == null) {
			throw
				new DomainException(
					"This Image object was not built with a default URL.");
		}
		
		if (urlExists(Size.getUrl(size,  originalUrl)))
			return true;
		else return false;
	
		/*
		// Attempt to connect to the file. If it doesn't exist, an exception
		// will be thrown.
		try {
			Size.getUrl(size, originalUrl).openStream().close();
			LOGGER.debug("Size.getURL exists: " +size.toString() + "," + Size.getUrl(size,originalUrl).toString());
			return true;
		}
		// The file does not exist.
		catch(IOException e) {
			LOGGER.debug("Size.getURL doesn't exists: " + size.toString() + "," + Size.getUrl(size,originalUrl).toString());
			return false;
		}
		*/
	}
/**
	 * Returns whether or not a certain size of an image exists.
	 * 
	 * @param size
	 *        The size in question.
	 * 
	 * @return Whether or not the image was saved.
	 * 
	 * @throws DomainException
	 *         The size was null or this image was not built with a default
	 *         URL.
	 */
Returns whether or not a certain size of an image exists.

@param size
The size in question.

@return Whether or not the image was saved.

@throws DomainException
The size was null or this image was not built with a default
URL.
Returns whether or not a certain size of an image exists . @param size The size in question . @return Whether or not the image was saved . @throws DomainException The size was null or this image was not built with a default URL .
public boolean sizeExists(final Size size) throws DomainException {
		if(size == null) {
			throw new DomainException("The size is null.");
		}
		URL originalUrl = imageData.get(ORIGINAL).getUrl();
		if(originalUrl == null) {
			throw
				new DomainException(
					"This Image object was not built with a default URL.");
		}
		if (urlExists(Size.getUrl(size,  originalUrl)))
			return true;
		else return false;
		/*
		// Attempt to connect to the file. If it doesn't exist, an exception
		// will be thrown.
		try {
			Size.getUrl(size, originalUrl).openStream().close();
			LOGGER.debug("Size.getURL exists: " +size.toString() + "," + Size.getUrl(size,originalUrl).toString());
			return true;
		}
		// The file does not exist.
		catch(IOException e) {
			LOGGER.debug("Size.getURL doesn't exists: " + size.toString() + "," + Size.getUrl(size,originalUrl).toString());
			return false;
		}
		*/
	}
public boolean sizeExists ( final Size size ) throws DomainException { if ( size == null ) { throw new DomainException ( "The size is null." ) ; } URL originalUrl = imageData . get ( ORIGINAL ) . getUrl ( ) ; if ( originalUrl == null ) { throw new DomainException ( "This Image object was not built with a default URL." ) ; } if ( urlExists ( Size . getUrl ( size , originalUrl ) ) ) return true ; else return false ; /*
		// Attempt to connect to the file. If it doesn't exist, an exception
		// will be thrown.
		try {
			Size.getUrl(size, originalUrl).openStream().close();
			LOGGER.debug("Size.getURL exists: " +size.toString() + "," + Size.getUrl(size,originalUrl).toString());
			return true;
		}
		// The file does not exist.
		catch(IOException e) {
			LOGGER.debug("Size.getURL doesn't exists: " + size.toString() + "," + Size.getUrl(size,originalUrl).toString());
			return false;
		}
		*/ }
Returns whether or not a certain size of an image exists.
Returns whether or not a certain size of an image exists .
// Validate the parameters. // Get the original file's URL. // If the original file was not built with a URL, then the variants may // or may not exist, but we have no way of checking.