Examples of lastModified()


Examples of java.io.File.lastModified()

    // We check the last modified timestamp on the template once per render.
    // If the template has changed, we reload and reparse it.  Otherwise, we
    // return the copy from memory.
    File file = new File(filename);
    long last_modified = file.lastModified();

    if (inCache(filename, last_modified)) {
      return templates_.get(filename);
    }
View Full Code Here

Examples of java.io.File.lastModified()

            int count = 0;
            for (File f : root.listFiles()) {
                String name = f.getName();
                if (f.isFile() && name.startsWith("backup") && name.endsWith(".zip")) {
                    count++;
                    if (oldest == null || f.lastModified() < oldest.lastModified()) {
                        oldest = f;
                    }
                }
            }
            if (count < max) {
View Full Code Here

Examples of java.io.File.lastModified()

                    if (!dir.exists()) {
                        unzipComponent(componentName, jarFile, dir);
                    }
                    // See if the JAR is newer than the directory. If so, the component
                    // needs to be unloaded and then reloaded.
                    else if (jarFile.lastModified() > dir.lastModified()) {
                        unloadComponent(componentName);
                        // Ask the system to clean up references.
                        System.gc();
                        while (!deleteDir(dir)) {
                            manager.getLog().error("Error unloading component " + componentName + ". " +
View Full Code Here

Examples of java.io.File.lastModified()

        JDefinedClass echo = model._getClass("org.codehaus.xfire.test.echo.SendMessagePortType");
        assertNotNull(echo);
       
        File file = getTestFile("target/test-services/org/codehaus/xfire/test/echo/SendMessageImpl.java");
        assertTrue(file.exists());
        long lastModified = file.lastModified();
       
        System.out.println("WRITE #2");
        generator = new Wsdl11Generator();
        generator.setOutputDirectory(getTestFilePath("target/test-services"));
        generator.setWsdl(getTestFilePath("src/wsdl/oneway.wsdl"));
View Full Code Here

Examples of java.io.File.lastModified()

        generator.setOutputDirectory(getTestFilePath("target/test-services"));
        generator.setWsdl(getTestFilePath("src/wsdl/oneway.wsdl"));
        generator.setOverwrite(false);
        generator.generate();
       
        assertEquals(lastModified, file.lastModified());
       
        System.out.println("WRITE #3");
        generator = new Wsdl11Generator();
        generator.setOutputDirectory(getTestFilePath("target/test-services"));
        generator.setWsdl(getTestFilePath("src/wsdl/oneway.wsdl"));
View Full Code Here

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

Examples of java.io.File.lastModified()

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

Examples of java.io.File.lastModified()

            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

Examples of java.io.File.lastModified()

    @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

Examples of java.io.File.lastModified()

        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
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.