1 package org.kuali.ole.select.document.service.impl;
2
3 import org.apache.commons.codec.binary.Base64;
4 import org.kuali.ole.OLEConstants;
5 import org.kuali.ole.gl.GeneralLedgerConstants;
6 import org.kuali.ole.gl.businessobject.OriginEntryFull;
7 import org.kuali.ole.select.document.service.OLEEncumberOpenRecurringOrdersService;
8 import org.kuali.rice.core.api.config.property.ConfigContext;
9 import org.kuali.rice.kns.lookup.LookupResults;
10 import org.kuali.rice.krad.service.BusinessObjectService;
11 import org.kuali.rice.krad.util.ObjectUtils;
12
13 import java.io.File;
14 import java.io.FilenameFilter;
15 import java.util.Arrays;
16 import java.util.HashMap;
17 import java.util.List;
18 import java.util.Map;
19
20
21
22
23
24
25
26
27 public class OLEEncumberOpenRecurringOrdersServiceImpl implements OLEEncumberOpenRecurringOrdersService {
28
29 protected String batchFileDirectoryName;
30 protected BusinessObjectService businessObjectService;
31
32 public File[] getAllFileInBatchDirectory() {
33 File[] returnFiles = null;
34 if (new File(batchFileDirectoryName) != null) {
35 returnFiles = new File(batchFileDirectoryName).listFiles();
36 }
37 return returnFiles;
38 }
39
40 public String getBatchFileDirectoryName() {
41 return batchFileDirectoryName;
42 }
43
44 public void setBatchFileDirectoryName(String batchFileDirectoryName) {
45 this.batchFileDirectoryName = batchFileDirectoryName;
46 }
47
48 protected BusinessObjectService getBusinessObjectService() {
49 return businessObjectService;
50 }
51
52 public void createRolloverDirectory() {
53 String stagingDirectory = ConfigContext.getCurrentContextConfig().getProperty(org.kuali.ole.sys.OLEConstants.STAGING_DIRECTORY_KEY);
54 String fileLocation = stagingDirectory + org.kuali.ole.sys.OLEConstants.ROLLOVER_DIRECTORY;
55 File fileLocationDir = new File(fileLocation);
56 if (!(fileLocationDir.exists())) {
57 fileLocationDir.mkdir();
58 }
59 }
60 }