View Javadoc
1   package org.kuali.ole.batch.helper;
2   
3   import org.apache.commons.lang.StringUtils;
4   import org.apache.log4j.Logger;
5   import org.kuali.ole.OLEConstants;
6   import org.kuali.ole.batch.bo.*;
7   import org.kuali.ole.docstore.common.document.content.bib.marc.BibMarcRecord;
8   import org.kuali.ole.docstore.model.xmlpojo.work.bib.marc.ControlField;
9   import org.kuali.ole.docstore.common.document.content.bib.marc.DataField;
10  import org.kuali.ole.docstore.common.document.content.bib.marc.SubField;
11  import org.kuali.ole.pojo.bib.BibliographicRecord;
12  import org.kuali.rice.core.api.config.property.ConfigContext;
13  import org.marc4j.MarcStreamWriter;
14  import org.marc4j.MarcWriter;
15  import org.marc4j.MarcXmlReader;
16  import org.marc4j.marc.Record;
17  
18  import java.io.*;
19  import java.nio.file.FileSystems;
20  import java.util.*;
21  
22  /**
23   * Created with IntelliJ IDEA.
24   * User: meenrajd
25   * Date: 2/20/13
26   * Time: 12:16 PM
27   * To change this template use File | Settings | File Templates.
28   */
29  public class OLEBatchProcessDataHelper {
30  
31      private String statingDirectory = ConfigContext.getCurrentContextConfig().getProperty("staging.directory");
32      private static final Logger LOG = Logger.getLogger(OLEBatchProcessDataHelper.class);
33  
34      private static volatile OLEBatchProcessDataHelper exportDataHelper;
35  
36  
37      private static final String applicationUrl = ConfigContext.getCurrentContextConfig().getProperty(OLEConstants.OLEBatchProcess.BATCH_EXPORT_PATH_APP_URL);
38      private static final String homeDirectory = ConfigContext.getCurrentContextConfig().getProperty(OLEConstants.USER_HOME_DIRECTORY);
39  
40      private OLEBatchProcessDataHelper() {
41      }
42  
43      public static synchronized OLEBatchProcessDataHelper getInstance() {
44          if (exportDataHelper == null) {
45              exportDataHelper = new OLEBatchProcessDataHelper();
46          }
47          return exportDataHelper;
48      }
49  
50      /**
51       * deletes the Marc Fields and subfileds of the given BibRecord for the given Batch process profile
52       *
53       * @param oleBatchProcessProfileBo
54       * @param record
55       */
56      public void deleteFieldsSubfields(OLEBatchProcessProfileBo oleBatchProcessProfileBo, BibMarcRecord record) {
57          List<OLEBatchProcessProfileDeleteField> deleteFieldList = oleBatchProcessProfileBo.getOleBatchProcessProfileDeleteFieldsList();
58          for (OLEBatchProcessProfileDeleteField deleteField : deleteFieldList) {
59              if (StringUtils.isNotEmpty(deleteField.getSubField())) {
60                  deleteMarcSubFields(record, deleteField);
61              } else if (StringUtils.isNotEmpty(deleteField.getTag())) {
62                  deleteMarcFields(record, deleteField);
63              }
64          }
65      }
66  
67      /**
68       * deletes marc fields
69       *
70       * @param record
71       * @param deleteField
72       */
73      public void deleteMarcFields(BibMarcRecord record, OLEBatchProcessProfileDeleteField deleteField) {
74          List<DataField> dataFieldList = record.getDataFields();
75          List<Integer> indices = findDataFieldIndex(dataFieldList, deleteField.getTag(), deleteField.getFirstIndicator(), deleteField.getSecondIndicator());
76          for (int i = indices.size() - 1; i >= 0; i--) {
77              dataFieldList.remove(indices.get(i).intValue());
78          }
79      }
80  
81      public void addMarcFields(BibMarcRecord record, OLEBatchProcessProfileRenameField renameField) {
82          List<DataField> dataFieldList = record.getDataFields();
83          DataField dataField = new DataField();
84          dataField.setTag(renameField.getRenamedTag());
85          dataField.setInd1(renameField.getRenamedFirstIndicator());
86          dataField.setInd2(renameField.getRenamedSecondIndicator());
87          SubField subField = new SubField();
88          if (renameField.getRenamedSubField().contains("$")) {
89              renameField.setRenamedSubField(renameField.getRenamedSubField().substring(1, renameField.getRenamedSubField().length()));
90          }
91          subField.setCode(renameField.getRenamedSubField());
92          subField.setValue(renameField.getRenamedSubFieldContains());
93          ListIterator<DataField> iterator = dataFieldList.listIterator();
94          if (renameField.getOriginalSubField().contains("$")) {
95              renameField.setOriginalSubField(renameField.getOriginalSubField().substring(1, renameField.getOriginalSubField().length()));
96          }
97          while (iterator.hasNext()) {
98              DataField dField = iterator.next();
99              if (dField.getTag().equals(renameField.getOriginalTag())) {
100                 Iterator<SubField> subFieldIterator = dField.getSubFields().iterator();
101                 while (subFieldIterator.hasNext()) {
102                     SubField sField = subFieldIterator.next();
103                     if (sField.getCode().equals(renameField.getOriginalSubField())) {
104                         if (StringUtils.isEmpty(renameField.getRenamedSubFieldContains())) {
105                             subField.setValue(sField.getValue());
106                         }
107                         dataField.addSubField(subField);
108                     }
109                 }
110             }
111         }
112         dataFieldList.add(dataField);
113     }
114 
115 
116     /**
117      * deletes marc subfields
118      *
119      * @param record
120      * @param deleteField
121      */
122     public void deleteMarcSubFields(BibMarcRecord record, OLEBatchProcessProfileDeleteField deleteField) {
123         List<DataField> dataFieldList = record.getDataFields();
124         boolean hasEmptySubFields = false;
125         for (DataField dataField : dataFieldList) {
126             if (!dataField.getTag().equals(deleteField.getTag())) continue;
127 
128             List<Integer> indices = findSubFieldIndex(dataField.getSubFields(), deleteField.getSubField(), deleteField.getSubFieldContains());
129             for (int i = indices.size() - 1; i >= 0; i--) {
130                 dataField.getSubFields().remove(indices.get(i).intValue());
131             }
132             if(dataField.getSubFields().isEmpty()){
133                 hasEmptySubFields=true;
134             }
135         }
136         if(hasEmptySubFields)
137             deleteEmptyFields(dataFieldList);
138     }
139 
140     /**
141      * deletes emply dataFields
142      * @param dataFieldList
143      */
144     private void deleteEmptyFields(List<DataField>dataFieldList){
145         Iterator<DataField> itr = dataFieldList.iterator();
146         while(itr.hasNext()){
147             DataField dataField = itr.next();
148             if(dataField.getSubFields().isEmpty()){
149                 itr.remove();
150             }
151         }
152 
153     }
154 
155     /**
156      * renames the marc fields ans subfields
157      *
158      * @param oleBatchProcessProfileBo
159      * @param record
160      */
161     public void renameMarcFieldsSubFields(OLEBatchProcessProfileBo oleBatchProcessProfileBo, BibMarcRecord record) {
162         List<OLEBatchProcessProfileRenameField> renameList = oleBatchProcessProfileBo.getOleBatchProcessProfileRenameFieldsList();
163         for (OLEBatchProcessProfileRenameField renameField : renameList) {
164             if (StringUtils.isNotEmpty(renameField.getOriginalSubField()) && StringUtils.isNotEmpty(renameField.getRenamedSubField())
165                     && !renameField.getOriginalSubField().equals(renameField.getRenamedSubField())) {
166                 renameMarcSubFields(record, renameField);
167             }
168             if (StringUtils.isNotEmpty(renameField.getOriginalTag()) && StringUtils.isNotEmpty(renameField.getRenamedTag())
169                     && !renameField.getOriginalTag().equals(renameField.getRenamedSubField())) {
170                 renameMarcFields(record, renameField);
171             }
172         }
173     }
174 
175     /**
176      * renames marc fields and indicators
177      *
178      * @param record
179      * @param renameField
180      */
181     public void renameMarcFields(BibMarcRecord record, OLEBatchProcessProfileRenameField renameField) {
182         List<DataField> dataFieldList = record.getDataFields();
183         List<Integer> indices = findDataFieldIndex(dataFieldList, renameField.getOriginalTag(), renameField.getOriginalFirstIndicator(), renameField.getOriginalSecondIndicator());
184         for (int i = 0; i < indices.size(); i++) {
185             DataField dataField = dataFieldList.get(indices.get(i));
186             if (StringUtils.isNotEmpty(renameField.getRenamedFirstIndicator()))
187                 dataField.setInd1(renameField.getRenamedFirstIndicator());
188             if (StringUtils.isNotEmpty(renameField.getRenamedSecondIndicator()))
189                 dataField.setInd2(renameField.getRenamedSecondIndicator());
190             if (StringUtils.isNotEmpty(renameField.getRenamedTag())) dataField.setTag(renameField.getRenamedTag());
191         }
192 
193 
194     }
195 
196     /**
197      * renames marc subfields
198      *
199      * @param record
200      * @param renameField
201      */
202     public void renameMarcSubFields(BibMarcRecord record, OLEBatchProcessProfileRenameField renameField) {
203         List<DataField> dataFieldList = record.getDataFields();
204         for (DataField dataField : dataFieldList) {
205             if (!dataField.getTag().equals(renameField.getOriginalTag())) continue;
206             List<Integer> indices = findSubFieldIndex(dataField.getSubFields(), renameField.getOriginalSubField(), renameField.getOriginalSubFieldContains());
207             for (int i = 0; i < indices.size(); i++) {
208                 SubField subField = dataField.getSubFields().get(indices.get(i));
209                 if (StringUtils.isNotEmpty(renameField.getRenamedSubField()))
210                     subField.setCode(renameField.getRenamedSubField());
211                 if (StringUtils.isNotEmpty(renameField.getRenamedSubFieldContains()))
212                     subField.setValue(renameField.getRenamedSubFieldContains());
213             }
214         }
215     }
216 
217     /**
218      * Method will return the index of the matchin tag , indicator 1 and indicator 2 for the giving dataFieldList
219      * for null indicators only tag is matched
220      *
221      * @param dataFieldList
222      * @param tag
223      * @param ind1
224      * @param ind2
225      * @return
226      */
227     public List<Integer> findDataFieldIndex(List<DataField> dataFieldList, String tag, String ind1, String ind2) {
228         if (StringUtils.isEmpty(tag)) return Collections.emptyList();
229         List<Integer> indices = new ArrayList<Integer>();
230         for (int i = 0; i < dataFieldList.size(); i++) {
231             if (!tag.equals(dataFieldList.get(i).getTag())) continue;
232             if (StringUtils.isNotEmpty(ind1) ? !ind1.equals(dataFieldList.get(i).getInd1()) : false) continue;
233             if (StringUtils.isNotEmpty(ind2) ? !ind2.equals(dataFieldList.get(i).getInd2()) : false) continue;
234             indices.add(i);
235         }
236         return indices;
237     }
238 
239     /**
240      * Method will return the index of the matching subfield and subfield content for the given subFieldList
241      * For null content only the subfield will be matched
242      *
243      * @param subFieldList
244      * @param subField
245      * @param content
246      * @return
247      */
248     public List<Integer> findSubFieldIndex(List<SubField> subFieldList, String subField, String content) {
249         if (StringUtils.isEmpty(subField)) return Collections.emptyList();
250         List<Integer> indices = new ArrayList<Integer>();
251         for (int i = 0; i < subFieldList.size(); i++) {
252             if(subField.contains("$")){
253                 subField = subField.substring(1);
254             }
255             if (StringUtils.isNotEmpty(subField) ? !subField.equals(subFieldList.get(i).getCode()) : true) continue;
256             if (StringUtils.isNotEmpty(content) ? !subFieldList.get(i).getValue().contains(content) : false) continue;
257             indices.add(i);
258         }
259         return indices;
260     }
261 
262     /**
263      * create and return the dirctory based on batch process type in the server file system for batch delete
264      * @param batchProceesType
265      * @param jobId
266      * @return
267      */
268     public String getBatchProcessFilePath(String batchProceesType, String jobId) {
269         String batchProcessLocation = getBatchProcessFilePath(batchProceesType);
270         if (batchProcessLocation != null) {
271             batchProcessLocation = batchProcessLocation + jobId + FileSystems.getDefault().getSeparator();
272             File file = new File(batchProcessLocation);
273             if (!file.isDirectory()) {
274                 file.mkdir();
275             }
276         }
277         return batchProcessLocation;
278     }
279 
280 
281     /**
282      * create and return the dirctory based on batch process type in the server file system
283      * @param batchProceesType
284      * @return
285      */
286     public String getBatchProcessFilePath(String batchProceesType) {
287 
288         String batchProcessLocation = null;
289         if (batchProceesType.equals(OLEConstants.OLEBatchProcess.BATCH_DELETE)) {
290             batchProcessLocation = ConfigContext.getCurrentContextConfig().getProperty(OLEConstants.OLEBatchProcess.BATCH_DELETE_DIR_PATH) + "/";
291         } else if (batchProceesType.equalsIgnoreCase(OLEConstants.OLEBatchProcess.BATCH_BIB_IMPORT)) {
292             batchProcessLocation = ConfigContext.getCurrentContextConfig().getProperty(OLEConstants.OLEBatchProcess.BATCH_BIB_IMPORT_DIR_PATH) + "/";
293         } else if (batchProceesType.equals(OLEConstants.OLEBatchProcess.BATCH_INVOICE)) {
294             batchProcessLocation = ConfigContext.getCurrentContextConfig().getProperty(OLEConstants.OLEBatchProcess.BATCH_INVOICE_DIR_PATH) + "/";
295         } else if (batchProceesType.equals(OLEConstants.OLEBatchProcess.ORDER_RECORD_IMPORT)) {
296             batchProcessLocation = ConfigContext.getCurrentContextConfig().getProperty(OLEConstants.OLEBatchProcess.BATCH_ORDER_RECORD_IMPORT_DIR_PATH) + "/";
297         } else if (batchProceesType.equals(OLEConstants.OLEBatchProcess.PATRON_IMPORT)) {
298             batchProcessLocation = ConfigContext.getCurrentContextConfig().getProperty(OLEConstants.OLEBatchProcess.BATCH_PATRON_IMPORT_DIR_PATH) + "/";
299         } else if (batchProceesType.equals(OLEConstants.OLEBatchProcess.LOCATION_IMPORT)) {
300             batchProcessLocation = ConfigContext.getCurrentContextConfig().getProperty(OLEConstants.OLEBatchProcess.BATCH_LOCATION_IMPORT_DIR_PATH) + "/";
301         } else if (batchProceesType.equals(OLEConstants.OLEBatchProcess.BATCH_EXPORT)) {
302             batchProcessLocation = ConfigContext.getCurrentContextConfig().getProperty(OLEConstants.OLEBatchProcess.BATCH_EXPORT_DIR_PATH) + "/";
303         }else if (batchProceesType.equals(OLEConstants.OLEBatchProcess.SERIAL_RECORD_IMPORT)) {
304             batchProcessLocation = ConfigContext.getCurrentContextConfig().getProperty(OLEConstants.OLEBatchProcess.SERIAL_IMPORT_DIR_PATH) + "/";
305         }
306 
307 
308         if (batchProcessLocation != null) {
309             File file = new File(batchProcessLocation);
310             if (!file.isDirectory()) {
311                 file.mkdir();
312             }
313         }
314         return batchProcessLocation;
315     }
316 
317     /**
318      * Create the failure record file in the batch process type dirctory
319      *
320      * @param failureRecordData
321      * @param batchProcessType
322      * @param batchFileName
323      * @throws Exception
324      */
325     public void createBatchFailureFile(String failureRecordData, String batchProcessType, String batchFileName, String jobId) throws Exception {
326         String fileLocation = getBatchProcessFilePath(batchProcessType , jobId);
327         //if (batchProcessType.equals(OLEConstants.OLEBatchProcess.BATCH_DELETE) || batchProcessType.equals(OLEConstants.OLEBatchProcess.SERIAL_RECORD_IMPORT)) {
328         //    fileLocation = getBatchProcessFilePath(batchProcessType, jobId);
329        // } else {
330        //     fileLocation = getBatchProcessFilePath(batchProcessType);
331       //  }
332         BufferedWriter out = new BufferedWriter(new FileWriter(fileLocation + batchFileName));
333         out.write(failureRecordData);
334         out.close();
335 
336     }
337 
338     /**
339      * Create the failure record file in the batch process type directory for batch delete
340      *
341      * @param successRecordData
342      * @param batchProcessType
343      * @param batchFileName
344      * @throws Exception
345      */
346     public void createBatchSuccessFile(String successRecordData, String batchProcessType, String batchFileName, String jobId) throws Exception {
347         String fileLocation =  fileLocation = getBatchProcessFilePath(batchProcessType, jobId);
348       //  if (batchProcessType.equals(OLEConstants.OLEBatchProcess.BATCH_DELETE)) {
349       //      fileLocation = getBatchProcessFilePath(batchProcessType, jobId);
350      //   }
351         BufferedWriter out = new BufferedWriter(new FileWriter(fileLocation + batchFileName));
352         out.write(successRecordData);
353         out.close();
354 
355     }
356 
357     /**
358      * Create the failure record file in the batch process type directory for batch delete
359      *
360      * @param failureReportData
361      * @param batchProcessType
362      * @param batchFileName
363      * @throws Exception
364      */
365     public void createBatchDeleteFailureReportFile(String failureReportData, String batchProcessType, String batchFileName, String jobId) throws Exception {
366         String fileLocation = getBatchProcessFilePath(batchProcessType, jobId);
367         //if (batchProcessType.equals(OLEConstants.OLEBatchProcess.BATCH_DELETE)) {
368         //    fileLocation = getBatchProcessFilePath(batchProcessType, jobId);
369        // }
370         BufferedWriter out = new BufferedWriter(new FileWriter(fileLocation + batchFileName));
371         out.write(failureReportData);
372         out.close();
373 
374     }
375 
376 
377     /**
378      * Delete the failure record file in the batch process type dirctory
379      */
380     public void deleteBatchFailureFile(String batchProcessType, String batchFileName) throws Exception {
381 
382         File file = new File(getBatchProcessFilePath(batchProcessType) + batchFileName);
383         if (file.exists()) {
384             file.delete();
385         }
386 
387 
388     }
389 
390     public void createFile(String[] content, String batchProcessType, String batchFileName, String jobId) throws Exception {
391         String fileLocation = getBatchProcessFilePath(batchProcessType) + jobId + "/";
392         File file = new File(fileLocation);
393         if (!file.isDirectory()) {
394             file.mkdir();
395         }
396         BufferedWriter out = new BufferedWriter(new FileWriter(fileLocation + batchFileName));
397         for (String id : content) {
398             out.write(id);
399             out.newLine();
400         }
401         out.close();
402     }
403 
404     /**
405      * Delete the upload file in the batch process type dirctory
406      */
407     public void deleteBatchFile(String batchProcessType, String batchFileName, String jobId) throws Exception {
408 
409         String fileLocation = getBatchProcessFilePath(batchProcessType, jobId);
410        // if (batchProcessType.equals(OLEConstants.OLEBatchProcess.BATCH_DELETE)) {
411         //    fileLocation = getBatchProcessFilePath(batchProcessType, jobId);
412         //} else {
413         //    fileLocation = getBatchProcessFilePath(batchProcessType);
414         //}
415         File file = new File(fileLocation + batchFileName);
416         if (file.exists()) {
417             file.delete();
418         }
419     }
420 
421     /**
422      * Get the upload file content from the batch process type dirctory by using job id an upload file name
423      */
424     public String getBatchProcessFileContent(String batchProcessType, String batchFileName, String jobId) throws Exception {
425 
426         String fileLocation = getBatchProcessFilePath(batchProcessType, jobId);
427         /*if (batchProcessType.equals(OLEConstants.OLEBatchProcess.BATCH_DELETE)) {*/
428         //    fileLocation = getBatchProcessFilePath(batchProcessType, jobId);
429         /*} else {
430             fileLocation = getBatchProcessFilePath(batchProcessType);
431         }*/
432         File file = new File(fileLocation + batchFileName);
433         if (file.exists()) {
434             BufferedReader br = new BufferedReader(new FileReader(file));
435             StringBuilder sb = new StringBuilder();
436             String line = br.readLine();
437             while (line != null) {
438                 sb.append(line);
439                 line = br.readLine();
440                 if (line != null) {
441                     sb.append("\n");
442                 }
443             }
444             return sb.toString();
445         }
446         return null;
447     }
448 
449     /**
450      * Copy the upload batch file in to the batch process file directory
451      */
452     public void createBatchProcessFile(String batchProcessType, String batchFileName, String fileContent, String jobId) throws Exception {
453         String  fileLocation = getBatchProcessFilePath(batchProcessType, jobId);
454         //if (batchProcessType.equals(OLEConstants.OLEBatchProcess.BATCH_DELETE)) {
455         // fileLocation = getBatchProcessFilePath(batchProcessType, jobId);
456         /*} else {
457             fileLocation = getBatchProcessFilePath(batchProcessType);
458         }*/
459 
460         if (fileLocation != null) {
461             BufferedWriter out = new BufferedWriter(new FileWriter(fileLocation + batchFileName));
462             out.write(fileContent);
463             out.close();
464         }
465     }
466 
467 
468     /**
469      * Copy the upload batch file in to the batch process file directory
470      */
471     public void createBatchProcessFile(String batchProcessType, String mrcFileName, String ediFileName, String mrcfileContent, String ediFileContent , String jobId) throws Exception {
472         String fileLocation = getBatchProcessFilePath(batchProcessType , jobId);
473         if (fileLocation != null) {
474             BufferedWriter mrcOut = new BufferedWriter(new FileWriter(fileLocation + mrcFileName));
475             mrcOut.write(mrcfileContent);
476             mrcOut.close();
477             BufferedWriter ediOut = new BufferedWriter(new FileWriter(fileLocation + ediFileName));
478             ediOut.write(ediFileContent);
479             ediOut.close();
480         }
481     }
482 
483     public void createBatchProcessFile(String batchProcessType, String documentFileName, String typeFileName, String historyFileName, String documentFileContent, String typeFileContent, String historyFileContent , String jobId) throws Exception {
484         String fileLocation = getBatchProcessFilePath(batchProcessType ,jobId);
485         if (fileLocation != null) {
486             if (documentFileName != null) {
487                 BufferedWriter documentOut = new BufferedWriter(new FileWriter(fileLocation + documentFileName));
488                 documentOut.write(documentFileContent);
489                 documentOut.close();
490             }
491             if (typeFileName != null) {
492                 BufferedWriter typeOut = new BufferedWriter(new FileWriter(fileLocation + typeFileName));
493                 typeOut.write(typeFileContent);
494                 typeOut.close();
495             }
496             if (historyFileName != null) {
497                 BufferedWriter historyOut = new BufferedWriter(new FileWriter(fileLocation + historyFileName));
498                 historyOut.write(historyFileContent);
499                 historyOut.close();
500             }
501         }
502     }
503 
504    /* public void setRecordNumber(BibliographicRecord record, String localId) {
505         List<ControlField> controlFieldList = record.getControlfields();
506         for (ControlField cf : controlFieldList) {
507             if (cf.getTag().equals("001")) {
508                 cf.setValue(localId);
509                 break;
510             }
511 
512         }
513     }*/
514 
515     public void createBatchBibImportFailureFile(String failureRecordData, String batchProcessType, String batchFileName, String jobId) throws Exception {
516         String fileLocation = getBatchProcessFilePath(batchProcessType,jobId);
517         String filePath = fileLocation + FileSystems.getDefault().getSeparator() + batchFileName;
518         createMarcRecord(failureRecordData, filePath);
519     }
520 
521     public void createMarcRecord(String marcRecordContent, String filePath) throws Exception {
522         File fileToWrite = new File(filePath);
523         FileOutputStream fileOutputStream = new FileOutputStream(fileToWrite);
524         //String bibContent = StringUtils.join(bibDocList, "");
525         InputStream input = new ByteArrayInputStream(marcRecordContent.getBytes());
526         if (!fileToWrite.exists()) {
527             fileToWrite.getParentFile().mkdirs();
528             fileToWrite.createNewFile();
529         }
530         try {
531             MarcXmlReader marcXmlReader = new MarcXmlReader(input);
532             MarcWriter writer = new MarcStreamWriter(fileOutputStream);
533 
534             while (marcXmlReader.hasNext()) {
535                 Record record = marcXmlReader.next();
536                 writer.write(record);
537             }
538             writer.close();
539         } catch (Exception e) {
540             e.printStackTrace();
541             throw new RuntimeException(e);
542         }
543     }
544 
545     public String getExportPathUrl(OLEBatchProcessJobDetailsBo job) {
546         //String filePath = StringUtils.substringAfter(job.getUploadFileName(), homeDirectory);
547         //return applicationUrl + FileSystems.getDefault().getSeparator() + OLEConstants.OLEBatchProcess.HOME + filePath;
548         return applicationUrl + OLEConstants.OLEBatchProcess.BATCH_CHANNEL_STRING + applicationUrl +
549                 OLEConstants.OLEBatchProcess.DIRECTORY_LIST_LOCATION + job.getUploadFileName().replace(statingDirectory,"");
550     }
551 
552     public String getBibPathUrl(OLEBatchProcessJobDetailsBo job) {
553         return applicationUrl + OLEConstants.OLEBatchProcess.BATCH_CHANNEL_STRING + applicationUrl
554                 + OLEConstants.OLEBatchProcess.DIRECTORY_LIST_LOCATION  + getBatchProcessFilePath(job.getBatchProcessType(), job.getJobId()).replace(statingDirectory, "");
555     }
556 
557     public String getDeletePathUrl(OLEBatchProcessJobDetailsBo job) {
558         return applicationUrl + OLEConstants.OLEBatchProcess.BATCH_CHANNEL_STRING + applicationUrl
559                 + OLEConstants.OLEBatchProcess.DIRECTORY_LIST_LOCATION + getBatchProcessFilePath(job.getBatchProcessType(), job.getJobId()).replace(statingDirectory, "");
560     }
561 
562     public String getSerialCSVPathUrl(OLEBatchProcessJobDetailsBo job) {
563         return applicationUrl + OLEConstants.OLEBatchProcess.BATCH_CHANNEL_STRING + applicationUrl
564                 + OLEConstants.OLEBatchProcess.DIRECTORY_LIST_LOCATION + getBatchProcessFilePath(job.getBatchProcessType(), job.getJobId()).replace(statingDirectory, "");
565     }
566 }