Unable to Solve the errors on my plugin

=====401[InvalidInputException: [Error map: [{}]] [Error list: [[Kindly Check the below Listed Error Log nullArchive: D:/Atlassian/Home/Jira_7.13/data/attachments/CMC/10000/CMC-3519/219101 creating: C:\VPS_Tools\Supporting_Files\Meta-info-Log\9781526717238/META-INF/ inflating: C:\VPS_Tools\Supporting_Files\Meta-info-Log\9781526717238/META-INF/container.xml extracting: C:\VPS_Tools\Supporting_Files\Meta-info-Log\9781526717238/mimetype creating: C:\VPS_Tools\Supporting_Files\Meta-info-Log\9781526717238/OPS/ inflating: C:\VPS_Tools\Supporting_Files\Meta-info-Log\9781526717238/OPS/content.opf creating: C:\VPS_Tools\Supporting_Files\Meta-info-Log\9781526717238/OPS/css/ inflating: C:\VPS_Tools\Supporting_Files\Meta-info-Log\9781526717238/OPS/css/page-template.xpgt inflating: C:\VPS_Tools\Supporting_Files\Meta-info-Log\9781526717238/OPS/css/stylesheet.css creating: C:\VPS_Tools\Supporting_Files\Meta-info-Log\9781526717238/OPS/images/ inflating: C:\VPS_Tools\Supporting_Files\Meta-info-Log\9781526717238/OPS/images/box.jpg inflating: C:\VPS_Tools\Supporting_Files\Meta-info-Log\9781526717238/OPS/images/cover.jpg inflating: C:\VPS_Tools\Supporting_Files\Meta-info-Log\9781526717238/OPS/images/image045_01.jpg inflating: C:\VPS_Tools\Supporting_Files\Meta-info-Log\9781526717238/OPS/images/img55.jpg inflating: C:\VPS_Tools\Supporting_Files\Meta-info-Log\9781526717238/OPS/images/img68.jpg inflating: C:\VPS_Tools\Supporting_Files\Meta-info-Log\9781526717238/OPS/images/plate1.jpg inflating: C:\VPS_Tools\Supporting_Files\Meta-info-Log\9781526717238/OPS/images/plate10.jpg inflating: C:\VPS_Tools\Supporting_Files\Meta-info-Log\9781526717238/OPS/images/plate10_1.jpg inflating: C:\VPS_Tools\Supporting_Files\Meta-info-Log\9781526717238/OPS/images/plate11.jpg inflating: C:\VPS_Tools\Supporting_Files\Meta-info-Log\9781526717238/OPS/images/plate11_1.jpg inflating: C:\VPS_Tools\Supporting_Files\Meta-info-Log\9781526717238/OPS/images/plate12.jpg inflating: C:\VPS_Tools\Supporting_Files\Meta-info-Log\9781526717238/OPS/images/plate12_1.jpg inflating: C:\VPS_Tools\Supporting_Files\Meta-info-Log\9781526717238/OPS/images/plate13.jpg inflating: C:\VPS_Tools\Supporting_Files\Meta-info-Log\9781526717238/OPS/images/plate13_1.jpg inflating: C:\VPS_Tools\Supporting_Files\Meta-info-Log\9781526717238/OPS/images/plate14.jpg inflating: C:\VPS_Tools\Supporting_Files\Meta-info-Log\9781526717238/OPS/images/plate14_1.jpg inflating: C:\VPS_Tools\Supporting_Files\Meta-info-Log\9781526717238/OPS/images/plate15.jpg inflating: C:\VPS_Tools\Supporting_Files\Meta-info-Log\9781526717238/OPS/images/plate15_1.jpg inflating: C:\VPS_Tools\Supporting_Files\Meta-info-Log\9781526717238/OPS/images/plate16.jpg inflating: C:\VPS_Tools\Supporting_Files\Meta-info-Log\9781526717238/OPS/images/plate16_1.jpg inflating: C:\VPS_Tools\Supporting_Files\Meta-info-Log\9781526717238/OPS/images/plate1_1.jpg inflating: C:\VPS_Tools\Supporting_Files\Meta-info-Log\9781526717238/OPS/images/plate2.jpg inflating: C:\VPS_Tools\Supporting_Files\Meta-info-Log\9781526717238/OPS/images/plate2_1.jpg inflating: C:\VPS_Tools\Supporting_Files\Meta-info-Log\9781526717238/OPS/images/plate3.jpg inflating: C:\VPS_Tools\Supporting_Files\Meta-info-Log\9781526717238/OPS/images/plate3_1.jpg inflating: C:\VPS_Tools\Supporting_Files\Meta-info-Log\9781526717238/OPS/images/plate4.jpg inflating: C:\VPS_Tools\Supporting_Files\Meta-info-Log\9781526717238/OPS/images/plate4_1.jpg inflating: C:\VPS_Tools\Supporting_Files\Meta-info-Log\9781526717238/OPS/images/plate5.jpg inflating: C:\VPS_Tools\Supporting_Files\Meta-info-Log\9781526717238/OPS/images/plate5_1.jpg inflating: C:\VPS_Tools\Supporting_Files\Meta-info-Log\9781526717238/OPS/images/plate6.jpg inflating: C:\VPS_Tools\Supporting_Files\Meta-info-Log\9781526717238/OPS/images/plate6_1.jpg inflating: C:\VPS_Tools\Supporting_Files\Meta-info-Log\9781526717238/OPS/images/plate7.jpg inflating: C:\VPS_Tools\Supporting_Files\Meta-info-Log\9781526717238/OPS/images/plate7_1.jpg inflating: C:\VPS_Tools\Supporting_Files\Meta-info-Log\9781526717238/OPS/images/plate8.jpg inflating: C:\VPS_Tools\Supporting_Files\Meta-info-Log\9781526717238/OPS/images/plate8_1.jpg inflating: C:\VPS_Tools\Supporting_Files\Meta-info-Log\9781526717238/OPS/images/plate9.jpg inflating: C:\VPS_Tools\Supporting_Files\Meta-info-Log\9781526717238/OPS/images/plate9_1.jpg inflating: C:\VPS_Tools\Supporting_Files\Meta-info-Log\9781526717238/OPS/images/pub.jpg inflating: C:\VPS_Tools\Supporting_Files\Meta-info-Log\9781526717238/OPS/nav.xhtml inflating: C:\VPS_Tools\Supporting_Files\Meta-info-Log\9781526717238/OPS/toc.ncx creating: C:\VPS_Tools\Supporting_Files\Meta-info-Log\9781526717238/OPS/xhtml/ inflating: C:\VPS_Tools\Supporting_Files\Meta-info-Log\9781526717238/OPS/xhtml/00_Cover.xhtml inflating: C:\VPS_Tools\Supporting_Files\Meta-info-Log\9781526717238/OPS/xhtml/01_Halftitle.xhtml inflating: C:\VPS_Tools\Supporting_Files\Meta-info-Log\9781526717238/OPS/xhtml/02_Title.xhtml inflating: C:\VPS_Tools\Supporting_Files\Meta-info-Log\9781526717238/OPS/xhtml/03_Copyright.xhtml inflating: C:\VPS_Tools\Supporting_Files\Meta-info-Log\9781526717238/OPS/xhtml/04_Content.xhtml inflating: C:\VPS_Tools\Supporting_Files\Meta-info-Log\9781526717238/OPS/xhtml/05_Introduction.xhtml inflating: C:\VPS_Tools\Supporting_Files\Meta-info-Log\9781526717238/OPS/xhtml/06_Chapter01.xhtml inflating: C:\VPS_Tools\Supporting_Files\Meta-info-Log\9781526717238/OPS/xhtml/07_Chapter02.xhtml inflating: C:\VPS_Tools\Supporting_Files\Meta-info-Log\9781526717238/OPS/xhtml/08_Chapter03.xhtml inflating: C:\VPS_Tools\Supporting_Files\Meta-info-Log\9781526717238/OPS/xhtml/09_Plates.xhtml inflating: C:\VPS_Tools\Supporting_Files\Meta-info-Log\9781526717238/OPS/xhtml/10_Chapter04.xhtml inflating: C:\VPS_Tools\Supporting_Files\Meta-info-Log\9781526717238/OPS/xhtml/11_Chapter05.xhtml inflating: C:\VPS_Tools\Supporting_Files\Meta-info-Log\9781526717238/OPS/xhtml/12_Chapter06.xhtml inflating: C:\VPS_Tools\Supporting_Files\Meta-info-Log\9781526717238/OPS/xhtml/13_Notes.xhtml ******************<?xml version="1.0" encoding="UTF-8"?> dc:titleStruggle and Suffrage in Torbay</dc:title> <dc:identifier id=“idp9781526717238”>9781526717238</dc:identifier> <dc:creator id=“creator”>Melanie Crump</dc:creator> dc:publisherPen and Sword</dc:publisher> dc:date2019-02-28</dc:date> dc:format152 pages</dc:format> dc:languageen</dc:language> dc:rightsAll rights reserved</dc:rights> 2019-02-18T17:30:00Z ===========================OPFDATA<?xml version="1.0" encoding="UTF-8"?> Struggle and Suffrage in Torbay Melanie Crump ===========================NCXDATA======replaceopftitle=====Struggle and Suffrage in Torbay–summary–Struggle and Suffrage in Torbay============replacencxTitle=========Struggle and Suffrage in Torbay===summary===Struggle and Suffrage in Torbay]]]

It seems that you have tried to perform an illegal workflow operation.

If you think this message is wrong, please contact your Jira administrators.

and am using Jira 7.13.0

and My Plugin Code is

{

package com.vps.jira.plugin.validation;
import static java.nio.charset.StandardCharsets.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.atlassian.jira.issue.Issue;
import com.opensymphony.module.propertyset.PropertySet;
import com.opensymphony.workflow.Validator;
import com.opensymphony.workflow.InvalidInputException;

import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.nio.file.Path;
import java.nio.file.Paths;

import org.apache.commons.io.IOUtils;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;

import com.atlassian.jira.issue.AttachmentManager;
import com.atlassian.jira.issue.attachment.Attachment;
import com.atlassian.jira.component.ComponentAccessor;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.FilenameUtils;

import java.io.*;

import com.atlassian.jira.issue.fields.CustomField;
import org.apache.commons.lang.StringEscapeUtils;
import org.apache.commons.lang.StringUtils;
public class CmcMetaValidation implements Validator
{
@SuppressWarnings(“null”)
public void validate(Map transientVars, Map args, PropertySet ps) throws InvalidInputException
{
try
{
//StringBuilder output = new StringBuilder();
List folderfilesNAME = new ArrayList();
String message1= “”;
String folderFiles= null;
String errorLog = " ";
String SubjectMIS=null;
Issue issue = (Issue) transientVars.get(“issue”);
String summary= issue.getSummary();
String DescriptionMIS =issue.getDescription();
//Subject custom field value form mis
String selectedCustomFieldforSubject = (String)args.get(“selectedCustomFieldforSubject”);
CustomField SubjectcustomField = ComponentAccessor.getCustomFieldManager().getCustomFieldObject(selectedCustomFieldforSubject);
Object Subjectmis = issue.getCustomFieldValue(SubjectcustomField);

AttachmentManager attachmentManager = ComponentAccessor.getAttachmentManager();
Collection<Attachment> attachments = attachmentManager.getAttachments(issue);
String currentIssue = issue.toString();
String projectKey = currentIssue.replaceAll("[^A-Z]", "").toString();
//String attachmentPathManager = "D:\\Atlassian\\Home\\Jira_7.13\\data\\attachments";///198.168.1.30
String attachmentPathManager = "D:\\Atlassian\\Home\\Jira_7.13\\data\\attachments";///198.168.1.236
List<String> errorFilelist = new ArrayList<String>();
List errorFileName = new ArrayList();
List<String> filecontent = new ArrayList<String>();
String results =null;
String t111 =null;
//String urlCAL="http://localhost:8082/rest/attach-cat/1.0/attachments/get?issueKey="+issue;
String urlCAL="http://192.168.1.236:8082/rest/attach-cat/1.0/attachments/get?issueKey="+issue;

String requiredValue = (String) args.get("requiredValue");

if(Subjectmis != null && Subjectmis !="")
{
SubjectMIS = Subjectmis.toString();
}
else
{
throw new InvalidInputException(SubjectcustomField+" is missing.");
}
//added code here
try
{
String authString = “shitalchande:$hit@lVP@155”;
//String authString = “vpsvalidator:8c5ydjGL0S8ZiZsODG2JetNqn”;
String authStringEnc = Base64.getEncoder().encodeToString(authString.getBytes(“utf-8”));
URL url = new URL(urlCAL);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod(“GET”);
conn.setRequestProperty(“Accept”, “application/json”);
conn.setRequestProperty(“Authorization”, “Basic " + authStringEnc);
if (conn.getResponseCode() != 200)
{
throw new RuntimeException(“Failed : HTTP error code : “+ conn.getResponseCode());
}
BufferedReader br = new BufferedReader(new InputStreamReader((conn.getInputStream())));
String output = org.apache.commons.io.IOUtils.toString(br);
Pattern folderpattern = Pattern.compile(”“id”:(.+?),“name”:”(.+?)”,“attachments”:(.+?)]") ;
Matcher foldermatch = folderpattern.matcher(output);
message1 = message1+ output;
//String ncxPATH= null;
while(foldermatch.find())
{
String attachmentsID = foldermatch.group(1);
String attachmentsFolders = foldermatch.group(2);
String attachmentsDetails = foldermatch.group(3);
if(attachmentsFolders.contains(requiredValue))
{
String folderFiles1 =attachmentsDetails.replace("{","");
String folderFiles2 =folderFiles1.replace("[","");
String folderFiles3 =folderFiles2.replaceAll(""","");
folderFiles =folderFiles3.replace(“ids:”,"");
message1= message1+folderFiles;
}

        }
        //message1= message1+folderFiles;
}
catch (Exception e) 
{
    e.printStackTrace();
    throw new InvalidInputException(e+"Unable to Find the Selected folder"+message1);
}
    String[] items = folderFiles.split(",");
    List<String> fileList = Arrays.asList(items);

for(Attachment attachment:attachments)//main for loop
{
Long fID = attachment.getId();
String fName =attachment.getFilename();
String fileId=fID.toString();
String fileID = fileId.replaceAll("\s+","");
String fileName=null;
String message = null;
if(fileList.contains(fileID))///start fileID
{
if(fName.endsWith(".zip"))
{
throw new InvalidInputException(“Kindly upload ePub file, zip file not allowed”);
}
folderfilesNAME.add(fName);
if(fName.endsWith(".epub"))
{
String[] parts = fName.split(".epub");
fileName = parts[0];
String currentIssueKEY = null;
if(currentIssue.contains(“TSK”))
{
projectKey = “VPSTSK”;
currentIssueKEY= currentIssue.replace(“TSK-”,“VPSTSK-”);
}
else if(currentIssue.contains(“BOD”))
{
projectKey = “VPSBOD”;
currentIssueKEY= currentIssue.replace(“BOD-”,“VPSBOD-”);
}
else if(currentIssue.contains(“OTP”))
{
projectKey = “VPSOT”;
currentIssueKEY= currentIssue.replace(“OTP-”,“VPSOT-”);
}
else if(currentIssue.contains(“CMC”))
{
projectKey=“CMC”;
currentIssueKEY= currentIssue;
}
else
{
currentIssueKEY= currentIssue;
}
String path = attachmentPathManager + “\” + projectKey + “\” +“10000” +"\"+ currentIssueKEY + “\” + fID ;
File source = new File(path);
//C:\VPS_Tools\Supporting_Files\Meta-info-Log
File dest = new File(“C:\VPS_Tools\Supporting_Files\Meta-info-Log\”+fName);////198.168.1.30
String srcExe = “C:\VPS_Tools\Supporting_Files\unzip.exe” ;
String destFilepath=""" +“C:\VPS_Tools\Supporting_Files\Meta-info-Log\”+fileName+ “”";
String srcFile = “”"+path+""";
String append = srcExe+" -d “+destFilepath+” “+srcFile;
String opfPATH=null;
String sCurrentLine= null;
String ncxCurrentLine= null;
String metaDATA = null ;
String ncxmetaDATA = null ;
StringBuffer opfData = new StringBuffer();
StringBuffer ncxData = new StringBuffer();
String opfDATA= null;
String ncxDATA= null;
// String outputFormatOPF= null;
// String outputTypeOPF= null;
String currentpath = null;
/if(dest.exists() )
{
dest.delete();// do something
}
/
try//1 try block for opening file
{
org.apache.commons.io.FileUtils.copyFile(source,dest);
Runtime rt = Runtime.getRuntime();
Process proc =rt.exec(append);
//BufferedInputStream stdInput = new BufferedInputStream(proc.getInputStream());
BufferedReader stdInput = new BufferedReader(new InputStreamReader(proc.getInputStream()));
message = message + org.apache.commons.io.IOUtils.toString(stdInput);
errorLog =errorLog +message+”******************";
}// MAIN TRY BLOCK FOR OPENING FILE IS GETTING CLOSE HERE
catch(Exception ezz)
{
throw new InvalidInputException(“Unable to read opf file…”+errorLog+"…"+ezz.getStackTrace()[0].getLineNumber());/////Error
//throw new InvalidInputException(ezz+“Unable to copy file.”+source+"===="+dest);
}//main catch close
//basic validation code

      if( (!message.contains(".ncx")) || (!message.contains(".opf")) )
        {
        	throw new InvalidInputException("Unable to find opf and ncx file");
        }

//
//content for opening OPF file
Pattern pattern = Pattern.compile("((.*?).opf)");
Matcher matcher = pattern.matcher(message);
if (matcher.find())//
{
String opfPathd = matcher.group(1);
String opfPATH1 = opfPathd.replace(" inflating: “,”");
String opfPATH2= opfPATH1.replace(" extracting: “,”");
String opfPATH3 = opfPATH2.replace(’/’,’\’);
String opfPATH4 = opfPATH3.replaceAll("^\s+|\s+$", “”);

            opfPATH = opfPATH4.replace("\\","\\\\");   
            BufferedReader br = null;
            try //2try block2 for opening file in buffer redaer
            {
                String testPATH =opfPATH;
                br = new BufferedReader(new InputStreamReader(new FileInputStream(testPATH), "UTF8"));         
                //br = new BufferedReader(new FileReader(testPATH));
                while((sCurrentLine =br.readLine())!=null)
                {
                    opfData.append(sCurrentLine).append("\n");
                }
                br.close();
                opfDATA =opfData.toString();
                String[] opfparts = opfDATA.split("<manifest>");
                metaDATA = opfparts[0];
                br.close();
                errorLog = errorLog +metaDATA+"===========================OPFDATA";
                 //throw new InvalidInputException("=="+errorLog);
            }
            catch(Exception es)//2try block2 for opening ncx file in buffer redaer IS CLOSED
            {                    
            	errorLog = errorLog +metaDATA+"===========================OPFDATA";
                throw new InvalidInputException("=="+errorLog+es.getStackTrace()[0].getLineNumber());
            }
          }          

//Close content for Opf File
//content for opening ncx file
Pattern ncxpattern = Pattern.compile("((.*?).ncx)");
Matcher match = ncxpattern.matcher(message);
String ncxPATH= null;
if (match.find())//
{
String ncxPathd = match.group(1);
String ncxPATH1 = ncxPathd.replace(" inflating: “,”");
String ncxPATH2= ncxPATH1.replace(" extracting: “,”");
String ncxPATH3 = ncxPATH2.replace(’/’,’\’);
String ncxPATH4 = ncxPATH3.replaceAll("^\s+|\s+$", “”);
ncxPATH = ncxPATH4.replace("\","\\");
BufferedReader ncxbr = null;
try //2try block2 for opening ncx file in buffer redaer
{
String testPATH =ncxPATH;
//ncxbr = new BufferedReader(new FileReader(testPATH));
ncxbr = new BufferedReader(new InputStreamReader(new FileInputStream(testPATH), “UTF8”));
while((ncxCurrentLine =ncxbr.readLine())!=null)
{
ncxData.append(ncxCurrentLine).append("\n");
}
ncxbr.close();
ncxDATA =ncxData.toString();
String[] ncxparts = ncxDATA.split("");
ncxmetaDATA = ncxparts[0];
ncxbr.close();
errorLog = errorLog +ncxmetaDATA+"===========================NCXDATA";
}
catch(Exception es)
{
throw new InvalidInputException(“Unable to read ncx file”+es.getStackTrace()[0].getLineNumber());
}
}

//Close content for Ncx File

//Start code for delete files and directory from local path
/* dest.delete();
String destFilepath1 = destFilepath.replaceAll("^"|"$", “”);
try
{
FileUtils.deleteDirectory(new File(destFilepath1));
}
catch(Exception x)
{
throw new InvalidInputException(“Unable to delete directory,Kindly correct the Error.”+x.getStackTrace()[0].getLineNumber());
}*/

//Complete code for delete files and directory from local path
//From Here test case we are writing
//START COMMON TEST CASE FOR BOTH OUTPUT TYPE

       //Test Case:3<-------------------Start test case for match title [Summary] property with MIS-------------------------->
                Pattern dcTitlepattern = Pattern.compile("<dc:title>(.+?)</dc:title>");
                Matcher dcTitlematcher = dcTitlepattern.matcher(metaDATA);
                String replaceopftitle = null;
                if (dcTitlematcher.find())
                {
                    String opfTitle = dcTitlematcher.group(1);
                    replaceopftitle =StringEscapeUtils.unescapeHtml(opfTitle);
                    summary =StringEscapeUtils.unescapeHtml(summary);
                    errorLog=errorLog +"======replaceopftitle====="+replaceopftitle+"--summary--"+summary;
                    if(!replaceopftitle.equals(summary))
                    {
                        errorLog= errorLog + "Error:03 Title Details in the OPF File do not match with MIS Summary. "+"-----"+replaceopftitle+"----"+summary;;
                    }
                    else
                    {
                       // errorLog= errorLog + "Sucess:03 OPF File contins Title details and it is match with MIS Summary Value"+"-----"+replaceopftitle+"----"+summary;
                    }
                }
            //<-------------------Complete test case for match title [Summary] property with MIS-------------------------->
       
               
              
                //Test Case:4.8<-------------------Start test case for match subject property with MIS-------------------------->
                Pattern dcSubjectpattern = Pattern.compile("<dc:subject>(.+?)</dc:subject>");
                Matcher dcSubjectmatcher = dcSubjectpattern.matcher(metaDATA);
                String replaceopfSubject = null;
                if (dcSubjectmatcher.find())
                {
                    String opfSubject = dcSubjectmatcher.group(1);
                    replaceopfSubject =StringEscapeUtils.unescapeHtml(opfSubject);
                    SubjectMIS =StringEscapeUtils.unescapeHtml(SubjectMIS);
                    errorLog=errorLog+"==========replaceopfSubject=========="+replaceopfSubject+"==SubjectMIS=="+SubjectMIS;
                    if(!replaceopfSubject.equals(SubjectMIS))
                    {
                        errorLog= errorLog + "Error:4.7 Subject Details in the OPF File do not match with MIS Meta Information.  ";
                    }
                    else
                    {
                    //  errorLog= errorLog + "Sucess:01 OPF File contins Subject details and it is match with MIS"+"-----";;
                    }
                }
        //Test Case:1<-------------------Start test case for match xml:lang in NCX  with MIS-------------------------->
                    //errorLog = errorLog +"**************"+ncxmetaDATA;
                    Pattern dcncxTitle = Pattern.compile("<docTitle><text>(.+?)</text></docTitle>");
                    Matcher ncxTitlematcher = dcncxTitle.matcher(ncxmetaDATA);
                    String replacencxTitle= null;
                    if (ncxTitlematcher.find())
                    {
                        String ncxTitle= ncxTitlematcher.group(1);
                        replacencxTitle =StringEscapeUtils.unescapeHtml(ncxTitle);
                        summary =StringEscapeUtils.unescapeHtml(summary);
                        errorLog =errorLog+"============replacencxTitle========="+replacencxTitle+"===summary==="+summary;
                        if(!summary.equals(replacencxTitle))
                        {
                            errorLog= errorLog + "Error:39  Meta Title details in NCX File do not match with MIS Meta Information.  ";
                        }
                        else
                        {
                            //errorLog= errorLog + "Sucess:39 NCX File contins Meta Title details and it is match with MIS"+"-----";;
                        }
                    }        
   }//MAIN  if(fName.contains("epub")) IS CLOSE
} ////Close fileID

}//MAIN FOR LOOP OF ATTACHMENT IS CLOSE

int ePubcount = 0;
for (String target : folderfilesNAME) 
{
    if( (target.endsWith(".epub")) || (target.endsWith(".EPUB")))
    {
        ePubcount= ePubcount + 1;
    }
}
if(ePubcount==0)
{
    throw new InvalidInputException ("No ePUB file present in "+requiredValue+" folder. Kindly upload ePub file.");
}
int standeredCount = 0;
for (String standredCheck : folderfilesNAME) 
{
    if (standredCheck.endsWith(".EPUB"))
    {
        standeredCount= standeredCount + 1;
    }
}
if(standeredCount > 0)
{
    throw new InvalidInputException ("File Name not contains ePub Strandered");
}
if(errorLog.equals(" "))
{

}
else
{
    throw new InvalidInputException("Kindly Check the below Listed Error Log"+ errorLog); 
}
 }
    catch(Exception xv)
    {
        throw new InvalidInputException("====="+xv.getStackTrace()[0].getLineNumber()+xv); 

    }

}//atlas-mvn eclipse:eclipse
}

}