fixed bug 14501: licenseRestrictions is loaded from <source.path> directory
authorAsier Lostalé <asier.lostale@openbravo.com>
Fri, 10 Sep 2010 09:16:41 +0200
changeset 8371 224a37b46fd9
parent 8369 4ed5b7e9b0df
child 8372 fd51a5f4448f
fixed bug 14501: licenseRestrictions is loaded from <source.path> directory

Now license restrictions is in the same package directory as ActivationKey class is.
config/licenseRestrictions
src/build.xml
src/org/openbravo/erpCommon/obps/ActivationKey.java
src/org/openbravo/erpCommon/obps/licenseRestrictions
--- a/config/licenseRestrictions	Thu Sep 09 19:18:58 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-IeqpfXkoobemyDLAJHNBi3JrTdjgnU0BnGiX9k78CBHK1Eqdek/Lsi/HpeBev9c8sNQPOf9nwq8jWE4j7X4e6TUzdPX5xukYcTshjeB3wKh9Y6LE5rgEw+OqUm8bcaKH6Nm5Efg2yQnwsHqqTyjFQPXa9IdijkazSRrAEVg/X0WPMPEYYQRikHlz1CDJPiqEeQIhMejebxNmHa/VTLN5Hmhc+lyBfRVseGdJeJaf2Nh1YMwunKFAGMNKwPFFhqLyAXoGsNFs2BK5yPTgOEWaFRS+5Dei4fewUm7GI5k+a4xZ1qDrjYl+C/p6vod1oYf+KFsfH1P07v2k7J4VQ71XBANYXXDM81bgEWZJzz5F9mhUtabroQdejQdcTqGQPpX2ZOhmEfgelzN7WINpIF8rQHiMeVty8m3TG+zSTkc/Tj53UJaV8mjZ+cWSUAI7PFwIDbxeUcktfwV85yzpxAxu6Fln6h6fpxlmzy3DYhjBNTpMKYmjJX0ilomTCAivh31pfCMDOkoLwMmDQoov/bCPJfLej9RlhmC0Y1EswNL/IAbuINX3DNk2+G8i7yXUOE6FsUtDJ6WdVhSKw0BvCH/28oJ38rfx3aCcuLHjAJI23L5RjlQlqnVsGOZsDeJ5UWQGeBotYJWdfz1mSRAiPB4RE6dv9Ap0X90Y0MDYrJP2jW2FmIrY1R5UTh2XcvAomsToZdwLrolZIWe26RIn1yYRpGEf2wqg5sGQaOxQ39BB11Xhj2bzz96mnnqSP6GZiv52/cibVcp8VtErmClvF4OByPuKsswTUD8Fs9FYMNv+myfJ928PxuHmpjT99igMw7NNtbSD+lPckVSM9kKvUIuWxUgnSaly9FG2oP1DM2alkI9Vdc77EHW8Vjz5eID0EjM04rDKNvsbJygMCPF3XWaA2rpnUgcRB5Or0lCDe/z/zOoWK3p9N19TguH8y74cl0xd+jpkdfqfVEyUxqtTIG4/+0DZ8+VzPmOPArrFM51piby1Ym2L/J3Uuugiw1r8+RpRVdiTMLHKbe15KpuECf8W9KMpaYc7hzXo94aJXKvWuui1Y1vcrJhAXdN0ib8Wjz8473ecV/STAt5njB4dJiSjBfek+JYeXZz/Ft/fkPlvzW1DVbHx9RCmu068DWefuNvWMqJLr69pKCrea8PZXBJpit9tx/JSj454C1FOwigR+qsi24FOaaQ5Zy6m3VReW0cZ+9sQXLDwkjOfjvzJPFQ9A7kDTYOYzorjHPbCwy0JyXAxkHQ+wlV5+52WeM9uiTxAWtoyqcr+OhBb1btFqiaDhetH6LqxcGXm+0iLckp+cu4FY2t4eYY81PRKBUUCrdh8N0+N68P8XMht4rWIzeRzLVlY1PnFz0BDZa6IecwK2egOPmlH+xG8uhOYgIbbUE7nhcz8b1MDllGTOpTSG1e9UDJj8wBTWzeVIrVpJRztWjldY45skuAohNh7PxxDubeUv7701GVBqlg1mO2rb19evzDAMLUHF4i5exoWEy9uQqrF/qMT+W4I0zwJbgFHTs1HIpgQelm/gSysdnbnbQs14YceXv+BYMYurafh7N2lkUMnmkVkHpPk/08R0hCeOtKjkbSUCuOy9XPg153iJmxE3NCBeZl/gY2mmsMNtaswMEN05HKSkRqlu/CKedv/HrYYhXtdbaqkL8Ay0mcRtXimQCvr3aNQ9fcQLuLpmqJh5Uo=
\ No newline at end of file
--- a/src/build.xml	Thu Sep 09 19:18:58 2010 +0200
+++ b/src/build.xml	Fri Sep 10 09:16:41 2010 +0200
@@ -502,6 +502,7 @@
     <copy todir="${build}">
       <fileset file="${base.config}/quartz.properties" />
     </copy>
+    <copy todir="${build}/org/openbravo/erpCommon/obps" file="${basedir}/org/openbravo/erpCommon/obps/licenseRestrictions"/>
     <antcall target="build.local.context" inheritAll="true" inheritrefs="true" />
   </target>
 
--- a/src/org/openbravo/erpCommon/obps/ActivationKey.java	Thu Sep 09 19:18:58 2010 +0200
+++ b/src/org/openbravo/erpCommon/obps/ActivationKey.java	Fri Sep 10 09:16:41 2010 +0200
@@ -26,6 +26,7 @@
 import java.io.InputStreamReader;
 import java.io.ObjectInputStream;
 import java.math.BigInteger;
+import java.net.URL;
 import java.security.KeyFactory;
 import java.security.PublicKey;
 import java.security.Signature;
@@ -368,9 +369,12 @@
     }
 
     try {
-      File restrictionsFile = new File(OBPropertiesProvider.getInstance().getOpenbravoProperties()
-          .get("source.path")
-          + "/config/licenseRestrictions");
+      // read restriction file from this package's directory
+      URL url = this.getClass().getResource(getClass().getSimpleName() + ".class");
+      File classDir = new File(url.getPath());
+      File restrictionsFile = new File(classDir.getParent(), "licenseRestrictions");
+      log4j.debug("Restrictions file: " + restrictionsFile.getAbsolutePath());
+
       FileInputStream fis = new FileInputStream(restrictionsFile);
       byte fileContent[] = new byte[(int) restrictionsFile.length()];
       fis.read(fileContent);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/openbravo/erpCommon/obps/licenseRestrictions	Fri Sep 10 09:16:41 2010 +0200
@@ -0,0 +1,1 @@
+IeqpfXkoobemyDLAJHNBi3JrTdjgnU0BnGiX9k78CBHK1Eqdek/Lsi/HpeBev9c8sNQPOf9nwq8jWE4j7X4e6TUzdPX5xukYcTshjeB3wKh9Y6LE5rgEw+OqUm8bcaKH6Nm5Efg2yQnwsHqqTyjFQPXa9IdijkazSRrAEVg/X0WPMPEYYQRikHlz1CDJPiqEeQIhMejebxNmHa/VTLN5Hmhc+lyBfRVseGdJeJaf2Nh1YMwunKFAGMNKwPFFhqLyAXoGsNFs2BK5yPT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