Package java.util

Examples of java.util.Date


        this.processInstanceId = processInstanceId;
        this.processId = processId;
    this.nodeInstanceId = nodeInstanceId;
    this.nodeId = nodeId;
    this.nodeName = nodeName;
        this.date = new Date();
    }
View Full Code Here


            // rename file
            String rename = remoteTextFile + ".renamed";
            ftp.rename(remoteTextFile, rename);
           
            // get its mod time
            Date modTime = ftp.modtime(rename);
            String mod = modFormatter.format(modTime);
            log.debug(rename + ": " + mod);
   
            // modtime on original file should fail
            try {
View Full Code Here

            // move to test directory
            ftp.chdir(testdir);
   
            // get modtime
            log.debug("Modtime on existing file: " + remoteTextFile);
            Date modTime = ftp.modtime(remoteTextFile);
            String mod = modFormatter.format(modTime);
            log.debug(remoteTextFile + ": " + mod);
   
            try {
                // get modtime on non-existent file
View Full Code Here

            ftp.chdir(testdir);
   

            // get modtime
            log.debug("Existing modtime on existing file: " + remoteTextFile);
            Date modTime = ftp.modtime(remoteTextFile);
            log.debug(remoteTextFile + ": " + modTime.toString());
   
            // set modtime
            Calendar cal = Calendar.getInstance();
            cal.setTime(modTime);
            cal.add(Calendar.DAY_OF_YEAR, 1);
            cal.add(Calendar.HOUR_OF_DAY, 2);
            cal.add(Calendar.MINUTE, 3);
            cal.add(Calendar.SECOND, 4);
            Date desiredModTime = cal.getTime();
            log.debug("Setting mod-time to " + desiredModTime.toString());
            ftp.setModTime(remoteTextFile, desiredModTime);
           
            Date actualModTime = ftp.modtime(remoteTextFile);
            log.debug(remoteTextFile + ": " + actualModTime.toString());
            if ((int)desiredModTime.getTime()/1000 != (int)actualModTime.getTime()/1000)
            {
                String msg = "Desired mod-time(" + desiredModTime + ") != actual mod-time(" + actualModTime + ")";
                log.debug(msg);
                fail(msg);
            }
View Full Code Here

    StringBuffer result = new StringBuffer();
    result.append(e.getText());
    //    m_resultsString.append(e.getText());
    //    m_outText.setText(m_resultsString.toString());
    String name = (new SimpleDateFormat("HH:mm:ss - "))
      .format(new Date());
    name += e.getTextTitle();
    //    System.err.println(name);
    if (name.length() > 30) {
      name = name.substring(0, 30);
    }
View Full Code Here

      Instances header = new Instances(inst, 0);
      header.setClassIndex(classIndex);
      classificationOutput.setHeader(header);
      classificationOutput.setBuffer(outBuff);
    }
    String name = (new SimpleDateFormat("HH:mm:ss - ")).format(new Date());
    String cname = "";
          String cmd = "";
    Evaluation eval = null;
    try {
      if (m_CVBut.isSelected()) {
View Full Code Here

      m_Log.statusMessage("OK");
     
      if (classifier != null) {
  m_Log.logMessage("Loaded model from file '" + selected.getName()+ "'");
  String name = (new SimpleDateFormat("HH:mm:ss - ")).format(new Date());
  String cname = classifier.getClass().getName();
  if (cname.startsWith("weka.classifiers."))
    cname = cname.substring("weka.classifiers.".length());
  name += cname + " from file '" + selected.getName() + "'";
  StringBuffer outBuff = new StringBuffer();
View Full Code Here

        catch (NumberFormatException ex) {
            log.warn("Failed to parse size: " + fields[1]);
        }
        String lastModifiedStr = fields[2] + " " + fields[3];
        Date lastModified = getLastModified(lastModifiedStr);
            // test is dir
        boolean isDir = false;
        if (fields[4] == DIR || fields[4] == DDIR)
            isDir = true;
View Full Code Here

        return file;
    }


    private Date getLastModified(String lastModifiedStr) throws DateParseException {
        Date lastModified = null;
        if (formatIndex >= formats.length) {
            log.warn("Exhausted formats - failed to parse date");
            return null;
        }
        Calendar cal = Calendar.getInstance();
        cal.add(Calendar.DATE, 2);
       
        int prevIndex = formatIndex;
        for (int i = formatIndex; i < formats.length; i++, formatIndex++) {
            for (int j = 0; j < formats[i].length; j++) {
                try {
                    SimpleDateFormat dateFormatter = new SimpleDateFormat(formats[formatIndex][j], locale);
                    lastModified = dateFormatter.parse(lastModifiedStr);
                    if (lastModified.after(cal.getTime())) {
                        log.debug("Swapping to alternate format (found date in future)");
                        continue;
                    }
                    else // all ok, exit loop
                        return lastModified;
View Full Code Here

     */
    public Date getLastModified() {
        long modified = res.getLastModified();

        if (modified > -1) {
            return new Date(modified);
        } else {
            return null;
        }
    }
View Full Code Here

TOP

Related Classes of java.util.Date

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.