Java 类com.amazonaws.mobileconnectors.s3.transferutility.TransferType 实例源码

项目:aws-sdk-android-samples    文件:UploadActivity.java   
/**
 * Gets all relevant transfers from the Transfer Service for populating the
 * UI
 */
private void initData() {
    transferRecordMaps.clear();
    // Use TransferUtility to get all upload transfers.
    observers = transferUtility.getTransfersWithType(TransferType.UPLOAD);
    TransferListener listener = new UploadListener();
    for (TransferObserver observer : observers) {

        // For each transfer we will will create an entry in
        // transferRecordMaps which will display
        // as a single row in the UI
        HashMap<String, Object> map = new HashMap<String, Object>();
        Util.fillMap(map, observer, false);
        transferRecordMaps.add(map);

        // Sets listeners to in progress transfers
        if (TransferState.WAITING.equals(observer.getState())
                || TransferState.WAITING_FOR_NETWORK.equals(observer.getState())
                || TransferState.IN_PROGRESS.equals(observer.getState())) {
            observer.setTransferListener(listener);
        }
    }
    simpleAdapter.notifyDataSetChanged();
}
项目:aws-sdk-android-samples    文件:DownloadActivity.java   
/**
 * Gets all relevant transfers from the Transfer Service for populating the
 * UI
 */
private void initData() {
    transferRecordMaps.clear();
    // Uses TransferUtility to get all previous download records.
    observers = transferUtility.getTransfersWithType(TransferType.DOWNLOAD);
    TransferListener listener = new DownloadListener();
    for (TransferObserver observer : observers) {
        HashMap<String, Object> map = new HashMap<String, Object>();
        Util.fillMap(map, observer, false);
        transferRecordMaps.add(map);

        // Sets listeners to in progress transfers
        if (TransferState.WAITING.equals(observer.getState())
                || TransferState.WAITING_FOR_NETWORK.equals(observer.getState())
                || TransferState.IN_PROGRESS.equals(observer.getState())) {
            observer.setTransferListener(listener);
        }
    }
    simpleAdapter.notifyDataSetChanged();
}
项目:ureport-android    文件:TransferManager.java   
public void cancelTransfer() {
    AmazonServicesManager.getTransferUtility().cancelAllWithType(TransferType.ANY);
    transferCancelled = true;
}