1 package org.kuali.ole.ingest;
2
3 import org.kuali.ole.ingest.krms.builder.OleKrmsBuilder;
4
5 import java.io.File;
6 import java.net.URL;
7 import java.util.List;
8
9
10
11
12
13
14
15
16 public class LoadDefaultIngestProfileBean {
17 private String fileName;
18 private OleKrmsBuilder oleKrmsBuilder;
19
20 public List<String> loadDefaultIngestProfile() throws Exception {
21 URL resource = getClass().getResource(fileName);
22 File file = new File(resource.toURI());
23 String fileContent = new FileUtil().readFile(file);
24 List<String> policies= oleKrmsBuilder.persistKrmsFromFileContent(fileContent);
25 return policies;
26 }
27
28 public void setFileName(String fileName) {
29 this.fileName = fileName;
30 }
31
32 public String getFileName() {
33 return fileName;
34 }
35
36 public OleKrmsBuilder getOleKrmsBuilder() {
37 return oleKrmsBuilder;
38 }
39
40 public void setOleKrmsBuilder(OleKrmsBuilder oleKrmsBuilder) {
41 this.oleKrmsBuilder = oleKrmsBuilder;
42 }
43 }