Package java.io

Examples of java.io.File.lastModified()


        DebugFile.writeln("File not found " + sFilePath);
        DebugFile.decIdent();
      }
      throw new FileNotFoundException(sFilePath);
    }
    long lastMod = oFile.lastModified();

    TransformerFactory oFactory;
    Templates oTemplates;
    StreamSource oStreamSrc;
    SheetEntry oSheet = (SheetEntry) oCache.get(sFilePath);
View Full Code Here


    }
   
    public void addFile(String fileName) {
        File file = new File(fileName);       
        if ( file.exists() ) {
            long lastModified = file.lastModified();
            fileMap.put(fileName,new Long(lastModified));
        }
    }       
    /**
     * Adds FileListener
View Full Code Here

        return null;
    }
   
    private long checkFile(String fileName,long lm) {       
        File newFile = new File(fileName);
        if( newFile.lastModified() > lm ) {           
            lm = newFile.lastModified();
            String configName = (String)configMap.get(newFile);
            List all = (List)fileListenerList.get(configName);
            Iterator iterator = all.iterator();
            while( iterator.hasNext() ) {
View Full Code Here

    }
   
    private long checkFile(String fileName,long lm) {       
        File newFile = new File(fileName);
        if( newFile.lastModified() > lm ) {           
            lm = newFile.lastModified();
            String configName = (String)configMap.get(newFile);
            List all = (List)fileListenerList.get(configName);
            Iterator iterator = all.iterator();
            while( iterator.hasNext() ) {
                FileListener listener = (FileListener)iterator.next();               
View Full Code Here

                                resource.getOutputPattern(),
                                templateContext));

                    final boolean lastModifiedCheck = resource.isLastModifiedCheck();
                    // - if we have the last modified check set, then make sure the last modified time is greater than the outputFile
                    if (!lastModifiedCheck || (lastModifiedCheck && ResourceUtils.getLastModifiedTime(resourceUrl) > outputFile.lastModified()))
                    {   
                        // - only write files that do NOT exist, and
                        //   those that have overwrite set to 'true'
                        if (!outputFile.exists() || resource.isOverwrite())
                        {
View Full Code Here

      if (file.exists())
      {
        if (xbusSystem.getMaxAge() > 0 || xbusSystem.getMinAge() > 0)
        { // Restrictions to file age is specified.
          // Test the limits.
          long fileTimestamp = file.lastModified();
          long now = System.currentTimeMillis();
          if (now - fileTimestamp < xbusSystem.getMinAge())
            // The minimal age is not satisfied.
            successful = true;
          else if (xbusSystem.getMaxAge() > 0
View Full Code Here

        }

        classResource = new ClassResource();
        classResource.loadedClass = c;
        classResource.classFile = classFile;
        classResource.classFileLastModified = classFile.lastModified();
        classResourceCache.put(name, classResource);
        break; //classFile已经找到了,退出for循环
      }
    }
    //继续寻找对应的java源文件
View Full Code Here

        try
        {
            final File file = new File(resource.getFile());
            if (file.exists())
            {
                lastModified = file.lastModified();
            }
            else
            {
                URLConnection uriConnection = resource.openConnection();
                lastModified = uriConnection.getLastModified();
View Full Code Here

            true);
        boolean changed = files.isEmpty();
        for (final Iterator iterator = files.iterator(); iterator.hasNext();)
        {
            final File file = (File)iterator.next();
            changed = file.lastModified() < time;
            if (changed)
            {
                break;
            }
        }
View Full Code Here

    {
        boolean before = true;
        try
        {
            final File historyFile = new File(getHistoryStorage());
            if (historyFile.exists() && historyFile.lastModified() >= time)
            {
                final String history = ResourceUtils.getContents(new File(getHistoryStorage()).toURI().toURL());
                final String[] files = history.split(",");
                long lastModified = 0;
                for (int ctr = 0; ctr < files.length; ctr++)
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.