1 48 49 package org.jpublish.resource; 50 51 import com.anthonyeden.lib.config.Configuration; 52 import com.anthonyeden.lib.config.ConfigurationException; 53 import org.jpublish.ManagerBase; 54 55 61 public abstract class AbstractResourceManager extends ManagerBase 62 implements ResourceManager { 63 64 protected String name = null; 65 protected boolean writeAllowed = false; 66 67 72 public String getName() { 73 return name; 74 } 75 76 81 public void setName(String name) { 82 this.name = name; 83 } 84 85 90 public boolean isWriteAllowed() { 91 return writeAllowed; 92 } 93 94 99 100 public void setWriteAllowed(boolean writeAllowed) { 101 this.writeAllowed = writeAllowed; 102 } 103 104 109 110 public void setWriteAllowed(String writeAllowed) { 111 if (writeAllowed != null) { 112 setWriteAllowed("true".equals(writeAllowed)); 113 } 114 } 115 116 122 123 public void loadConfiguration(Configuration configuration) 124 throws ConfigurationException { 125 super.loadConfiguration(configuration); 126 setName(configuration.getAttribute("name")); 127 setWriteAllowed(configuration.getChildValue("write-allowed")); 128 } 129 130 } 131 | Popular Tags |