Skip to content

Commit

Permalink
Address PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sydney-munro committed Jun 23, 2023
1 parent 20fcf58 commit 083fc21
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,29 @@ private ParallelDownloadConfig(

/**
* A common prefix removed from an object's name before being written to the filesystem.
*
* @see Builder#setStripPrefix(String)
*/
@BetaApi
public @NonNull String getStripPrefix() {
return stripPrefix;
}

/** The base directory in which all objects will be placed when downloaded. */
/**
* The base directory in which all objects will be placed when downloaded.
*
* @see Builder#setDownloadDirectory(Path)
*/
@BetaApi
public @NonNull Path getDownloadDirectory() {
return downloadDirectory;
}

/** The bucket objects are being downloaded from. */
/**
* The bucket objects are being downloaded from.
*
* @see Builder#setBucketName(String)
*/
@BetaApi
public @NonNull String getBucketName() {
return bucketName;
Expand All @@ -75,6 +85,8 @@ private ParallelDownloadConfig(
/**
* A list of common BlobSourceOptions that are used for each download request. Note this list of
* options will be applied to every single request.
*
* @see Builder#setOptionsPerRequest(List)
*/
@BetaApi
public @NonNull List<BlobSourceOption> getOptionsPerRequest() {
Expand Down Expand Up @@ -141,6 +153,7 @@ private Builder() {
* names before they are written to the filesystem.
*
* @return the builder instance with the value for stripPrefix modified.
* @see ParallelDownloadConfig#getStripPrefix()
*/
@BetaApi
public Builder setStripPrefix(String stripPrefix) {
Expand All @@ -152,6 +165,7 @@ public Builder setStripPrefix(String stripPrefix) {
* Sets the base directory on the filesystem that all objects will be written to.
*
* @return the builder instance with the value for downloadDirectory modified.
* @see ParallelDownloadConfig#getDownloadDirectory()
*/
@BetaApi
public Builder setDownloadDirectory(Path downloadDirectory) {
Expand All @@ -163,6 +177,7 @@ public Builder setDownloadDirectory(Path downloadDirectory) {
* Sets the bucketName that Transfer Manager will download from. This field is required.
*
* @return the builder instance with the value for bucketName modified.
* @see ParallelDownloadConfig#getBucketName()
*/
@BetaApi
public Builder setBucketName(String bucketName) {
Expand All @@ -175,6 +190,7 @@ public Builder setBucketName(String bucketName) {
* will be applied to every single download request.
*
* @return the builder instance with the value for OptionsPerRequest modified.
* @see ParallelDownloadConfig#getOptionsPerRequest()
*/
@BetaApi
public Builder setOptionsPerRequest(List<BlobSourceOption> optionsPerRequest) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,29 @@ private ParallelUploadConfig(
/**
* If set Transfer Manager will skip uploading an object if it already exists, equivalent to
* providing {@link BlobWriteOption#doesNotExist()} in {@link #getWriteOptsPerRequest()}
*
* @see Builder#setSkipIfExists(boolean)
*/
@BetaApi
public boolean isSkipIfExists() {
return skipIfExists;
}

/** A common prefix that will be applied to all object paths in the destination bucket */
/**
* A common prefix that will be applied to all object paths in the destination bucket
*
* @see Builder#setPrefix(String)
*/
@BetaApi
public @NonNull String getPrefix() {
return prefix;
}

/** The bucket objects are being uploaded from */
/**
* The bucket objects are being uploaded from
*
* @see Builder#setBucketName(String)
*/
@BetaApi
public @NonNull String getBucketName() {
return bucketName;
Expand All @@ -75,6 +85,8 @@ public boolean isSkipIfExists() {
/**
* A list of common BlobWriteOptions, note these options will be applied to every single upload
* request.
*
* @see Builder#setWriteOptsPerRequest(List)
*/
@BetaApi
public @NonNull List<BlobWriteOption> getWriteOptsPerRequest() {
Expand Down Expand Up @@ -149,6 +161,7 @@ private Builder() {
* object if it already exists.
*
* @return the builder instance with the value for skipIfExists modified.
* @see ParallelUploadConfig#isSkipIfExists()
*/
@BetaApi
public Builder setSkipIfExists(boolean skipIfExists) {
Expand All @@ -160,6 +173,7 @@ public Builder setSkipIfExists(boolean skipIfExists) {
* Sets a common prefix that will be applied to all object paths in the destination bucket.
*
* @return the builder instance with the value for prefix modified.
* @see ParallelUploadConfig#getPrefix()
*/
@BetaApi
public Builder setPrefix(@NonNull String prefix) {
Expand All @@ -171,6 +185,7 @@ public Builder setPrefix(@NonNull String prefix) {
* Sets the bucketName that Transfer Manager will upload to. This field is required.
*
* @return the builder instance with the value for bucketName modified.
* @see ParallelUploadConfig#getBucketName()
*/
@BetaApi
public Builder setBucketName(@NonNull String bucketName) {
Expand All @@ -183,6 +198,7 @@ public Builder setBucketName(@NonNull String bucketName) {
* will be applied to every single upload request.
*
* @return the builder instance with the value for WriteOptsPerRequest modified.
* @see ParallelUploadConfig#getWriteOptsPerRequest()
*/
@BetaApi
public Builder setWriteOptsPerRequest(@NonNull List<BlobWriteOption> writeOptsPerRequest) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
public interface TransferManager extends AutoCloseable {

/**
* Uploads a list of files in parallel.
* Uploads a list of files in parallel. This operation will not block the invoking thread,
* awaiting results should be done on the returned UploadJob.
*
* <p>Accepts a {@link ParallelUploadConfig} which defines the constraints of parallel uploads or
* predefined defaults.
Expand Down Expand Up @@ -60,7 +61,8 @@ public interface TransferManager extends AutoCloseable {
UploadJob uploadFiles(List<Path> files, ParallelUploadConfig config);

/**
* Downloads a list of blobs in parallel.
* Downloads a list of blobs in parallel. This operation will not block the invoking thread,
* awaiting results should be done on the returned DownloadJob.
*
* <p>Accepts a {@link ParallelDownloadConfig} which defines the constraints of parallel downloads
* or predefined defaults.
Expand Down

0 comments on commit 083fc21

Please sign in to comment.