1 /**
2 * Copyright 2010-2012 The Kuali Foundation
3 *
4 * Licensed under the Educational Community License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.opensource.org/licenses/ecl2.php
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 package org.kuali.maven.wagon;
17
18 import org.apache.maven.wagon.resource.Resource;
19
20 /**
21 * A class that encapsulates the notification of the transfer listeners for
22 * Maven Wagon.
23 *
24 * @author Ben Hale
25 * @since 1.1
26 */
27 class TransferProgress {
28
29 private Resource resource;
30
31 private int requestType;
32
33 private TransferListenerSupport transferListeners;
34
35 public TransferProgress(Resource resource, int requestType, TransferListenerSupport listeners) {
36 this.resource = resource;
37 this.requestType = requestType;
38 this.transferListeners = listeners;
39 }
40
41 protected void notify(byte[] buffer, int length) {
42 transferListeners.fireTransferProgress(resource, requestType, buffer, length);
43 }
44
45 }