Subversion Repositories linid-dm

Compare Revisions

Rev 380 → Rev 345

/src/main/java/org/linid/dm/wui/t5lib/components/PhotoEditor.java
14,7 → 14,6
import org.apache.tapestry5.ioc.annotations.Value;
import org.apache.tapestry5.services.Request;
import org.apache.tapestry5.upload.services.UploadedFile;
import org.linid.dm.wui.model.exception.InvalidPhotoFormatException;
import org.linid.dm.wui.t5lib.services.JpegFileFormatChecker;
 
public class PhotoEditor {
44,13 → 43,12
 
/**
* upload file
* @throws InvalidPhotoFormatException
*/
public void onSuccess() throws InvalidPhotoFormatException
public void onSuccess()
{
if(userUid!=null){
if (!checkFileFormat()) {
throw new InvalidPhotoFormatException("Invalid format, JPEG expected");
throw new RuntimeException("Invalid format, JPEG expected");
} else {
File copied = new File(photoDirectory,userUid+PHOTO_EXT);
file.write(copied);