public class GdxFIRStorage extends PlatformDistributor<StorageDistribution> implements StorageDistribution
StorageDistribution,
PlatformDistributorplatformObject| Modifier | Constructor and Description |
|---|---|
protected |
GdxFIRStorage()
GdxFIRStorage protected constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
delete(java.lang.String path,
DeleteCallback callback) |
void |
download(java.lang.String path,
java.io.File targetFile,
DownloadCallback<java.io.File> callback) |
void |
download(java.lang.String path,
long bytesLimit,
DownloadCallback<byte[]> callback)
TODO - path type detection.
|
void |
downloadImage(java.lang.String path,
DownloadCallback<com.badlogic.gdx.graphics.g2d.TextureRegion> callback)
Downloads texture from Firebase storage.
|
protected java.lang.String |
getAndroidClassName()
Gives class name of object that will be create when application running on android platform.
|
protected java.lang.String |
getIOSClassName()
Gives class name of object that will be create when application running on ios platform.
|
StorageDistribution |
inBucket(java.lang.String url) |
static GdxFIRStorage |
instance() |
void |
upload(byte[] data,
java.lang.String path,
UploadCallback callback) |
void |
upload(com.badlogic.gdx.files.FileHandle file,
java.lang.String path,
UploadCallback callback) |
setMockObjectprotected GdxFIRStorage()
throws PlatformDistributorException
Instance of this class should be getting by instance()
PlatformDistributorExceptionpublic static GdxFIRStorage instance()
public void upload(com.badlogic.gdx.files.FileHandle file,
java.lang.String path,
UploadCallback callback)
upload in interface StorageDistributionfile - File you want to uploadpath - Target path at Firebase storagecallback - Callbackpublic void upload(byte[] data,
java.lang.String path,
UploadCallback callback)
upload in interface StorageDistributiondata - Data to uploadpath - Target pat at Firebase storagecallback - Callbackpublic void download(java.lang.String path,
long bytesLimit,
DownloadCallback<byte[]> callback)
download in interface StorageDistributionpath - Storage pathbytesLimit - Bytes sizecallback - Callbackpublic void download(java.lang.String path,
java.io.File targetFile,
DownloadCallback<java.io.File> callback)
download in interface StorageDistributionpath - PathtargetFile - Target file, if null the temporary file will be created.callback - Callbackpublic void delete(java.lang.String path,
DeleteCallback callback)
delete in interface StorageDistributionpath - Pathcallback - Callbackpublic StorageDistribution inBucket(java.lang.String url)
inBucket in interface StorageDistributionurl - Bucket url 'gs://'public void downloadImage(java.lang.String path,
DownloadCallback<com.badlogic.gdx.graphics.g2d.TextureRegion> callback)
Image is represented by TextureRegion because of need of size which should be power of two.
Remember to dispose texture when you done:
region.getTexture().dispose();
path - Path in FirebaseStorage bucket.callback - This callback will be call after image is downloaded.protected java.lang.String getIOSClassName()
getIOSClassName in class PlatformDistributor<StorageDistribution>protected java.lang.String getAndroidClassName()
getAndroidClassName in class PlatformDistributor<StorageDistribution>