Package java.util

Examples of java.util.StringTokenizer


    }
  }
 
  static void parseProperties(String str, Map<String, String> props) {
    str = str.trim();
    StringTokenizer st = new StringTokenizer(str, ",")//$NON-NLS-1$
    while (st.hasMoreTokens()) {
      String property = st.nextToken();
      int index = property.indexOf('=');
      if (index != -1 && property.length() > (index+1)) {
        props.put(property.substring(0, index).trim(), property.substring(index+1).trim());
      }
    }
View Full Code Here


    }
  }
 
  static void parseProperties(String str, Map<String, String> props) {
    str = str.trim();
    StringTokenizer st = new StringTokenizer(str, ",")//$NON-NLS-1$
    while (st.hasMoreTokens()) {
      String property = st.nextToken();
      int index = property.indexOf('=');
      if (index != -1 && property.length() > (index+1)) {
        props.put(property.substring(0, index).trim(), property.substring(index+1).trim());
      }
    }
View Full Code Here

                 "SSLTcpProxyService.init(" + args + ',' + firstTime + ')');

    int port = DEFAULT_PORT;
    String address = DEFAULT_BINDADDRESS;
    if (args != null) {
      StringTokenizer st = new StringTokenizer(args);     
      port = Integer.parseInt(st.nextToken());
      if (st.hasMoreTokens()) {
        address = st.nextToken();
      }
    }

    int backlog = AgentServer.getInteger(BACKLOG_PROP, DEFAULT_BACKLOG).intValue();
View Full Code Here

  private static String [] getCipherList() throws Exception {
    String cipherList = System.getProperty(CIPHER,null);
    String[] cipherTable = null;
    if ( cipherList != null ) {
      StringTokenizer tokenizer = new StringTokenizer( cipherList,",");
      int tokens = tokenizer.countTokens();
      if (tokens > 0) {
        cipherTable = new String[tokens];
        while(tokenizer.hasMoreElements())
          cipherTable[--tokens] = tokenizer.nextToken();
      }
    }
    return cipherTable;
  }
View Full Code Here

    }


    public void _add(String fqn, Serializable element) {
        Node curr, n;
        StringTokenizer tok;
        String child_name;
        String tmp_fqn="";

        if(root == null) {
            root=new Node("/", null);
            notifyNodeAdded("/", null);
        }
        if(fqn == null)
            return;
        curr=root;
        tok=new StringTokenizer(fqn, "/");

        while(tok.hasMoreTokens()) {
            child_name=tok.nextToken();
            tmp_fqn=tmp_fqn + '/' + child_name;
            n=curr.findChild(child_name);
            if(n == null) {
                n=new Node(child_name, null);
                curr.addChild(n);
                if(!tok.hasMoreTokens()) {
                    n.element=element;
                    notifyNodeAdded(tmp_fqn, element);
                    return;
                }
                else
View Full Code Here

    }


    public void _remove(String fqn) {
        Node curr, n;
        StringTokenizer tok;
        String child_name=null;

        if(fqn == null || root == null)
            return;
        curr=root;
        tok=new StringTokenizer(fqn, "/");

        while(tok.countTokens() > 1) {
            child_name=tok.nextToken();
            n=curr.findChild(child_name);
            if(n == null) // node does not exist
                return;
            curr=n;
        }
        try {
            child_name=tok.nextToken();
            if(child_name != null) {
                n=curr.removeChild(child_name);
                if(n != null)
                    notifyNodeRemoved(fqn);
            }
View Full Code Here

    }


    private Node findNode(String fqn) {
        Node curr=root;
        StringTokenizer tok;
        String child_name;

        if(fqn == null || root == null) return null;
        if("/".equals(fqn) || "".equals(fqn))
            return root;

        tok=new StringTokenizer(fqn, "/");
        while(tok.hasMoreTokens()) {
            child_name=tok.nextToken();
            curr=curr.findChild(child_name);
            if(curr == null) return null;
        }
        return curr;
    }
View Full Code Here

       
        Map pathResults = new HashMap();
        List reversetList = new ArrayList();
        String separator = System.getProperty( "path.separator"  ); //$NON-NLS-1$

        StringTokenizer path = new StringTokenizer( classPath, separator );

        while(path.hasMoreTokens()){
            String pathElement = path.nextToken();
            File pathFile = new File( pathElement );
            if (pathFile.exists()) {
//                        if (resourceExistInClassPath(pathElement)) {
                pathResults.put(pathElement, Boolean.TRUE);
                   
View Full Code Here

        // strip last '/'
        result = trimTrailingSlash(result);

        // replace ., ~ and ..
        // in this loop resArg will never end with '/'
        StringTokenizer st = new StringTokenizer(normalizedFileName, "/");
        while (st.hasMoreTokens()) {
            String tok = st.nextToken();

            // . => current directory
            if (tok.equals(".")) {
                // ignore and move on
            } else if (tok.equals("..")) {
View Full Code Here

            listTypes = "";
        } else {
            listTypes = argument.substring(spIndex + 1);
   
            // parse all the type tokens
            StringTokenizer st = new StringTokenizer(listTypes, ";");
            types = new String[st.countTokens()];
            for (int i = 0; i < types.length; ++i) {
                types[i] = st.nextToken();
            }
        }
        // set the list types
        String[] validatedTypes = validateSelectedTypes(types);
        if (validatedTypes != null) {
View Full Code Here

TOP

Related Classes of java.util.StringTokenizer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.