com.stackmob.sdk.api
Class StackMobFile

java.lang.Object
  extended by com.stackmob.sdk.api.StackMobFile

public class StackMobFile
extends Object

Represents binary data to be uploaded to StackMob and hosted on S3 as a file.


Constructor Summary
StackMobFile(String url)
          create a StackMobFile that just wraps an url from S3
StackMobFile(String contentType, String fileName, byte[] bytes)
          create a StackMobFile with the information needed for the corresponding S3 file
 
Method Summary
 String getBinaryString()
          get a binary string suitable for posting to StackMob
 String getS3Url()
          get the url on S3 where this file has been uploaded
 void setS3Url(String url)
          set the url for this file once uploaded
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StackMobFile

public StackMobFile(String contentType,
                    String fileName,
                    byte[] bytes)
create a StackMobFile with the information needed for the corresponding S3 file

Parameters:
contentType - The content type of the file to be created
fileName - The filename of the file to be created
bytes - The bytes of the file to be created

StackMobFile

public StackMobFile(String url)
create a StackMobFile that just wraps an url from S3

Parameters:
url - the S3 url
Method Detail

getS3Url

public String getS3Url()
get the url on S3 where this file has been uploaded

Returns:
the S3 url

setS3Url

public void setS3Url(String url)
set the url for this file once uploaded

Parameters:
url - the url where the file is located

getBinaryString

public String getBinaryString()
get a binary string suitable for posting to StackMob

Returns:
a binary representation of this file

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2013 StackMob. All Rights Reserved.