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;
}
Aggregations