Search in sources :

Example 1 with SyncException

use of com.android.ddmlib.SyncException in project android by JetBrains.

the class HttpDataCache method getFile.

public File getFile(String path) {
    File tempFile = myFiles.get(path);
    if (tempFile == null) {
        int fileNameStartIndex = path.lastIndexOf('\\');
        String fileName = fileNameStartIndex >= 0 ? path.substring(fileNameStartIndex) : path;
        try {
            tempFile = FileUtil.createTempFile(fileName, null);
            tempFile.deleteOnExit();
            myDevice.pullFile(path, tempFile.getAbsolutePath());
            myFiles.put(path, tempFile);
        } catch (IOException | AdbCommandRejectedException | TimeoutException | SyncException e) {
        // TODO: Add logs
        }
    }
    return tempFile;
}
Also used : AdbCommandRejectedException(com.android.ddmlib.AdbCommandRejectedException) IOException(java.io.IOException) SyncException(com.android.ddmlib.SyncException) File(java.io.File) TimeoutException(com.android.ddmlib.TimeoutException)

Aggregations

AdbCommandRejectedException (com.android.ddmlib.AdbCommandRejectedException)1 SyncException (com.android.ddmlib.SyncException)1 TimeoutException (com.android.ddmlib.TimeoutException)1 File (java.io.File)1 IOException (java.io.IOException)1