コード例 #1
0
ファイル: SyncService.cs プロジェクト: yuva2achieve/dot42
        /// <summary>
        /// Pulls a single file. </summary>
        /// <param name="remote"> the remote file </param>
        /// <param name="localFilename"> The local destination. </param>
        /// <param name="monitor"> The progress monitor. Cannot be null.
        /// </param>
        /// <exception cref="IOException"> in case of an IO exception. </exception>
        /// <exception cref="TimeoutException"> in case of a timeout reading responses from the device. </exception>
        /// <exception cref="SyncException"> in case of a sync exception.
        /// </exception>
        /// <seealso cref= FileListingService.FileEntry </seealso>
        /// <seealso cref= #getNullProgressMonitor() </seealso>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public void pullFile(com.android.ddmlib.FileListingService.FileEntry remote, String localFilename, ISyncProgressMonitor monitor) throws java.io.IOException, SyncException, TimeoutException
        public void pullFile(FileListingService.FileEntry remote, string localFilename, ISyncProgressMonitor monitor)
        {
            int total = remote.sizeValue;

            monitor.start(total);

            doPullFile(remote.fullPath, localFilename, monitor);

            monitor.stop();
        }
コード例 #2
0
ファイル: SyncService.cs プロジェクト: yuva2achieve/dot42
        /// <summary>
        /// Push several files. </summary>
        /// <param name="local"> An array of loca files to push </param>
        /// <param name="remote"> the remote <seealso cref="FileListingService.FileEntry"/> representing a directory. </param>
        /// <param name="monitor"> The progress monitor. Cannot be null. </param>
        /// <exception cref="SyncException"> if file could not be pushed </exception>
        /// <exception cref="IOException"> in case of I/O error on the connection. </exception>
        /// <exception cref="TimeoutException"> in case of a timeout reading responses from the device. </exception>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public void push(String[] local, com.android.ddmlib.FileListingService.FileEntry remote, ISyncProgressMonitor monitor) throws SyncException, java.io.IOException, TimeoutException
        public void push(string[] local, FileListingService.FileEntry remote, ISyncProgressMonitor monitor)
        {
            if (remote.directory == false)
            {
                throw new SyncException(SyncException.SyncError.REMOTE_IS_FILE);
            }

            // get the total count of the bytes to transfer
            int total = getTotalLocalFileSize(local);

            monitor.start(total);

            doPush(local, remote.fullPath, monitor);

            monitor.stop();
        }