Examples of FileTime


Examples of java.nio.file.attribute.FileTime

      FileTime t = attrs().lastAccessTime();
      assertThat(t).isEqualTo(accessTime);
    }

    public void assertModifiedTimeChanged() throws IOException {
      FileTime t = attrs().lastModifiedTime();
      assertThat(t).isNotEqualTo(modifiedTime);
      modifiedTime = t;
    }
View Full Code Here

Examples of java.nio.file.attribute.FileTime

      assertThat(t).isNotEqualTo(modifiedTime);
      modifiedTime = t;
    }

    public void assertModifiedTimeDidNotChange() throws IOException {
      FileTime t = attrs().lastModifiedTime();
      assertThat(t).isEqualTo(modifiedTime);
    }
View Full Code Here

Examples of java.nio.file.attribute.FileTime

            .build());
  }

  @Test
  public void testSet() {
    FileTime time = FileTime.fromMillis(0L);

    // settable
    assertSetAndGetSucceeds("creationTime", time);
    assertSetAndGetSucceeds("lastModifiedTime", time);
    assertSetAndGetSucceeds("lastAccessTime", time);
View Full Code Here

Examples of java.nio.file.attribute.FileTime

    assertSetFails("creationTime", "foo");
  }

  @Test
  public void testSetOnCreate() {
    FileTime time = FileTime.fromMillis(0L);

    assertSetFailsOnCreate("creationTime", time);
    assertSetFailsOnCreate("lastModifiedTime", time);
    assertSetFailsOnCreate("lastAccessTime", time);
  }
View Full Code Here

Examples of java.nio.file.attribute.FileTime

    assertThat(view.name()).isEqualTo("basic");

    BasicFileAttributes attrs = view.readAttributes();
    assertThat(attrs.fileKey()).isEqualTo(0);

    FileTime time = attrs.creationTime();
    assertThat(attrs.lastAccessTime()).isEqualTo(time);
    assertThat(attrs.lastModifiedTime()).isEqualTo(time);

    view.setTimes(null, null, null);
View Full Code Here

Examples of java.nio.file.attribute.FileTime

            return false;
        try {
            Path extractedFile = appCache.resolve(TIMESTAMP_FILE_NAME);
            if (!Files.exists(extractedFile))
                return false;
            FileTime extractedTime = Files.getLastModifiedTime(extractedFile);
            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

    @Override
    public long lastModified()
    {
        try
        {
            FileTime ft = Files.getLastModifiedTime(path,linkOptions);
            return ft.toMillis();
        }
        catch (IOException e)
        {
            LOG.ignore(e);
            return 0;
View Full Code Here

Examples of java.nio.file.attribute.FileTime

    private boolean isUpToDate() {
        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(TIMESTAMP_FILE_NAME);
            if (!Files.exists(extractedFile))
                return false;
            FileTime extractedTime = Files.getLastModifiedTime(extractedFile);
            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(TIMESTAMP_FILE_NAME);
            if (!Files.exists(extractedFile))
                return false;
            FileTime extractedTime = Files.getLastModifiedTime(extractedFile);
            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.