|
23 | 23 | import java.util.Map; |
24 | 24 |
|
25 | 25 | import org.apache.commons.io.FileUtils; |
26 | | -import org.apache.commons.io.IOUtils; |
27 | 26 | import org.apache.http.HttpEntity; |
28 | 27 | import org.apache.http.impl.client.CloseableHttpClient; |
29 | 28 | import org.apache.http.impl.client.HttpClients; |
@@ -584,53 +583,6 @@ public void downloadFileRangeByNameToFile(String bucketName, String fileName, Fi |
584 | 583 | .getResponse().getContent(), file); |
585 | 584 | } |
586 | 585 |
|
587 | | - /** |
588 | | - * Download a named file from a named bucket to an byte[]. This is a |
589 | | - * utility method which will automatically convert the response stream to a |
590 | | - * byte[]. |
591 | | - * |
592 | | - * Note: This will not return any of the headers that accompanied the download. |
593 | | - * See downloadFileByName to retrieve the complete response including sha1, |
594 | | - * content length, content type and all headers. |
595 | | - * |
596 | | - * @param bucketName The name of the bucket to download the file from |
597 | | - * @param fileName the name of the file to download |
598 | | - * |
599 | | - * @return the array of bytes from the download |
600 | | - * |
601 | | - * @throws B2ApiException if there was an error with the call |
602 | | - * @throws IOException if there was an error communicating with the API service |
603 | | - */ |
604 | | - public byte[] downloadFileByNameToBytes(String bucketName, String fileName) throws B2ApiException, IOException { |
605 | | - return IOUtils.toByteArray(new B2DownloadFileByNameRequest(client, b2AuthorizeAccountResponse, bucketName, fileName).getResponse().getContent()); |
606 | | - } |
607 | | - |
608 | | - /** |
609 | | - * Download a range of bytes from a named file from a named bucket to an |
610 | | - * byte[]. This is a utility method which will automatically convert the |
611 | | - * response stream to a byte[].The range starts at 0 (zero) and goes up |
612 | | - * to the end. Both are inclusive - e.g. a range of 0-5 will return 6 |
613 | | - * (six) bytes. If the range values are not correct, the complete file |
614 | | - * will be downloaded |
615 | | - * |
616 | | - * Note: This will not return any of the headers that accompanied the download. |
617 | | - * See downloadFileByName to retrieve the complete response including sha1, |
618 | | - * content length, content type and all headers. |
619 | | - * |
620 | | - * @param bucketName The name of the bucket to download the file from |
621 | | - * @param fileName the name of the file to download |
622 | | - * @param rangeStart the start range (byte) offset for the content (inclusive) |
623 | | - * @param rangeEnd the end range (byte) offset for the content (inclusive) |
624 | | - * |
625 | | - * @return the array of bytes from the download |
626 | | - * |
627 | | - * @throws B2ApiException if there was an error with the call |
628 | | - * @throws IOException if there was an error communicating with the API service |
629 | | - */ |
630 | | - public byte[] downloadFileRangeByNameToBytes(String bucketName, String fileName, long rangeStart, long rangeEnd) throws B2ApiException, IOException { |
631 | | - return IOUtils.toByteArray(new B2DownloadFileByNameRequest(client, b2AuthorizeAccountResponse, bucketName, fileName, rangeStart, rangeEnd).getResponse().getContent()); |
632 | | - } |
633 | | - |
634 | 586 | /** |
635 | 587 | * Download a named file from a named bucket and return the input stream from |
636 | 588 | * the HTTP response. This is a utility method which will automatically return |
@@ -750,48 +702,6 @@ public B2DownloadFileResponse downloadFileRangeById(String fileId, long rangeSta |
750 | 702 | return new B2DownloadFileByIdRequest(client, b2AuthorizeAccountResponse, fileId, rangeStart, rangeEnd).getResponse(); |
751 | 703 | } |
752 | 704 |
|
753 | | - /** |
754 | | - * Download a file to a byte[] |
755 | | - * |
756 | | - * Note: This will not return any of the headers that accompanied the download. |
757 | | - * See downloadFileByName to retrieve the complete response including sha1, |
758 | | - * content length, content type and all headers. |
759 | | - * |
760 | | - * @param fileId the id of the file to download |
761 | | - * |
762 | | - * @return the array of bytes for the file |
763 | | - * |
764 | | - * @throws B2ApiException if there was an error with the call |
765 | | - * @throws IOException if there was an error communicating with the API service |
766 | | - */ |
767 | | - public byte[] downloadFileByIdToBytes(String fileId) throws B2ApiException, IOException { |
768 | | - return IOUtils.toByteArray(new B2DownloadFileByIdRequest(client, b2AuthorizeAccountResponse, fileId).getResponse().getContent()); |
769 | | - } |
770 | | - |
771 | | - /** |
772 | | - * Download a partial range of file data to a byte[], the range starts at 0 |
773 | | - * (zero) and goes up to the end. Both are inclusive - e.g. a range of 0-5 |
774 | | - * will return 6 (six) bytes. If the range values are not correct, the |
775 | | - * complete file will be downloaded |
776 | | - * |
777 | | - * Note: This will not return any of the headers that accompanied the download. |
778 | | - * See downloadFileByName to retrieve the complete response including sha1, |
779 | | - * content length, content type and all headers. |
780 | | - * |
781 | | - * @param fileId the id of the file to download |
782 | | - * @param rangeStart the start range (byte) offset for the content (inclusive) |
783 | | - * @param rangeEnd the end range (byte) offset for the content (inclusive) |
784 | | - * |
785 | | - * @return the array of bytes for the file |
786 | | - * |
787 | | - * @throws B2ApiException if there was an error with the call |
788 | | - * @throws IOException if there was an error communicating with the API service |
789 | | - */ |
790 | | - public byte[] downloadFileRangeByIdToBytes(String fileId, long rangeStart, long rangeEnd) throws B2ApiException, IOException { |
791 | | - return IOUtils.toByteArray(new B2DownloadFileByIdRequest(client, b2AuthorizeAccountResponse, fileId, rangeStart, rangeEnd) |
792 | | - .getResponse().getContent()); |
793 | | - } |
794 | | - |
795 | 705 | /** |
796 | 706 | * Download the file to a local file |
797 | 707 | * |
|
0 commit comments