Package java.io

Examples of java.io.File.lastModified()


                String date = noDateLabel;
                String size = directoryLabel;
                if (!file.isDirectory()) {
                    size = "" + file.length();
                    synchronized (sdfFileDate) {
                        date = sdfFileDate.format(new Date(file.lastModified()));
                    }
                }
                rowString.write(Launcher.RESOURCES.getString(
                        "StaticResourceServlet.DirectoryList.Row",
                        new String[] {
View Full Code Here


                            if (!path.exists()) {
                                continue;
                            } else if (path.isDirectory()) {
                                File classLocation = new File(path, className);
                                if (classLocation.exists()) {
                                    classDate = new Long(classLocation.lastModified());
                                    classLocationTable.put(className, classLocation);
                                }
                            } else if (path.isFile()) {
                                classDate = searchJarPath(className, path);
                                if (classDate != null)
View Full Code Here

  static void make(DiskCache2 dc, String filename) throws IOException {
    File want = dc.getCacheFile(filename);
    System.out.println("make=" + want.getPath() + "; exists = " + want.exists());
    if (!want.exists())
      want.createNewFile();
    System.out.println(" canRead= " + want.canRead() + " canWrite = " + want.canWrite() + " lastMod = " + new Date(want.lastModified()));

    String enc = EscapeStrings.urlEncode(filename);
    System.out.println(" original=" + EscapeStrings.urlDecode(enc));
    /* try {
      String enc = java.net.URLEncoder.encode(filename, "UTF8");
View Full Code Here

        if (!oCached.exists()) {
          oFS.mkdirs(sFileDir);
        }
        else {
          if (DebugFile.trace) {
            DebugFile.writeln ("file modified " + new Date(oCached.lastModified()).toString());
            DebugFile.writeln ("last modified " + new Date(oDtModified.getTime()).toString());
          }
          if (oCached.lastModified()>oDtModified.getTime()) {
            sOutput = new String(FileSystem.readfile(sFileDir+File.separator+sCachedFile, sEncoding==null ? "ISO8859_1" : sEncoding));
View Full Code Here

        else {
          if (DebugFile.trace) {
            DebugFile.writeln ("file modified " + new Date(oCached.lastModified()).toString());
            DebugFile.writeln ("last modified " + new Date(oDtModified.getTime()).toString());
          }
          if (oCached.lastModified()>oDtModified.getTime()) {
            sOutput = new String(FileSystem.readfile(sFileDir+File.separator+sCachedFile, sEncoding==null ? "ISO8859_1" : sEncoding));

            if (DebugFile.trace) {
              DebugFile.writeln("cache hit " + sFileDir+File.separator+sCachedFile);
              DebugFile.decIdent();
View Full Code Here

      sFilePath = getOutputPath()+"main.html";

      oOut = new File(sFilePath);
      if (oOut.exists()) {
        dtFileModified = new Date(oOut.lastModified());
          if (DebugFile.trace) {
            DebugFile.writeln("Output file path is "+sFilePath+" last modified at "+dtFileModified.toString());
          }
        bNeedsRebuild = (dtLastModified.compareTo(dtFileModified)>0) || (new File(getBlogPath()+t.getInputFilePath()).lastModified()>dtFileModified.getTime());
        if (bNeedsRebuild || bFullRebuild) oOut.delete();
View Full Code Here

      sFilePath = getOutputPath()+"rss2.xml";

      oOut = new File(sFilePath);
      if (oOut.exists()) {
        dtFileModified = new Date(oOut.lastModified());
          if (DebugFile.trace) {
            DebugFile.writeln("Output file path is "+sFilePath+" last modified at "+dtFileModified.toString());
          }
        bNeedsRebuild = (dtLastModified.compareTo(dtFileModified)>0) || (new File(getBlogPath()+t.getInputFilePath()).lastModified()>dtFileModified.getTime());
        if (bNeedsRebuild || bFullRebuild) oOut.delete();
View Full Code Here

            }

          sFilePath = getOutputPath()+"archives"+File.separator+m.toString()+".html";
          oOut = new File(sFilePath);
          if (oOut.exists()) {
            dtFileModified = new Date(oOut.lastModified());
              if (DebugFile.trace) {
                DebugFile.writeln("Output file path is "+sFilePath+" last modified at "+dtFileModified.toString());
              }
            bNeedsRebuild = (dtLastModified.compareTo(dtFileModified)>0);
            if (bNeedsRebuild || bFullRebuild) oOut.delete();
View Full Code Here

                }

              sFilePath = getOutputPath()+"archives"+File.separator+oFmt.format(dtDay00)+".html";
              oOut = new File(sFilePath);
              if (oOut.exists()) {
                dtFileModified = new Date(oOut.lastModified());
                  if (DebugFile.trace) {
                    DebugFile.writeln("Output file path is "+sFilePath+" last modified at "+dtFileModified.toString());
                  }
                bNeedsRebuild = (dtLastModified.compareTo(dtFileModified)>0);
                if (bNeedsRebuild || bFullRebuild) oOut.delete();
View Full Code Here

            }
       
          sFilePath = getOutputPath()+"archives"+File.separator+oPostsModified.getString(1,p)+".html";
          oOut = new File(sFilePath);
          if (oOut.exists()) {
            dtFileModified = new Date(oOut.lastModified());
              if (DebugFile.trace) {
                DebugFile.writeln("Output file path is "+sFilePath+" last modified at "+dtFileModified.toString());
              }
            bNeedsRebuild = (dtLastModified.compareTo(dtFileModified)>0);
            if (bNeedsRebuild || bFullRebuild) oOut.delete();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.