Examples of FileTime


Examples of java.nio.file.attribute.FileTime

        assertThat(FileUtils.readFileToByteArray(daemonJar.toFile()), is(expectedContent));
    }

    @Test
    public void does_not_copy_the_daemon_JAR_if_it_has_already_been_copied() throws IOException {
        FileTime lastModified1 = Files.getLastModifiedTime(steward.getDaemonJar(jumiHome));
        FileTime lastModified2 = Files.getLastModifiedTime(steward.getDaemonJar(jumiHome));

        assertThat(lastModified2, is(lastModified1));
    }
View Full Code Here

Examples of java.nio.file.attribute.FileTime

            Descriptor descriptor = Descriptor.fromFilename(fname);
            if (descriptor.version.hasRepairedAt())
            {
                if (setIsRepaired)
                {
                    FileTime f = Files.getLastModifiedTime(new File(descriptor.filenameFor(Component.DATA)).toPath());
                    descriptor.getMetadataSerializer().mutateRepairedAt(descriptor, f.toMillis());
                }
                else
                {
                    descriptor.getMetadataSerializer().mutateRepairedAt(descriptor, ActiveRepairService.UNREPAIRED_SSTABLE);
                }
View Full Code Here

Examples of java.nio.file.attribute.FileTime

                    attrView = Files.getFileAttributeView(path, BasicFileAttributeView.class);
                }

                BasicFileAttributes attrs = attrView.readAttributes();
                // The timestamp seems to come from JavaScript as a decimal value of seconds
                FileTime newATime = FileTime.fromMillis((long)(atime * 1000.0));
                FileTime newMTime = FileTime.fromMillis((long)(mtime * 1000.0));
                attrView.setTimes(newMTime, newATime, attrs.creationTime());
            } catch (IOException ioe) {
                throw new NodeOSException(getErrorCode(ioe), ioe, path.toString());
            }
            return new Object[] { Context.getUndefinedValue(), Context.getUndefinedValue() };
View Full Code Here

Examples of java.nio.file.attribute.FileTime

            return mode;
        }

        private Object makeDate(Context cx, Object o)
        {
            FileTime ft = (FileTime)o;
            return cx.newObject(this, "Date", new Object[] { ft.toMillis() });
        }
View Full Code Here

Examples of java.nio.file.attribute.FileTime

        String fname = args[2];
        Descriptor descriptor = Descriptor.fromFilename(fname);
        if (setIsRepaired)
        {
            FileTime f = Files.getLastModifiedTime(new File(descriptor.filenameFor(Component.DATA)).toPath());
            descriptor.getMetadataSerializer().mutateRepairedAt(descriptor, f.toMillis());
        }
        else
        {
            descriptor.getMetadataSerializer().mutateRepairedAt(descriptor, ActiveRepairService.UNREPAIRED_SSTABLE);
        }
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(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

        ImmutableMap.of(
            "foo", "hello",
            "bar", 0L,
            "baz", 1));

    FileTime time = (FileTime) service.getAttribute(file, "basic:creationTime");

    map = service.readAttributes(file, "test:*");
    assertThat(map).isEqualTo(
        ImmutableMap.<String, Object>builder()
            .put("foo", "hello")
View Full Code Here

Examples of java.nio.file.attribute.FileTime

    private BasicFileAttributes attrs() throws IOException {
      return Files.readAttributes(path, BasicFileAttributes.class);
    }

    public void assertAccessTimeChanged() throws IOException {
      FileTime t = attrs().lastAccessTime();
      assertThat(t).isNotEqualTo(accessTime);
      accessTime = t;
    }
View Full Code Here

Examples of java.nio.file.attribute.FileTime

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

    public void assertAccessTimeDidNotChange() throws IOException {
      FileTime t = attrs().lastAccessTime();
      assertThat(t).isEqualTo(accessTime);
    }
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.