superwaba.ext.xplat.sync
Class RemoteFile

java.lang.Object
  |
  +--superwaba.ext.xplat.sync.RemoteFile

public final class RemoteFile
extends java.lang.Object

Used to access a remote file on Windows CE synchronization. Starting on version 5.7, it also works with Palm OS devices that have an external card inserted or flash memory (non-volatile memory). Check the LitebaseConduit for an example on how to use it on Palm OS devices.


Constructor Summary
RemoteFile()
           
 
Method Summary
static boolean copyFromRemote(java.lang.String srcFile, java.lang.String dstFile)
          Copies a file from a remote device to the desktop.
static boolean copyToRemote(java.lang.String srcFile, java.lang.String dstFile)
          Copies a file from the desktop to remote device.
static boolean delete(java.lang.String fileOrFolder)
          Deletes a remote file or folder
static java.lang.String[] listFiles(java.lang.String dir)
          Lists the files contained in a directory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemoteFile

public RemoteFile()
Method Detail

listFiles

public static java.lang.String[] listFiles(java.lang.String dir)
Lists the files contained in a directory. The strings returned are the names of the files and directories contained within this directory. This method returns null if the directory can't be read or if the operation fails. Path names ends with /, so it is easy to distinguish them from a file. On Palm OS, passing an empty string will return all installed cards. The flash memory slot will be named builtin (which is usually slot 1). Then, to copy to/from a slot, you must use slot:/full_path_to_file (E.G.: 1:/dbs/myapp/MyCatalog.pdb).

copyToRemote

public static boolean copyToRemote(java.lang.String srcFile,
                                   java.lang.String dstFile)
Copies a file from the desktop to remote device. If the target folder doesn't exist, it is created.
Parameters:
srcFile - The file on the desktop.
dstFile - The target file on the remote device. Note: this CANNOT be a folder name, but the target file name instead.
Returns:
True if the operation succeeds.

copyFromRemote

public static boolean copyFromRemote(java.lang.String srcFile,
                                     java.lang.String dstFile)
Copies a file from a remote device to the desktop.
Parameters:
srcFile - The file on the remote device.
dstFile - The target file on the desktop. Note: this CANNOT be a folder name, but the target file name instead.
Returns:
True if the operation succeeds.

delete

public static boolean delete(java.lang.String fileOrFolder)
Deletes a remote file or folder
Returns:
True if the operation succeeds.