All Products
Search
Document Center

Object Storage Service:Download files (Java SDK)

Last Updated:Jul 30, 2025

The OSS Java SDK provides several methods to download files:

  • Streaming download (Java SDK): You can read file content in real time without saving the entire file to a local disk. This method is suitable for scenarios such as processing large files or data in memory.

  • Download to a local file (Java SDK): You can download a file and save it to a specified local path. This method simplifies file management and subsequent operations.

  • Range download (Java SDK): You can download a specific part (byte range) of a file instead of the entire file. This method is useful when you need only a portion of a file.

  • Resumable download (Java SDK): You can resume an interrupted download from the breakpoint without starting over. This method is especially suitable for large files or unstable networks because it can significantly save time and bandwidth.

  • Conditional download (Java SDK): You can set specific conditions, such as the file size or modification time. A file is downloaded only if it meets the specified conditions. This method is suitable for scenarios where you need to ensure that the version or status of the downloaded file meets specific standards.

  • Download using a signed URL (Java SDK): You can generate a signed URL to ensure that only users with valid signatures can access and download the file. This method lets you generate temporary access links for third parties.

You can also use the progress bar chart feature to monitor the download progress.