1 31 32 package org.opencms.file.types; 33 34 import org.opencms.configuration.CmsConfigurationException; 35 import org.opencms.loader.CmsDumpLoader; 36 import org.opencms.main.OpenCms; 37 38 47 public class CmsResourceTypeBinary extends A_CmsResourceType { 48 49 50 private static final int RESOURCE_TYPE_ID = 2; 51 52 53 private static final String RESOURCE_TYPE_NAME = "binary"; 54 55 56 private static boolean m_staticFrozen; 57 58 59 private static int m_staticTypeId; 60 61 64 public CmsResourceTypeBinary() { 65 66 super(); 67 m_typeId = RESOURCE_TYPE_ID; 68 m_typeName = RESOURCE_TYPE_NAME; 69 } 70 71 76 public static int getStaticTypeId() { 77 78 return m_staticTypeId; 79 } 80 81 86 public static String getStaticTypeName() { 87 88 return RESOURCE_TYPE_NAME; 89 } 90 91 94 public int getLoaderId() { 95 96 return CmsDumpLoader.RESOURCE_LOADER_ID; 97 } 98 99 102 public void initConfiguration(String name, String id, String className) throws CmsConfigurationException { 103 104 if ((OpenCms.getRunLevel() > OpenCms.RUNLEVEL_2_INITIALIZING) && m_staticFrozen) { 105 throw new CmsConfigurationException(Messages.get().container( 107 Messages.ERR_CONFIG_FROZEN_3, 108 this.getClass().getName(), 109 getStaticTypeName(), 110 new Integer (getStaticTypeId()))); 111 } 112 113 if (!RESOURCE_TYPE_NAME.equals(name)) { 114 throw new CmsConfigurationException(Messages.get().container( 116 Messages.ERR_INVALID_RESTYPE_CONFIG_NAME_3, 117 this.getClass().getName(), 118 RESOURCE_TYPE_NAME, 119 name)); 120 } 121 122 m_staticFrozen = true; 124 125 super.initConfiguration(RESOURCE_TYPE_NAME, id, className); 126 m_staticTypeId = m_typeId; 128 } 129 }
| Popular Tags
|