package innovimax.mixthem.rest.request;

import innovimax.mixthem.rest.ErrorResponse;

import javax.ws.rs.core.Response;

import org.glassfish.jersey.media.multipart.FormDataContentDisposition;

public abstract class AbstractParamsCheck {

    protected ErrorResponse error = null;

    public Response getErrorResponse() {        
        return Response.status(this.error.getCode()).entity(this.error).build();            
    }

    protected boolean checkTextMissing(String text) {
        if (text == null || text.trim().equals("")) {
            this.error = RequestErrorResponse.createMissingParamTextError();
            return false;
        }
        return true;
    }

    protected boolean checkFileMissing(FormDataContentDisposition fileDetail) {     
        if (fileDetail.getFileName().equals("")) {
            this.error = RequestErrorResponse.createMissingParamFileError();
            return false;
        }      
        return true;
    }

    protected boolean checkAlternateMode(String mode) {
        if (!AlternateMode.accept(mode)) {
            this.error = RequestErrorResponse.createWrongParamAltModeError();
            return false;
        }
        return true;
    }

    protected boolean checkZipMode(String mode) {
        if (!ZipMode.accept(mode)) {
            this.error = RequestErrorResponse.createWrongParamZipModeError();
            return false;
        }
        return true;
    }

}

@@ -34,16 +34,47 @@
 quest;%0A%0A
+import innovimax.mixthem.Rule;%0A
 import i
@@ -270,23 +270,21 @@
 %0A%0A    pr
-otec
+iva
 te
-d
  ErrorRe
@@ -303,16 +303,46 @@
  = null;
+%0A    private Rule rule = null;
 %0A%0A    pu
@@ -476,32 +476,164 @@
         %0A    %7D%0A%0A
+    public Rule getRule() %7B%0A        return this.rule;%0A    %7D%0A%0A    private void setRule(Rule rule) %7B%0A        this.rule = rule;%0A    %7D%0A%0A
     protected bo

Update AbstractParamsCheck.java