Package java.io

Examples of java.io.File.lastModified()


    public void checkKeyStore() {
        initKeyStoreFile();
        try {
            File keystoreFile = getKeyStoreFile();
            if (keystoreFile.exists() && keystoreFile.canRead()) {
                Date fileLastModified = new Date(keystoreFile.lastModified());
                if (keystoreLastModified == null || !keystoreLastModified.equals(fileLastModified)) {
                    keystoreLastModified = fileLastModified;
                    reloadKeystore();
                } else {
                    // No change
View Full Code Here


          // does file exits?
          if (file.exists()) {
           
            // is file?
            if (file.isFile()) {
              long lastModified = (file.lastModified() / 1000) * 1000;    // ignore millis
              String ifModifiedSinceRequestHeader = request.getHeader("If-Modified-Since");

              if (ifModifiedSinceRequestHeader != null) {
                long ifModifedSince = DataConverter.toDate(ifModifiedSinceRequestHeader).getTime();
               
View Full Code Here

   
    public IFileInfo newFile(String id, String mimeType, int cacheExpireTime) throws IOException {
      File file = new File(fileBasepath + File.separator + id + "." + encode(mimeType) + "." + encode(Integer.toString(cacheExpireTime)));
      file.createNewFile();

      return new FileInfo(file, mimeType, id, file.lastModified(), cacheExpireTime);
    }

   
    public IFileInfo replaceFile(String id, String mimeType, int cacheExpireTimeSec) throws IOException {
     
View Full Code Here

                            if (headline != null && headline.length() > 0) aBuffer.append("<a href=\"" + element + "\"><b>" + headline + "</b></a><br/>");
                            aBuffer.append("<a href=\"" + path + element + "\">" + element + "</a><br/>");
                            if (author != null && author.length() > 0) aBuffer.append("Author: " + author + "<br/>");
                            if (publisher != null && publisher.length() > 0) aBuffer.append("Publisher: " + publisher + "<br/>");
                            if (description != null && description.length() > 0) aBuffer.append("Description: " + description + "<br/>");
                            aBuffer.append(GenericFormatter.SHORT_DAY_FORMATTER.format(new Date(f.lastModified())) + ", " + size + ((images > 0) ? ", " + images + " images" : "") + ((links > 0) ? ", " + links + " links" : "") + "<br/></li>\n");
                        }
                    }
                    aBuffer.append("  </ul>\n</body>\n</html>\n");

                    // write the list to the client
View Full Code Here

        } else if (key instanceof HashKeys) {
          file = ((HashKeys) key).getFile();
        }
       
        if (file != null) { // invalidate entry if it's file has changed
          long lastModified = file.lastModified();
          isValid = lastModified != 0 && lastModified <= ref.insertionTime;
          if (!isValid) msg = "INVALID (fileChange)";
        }
      }
     
View Full Code Here

                 f.setLastModified(entry.getTime());
             }
             continue;
         }
        
         if(onlyIfNewer && entry.getTime() != -1 && entry.getTime() == f.lastModified()) {
             continue;
         }
        
         f.getParentFile().mkdirs();
         FileOutputStream out = new FileOutputStream(f);
View Full Code Here

            if (MAPPING.get(cr.getClassName() + "/remove") != null) {
                return;
            }
            String n = remapper.mapType(cr.getClassName());
            File g = new File(d, n + ".class");
            if (!g.exists() || g.lastModified() < f.lastModified()) {
                if (!g.getParentFile().exists() && !g.getParentFile().mkdirs()) {
                    throw new IOException("Cannot create directory " + g.getParentFile());
                }
                OutputStream os = new FileOutputStream(g);
                try {
View Full Code Here

                    lastMain = aVersion.getName();
                }

                // check file age
                final File downloadedFile = new File(filesPath + File.separator + filename);
                if (now - downloadedFile.lastModified() > deleteAfterMillis) {
                    // delete file
                    FileUtils.deletedelete(downloadedFile);
                    FileUtils.deletedelete(new File(downloadedFile.getAbsolutePath() + ".sig"));
                    if (downloadedFile.exists()) {
                        Log.logWarning("STARTUP", "cannot delete old release " + downloadedFile.getAbsolutePath());
View Full Code Here

          log("Making dir: "+destination.getParentFile(), Project.MSG_VERBOSE);
          destination.getParentFile().mkdirs();
        }
       
   
        if (source.lastModified() <= destination.lastModified()) {
          log(source+" omitted as "+destination+" is up to date", Project.MSG_VERBOSE);
          continue;
        }
        if (one.endsWith(".class")) {
          try {
View Full Code Here

    public void updateExistsCheck() {
      File existingFile = new java.io.File(frostDownloadItem.getDownloadDir() + frostDownloadItem.getFileName());
      exists = existingFile.exists();
      if( exists) {
        final long date = existingFile.lastModified();
        existsTooltip = new StringBuilder("<html>")
        .append(language.getString("AddNewDownloadsDialog.table.lastModifiedTooltip"))
        .append(": ")
        .append(DateFun.FORMAT_DATE_VISIBLE.print(date))
        .append(" ")
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.