Пример #1
0
  @Test
  public void testFileHistoryIdRandom() {
    FileHistoryId secureRandomFileId1 = FileHistoryId.secureRandomFileId();
    FileHistoryId secureRandomFileId2 = FileHistoryId.secureRandomFileId();

    assertNotNull(secureRandomFileId1);
    assertEquals(20 * 2, secureRandomFileId1.toString().length());

    assertNotSame(secureRandomFileId1, secureRandomFileId2);
    assertNotNull(secureRandomFileId2);
    assertEquals(20 * 2, secureRandomFileId2.toString().length());
  }
  private void sendLsFolderRequest(String root, FileHistoryId fileHistoryId) {
    // Create list request
    LsOperationOptions lsOptions = new LsOperationOptions();

    lsOptions.setPathExpression(fileHistoryId.toString());
    lsOptions.setFileHistoryId(true);
    lsOptions.setRecursive(false);
    lsOptions.setDeleted(true);
    lsOptions.setFetchHistories(true);
    lsOptions.setFileTypes(Sets.newHashSet(FileType.FILE, FileType.SYMLINK));

    LsFolderRequest lsRequest = new LsFolderRequest();

    lsRequest.setRoot(root);
    lsRequest.setOptions(lsOptions);

    logger.log(
        Level.INFO,
        "Detail panel: Sending LsRequest with ID #" + lsRequest.getId() + " for " + root + " ...");

    // Send request
    pendingLsFolderRequests.put(lsRequest.getId(), lsRequest);
    eventBus.post(lsRequest);
  }