Skip to content
This repository was archived by the owner on Dec 6, 2024. It is now read-only.

Commit 8e0ce77

Browse files
committed
Add prefix and delimiter parameters.
1 parent eafdf9e commit 8e0ce77

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

src/main/java/synapticloop/b2/B2ApiClient.java

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -679,6 +679,24 @@ public B2ListFilesResponse listFileNames(String bucketId, String startFileName,
679679
return new B2ListFileNamesRequest(client, b2AuthorizeAccountResponse, bucketId, startFileName, maxFileCount, null, null).getResponse();
680680
}
681681

682+
/**
683+
* Return a list of all of the files within a bucket with the specified ID,
684+
* by default a maximum of 100 files are returned with this request.
685+
*
686+
* @param bucketId the id of the bucket to list
687+
* @param startFileName the start file name, or if null, this will be the first file
688+
* @param maxFileCount (optional) if null, the default is 100, the maximum number to be returned is 1000
689+
* @param prefix Files returned will be limited to those with the given prefix. Defaults to the empty string, which matches all files.
690+
* @param delimiter Files returned will be limited to those within the top folder, or any one subfolder. Defaults to NULL. Folder names will also be returned. The delimiter character will be used to "break" file names into folders.
691+
* @return the list of files response
692+
*
693+
* @throws B2ApiException if there was an error with the call,
694+
* @throws IOException if there was an error communicating with the API service
695+
*/
696+
public B2ListFilesResponse listFileNames(String bucketId, String startFileName, Integer maxFileCount, String prefix, String delimiter) throws B2ApiException, IOException {
697+
return new B2ListFileNamesRequest(client, b2AuthorizeAccountResponse, bucketId, startFileName, maxFileCount, prefix, delimiter).getResponse();
698+
}
699+
682700
/**
683701
* List the files and versions for a specific bucket
684702
*
@@ -726,6 +744,25 @@ public B2ListFilesResponse listFileVersions(String bucketId, String startFileNam
726744
return new B2ListFileVersionsRequest(client, b2AuthorizeAccountResponse, bucketId, maxFileCount, startFileName, startFileId, null, null).getResponse();
727745
}
728746

747+
/**
748+
* List the file versions in a bucket starting at a specific file name and file id
749+
*
750+
* @param bucketId the id of the bucket
751+
* @param startFileName the file name to start with
752+
* @param startFileId the id of the file to start with
753+
* @param maxFileCount the maximum number of files to return (must be less than or equal to 1000, else an error is thrown)
754+
* @param prefix Files returned will be limited to those with the given prefix. Defaults to the empty string, which matches all files.
755+
* @param delimiter Files returned will be limited to those within the top folder, or any one subfolder. Defaults to NULL. Folder names will also be returned. The delimiter character will be used to "break" file names into folders.
756+
*
757+
* @return the list files response
758+
*
759+
* @throws B2ApiException if there was an error with the call
760+
* @throws IOException if there was an error communicating with the API service
761+
*/
762+
public B2ListFilesResponse listFileVersions(String bucketId, String startFileName, String startFileId, Integer maxFileCount, String prefix, String delimiter) throws B2ApiException, IOException {
763+
return new B2ListFileVersionsRequest(client, b2AuthorizeAccountResponse, bucketId, maxFileCount, startFileName, startFileId, prefix, delimiter).getResponse();
764+
}
765+
729766
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
730767
*
731768
* DOWNLOAD FILE API ACTIONS

0 commit comments

Comments
 (0)