|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.rackspacecloud.client.cloudfiles.FilesObject
public class FilesObject
Method Summary | |
---|---|
java.lang.String |
getLastModified()
|
java.lang.String |
getMd5sum()
Get's the MD5 Checksum for this object |
FilesObjectMetaData |
getMetaData()
Return any metadata associated with this object |
java.lang.String |
getMimeType()
|
java.lang.String |
getName()
|
byte[] |
getObject()
Download the contents of the object |
java.io.InputStream |
getObjectAsStream()
Returns an inputStream with the contents of the object |
long |
getSize()
Returns the size of the object, in bytes |
java.lang.String |
getSizeString()
Returns the size as a human readable string, rounding to the nearest KB/MB/GB |
boolean |
isDirectory()
|
void |
setLastModified(java.lang.String lastModified)
|
void |
setMd5sum(java.lang.String md5sum)
|
void |
setMimeType(java.lang.String mimeType)
|
void |
setName(java.lang.String name)
Set's the objects name (up to a maximum of 128 characters) |
void |
setSize(long size)
Set the size of the object |
static FilesObject |
uploadObject(java.io.File obj,
java.lang.String mimeType,
FilesContainer container)
|
static FilesObject |
uploadObject(java.io.File obj,
java.lang.String mimeType,
FilesContainer container,
IFilesTransferCallback callback)
|
long |
writeObjectToFile(java.io.File localFile)
Download the object and write it to a local file |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public java.lang.String getName()
public void setName(java.lang.String name)
name
- The new namepublic java.lang.String getMimeType() throws org.apache.http.HttpException, java.io.IOException, FilesAuthorizationException, FilesInvalidNameException
org.apache.http.HttpException
java.io.IOException
FilesAuthorizationException
FilesInvalidNameException
public void setMimeType(java.lang.String mimeType)
mimeType
- The new MIME type for this objectpublic java.lang.String getMd5sum() throws org.apache.http.HttpException, java.io.IOException, FilesAuthorizationException, FilesInvalidNameException
org.apache.http.HttpException
java.io.IOException
FilesAuthorizationException
FilesInvalidNameException
public void setMd5sum(java.lang.String md5sum)
md5sum
- The MD5 sum of the file (as a hex-encoded string)public long getSize() throws org.apache.http.HttpException, java.io.IOException, FilesAuthorizationException, FilesInvalidNameException
org.apache.http.HttpException
java.io.IOException
FilesAuthorizationException
FilesInvalidNameException
public void setSize(long size)
size
- The size, in bytespublic long writeObjectToFile(java.io.File localFile) throws java.io.FileNotFoundException, org.apache.http.HttpException, java.io.IOException, FilesAuthorizationException, FilesInvalidNameException
localFile
- The file
java.io.FileNotFoundException
- Could not find the local file (does the path to it exist?)
org.apache.http.HttpException
- There was an error communicating with the server
java.io.IOException
- There was an I/O exception communicating with the server or writing the file.
FilesAuthorizationException
FilesInvalidNameException
public java.io.InputStream getObjectAsStream() throws org.apache.http.HttpException, java.io.IOException, FilesAuthorizationException, FilesInvalidNameException
org.apache.http.HttpException
- There was an error communicating with the server
java.io.IOException
- There was an I/O exception communicating with the server or writing the file.
FilesAuthorizationException
FilesInvalidNameException
public byte[] getObject() throws org.apache.http.HttpException, java.io.IOException, FilesAuthorizationException, FilesInvalidNameException, FilesNotFoundException
org.apache.http.HttpException
- There was an error communicating with the server
java.io.IOException
- There was an I/O exception communicating with the server or writing the file.
FilesAuthorizationException
FilesInvalidNameException
FilesNotFoundException
public FilesObjectMetaData getMetaData() throws org.apache.http.HttpException, java.io.IOException, FilesAuthorizationException, FilesInvalidNameException
org.apache.http.HttpException
- There was an error communicating with the server
java.io.IOException
- There was an I/O exception communicating with the server or writing the file.
FilesAuthorizationException
FilesInvalidNameException
public static FilesObject uploadObject(java.io.File obj, java.lang.String mimeType, FilesContainer container) throws java.io.IOException, FilesException
java.io.IOException
FilesException
public static FilesObject uploadObject(java.io.File obj, java.lang.String mimeType, FilesContainer container, IFilesTransferCallback callback) throws java.io.IOException, FilesException
java.io.IOException
FilesException
public java.lang.String getSizeString() throws org.apache.http.HttpException, java.io.IOException, FilesAuthorizationException, FilesInvalidNameException
org.apache.http.HttpException
- There was an error communicating with the server
java.io.IOException
- There was an I/O exception communicating with the server or writing the file.
FilesAuthorizationException
FilesInvalidNameException
public java.lang.String getLastModified() throws org.apache.http.HttpException, java.io.IOException, FilesAuthorizationException, FilesInvalidNameException
org.apache.http.HttpException
java.io.IOException
FilesAuthorizationException
FilesInvalidNameException
public void setLastModified(java.lang.String lastModified)
lastModified
- the lastModified to setpublic boolean isDirectory()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |