Google Data APIs Client Library (1.41.1)



com.google.gdata.client.uploader
Class FileUploadData

java.lang.Object
  extended by com.google.gdata.client.uploader.FileUploadData
All Implemented Interfaces:
UploadData

public class FileUploadData
extends java.lang.Object
implements UploadData

An implementation of UploadData that provides data from a File.


Constructor Summary
FileUploadData(java.io.File file)
           
 
Method Summary
 java.lang.String getFileName()
          Gets the filename.
 long length()
          Returns the total number of bytes of data in the buffer.
 void read(byte[] destination)
          Reads up to destination.length bytes from the current position into the destination buffer.
 int read(byte[] chunk, int i, int length)
          Reads up to length bytes into the chunk buffer.
 void setPosition(long position)
          Sets the offset from the start of the the source data from which the next read will begin.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileUploadData

public FileUploadData(java.io.File file)
               throws java.io.IOException
Throws:
java.io.IOException
Method Detail

length

public long length()
Description copied from interface: UploadData
Returns the total number of bytes of data in the buffer.

Specified by:
length in interface UploadData

read

public void read(byte[] destination)
          throws java.io.IOException
Description copied from interface: UploadData
Reads up to destination.length bytes from the current position into the destination buffer.

Specified by:
read in interface UploadData
Throws:
java.io.IOException - if the data could not be read.

setPosition

public void setPosition(long position)
                 throws java.io.IOException
Description copied from interface: UploadData
Sets the offset from the start of the the source data from which the next read will begin.

Specified by:
setPosition in interface UploadData
Throws:
java.io.IOException - if position is negative or past the end of the data.

read

public int read(byte[] chunk,
                int i,
                int length)
         throws java.io.IOException
Description copied from interface: UploadData
Reads up to length bytes into the chunk buffer.

Specified by:
read in interface UploadData
i - the start offset in the destination buffer.
Throws:
java.io.IOException - if the data could not be read.

getFileName

public java.lang.String getFileName()
Gets the filename.

Returns:
the local file name