Examples of FileTime


Examples of com.sun.jna.platform.win32.WinBase.FILETIME

      IntByReference lpcValues = new IntByReference();
      IntByReference lpcMaxClassLen = new IntByReference();
      IntByReference lpcMaxValueNameLen = new IntByReference();
      IntByReference lpcMaxValueLen = new IntByReference();
      IntByReference lpcbSecurityDescriptor = new IntByReference();
      FILETIME lpftLastWriteTime = new FILETIME();
      assertEquals(W32Errors.ERROR_SUCCESS, Advapi32.INSTANCE.RegQueryInfoKey(
          WinReg.HKEY_LOCAL_MACHINE, null, lpcClass, null,
          lpcSubKeys, lpcMaxSubKeyLen, lpcMaxClassLen, lpcValues,
          lpcMaxValueNameLen, lpcMaxValueLen, lpcbSecurityDescriptor,
          lpftLastWriteTime));
View Full Code Here

Examples of isi.pasco2.parser.time.FileTime

      assertEquals(4, st.wHour.getValue());
      assertEquals(35, st.wMinute.getValue());
      assertEquals(17, st.wSecond.getValue());
      assertEquals(625, st.wMilliseconds.getValue());

      FileTime nonSystemFileTime = new FileTime(lowValue, highValue);
      assertEquals("2006-02-21T04:35:17.625Z", nonSystemFileTime.toXSDString());

    } catch (Exception e) {
      fail();
    }
  }
View Full Code Here

Examples of isi.pasco2.platform.FILETIME

    try {
      CDLL dll = CDLL.LoadLibrary("kernel32.dll");
      CFunction getSystemTimeAsFileTime = dll
          .loadFunction("GetSystemTimeAsFileTime");

      FILETIME ft = new FILETIME();
      Object[] ary = { ft };
      Object o = getSystemTimeAsFileTime.call(null, ary,
          CFunction.FUNCFLAG_STDCALL);
      long lowValue = ft.dwLowDateTime.getValue();
      long highValue = ft.dwHighDateTime.getValue();
View Full Code Here

Examples of java.nio.file.attribute.FileTime

  public static void writeToFileAndUpdateMTime(Path file, String contents) throws IOException {
    if(!file.toFile().exists()) {
      writeStringToFile(file, contents);
      return;
    }
    FileTime lastModifiedTime = Files.getLastModifiedTime(file);
    writeStringToFile(file, contents);
    // Make sure last modified time is different from before
    Files.setLastModifiedTime(file, FileTime.fromMillis(lastModifiedTime.toMillis() - 1_000));
  }
View Full Code Here

Examples of java.nio.file.attribute.FileTime

  public void markStale() {
    valueTimeStamp = null;
  }
 
  public synchronized boolean isStale() {
    FileTime lastModifiedTime;
    try {
      lastModifiedTime = Files.getLastModifiedTime(filePath);
    } catch (IOException e) {
      return true;
    }
   
    if(valueTimeStamp == null || valueTimeStamp.toMillis() < lastModifiedTime.toMillis()) {
      return true;
    }
    return false;
  }
View Full Code Here

Examples of java.nio.file.attribute.FileTime

  }
 
  public void updateValue(VALUE value, FileTime newTimeStampMaximum) {
    assertNotNull(newTimeStampMaximum);
   
    FileTime newValueTimeStamp;
    try {
      newValueTimeStamp = Files.getLastModifiedTime(filePath);
    } catch (IOException e) {
      newValueTimeStamp = FileTime.fromMillis(0);
    }
View Full Code Here

Examples of java.nio.file.attribute.FileTime

 
  protected void doUpdateManifestEntry(BundlePath bundlePath) throws ExecutionException {
    RunDubDescribeCallable dubDescribeTask = new RunDubDescribeCallable(bundlePath, false);
    DubBundleDescription bundleDesc = dubDescribeTask.submitAndGet(dubProcessAgent);
   
    FileTime dubStartTimeStamp = dubDescribeTask.getStartTimeStamp();
    DubDescribeAnalysis dubDescribeAnalyzer = new DubDescribeAnalysis(bundleDesc);
   
    setNewManifestEntry(dubStartTimeStamp, dubDescribeAnalyzer);
  }
View Full Code Here

Examples of java.nio.file.attribute.FileTime

            return false;
        try {
            Path extractedFile = appCache.resolve(".extracted");
            if (!Files.exists(extractedFile))
                return false;
            FileTime extractedTime = Files.getLastModifiedTime(extractedFile);

            Path jarFile = Paths.get(jar.getName());
            FileTime jarTime = Files.getLastModifiedTime(jarFile);

            return extractedTime.compareTo(jarTime) >= 0;
        } catch (IOException e) {
            throw new AssertionError(e);
        }
View Full Code Here

Examples of java.nio.file.attribute.FileTime

            return false;
        try {
            Path extractedFile = appCache.resolve(".extracted");
            if (!Files.exists(extractedFile))
                return false;
            FileTime extractedTime = Files.getLastModifiedTime(extractedFile);

            Path jarFile = Paths.get(jar.getName());
            FileTime jarTime = Files.getLastModifiedTime(jarFile);

            return extractedTime.compareTo(jarTime) >= 0;
        } catch (IOException e) {
            throw new AssertionError(e);
        }
View Full Code Here

Examples of java.nio.file.attribute.FileTime

            return false;
        try {
            Path extractedFile = appCache.resolve(".extracted");
            if (!Files.exists(extractedFile))
                return false;
            FileTime extractedTime = Files.getLastModifiedTime(extractedFile);

            Path jarFile = Paths.get(jar.getName());
            FileTime jarTime = Files.getLastModifiedTime(jarFile);

            return extractedTime.compareTo(jarTime) >= 0;
        } catch (IOException e) {
            throw new AssertionError(e);
        }
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.