Package java.io

Examples of java.io.File.lastModified()


        generator.setWsdl(getTestFilePath("src/wsdl/oneway.wsdl"));
        generator.setOverwrite(true);
        generator.generate();
       
        System.out.println("l1 " + lastModified);
        System.out.println("l2 " + file.lastModified());
        assertTrue(lastModified < file.lastModified());
    }
   
}
View Full Code Here


        generator.setOverwrite(true);
        generator.generate();
       
        System.out.println("l1 " + lastModified);
        System.out.println("l2 " + file.lastModified());
        assertTrue(lastModified < file.lastModified());
    }
   
}
View Full Code Here

            XMLReader parser = XMLReaderFactory.createXMLReader();
            parser.setContentHandler(contentHandler);
            parser.parse(mapFile.getAbsolutePath());

            mappingTime = mapFile.lastModified();
            mapping = contentHandler.getUserMapping();

        }
        catch (IOException e) {
            throw new GuacamoleException("Error reading basic user mapping file.", e);
View Full Code Here

    @Override
    public GuacamoleConfiguration getAuthorizedConfiguration(String username, String password) throws GuacamoleException {

        // Check mapping file mod time
        File userMappingFile = getUserMappingFile();
        if (userMappingFile.exists() && mappingTime < userMappingFile.lastModified()) {

            // If modified recently, gain exclusive access and recheck
            synchronized (this) {
                if (userMappingFile.exists() && mappingTime < userMappingFile.lastModified()) {
                    logger.info("User mapping file {} has been modified.", userMappingFile);
View Full Code Here

        File userMappingFile = getUserMappingFile();
        if (userMappingFile.exists() && mappingTime < userMappingFile.lastModified()) {

            // If modified recently, gain exclusive access and recheck
            synchronized (this) {
                if (userMappingFile.exists() && mappingTime < userMappingFile.lastModified()) {
                    logger.info("User mapping file {} has been modified.", userMappingFile);
                    init(); // If still not up to date, re-init
                }
            }
View Full Code Here

       
        File destFile = getDestinationFile(javaClass);
        File sourceFile = getSourceFile(javaClass);

        return !(destFile.exists() &&
            sourceFile.lastModified() < destFile.lastModified());
    }
   
    /**
     * Returns a File object representing the Source File represented
     * by the given JavaClass
View Full Code Here

            + "\" />");
      } catch (Exception e) {
        throw new HelpException("Error while loading [" + xmlFile + "]", e);
      }

      if (outputFile.exists() && outputFile.lastModified() >= sourceFile.lastModified())
        continue;

      log.debug("transforming help file to [" + outputFile.getPath() + "]");
      StreamResult result = new StreamResult(outputFile);
View Full Code Here

            Collection beans = ejbUtils.getBeans(getMetadata());
            File sourceFile = null;
            for (Iterator iterator = beans.iterator(); iterator.hasNext();) {
                JavaClass javaClass = (JavaClass) iterator.next();
                sourceFile = getSourceFile(javaClass);
                if (destFile.lastModified() < sourceFile.lastModified()) {
                    System.out.println("dirty source = " + sourceFile.getAbsolutePath());
                    dirty = true;
                    break;
                }
            }
View Full Code Here

    _url = url;
    _connection = url.openConnection();
    if (_url.getProtocol().equals("file")) {
      File file = new File(_url.getFile());
      if (file.exists()) {
        _lastModified = file.lastModified();
      }
    }
  }
 
 
View Full Code Here

          Map<?, ?> oldMapTrackUsage = FileUtil.readResilientFile(f);
          String version = MapUtils.getMapString(oldMapTrackUsage, "version",
              null);
          Map<?, ?> map = MapUtils.getMapMap(oldMapTrackUsage, "statsmap", null);
          if (version != null && map != null) {
            PlatformConfigMessenger.sendUsageStats(map, f.lastModified(),
                version, null);
          }
        }

        SimpleTimer.addPeriodicEvent("UsageTracker", 1000,
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.