Package com.google.cloud.tools.jib.blob
Class Blobs
- java.lang.Object
-
- com.google.cloud.tools.jib.blob.Blobs
-
public class Blobs extends java.lang.Object
Static methods forBlob
.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Blob
from(WritableContents writable, boolean retryable)
static Blob
from(JsonTemplate template)
static Blob
from(java.io.InputStream inputStream)
static Blob
from(java.lang.String content)
Creates aStringBlob
with UTF-8 encoding.static Blob
from(java.nio.file.Path file)
static byte[]
writeToByteArray(Blob blob)
Writes the BLOB to a byte array.static java.lang.String
writeToString(Blob blob)
Writes the BLOB to a string with UTF-8 decoding.
-
-
-
Method Detail
-
from
public static Blob from(java.io.InputStream inputStream)
-
from
public static Blob from(java.nio.file.Path file)
-
from
public static Blob from(JsonTemplate template)
-
from
public static Blob from(java.lang.String content)
Creates aStringBlob
with UTF-8 encoding.- Parameters:
content
- the string to create the blob from- Returns:
- the
StringBlob
-
from
public static Blob from(WritableContents writable, boolean retryable)
-
writeToString
public static java.lang.String writeToString(Blob blob) throws java.io.IOException
Writes the BLOB to a string with UTF-8 decoding.- Parameters:
blob
- the BLOB to write- Returns:
- the BLOB contents as a string
- Throws:
java.io.IOException
- if writing out the BLOB contents fails
-
writeToByteArray
public static byte[] writeToByteArray(Blob blob) throws java.io.IOException
Writes the BLOB to a byte array.- Parameters:
blob
- the BLOB to write- Returns:
- the BLOB contents as a byte array
- Throws:
java.io.IOException
- if writing out the BLOB contents fails
-
-