|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.android.ddmlib.SyncService
public final class SyncService
Sync service class to push/pull to/from devices/emulators, through the debug bridge.
To get aSyncService
object, use Device.getSyncService()
.
Nested Class Summary | |
---|---|
static interface |
SyncService.ISyncProgressMonitor
Classes which implement this interface provide methods that deal with displaying transfer progress. |
Method Summary | |
---|---|
void |
close()
Closes the connection. |
static SyncService.ISyncProgressMonitor |
getNullProgressMonitor()
Returns a sync progress monitor that does nothing. |
void |
pull(FileListingService.FileEntry[] entries,
String localPath,
SyncService.ISyncProgressMonitor monitor)
Pulls file(s) or folder(s). |
void |
pullFile(FileListingService.FileEntry remote,
String localFilename,
SyncService.ISyncProgressMonitor monitor)
Pulls a single file. |
void |
pullFile(String remoteFilepath,
String localFilename,
SyncService.ISyncProgressMonitor monitor)
Pulls a single file. |
void |
push(String[] local,
FileListingService.FileEntry remote,
SyncService.ISyncProgressMonitor monitor)
Push several files. |
void |
pushFile(String local,
String remote,
SyncService.ISyncProgressMonitor monitor)
Push a single file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public void close()
public static SyncService.ISyncProgressMonitor getNullProgressMonitor()
SyncService.ISyncProgressMonitor
.
This object can be reused multiple times and can be used by concurrent threads.
public void pull(FileListingService.FileEntry[] entries, String localPath, SyncService.ISyncProgressMonitor monitor) throws SyncException, IOException, TimeoutException
entries
- the remote item(s) to pulllocalPath
- The local destination. If the entries count is > 1 or
if the unique entry is a folder, this should be a folder.monitor
- The progress monitor. Cannot be null.
SyncException
IOException
TimeoutException
FileListingService.FileEntry
,
getNullProgressMonitor()
public void pullFile(FileListingService.FileEntry remote, String localFilename, SyncService.ISyncProgressMonitor monitor) throws IOException, SyncException, TimeoutException
remote
- the remote filelocalFilename
- The local destination.monitor
- The progress monitor. Cannot be null.
IOException
- in case of an IO exception.
TimeoutException
- in case of a timeout reading responses from the device.
SyncException
- in case of a sync exception.FileListingService.FileEntry
,
getNullProgressMonitor()
public void pullFile(String remoteFilepath, String localFilename, SyncService.ISyncProgressMonitor monitor) throws TimeoutException, IOException, SyncException
FileListingService.FileEntry
, the size of the file being pulled is unknown and the
SyncService.ISyncProgressMonitor
will not properly show the progress
remoteFilepath
- the full path to the remote filelocalFilename
- The local destination.monitor
- The progress monitor. Cannot be null.
IOException
- in case of an IO exception.
TimeoutException
- in case of a timeout reading responses from the device.
SyncException
- in case of a sync exception.getNullProgressMonitor()
public void push(String[] local, FileListingService.FileEntry remote, SyncService.ISyncProgressMonitor monitor) throws SyncException, IOException, TimeoutException
local
- An array of loca files to pushremote
- the remote FileListingService.FileEntry
representing a directory.monitor
- The progress monitor. Cannot be null.
SyncException
- if file could not be pushed
IOException
- in case of I/O error on the connection.
TimeoutException
- in case of a timeout reading responses from the device.public void pushFile(String local, String remote, SyncService.ISyncProgressMonitor monitor) throws SyncException, IOException, TimeoutException
local
- the local filepath.remote
- The remote filepath.monitor
- The progress monitor. Cannot be null.
SyncException
- if file could not be pushed
IOException
- in case of I/O error on the connection.
TimeoutException
- in case of a timeout reading responses from the device.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |