com.amazonaws.services.s3.internal

## クラス ServiceUtils

- java.lang.Object
- - com.amazonaws.services.s3.internal.ServiceUtils

-     public class ServiceUtils
      extends java.lang.Object

  General utility methods used throughout the AWS S3 Java client.

- - ### ネストされたクラスの概要

    ネストされたクラス
    修飾子とタイプ | クラスと説明
    --- | ---
    `static interface` | `ServiceUtils.RetryableS3DownloadTask` Interface for the task of downloading object from S3 to a specific file, enabling one-time retry mechanism after integrity check failure on the downloaded file.

  - ### フィールドの概要

    フィールド
    修飾子とタイプ | フィールドと説明
    --- | ---
    `protected static DateUtils` | `dateUtils`

  - ### コンストラクタの概要

    コンストラクタ
    コンストラクタと説明
    `ServiceUtils()`

  - ### メソッドの概要

    メソッド
    修飾子とタイプ | メソッドと説明
    --- | ---
    `static java.net.URL` | `convertRequestToUrl(Request<?> request)` Converts the specified request object into a URL, containing all the specified parameters, the specified request endpoint, etc.
    `static void` | `downloadObjectToFile(S3Object s3Object, java.io.File destinationFile, boolean performIntegrityCheck)` Downloads an S3Object, as returned from `AmazonS3Client.getObject(com.amazonaws.services.s3.model.GetObjectRequest)`, to the specified file.
    `static java.lang.String` | `formatIso8601Date(java.util.Date date)`
    `static java.lang.String` | `formatRfc822Date(java.util.Date date)`
    `static boolean` | `isMultipartUploadETag(java.lang.String eTag)` Returns true if the specified ETag was from a multipart upload.
    `static java.lang.String` | `join(java.util.List<java.lang.String> strings)` Returns a new string created by joining each of the strings in the specified list together, with a comma between them.
    `static java.util.Date` | `parseIso8601Date(java.lang.String dateString)`
    `static java.util.Date` | `parseRfc822Date(java.lang.String dateString)`
    `static java.lang.String` | `removeQuotes(java.lang.String s)` Removes any surrounding quotes from the specified string and returns a new string.
    `static S3Object` | `retryableDownloadS3ObjectToFile(java.io.File file, ServiceUtils.RetryableS3DownloadTask retryableS3DownloadTask)` Gets an object stored in S3 and downloads it into the specified file.
    `static byte[]` | `toByteArray(java.lang.String s)` Safely converts a string to a byte array, first attempting to explicitly use our preferred encoding (UTF-8), and then falling back to the platform's default encoding if for some reason our preferred encoding isn't supported.

    - ### クラスから継承されたメソッド java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### フィールドの詳細

    - #### dateUtils

          protected static final DateUtils dateUtils

  - ### コンストラクタの詳細

    - #### ServiceUtils

          public ServiceUtils()

  - ### メソッドの詳細

    - #### parseIso8601Date

          public static java.util.Date parseIso8601Date(java.lang.String dateString)
                                                 throws java.text.ParseException

      例外:
        `java.text.ParseException`

    - #### formatIso8601Date

          public static java.lang.String formatIso8601Date(java.util.Date date)

    - #### parseRfc822Date

          public static java.util.Date parseRfc822Date(java.lang.String dateString)
                                                throws java.text.ParseException

      例外:
        `java.text.ParseException`

    - #### formatRfc822Date

          public static java.lang.String formatRfc822Date(java.util.Date date)

    - #### isMultipartUploadETag

          public static boolean isMultipartUploadETag(java.lang.String eTag)

      Returns true if the specified ETag was from a multipart upload.
      パラメータ:
        `eTag` - The ETag to test.
      戻り値:
        True if the specified ETag was from a multipart upload, otherwise false it if belongs to an object that was uploaded in a single part.

    - #### toByteArray

          public static byte[] toByteArray(java.lang.String s)

      Safely converts a string to a byte array, first attempting to explicitly use our preferred encoding (UTF-8), and then falling back to the platform's default encoding if for some reason our preferred encoding isn't supported.
      パラメータ:
        `s` - The string to convert to a byte array.
      戻り値:
        The byte array contents of the specified string.

    - #### removeQuotes

          public static java.lang.String removeQuotes(java.lang.String s)

      Removes any surrounding quotes from the specified string and returns a new string.
      パラメータ:
        `s` - The string to check for surrounding quotes.
      戻り値:
        A new string created from the specified string, minus any surrounding quotes.

    - #### convertRequestToUrl

          public static java.net.URL convertRequestToUrl(Request<?> request)

      Converts the specified request object into a URL, containing all the specified parameters, the specified request endpoint, etc.
      パラメータ:
        `request` - The request to convert into a URL.
      戻り値:
        A new URL representing the specified request.
      例外:
        `AmazonClientException` - If the request cannot be converted to a well formed URL.

    - #### join

          public static java.lang.String join(java.util.List<java.lang.String> strings)

      Returns a new string created by joining each of the strings in the specified list together, with a comma between them.
      パラメータ:
        `strings` - The list of strings to join into a single, comma delimited string list.
      戻り値:
        A new string created by joining each of the strings in the specified list together, with a comma between strings.

    - #### downloadObjectToFile

          public static void downloadObjectToFile(S3Object s3Object,
                                  java.io.File destinationFile,
                                  boolean performIntegrityCheck)

      Downloads an S3Object, as returned from `AmazonS3Client.getObject(com.amazonaws.services.s3.model.GetObjectRequest)`, to the specified file.
      パラメータ:
        `s3Object` - The S3Object containing a reference to an InputStream containing the object's data.
        `destinationFile` - The file to store the object's data in.
        `performIntegrityCheck` - Boolean valuable to indicate whether do the integrity check or not

    - #### retryableDownloadS3ObjectToFile

          public static S3Object retryableDownloadS3ObjectToFile(java.io.File file,
                                                 ServiceUtils.RetryableS3DownloadTask retryableS3DownloadTask)

      Gets an object stored in S3 and downloads it into the specified file. This method includes the one-time retry mechanism after integrity check failure on the downloaded file. It will also return immediately after getting null valued S3Object (when getObject request does not meet the specified constraints).
      パラメータ:
        `file` - The file to store the object's data in.
        `safeS3DownloadTask` - The implementation of SafeS3DownloadTask interface which allows user to get access to all the visible variables at the calling site of this method.