public class FileUtils extends Object
| Constructor and Description |
|---|
FileUtils() |
| Modifier and Type | Method and Description |
|---|---|
static String |
base64encode(String str)
Returns a base64 encoding of the specified binary string
|
static String |
createDataUrl(String type,
String data)
Returns a data
url with the specified mime type and data.
|
static String |
createObjectURL(Blob blob)
Creates a new object URL, whose lifetime is tied to the document in the
window on which it was created.
|
static void |
revokeObjectURL(String url)
Releases an existing object URL which was previously created by calling
createObjectURL(org.vectomatic.file.Blob) . |
static boolean |
supportsFileAPI()
Tests whether the browser support the W3C File API
|
public static String base64encode(String str)
str - A binary string (obtained for instance by the FileReader API).public static String createDataUrl(String type, String data)
type - The mime type to use in the data url.data - A binary string (obtained for instance by the FileReader API)public static final String createObjectURL(Blob blob)
blob - the blob to representpublic static final void revokeObjectURL(String url)
createObjectURL(org.vectomatic.file.Blob) . Call this method
when you've finished using a object URL, in order to let the browser know
it doesn't need to keep the reference to the file any longer.url - a string representing the object URL that was created by
calling createObjectURL(org.vectomatic.file.Blob)public static final boolean supportsFileAPI()
Copyright © 2017. All Rights Reserved.