1 13 package org.ejbca.ui.web.admin.services.servicetypes; 14 15 import java.io.ByteArrayInputStream ; 16 import java.io.ByteArrayOutputStream ; 17 import java.io.IOException ; 18 import java.util.ArrayList ; 19 import java.util.Properties ; 20 21 28 public class CustomActionType extends ActionType { 29 30 public static final String NAME = "CUSTOMACTION"; 31 32 public CustomActionType() { 33 super("customaction.jsp", NAME, true); 34 } 35 36 private String classPath; 37 38 private String propertyText; 39 40 43 public String getPropertyText() { 44 return propertyText; 45 } 46 47 50 public void setPropertyText(String propertyText) { 51 this.propertyText = propertyText; 52 } 53 54 57 public void setClassPath(String classPath) { 58 this.classPath = classPath; 59 } 60 61 public String getClassPath() { 62 return classPath; 63 } 64 65 public Properties getProperties(ArrayList errorMessages) throws IOException { 66 Properties retval = new Properties (); 67 retval.load(new ByteArrayInputStream (getPropertyText().getBytes())); 68 return retval; 69 } 70 71 public void setProperties(Properties properties) throws IOException { 72 ByteArrayOutputStream baos = new ByteArrayOutputStream (); 73 properties.store(baos, null); 74 setPropertyText(new String (baos.toByteArray())); 75 } 76 77 78 public boolean isCustom() { 79 return true; 80 } 81 82 83 } 84 | Popular Tags |