Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package com.spectralogic.ds3client.integration;

import com.spectralogic.ds3client.helpers.DataTransferredListener;
import com.spectralogic.ds3client.helpers.ObjectCompletedListener;

class TransferredListener implements DataTransferredListener, ObjectCompletedListener {

private long totalBytes = 0;
private int numberOfFiles = 0;
public TransferredListener() {
//pass
}

@Override
public synchronized void dataTransferred(final long size) {
this.totalBytes += size;
}

public long getTotalBytes() {
return this.totalBytes;
}


@Override
public synchronized void objectCompleted(final String s) {
this.numberOfFiles += 1;
}

public int getNumberOfFiles() {
return this.numberOfFiles;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@

public class Util {
public static final String RESOURCE_BASE_NAME = "books/";
public static final String[] BOOKS = {"beowulf.txt", "sherlock_holmes.txt", "tale_of_two_cities.txt", "ulysses.txt"};

private Util() {}

Expand All @@ -62,7 +63,6 @@ public static void assumeVersion1_2(final Ds3Client client) throws IOException,
assumeThat(majorVersion, is(1));
}

private static final String[] BOOKS = {"beowulf.txt", "sherlock_holmes.txt", "tale_of_two_cities.txt", "ulysses.txt"};
public static void loadBookTestData(final Ds3Client client, final String bucketName) throws IOException, SignatureException, XmlProcessingException, URISyntaxException {

getLoadJob(client, bucketName, RESOURCE_BASE_NAME)
Expand Down Expand Up @@ -100,7 +100,6 @@ public static void loadBookTestDataWithPrefix(final Ds3Client client, final Stri
helpers.startWriteJob(bucketName, objects).transfer(new PrefixAdderObjectChannelBuilder(new ResourceObjectPutter(RESOURCE_BASE_NAME), prefix));
}


public static void deleteAllContents(final Ds3Client client, final String bucketName) throws IOException, SignatureException {
final Ds3ClientHelpers helpers = Ds3ClientHelpers.wrap(client);

Expand Down
Loading