view src/main/java/de/mpiwg/gazetteer/utils/exceptions/VersioningException.java @ 10:5610250d021a default tip

SectionsIndex, we added a method to print the setting of the VM
author "jurzua <jurzua@mpiwg-berlin.mpg.de>"
date Thu, 19 Mar 2015 11:46:33 +0100
parents 7682c04c63a8
children
line wrap: on
line source

package de.mpiwg.gazetteer.utils.exceptions;

import de.mpiwg.gazetteer.bo.LGFile;

public class VersioningException extends GazetteerException{

	private static final long serialVersionUID = 3686916552150745726L;

	private static int CODE = 1;
	
	public LGFile userFile;
	public LGFile currentFile;
	
	public VersioningException(LGFile userFile, LGFile currentFile){
		this.userFile = userFile;
		this.currentFile = currentFile;
	}
	
	public String getMessage(){
		String msg = "VersioningException: In the between time, somebody else saved a new version of this file. ";
		msg += " You modified the version " + this.userFile.getVersion() + ", however the current version is " + this.currentFile.getVersion() + ".";
		return msg;
	}
	
	
	public LGFile getUserFile() {
		return userFile;
	}

	public void setUserFile(LGFile userFile) {
		this.userFile = userFile;
	}

	public LGFile getCurrentFile() {
		return currentFile;
	}

	public void setCurrentFile(LGFile currentFile) {
		this.currentFile = currentFile;
	}

	public int getCode(){
		return CODE;
	}
}