Пример #1
0
  public List<TransferredResource> createCorpora()
      throws InterruptedException, IOException, FileAlreadyExistsException, NotFoundException,
          GenericException, AlreadyExistsException, SolrServerException, IsStillUpdatingException {
    TransferredResourcesScanner f = RodaCoreFactory.getTransferredResourcesScanner();

    List<TransferredResource> resources = new ArrayList<TransferredResource>();

    Path corpora =
        corporaPath
            .resolve(RodaConstants.STORAGE_CONTAINER_AIP)
            .resolve(CorporaConstants.SOURCE_AIP_CONVERTER_3)
            .resolve(RodaConstants.STORAGE_DIRECTORY_REPRESENTATIONS)
            .resolve(CorporaConstants.REPRESENTATION_CONVERTER_ID_3)
            .resolve(RodaConstants.STORAGE_DIRECTORY_DATA);

    String transferredResourceId = "testt";
    FSUtils.copy(corpora, f.getBasePath().resolve(transferredResourceId), true);

    f.updateTransferredResources(Optional.empty(), true);
    index.commit(TransferredResource.class);

    resources.add(
        index.retrieve(
            TransferredResource.class,
            UUID.nameUUIDFromBytes(transferredResourceId.getBytes()).toString()));
    return resources;
  }
Пример #2
0
 @AfterMethod
 public void tearDown() throws Exception {
   RodaCoreFactory.shutdown();
   FSUtils.deletePath(basePath);
 }