Package java.util

Examples of java.util.StringTokenizer


   private void getArchiveArray(String archiveList)
   {
      if (archiveList != null)
      {
         StringTokenizer st = new StringTokenizer(archiveList, ", ");
         archives = new String[st.countTokens()];

         for (int i = 0; i < archives.length; i++)
            archives[i] = st.nextToken();
      }
   }
View Full Code Here


  {
    this();

    String cookieHeader = null;
    String host = "";
    StringTokenizer tokens = null;

    // does is start with "Set-Cookie" ?
    if (setCookie.substring(0,HEADER_SETCOOKIE.length()).equalsIgnoreCase(HEADER_SETCOOKIE)) {
      cookieHeader = setCookie.substring(HEADER_SETCOOKIE.length());
    } else {
      throw new CookieException("Not a Set-Cookie header");
    }

    // set defaults from the URL
    if (u != null) {
      this.domain = u.getHost().toLowerCase();
      host = this.domain;
    } else {
      this.domain = "";
    }

    // tokenize setcookie request
    tokens = new StringTokenizer(cookieHeader,";");

    // there must be at least ONE token (name=value)
    if (tokens.countTokens() < 1) {
      throw new CookieException("Cookie contains no data");
    } else {
      String field = tokens.nextToken();
      int pos = field.indexOf('=');
      if (pos <= 0) {
  throw new CookieException("First field not in the format NAME=VALUE"
          +" but got "+field);
      } else {
  name = field.substring(0,pos).trim();
  value = field.substring(pos+1);
      }
    }

    // parse all other fields
    while (tokens.hasMoreTokens()) {
      String field = tokens.nextToken();
      String fieldname="";
      String fieldvalue="";

      int pos = field.indexOf('=');
      if (pos <= 0) {
View Full Code Here

      if (drivers == null) {
        throw new Exception("No database drivers (JDBC) specified");
      }
      // The call to newInstance() is necessary on some platforms
      // (with some java VM implementations)
      StringTokenizer st = new StringTokenizer(drivers, ", ");
      while (st.hasMoreTokens()) {
        String driver = st.nextToken();
        boolean result;
        try {
          Class.forName(driver);
          DRIVERS.addElement(driver);
          result = true;
View Full Code Here

    } else {
      throw new CookieException("Not a Cookie header");
    }
   
    // tokenize setcookie request
    StringTokenizer tokens = new StringTokenizer(cookieHeader,";");
    Cookie[] cookies= new Cookie[tokens.countTokens()];
    int i=0;
   
    while (tokens.hasMoreTokens()) {
      cookies[i]=null;
        String field = tokens.nextToken();
        int pos = field.indexOf('=');
        if (pos <= 0) {
          throw new CookieException("Cookie field not in the format NAME=VALUE"
            +" but got "+field);
        } else {
View Full Code Here

      toLoad.getPackageMetaDataElement("DoNotLoadIfClassNotPresent");
   
    if (doNotLoadIfClassNotInstantiable != null &&
        doNotLoadIfClassNotInstantiable.toString().length() > 0) {
     
      StringTokenizer tok = new StringTokenizer(doNotLoadIfClassNotInstantiable.toString(), ",");
      while (tok.hasMoreTokens()) {
        String nextT = tok.nextToken().trim();
        try {
          Class.forName(nextT);
        } catch (Exception ex) {
          for (PrintStream p : progress) {
            p.println("[Weka] " + toLoad.getName() + " can't be loaded because "
View Full Code Here

    String packageRootPath = packageRoot.getPath() + File.separator;
   
    if (doNotLoadIfFileMissing != null &&
        doNotLoadIfFileMissing.toString().length() > 0) {

      StringTokenizer tok = new StringTokenizer(doNotLoadIfFileMissing.toString(), ",");
      while (tok.hasMoreTokens()) {
        String nextT = tok.nextToken().trim();
        File toCheck = new File(packageRootPath + nextT);
        if (!toCheck.exists()) {
          for (PrintStream p : progress) {
            p.println("[Weka] " + toLoad.getName() + " can't be loaded because "
                + toCheck.getPath() + " appears to be missing.");
View Full Code Here

    _bpelServer.registerBpelEventListener(new DebugBpelEventListener());

    // then, whatever else they want.
    String listenersStr = _odeConfig.getEventListeners();
    if (listenersStr != null) {
      for (StringTokenizer tokenizer = new StringTokenizer(listenersStr, ",;"); tokenizer.hasMoreTokens();) {
        String listenerCN = tokenizer.nextToken();
        try {
          _bpelServer.registerBpelEventListener((BpelEventListener) Class.forName(listenerCN).newInstance());
          __log.debug("REGISTERED EVENT LISTENER: "+listenerCN);
        } catch (Exception e) {
          __log.warn("Couldn't register the event listener " + listenerCN + ", the class couldn't be "
View Full Code Here

  }

  private void registerMexInterceptors() {
    String listenersStr = _odeConfig.getMessageExchangeInterceptors();
    if (listenersStr != null) {
      for (StringTokenizer tokenizer = new StringTokenizer(listenersStr, ",;"); tokenizer.hasMoreTokens();) {
        String interceptorCN = tokenizer.nextToken();
        try {
          _bpelServer.registerMessageExchangeInterceptor((MessageExchangeInterceptor) Class.forName(interceptorCN).newInstance());
          __log.debug("MESSAGE EXCHANGE INTERCEPTOR REGISTERED: "+interceptorCN);
        } catch (Exception e) {
          __log.warn("Couldn't register the event listener " + interceptorCN + ", the class couldn't be "
View Full Code Here

      String equiv=element.getAttribute("http-equiv");
      if ((equiv != null) && (equiv.equalsIgnoreCase("refresh"))) {
        String refreshcontent=element.getAttribute("content");
        if (refreshcontent == null) { refreshcontent=""; }
       
        StringTokenizer st=new StringTokenizer(refreshcontent,";");
        while (st.hasMoreTokens()) {
          String token=st.nextToken().trim();
          AttribValuePair av = new AttribValuePair(token);
          if (av.getAttrib().equals("url")) {
            addLink(av.getValue(),links);
          }
        }
View Full Code Here

        iRandomSelection = properties.getPropertyBoolean("GreatDeluge.Random", iRandomSelection);
        iUpdatePoints = properties.getPropertyBoolean("GreatDeluge.Update", iUpdatePoints);
        String neighbours = properties.getProperty("GreatDeluge.Neighbours",
                ItcSwapMove.class.getName() + "@1;"
                + ItcNotConflictingMove.class.getName() + "@1");
        for (StringTokenizer s = new StringTokenizer(neighbours, ";"); s.hasMoreTokens();) {
            String nsClassName = s.nextToken();
            double bonus = 1.0;
            if (nsClassName.indexOf('@') >= 0) {
                bonus = Double.parseDouble(nsClassName.substring(nsClassName.indexOf('@') + 1));
                nsClassName = nsClassName.substring(0, nsClassName.indexOf('@'));
            }
View Full Code Here

TOP

Related Classes of java.util.StringTokenizer

Copyright © 2015 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.