private void pullDirectory(final IDevice device, final String name) throws Exception { // Output path on private internal storage, for KitKat and below. FileEntry internalDir = getDirectoryOnInternalStorage(name); logDebug(debug, "Internal path is " + internalDir.getFullPath()); // Output path on public external storage, for Lollipop and above. FileEntry externalDir = getDirectoryOnExternalStorage(device, name); logDebug(debug, "External path is " + externalDir.getFullPath()); // Sync test output files to the local filesystem. logDebug(debug, "Pulling files from external dir on [%s]", serial); String localDirName = work.getAbsolutePath(); adbPull(device, externalDir, localDirName); logDebug(debug, "Pulling files from internal dir on [%s]", serial); adbPull(device, internalDir, localDirName); logDebug(debug, "Done pulling %s from on [%s]", name, serial); }
String path = child.getFullPath(); map.put(path, child);
/** * Push several files. * @param local An array of loca files to push * @param remote the remote {@link FileEntry} representing a directory. * @param monitor The progress monitor. Cannot be null. * @throws SyncException if file could not be pushed * @throws IOException in case of I/O error on the connection. * @throws TimeoutException in case of a timeout reading responses from the device. */ public void push(String[] local, FileEntry remote, ISyncProgressMonitor monitor) throws SyncException, IOException, TimeoutException { if (remote.isDirectory() == false) { throw new SyncException(SyncError.REMOTE_IS_FILE); } // make a list of File from the list of String ArrayList<File> files = new ArrayList<File>(); for (String path : local) { files.add(new File(path)); } // get the total count of the bytes to transfer File[] fileArray = files.toArray(new File[files.size()]); int total = getTotalLocalFileSize(fileArray); monitor.start(total); doPush(fileArray, remote.getFullPath(), monitor); monitor.stop(); }
Thread t = new Thread("ls " + entry.getFullPath()) { //$NON-NLS-1$ @Override public void run() {
Thread t = new Thread("ls " + entry.getFullPath()) { //$NON-NLS-1$ @Override public void run() {
String path = child.getFullPath(); map.put(path, child);
monitor.startSubTask(e.getFullPath()); String dest = localPath + File.separator + e.getName(); monitor.advance(1); } else if (type == FileListingService.TYPE_FILE) { monitor.startSubTask(e.getFullPath()); String dest = localPath + File.separator + e.getName(); doPullFile(e.getFullPath(), dest, monitor);
monitor.startSubTask(e.getFullPath()); String dest = localPath + File.separator + e.getName(); monitor.advance(1); } else if (type == FileListingService.TYPE_FILE) { monitor.startSubTask(e.getFullPath()); String dest = localPath + File.separator + e.getName(); doPullFile(e.getFullPath(), dest, monitor);
/** * Push several files. * @param local An array of loca files to push * @param remote the remote {@link FileEntry} representing a directory. * @param monitor The progress monitor. Cannot be null. * @throws SyncException if file could not be pushed * @throws IOException in case of I/O error on the connection. * @throws TimeoutException in case of a timeout reading responses from the device. */ public void push(String[] local, FileEntry remote, ISyncProgressMonitor monitor) throws SyncException, IOException, TimeoutException { if (!remote.isDirectory()) { throw new SyncException(SyncError.REMOTE_IS_FILE); } // make a list of File from the list of String ArrayList<File> files = new ArrayList<File>(); for (String path : local) { files.add(new File(path)); } // get the total count of the bytes to transfer File[] fileArray = files.toArray(new File[files.size()]); int total = getTotalLocalFileSize(fileArray); monitor.start(total); doPush(fileArray, remote.getFullPath(), monitor); monitor.stop(); }
/** * Pulls a single file. * @param remote the remote file * @param localFilename The local destination. * @param monitor The progress monitor. Cannot be null. * * @throws IOException in case of an IO exception. * @throws TimeoutException in case of a timeout reading responses from the device. * @throws SyncException in case of a sync exception. * * @see FileListingService.FileEntry * @see #getNullProgressMonitor() */ public void pullFile(FileEntry remote, String localFilename, ISyncProgressMonitor monitor) throws IOException, SyncException, TimeoutException { int total = remote.getSizeValue(); monitor.start(total); doPullFile(remote.getFullPath(), localFilename, monitor); monitor.stop(); }
/** * Pulls a single file. * @param remote the remote file * @param localFilename The local destination. * @param monitor The progress monitor. Cannot be null. * * @throws IOException in case of an IO exception. * @throws TimeoutException in case of a timeout reading responses from the device. * @throws SyncException in case of a sync exception. * * @see FileListingService.FileEntry * @see #getNullProgressMonitor() */ public void pullFile(FileEntry remote, String localFilename, ISyncProgressMonitor monitor) throws IOException, SyncException, TimeoutException { int total = remote.getSizeValue(); monitor.start(total); doPullFile(remote.getFullPath(), localFilename, monitor); monitor.stop(); }
private void pullDirectory(final IDevice device, final String name) throws Exception { // Output path on private internal storage, for KitKat and below. FileEntry internalDir = getDirectoryOnInternalStorage(name); logDebug(debug, "Internal path is " + internalDir.getFullPath()); // Output path on public external storage, for Lollipop and above. FileEntry externalDir = getDirectoryOnExternalStorage(device, name); logDebug(debug, "External path is " + externalDir.getFullPath()); // Sync test output files to the local filesystem. logDebug(debug, "Pulling files from external dir on [%s]", serial); String localDirName = work.getAbsolutePath(); adbPull(device, externalDir, localDirName); logDebug(debug, "Pulling files from internal dir on [%s]", serial); adbPull(device, internalDir, localDirName); logDebug(debug, "Done pulling %s from on [%s]", name, serial); }
private void cleanFilesDirectoriesOnDevice(IDevice device) throws Exception { FileEntry externalFileDir = getDirectoryOnExternalStorage(device, DEVICE_FILE_DIR); cleanDirectoryOnDevice(externalFileDir.getFullPath(), device); FileEntry internalFileDir = getDirectoryOnInternalStorage(DEVICE_FILE_DIR); cleanDirectoryOnDevice(internalFileDir.getFullPath(), device); }
private void cleanScreenshotsDirectoriesOnDevice(IDevice device) throws Exception { FileEntry externalScreenShotDir = getDirectoryOnExternalStorage(device, DEVICE_SCREENSHOT_DIR); cleanDirectoryOnDevice(externalScreenShotDir.getFullPath(), device); FileEntry internalScreenShotDir = getDirectoryOnInternalStorage(DEVICE_SCREENSHOT_DIR); cleanDirectoryOnDevice(internalScreenShotDir.getFullPath(), device); }
private void cleanScreenshotsDirectoriesOnDevice(IDevice device) throws Exception { FileEntry externalScreenShotDir = getDirectoryOnExternalStorage(device, DEVICE_SCREENSHOT_DIR); cleanDirectoryOnDevice(externalScreenShotDir.getFullPath(), device); FileEntry internalScreenShotDir = getDirectoryOnInternalStorage(DEVICE_SCREENSHOT_DIR); cleanDirectoryOnDevice(internalScreenShotDir.getFullPath(), device); }
private void cleanFilesDirectoriesOnDevice(IDevice device) throws Exception { FileEntry externalFileDir = getDirectoryOnExternalStorage(device, DEVICE_FILE_DIR); cleanDirectoryOnDevice(externalFileDir.getFullPath(), device); FileEntry internalFileDir = getDirectoryOnInternalStorage(DEVICE_FILE_DIR); cleanDirectoryOnDevice(internalFileDir.getFullPath(), device); }