Package java.io

Examples of java.io.File.lastModified()


     *
     * @return Instance of ConfigReader
     */
    public static ConfigReader getInstance(){
        File configFile = new File(DEFAULT_CONFIG_FILE_NAME);
        if(lastModified < configFile.lastModified()){
            /*  Refresh the cache   */
            configReader = new ConfigReader(configFile);
        }
        return configReader;
    }
View Full Code Here


public IndexableDoc(String ifile)
{
  setFileName(ifile);                       //*-- set the name of the file
  File file = new File(ifile);
  setMdate(file.lastModified() )//*-- set the last modified date
  setFileLength( file.length() );
  setContents(new StringBuffer(""));
  setLanguage("English");
  setBdbBinding(new IndexableDocBinding() );
}
View Full Code Here

        return;

      /* Same Unmodified File */
      else if (importResource.equals(fCurrentSourceResource)) {
        File file = new File(importResource);
        if (file.exists() && file.lastModified() == fCurrentSourceFileModified)
          return;
      }
    }

    /* Remember Source */
 
View Full Code Here

    /* Remember Source */
    fCurrentSourceKind = source;
    fCurrentSourceResource = importSourcePage.getImportResource();
    final File sourceFile = (source == Source.RESOURCE) ? new File(importSourcePage.getImportResource()) : null;
    fCurrentSourceFileModified = (sourceFile != null && sourceFile.exists()) ? sourceFile.lastModified() : 0;
    fCurrentSourceKeywords = importSourcePage.getImportKeywords();
    fCurrentSourceLocalizedFeedSearch = importSourcePage.isLocalizedFeedSearch();

    /* Reset Fields */
    fLabels.clear();
View Full Code Here

    File weeklyBackupFile = weeklyBackupPath.toFile();

    if (dailyBackupFile.exists()) {

      /* Update Weekly Backup if required */
      if (!weeklyBackupFile.exists() || (weeklyBackupFile.lastModified() + DateUtils.WEEK < System.currentTimeMillis())) {
        weeklyBackupFile.delete();
        dailyBackupFile.renameTo(weeklyBackupFile);
      }

      /* Check 1 Day Condition */
 
View Full Code Here

        File backupFile = backupService.getBackupFile(i);
        /* Always false in first iteration */
        if (backupFile == null)
          break;

        lastModified = backupFile.lastModified();

        DBHelper.rename(backupFile, backupService.getFileToBackup());
        try {
          fObjectContainer = Db4o.openFile(config, getDBFilePath());
          foundSuitableBackup = true;
View Full Code Here

     *
     * @return
     */
    public static List getAll(){
        File roleConfigFile = new File(ROLE_CONFIG_FILE_NAME);
        if(lastModified < roleConfigFile.lastModified()){
            /*  Refresh the cache   */
            init(roleConfigFile);
        }
        return roles;
    }
View Full Code Here

     * @return true if an autosave is found, and if the autosave is newer
     *   than the given file.
     */
    public static boolean newerAutoSaveExists(File f) {
        File asFile = getAutoSaveFile(f);
        return asFile.exists() && (asFile.lastModified() > f.lastModified());
    }
}
View Full Code Here

  private boolean isSourceFileModified() {
    for (File sourceFile : sourceFiles) {
      File classFile = new File(sourceFile.getAbsolutePath().replace(
          ".java", ".class"));
      if (classFile.lastModified() < sourceFile.lastModified()) {
        return true;
      }
    }
    return false;
  }
View Full Code Here

        String packageName = sourceFile.getAbsolutePath().substring(basePath.length() + 1, staticDirPos - 1);
        packageName = packageName.replace(File.separator, ".");
        String fileName = sourceFile.getAbsolutePath().substring(staticDirPos + ClassPathStaticDispatcher.STATIC_DIR_NAME.length());
        File targetFile = new File(classPathStaticDir, packageName + fileName);
        // Only do this if it does not already exist
        if (targetFile.exists() && targetFile.lastModified() >= sourceFile.lastModified()) {
          if (isLogDebugEnabled()) logDebug("Skipping static file from filename::" + sourceFile + " - does already exist", null);
        } else {
          targetFile.getParentFile().mkdirs();
          BufferedInputStream inputStream = new BufferedInputStream(new FileInputStream(sourceFile));
          BufferedOutputStream outputStream = new BufferedOutputStream(new FileOutputStream(targetFile));
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.