diff options
| author | netconomy <netconomy@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c> | 2007-11-22 08:27:04 +0000 | 
|---|---|---|
| committer | netconomy <netconomy@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c> | 2007-11-22 08:27:04 +0000 | 
| commit | fe11385a26e576e2da716b0a120c6eee4410a575 (patch) | |
| tree | 3952fc833e8ed91f6f828d60a7273981da5a07d9 /src | |
| parent | 35a65bfdfeee48e03cb5dcfc72d45ac0b8a6c790 (diff) | |
| download | pdf-as-3-fe11385a26e576e2da716b0a120c6eee4410a575.tar.gz pdf-as-3-fe11385a26e576e2da716b0a120c6eee4410a575.tar.bz2 pdf-as-3-fe11385a26e576e2da716b0a120c6eee4410a575.zip | |
Fixed the "assume only signature blocks" typo
git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@226 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c
Diffstat (limited to 'src')
| -rw-r--r-- | src/main/java/at/gv/egiz/pdfas/framework/config/SettingsHelper.java | 33 | 
1 files changed, 28 insertions, 5 deletions
| diff --git a/src/main/java/at/gv/egiz/pdfas/framework/config/SettingsHelper.java b/src/main/java/at/gv/egiz/pdfas/framework/config/SettingsHelper.java index abe4378..bb00ea1 100644 --- a/src/main/java/at/gv/egiz/pdfas/framework/config/SettingsHelper.java +++ b/src/main/java/at/gv/egiz/pdfas/framework/config/SettingsHelper.java @@ -3,6 +3,9 @@   */
  package at.gv.egiz.pdfas.framework.config;
 +import org.apache.commons.logging.Log;
 +import org.apache.commons.logging.LogFactory;
 +
  import at.gv.egiz.pdfas.framework.vfilter.VerificationFilterParameters;
  import at.gv.egiz.pdfas.impl.vfilter.VerificationFilterParametersImpl;
  import at.knowcenter.wag.egov.egiz.cfg.SettingsReader;
 @@ -10,22 +13,27 @@ import at.knowcenter.wag.egov.egiz.exceptions.SettingsException;  /**
   * Contains helpful Settings functions.
 + * 
   * @author wprinz
   */
  public final class SettingsHelper
  {
 +  /**
 +   * The log.
 +   */
 +  private static final Log log = LogFactory.getLog(SettingsHelper.class);
 +
    public static VerificationFilterParameters readVerificationFilterParametersFromSettings() throws SettingsException
 -  { 
 +  {
      boolean binaryOnly = getFlag("binary_only");
 -    // TODO: tknall: typo should be fixed (including entry within config.properties)
 -    boolean assumeOnlySB = getFlag("assume_only_signauture_blocks");
 +    boolean assumeOnlySB = getAssumeSB();
      boolean checkOld = getFlag("check_old_textual_sigs");
 -    
 +
      VerificationFilterParameters vfp = new VerificationFilterParametersImpl(binaryOnly, assumeOnlySB, checkOld);
      return vfp;
    }
 -  protected static boolean getFlag (String settingsKey) throws SettingsException
 +  protected static boolean getFlag(String settingsKey) throws SettingsException
    {
      String flag = SettingsReader.getInstance().getSetting(settingsKey, "false");
      boolean b = true;
 @@ -35,4 +43,19 @@ public final class SettingsHelper      }
      return b;
    }
 +
 +  protected static boolean getAssumeSB() throws SettingsException
 +  {
 +    // backward compatibility for typo
 +    String setting_with_typo = SettingsReader.getInstance().getSetting("assume_only_signauture_blocks", null);
 +    if (setting_with_typo != null)
 +    {
 +      log.warn("You still have the typo in your configuration file. Please change 'assume_only_signauture_blocks' to 'assume_only_signature_blocks'. Thanks.");
 +      boolean assumeOnlySB_typo = getFlag("assume_only_signauture_blocks");
 +      return assumeOnlySB_typo;
 +    }
 +
 +    boolean assumeOnlySB = getFlag("assume_only_signature_blocks");
 +    return assumeOnlySB;
 +  }
  }
 | 
