Package org.eclipse.jgit.internal.storage.file

Examples of org.eclipse.jgit.internal.storage.file.FileSnapshot


   * @throws ConfigInvalidException
   *             the file is not a properly formatted configuration file.
   */
  @Override
  public void load() throws IOException, ConfigInvalidException {
    final FileSnapshot oldSnapshot = snapshot;
    final FileSnapshot newSnapshot = FileSnapshot.save(getFile());
    try {
      final byte[] in = IO.readFully(getFile());
      final ObjectId newHash = hash(in);
      if (hash.equals(newHash)) {
        if (oldSnapshot.equals(newSnapshot))
View Full Code Here


   */
  @Test
  public void testActuallyIsModifiedTrivial() throws Exception {
    File f1 = createFile("simple");
    waitNextSec(f1);
    FileSnapshot save = FileSnapshot.save(f1);
    append(f1, (byte) 'x');
    waitNextSec(f1);
    assertTrue(save.isModified(f1));
  }
View Full Code Here

   */
  @Test
  public void testOldFile() throws Exception {
    File f1 = createFile("oldfile");
    waitNextSec(f1);
    FileSnapshot save = FileSnapshot.save(f1);
    Thread.sleep(3500);
    assertFalse(save.isModified(f1));
  }
View Full Code Here

   */
  @Test
  public void testNewFileWithWait() throws Exception {
    File f1 = createFile("newfile");
    waitNextSec(f1);
    FileSnapshot save = FileSnapshot.save(f1);
    Thread.sleep(1500);
    assertTrue(save.isModified(f1));
  }
View Full Code Here

   */
  @Test
  public void testNewFileNoWait() throws Exception {
    File f1 = createFile("newfile");
    waitNextSec(f1);
    FileSnapshot save = FileSnapshot.save(f1);
    Thread.sleep(1500);
    assertTrue(save.isModified(f1));
  }
View Full Code Here

   * @throws ConfigInvalidException
   *             the file is not a properly formatted configuration file.
   */
  @Override
  public void load() throws IOException, ConfigInvalidException {
    final FileSnapshot oldSnapshot = snapshot;
    final FileSnapshot newSnapshot = FileSnapshot.save(getFile());
    try {
      final byte[] in = readFully();
      final ObjectId newHash = hash(in);
      if (hash.equals(newHash)) {
        if (oldSnapshot.equals(newSnapshot))
View Full Code Here

TOP

Related Classes of org.eclipse.jgit.internal.storage.file.FileSnapshot

Copyright © 2018 www.massapicom. 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.