@Test public void initializeRecoverUnknownTarFile() throws Exception { Path fileBucketFolder1 = inputTarStorageFolder.resolve(FILE_BUCKET_1); Path fileBucketFolder2 = inputTarStorageFolder.resolve(FILE_BUCKET_2); Files.createDirectories(fileBucketFolder1); Files.createDirectories(fileBucketFolder2); String tarId = createTarId(LocalDateUtil.parseMongoFormattedDate("2019-03-01T01:23:45.678")); Path tarFile = fileBucketFolder2.resolve(tarId); Files.createFile(tarFile); doReturn(Optional.empty()) .when(archiveReferentialRepository).find(tarId); assertThatThrownBy(() -> writeOrderCreatorBootstrapRecovery.initializeOnBootstrap()) .isInstanceOf(Exception.class); }
public void initializeOnBootstrap() { try { Path fileBucketTarStoragePath = Paths.get(inputTarStorageFolder).resolve(BucketTopologyHelper.BACKUP_FILE_BUCKET); if (fileBucketTarStoragePath.toFile().exists()) { recoverFileBucket(BucketTopologyHelper.BACKUP_FILE_BUCKET, fileBucketTarStoragePath); } for (String fileBucket : bucketTopologyHelper.listFileBuckets()) { fileBucketTarStoragePath = Paths.get(inputTarStorageFolder).resolve(fileBucket); if (fileBucketTarStoragePath.toFile().exists()) { recoverFileBucket(fileBucket, fileBucketTarStoragePath); } } } catch (Exception e) { throw new VitamRuntimeException("Could not reschedule tar files to copy on tape", e); } }
WriteOrderCreatorBootstrapRecovery { public void initializeOnBootstrap() { try { Path fileBucketTarStoragePath = Paths.get(inputTarStorageFolder).resolve(BucketTopologyHelper.BACKUP_FILE_BUCKET); if (fileBucketTarStoragePath.toFile().exists()) { recoverFileBucket(BucketTopologyHelper.BACKUP_FILE_BUCKET, fileBucketTarStoragePath); } for (String fileBucket : bucketTopologyHelper.listFileBuckets()) { fileBucketTarStoragePath = Paths.get(inputTarStorageFolder).resolve(fileBucket); if (fileBucketTarStoragePath.toFile().exists()) { recoverFileBucket(fileBucket, fileBucketTarStoragePath); } } } catch (Exception e) { throw new VitamRuntimeException("Could not reschedule tar files to copy on tape", e); } } }
WriteOrderCreatorBootstrapRecovery { public void initializeOnBootstrap() { try { Path fileBucketTarStoragePath = Paths.get(inputTarStorageFolder).resolve(BucketTopologyHelper.BACKUP_FILE_BUCKET); if (fileBucketTarStoragePath.toFile().exists()) { recoverFileBucket(BucketTopologyHelper.BACKUP_FILE_BUCKET, fileBucketTarStoragePath); } for (String fileBucket : bucketTopologyHelper.listFileBuckets()) { fileBucketTarStoragePath = Paths.get(inputTarStorageFolder).resolve(fileBucket); if (fileBucketTarStoragePath.toFile().exists()) { recoverFileBucket(fileBucket, fileBucketTarStoragePath); } } } catch (Exception e) { throw new VitamRuntimeException("Could not reschedule tar files to copy on tape", e); } } WriteOrderCreatorBootstrapRecovery(
        String inputTarStorageFolder,
        ArchiveReferentialRepository archiveReferentialRepository,
        BucketTopologyHelper bucketTopologyHelper,
        WriteOrderCreator writeOrderCreator, TarFileRapairer tarFileRapairer); }
WriteOrderCreatorBootstrapRecovery { public void initializeOnBootstrap() { try { Path fileBucketTarStoragePath = Paths.get(inputTarStorageFolder).resolve(BucketTopologyHelper.BACKUP_FILE_BUCKET); if (fileBucketTarStoragePath.toFile().exists()) { recoverFileBucket(BucketTopologyHelper.BACKUP_FILE_BUCKET, fileBucketTarStoragePath); } for (String fileBucket : bucketTopologyHelper.listFileBuckets()) { fileBucketTarStoragePath = Paths.get(inputTarStorageFolder).resolve(fileBucket); if (fileBucketTarStoragePath.toFile().exists()) { recoverFileBucket(fileBucket, fileBucketTarStoragePath); } } } catch (Exception e) { throw new VitamRuntimeException("Could not reschedule tar files to copy on tape", e); } } WriteOrderCreatorBootstrapRecovery(
        String inputTarStorageFolder,
        ArchiveReferentialRepository archiveReferentialRepository,
        BucketTopologyHelper bucketTopologyHelper,
        WriteOrderCreator writeOrderCreator, TarFileRapairer tarFileRapairer); void initializeOnBootstrap(); }
WriteOrderCreatorBootstrapRecovery { public void initializeOnBootstrap() { try { Path fileBucketTarStoragePath = Paths.get(inputTarStorageFolder).resolve(BucketTopologyHelper.BACKUP_FILE_BUCKET); if (fileBucketTarStoragePath.toFile().exists()) { recoverFileBucket(BucketTopologyHelper.BACKUP_FILE_BUCKET, fileBucketTarStoragePath); } for (String fileBucket : bucketTopologyHelper.listFileBuckets()) { fileBucketTarStoragePath = Paths.get(inputTarStorageFolder).resolve(fileBucket); if (fileBucketTarStoragePath.toFile().exists()) { recoverFileBucket(fileBucket, fileBucketTarStoragePath); } } } catch (Exception e) { throw new VitamRuntimeException("Could not reschedule tar files to copy on tape", e); } } WriteOrderCreatorBootstrapRecovery(
        String inputTarStorageFolder,
        ArchiveReferentialRepository archiveReferentialRepository,
        BucketTopologyHelper bucketTopologyHelper,
        WriteOrderCreator writeOrderCreator, TarFileRapairer tarFileRapairer); void initializeOnBootstrap();  }