org.biffle.cliff.pearl2
Interface Pearl2Connection

All Known Implementing Classes:
Pearl2TCPConnection

public interface Pearl2Connection


Method Summary
 void close()
          Closes a connection.
 void deleteFile(int fid)
          Removes a file from the device.
 DeviceInfo getDeviceInfo()
          Returns an object encapsulating basic device information -- number of storage devices, system software name, and firmware version.
 DeviceSettings getDeviceSettings()
          Retrieves the Pearl device's settings as a DeviceSettings object.
 FileInfo getFileByFID(int fid)
          Returns a file by FID, or null if no such FID exists.
 long getFileCount()
          Returns the number of files available on the device.
 java.util.Iterator getFileIterator()
          Returns an iterator for the known files.
 int getMaxFID()
          Returns the highest allocated FID.
 StorageInfo getStorageInfo(int index)
          Retrieves information about a storage device in the Pearl device.
 int[] getVersion()
          Returns the version of the protocol being used as an array of two integers: the major and minor versions, respectively.
 boolean isAuthenticated()
          Checks to see if the underlying session has been successfully authenticated.
 void readFile(int fid, java.io.File dest)
          Downloads a file from the device by FID.
 void setAuthHandler(AuthHandler handler)
          Sets the AuthHandler to be used if authentication is required.
 void setFileInfo(int fid, FileInfo newInfo)
          Updates information for a file identified by FID.
 void setProgressHandler(ProgressHandler handler)
          Sets a library-global ProgressHandler.
 int writeFile(java.io.File src)
          Writes a local file to the device.
 int writeTaxiFile(java.io.File src)
          Writes a local file to the device without attempting to interpret the file as a song.
 

Method Detail

getVersion

public int[] getVersion()
                 throws PearlException
Returns the version of the protocol being used as an array of two integers: the major and minor versions, respectively.

PearlException

setAuthHandler

public void setAuthHandler(AuthHandler handler)
Sets the AuthHandler to be used if authentication is required.


isAuthenticated

public boolean isAuthenticated()
Checks to see if the underlying session has been successfully authenticated.


setProgressHandler

public void setProgressHandler(ProgressHandler handler)
Sets a library-global ProgressHandler.


getDeviceInfo

public DeviceInfo getDeviceInfo()
                         throws PearlException
Returns an object encapsulating basic device information -- number of storage devices, system software name, and firmware version.

PearlException

getStorageInfo

public StorageInfo getStorageInfo(int index)
                           throws PearlException
Retrieves information about a storage device in the Pearl device.

PearlException

getDeviceSettings

public DeviceSettings getDeviceSettings()
                                 throws PearlException
Retrieves the Pearl device's settings as a DeviceSettings object.

PearlException

getFileCount

public long getFileCount()
                  throws PearlException
Returns the number of files available on the device.

PearlException

getFileIterator

public java.util.Iterator getFileIterator()
                                   throws PearlException
Returns an iterator for the known files.

PearlException

getFileByFID

public FileInfo getFileByFID(int fid)
                      throws PearlException
Returns a file by FID, or null if no such FID exists.

PearlException

setFileInfo

public void setFileInfo(int fid,
                        FileInfo newInfo)
                 throws PearlException
Updates information for a file identified by FID.

PearlException

getMaxFID

public int getMaxFID()
              throws PearlException
Returns the highest allocated FID.

PearlException

writeFile

public int writeFile(java.io.File src)
              throws PearlException,
                     java.io.FileNotFoundException,
                     java.io.IOException
Writes a local file to the device. Returns the file's FID.

PearlException
java.io.FileNotFoundException
java.io.IOException

writeTaxiFile

public int writeTaxiFile(java.io.File src)
                  throws PearlException,
                         java.io.FileNotFoundException,
                         java.io.IOException
Writes a local file to the device without attempting to interpret the file as a song. Returns the file's FID.

PearlException
java.io.FileNotFoundException
java.io.IOException

readFile

public void readFile(int fid,
                     java.io.File dest)
              throws PearlException,
                     java.io.IOException
Downloads a file from the device by FID.

PearlException
java.io.IOException

deleteFile

public void deleteFile(int fid)
                throws PearlException
Removes a file from the device.

PearlException

close

public void close()
Closes a connection.