Package java.io

Examples of java.io.File.lastModified()


      File file = new File(filename);
      if (!file.exists()) {
        doc.setHttpCode("httpcode " + HttpConstants.HTTP_NOTFOUND);
        return doc;
      }
      long fileLastModified = file.lastModified();
      long ifModifiedSinceTime = ifModifiedSince == null ? 0 : ifModifiedSince.getTime();
      if (fileLastModified > ifModifiedSinceTime) {
        byte[] content = readFileToByteArray(file);
        doc.setContent(content);
        doc.setHttpCode("httpcode " + HttpConstants.HTTP_OK);
View Full Code Here


                jarFilePath = jarFilePath.substring(5);
            }
            file = new File(jarFilePath);
        }
        if(file.exists()) {
            return file.lastModified();
        }
        return -1L;
    }

    @Deprecated
View Full Code Here

        // if we were writing to the second file, carry on from there
     
      if ( f1.exists() && f2.exists()){
 
        if ( f1.lastModified() < f2.lastModified()){
         
          first_file = false;
        }
      }
    }catch( Throwable ignore ){
View Full Code Here

          }
        String aFileSize = lengthftm.format(aFileLen = aFile.length());
        total += (aFileLen + 1023) / 1024; //
        while (aFileSize.length() < 12)
          aFileSize = " " + aFileSize;
        String aFileDate = Acme.Utils.lsDateStr(new Date(aFile.lastModified()));
        while (aFileDate.length() < 14)
          aFileDate += " ";
        String aFileDirsuf = (aFile.isDirectory() ? "/" : "");
        String aFileSuf = (aFile.isDirectory() ? "/" : "");
        p.println(aFileType + aFileRead + aFileWrite + aFileExe + "  " + aFileSize + "  " + aFileDate + "  "
View Full Code Here

        return f != null && f.exists() ? f.length() : 0;
    }

    public Timestamp getLastModified() {
        File f = getFile();
        return f != null && f.exists() ? new Timestamp(f.lastModified()) : null;
    }

    public String getLevel() {
        return null;
    }
View Full Code Here

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

            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

                    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

        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

        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

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.