public void read(Reader policy) throws ParsingException, IOException {
  if (!(policy instanceof BufferedReader)) {
    policy=new BufferedReader(policy);
  }
  st=new StreamTokenizer(policy);
  st.resetSyntax();
  st.wordChars('a','z');
  st.wordChars('A','Z');
  st.wordChars('.','.');
  st.wordChars('0','9');
  st.wordChars('_','_');
  st.wordChars('$','$');
  st.wordChars(128 + 32,255);
  st.whitespaceChars(0,' ');
  st.commentChar('/');
  st.quoteChar('\'');
  st.quoteChar('"');
  st.lowerCaseMode(false);
  st.ordinaryChar('/');
  st.slashSlashComments(true);
  st.slashStarComments(true);
  lookahead=st.nextToken();
  GrantEntry ge=null;
  while (lookahead != StreamTokenizer.TT_EOF) {
    if (peek("grant")) {
      ge=parseGrantEntry();
      if (ge != null)       add(ge);
    }
 else     if (peek("keystore") && keyStoreUrlString == null) {
      parseKeyStoreEntry();
    }
 else     if (peek("keystorePasswordURL") && storePassURL == null) {
      parseStorePassURL();
    }
 else     if (ge == null && keyStoreUrlString == null && storePassURL == null && peek("domain")) {
      if (domainEntries == null) {
        domainEntries=new TreeMap<>();
      }
      DomainEntry de=parseDomainEntry();
      if (de != null) {
        String domainName=de.getName();
        if (!domainEntries.containsKey(domainName)) {
          domainEntries.put(domainName,de);
        }
 else {
          MessageFormat form=new MessageFormat(ResourcesMgr.getString("duplicate.keystore.domain.name"));
          Object[] source={domainName};
          throw new ParsingException(form.format(source));
        }
      }
    }
 else {
    }
    match(";");
  }
  if (keyStoreUrlString == null && storePassURL != null) {
    throw new ParsingException(ResourcesMgr.getString("keystorePasswordURL.can.not.be.specified.without.also.specifying.keystore"));
  }
}

public void read ( Reader policy ) throws ParsingException , IOException { if ( ! ( policy instanceof BufferedReader ) ) { policy = new BufferedReader ( policy ) ; } st = new StreamTokenizer ( policy ) ; st . resetSyntax ( ) ; st . wordChars ( 'a' , 'z' ) ; st . wordChars ( 'A' , 'Z' ) ; st . wordChars ( '.' , '.' ) ; st . wordChars ( '0' , '9' ) ; st . wordChars ( '_' , '_' ) ; st . wordChars ( '$' , '$' ) ; st . wordChars ( 128 + 32 , 255 ) ; st . whitespaceChars ( 0 , ' ' ) ; st . commentChar ( '/' ) ; st . quoteChar ( '\'' ) ; st . quoteChar ( '"' ) ; st . lowerCaseMode ( false ) ; st . ordinaryChar ( '/' ) ; st . slashSlashComments ( true ) ; st . slashStarComments ( true ) ; lookahead = st . nextToken ( ) ; GrantEntry ge = null ; while ( lookahead != StreamTokenizer . TT_EOF ) { if ( peek ( "grant" ) ) { ge = parseGrantEntry ( ) ; if ( ge != null ) add ( ge ) ; } else if ( peek ( "keystore" ) && keyStoreUrlString == null ) { parseKeyStoreEntry ( ) ; } else if ( peek ( "keystorePasswordURL" ) && storePassURL == null ) { parseStorePassURL ( ) ; } else if ( ge == null && keyStoreUrlString == null && storePassURL == null && peek ( "domain" ) ) { if ( domainEntries == null ) { domainEntries = new TreeMap < > ( ) ; } DomainEntry de = parseDomainEntry ( ) ; if ( de != null ) { String domainName = de . getName ( ) ; if ( ! domainEntries . containsKey ( domainName ) ) { domainEntries . put ( domainName , de ) ; } else { MessageFormat form = new MessageFormat ( ResourcesMgr . getString ( "duplicate.keystore.domain.name" ) ) ; Object [ ] source = { domainName } ; throw new ParsingException ( form . format ( source ) ) ; } } } else { } match ( ";" ) ; } if ( keyStoreUrlString == null && storePassURL != null ) { throw new ParsingException ( ResourcesMgr . getString ( "keystorePasswordURL.can.not.be.specified.without.also.specifying.keystore" ) ) ; } }
reads a policy configuration into the policy object using a reader object . < p >
