1 13 package org.jahia.services.jef; 14 15 import org.jahia.exceptions.JahiaException; 16 import org.jahia.security.license.LicenseConstants; 17 18 import java.io.IOException ; 19 20 21 27 public final class JecFile extends JefFile { 28 29 private static org.apache.log4j.Logger logger = 30 org.apache.log4j.Logger.getLogger (JecFile.class); 31 32 42 public JecFile (String path) 43 throws IOException , JahiaException, InvalidJefFileException { 44 super (path); 45 } 46 47 48 54 public int getLicenseType () 55 throws JefFileKeyNotFoundException, JefFileInvalidKeyValueException { 56 57 String val = getKey (LicenseConstants.LICENSE_TYPE_OPTION); 58 if (val == null) { 59 throw new JefFileKeyNotFoundException (LicenseConstants.LICENSE_TYPE_OPTION); 60 } 61 62 logger.debug (" getLicenseType val=" + val); 63 64 try { 65 return Integer.parseInt (val); 66 } catch (Throwable t) { 67 throw new JefFileInvalidKeyValueException (LicenseConstants.LICENSE_TYPE_OPTION); 68 } 69 } 70 71 72 80 public int getLicenseTypeRelComp () 81 throws JefFileKeyNotFoundException, JefFileInvalidKeyValueException { 82 83 String val = getKey (LicenseConstants.LICENSE_TYPE_RELCOMP_OPTION); 84 if (val == null) { 85 throw new JefFileKeyNotFoundException ( 86 LicenseConstants.LICENSE_TYPE_RELCOMP_OPTION); 87 } 88 89 logger.debug (" getLicenseTypeRelComp val=" + val); 90 91 try { 92 return Integer.parseInt (val); 93 } catch (Throwable t) { 94 throw new JefFileInvalidKeyValueException ( 95 LicenseConstants.LICENSE_TYPE_RELCOMP_OPTION); 96 } 97 } 98 99 } 100 101 | Popular Tags |