src/org/ohmage/domain/Image.java
public void saveImage(final Size size) throws DomainException {
		// Validate the input.
		if(size == null) {
			throw new DomainException("The size is null.");
		}
		// The original image must be saved with a save directory.
		if(ORIGINAL.equals(size)) {
			return;
		}
		
		// Get the URL for the original image.
		URL originalUrl = imageData.get(ORIGINAL).getUrl();
		// If the original image doesn't have a URL, then it may have never
		// been saved, which means there is nowhere to save the variants of the
		// image.
		try {
			saveImage(size, new File(originalUrl.getFile()), false);
		}
		catch(DomainException e) {
			throw
				new DomainException(
					"There was a problem creating the file.",
					e);
		}
	}
/**
	 * Saves a specific size of the file. This checks to be sure that the 
	 * original image has a URL built with it.
	 * 
	 * @param size The size of the file to save.
	 * 
	 * @see #saveImage(File)
	 */
Saves a specific size of the file. This checks to be sure that the
original image has a URL built with it.

@param size The size of the file to save.


Saves a specific size of the file . This checks to be sure that the original image has a URL built with it . @param size The size of the file to save .
public void saveImage(final Size size) throws DomainException {
		if(size == null) {
			throw new DomainException("The size is null.");
		}
		if(ORIGINAL.equals(size)) {
			return;
		}
		URL originalUrl = imageData.get(ORIGINAL).getUrl();
		try {
			saveImage(size, new File(originalUrl.getFile()), false);
		}
		catch(DomainException e) {
			throw
				new DomainException(
					"There was a problem creating the file.",
					e);
		}
	}
public void saveImage ( final Size size ) throws DomainException { if ( size == null ) { throw new DomainException ( "The size is null." ) ; } if ( ORIGINAL . equals ( size ) ) { return ; } URL originalUrl = imageData . get ( ORIGINAL ) . getUrl ( ) ; try { saveImage ( size , new File ( originalUrl . getFile ( ) ) , false ) ; } catch ( DomainException e ) { throw new DomainException ( "There was a problem creating the file." , e ) ; } }
Saves a specific size of the file.
Saves a specific size of the file .
// Validate the input. // The original image must be saved with a save directory. // Get the URL for the original image. // If the original image doesn't have a URL, then it may have never // been saved, which means there is nowhere to save the variants of the // image.