1 package org.apache.maven.wagon; 2 3 /* 4 * Licensed to the Apache Software Foundation (ASF) under one 5 * or more contributor license agreements. See the NOTICE file 6 * distributed with this work for additional information 7 * regarding copyright ownership. The ASF licenses this file 8 * to you under the Apache License, Version 2.0 (the 9 * "License"); you may not use this file except in compliance 10 * with the License. You may obtain a copy of the License at 11 * 12 * http://www.apache.org/licenses/LICENSE-2.0 13 * 14 * Unless required by applicable law or agreed to in writing, 15 * software distributed under the License is distributed on an 16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 * KIND, either express or implied. See the License for the 18 * specific language governing permissions and limitations 19 * under the License. 20 */ 21 22 import java.io.InputStream; 23 import java.io.OutputStream; 24 25 import org.apache.maven.wagon.authorization.AuthorizationException; 26 27 public interface StreamingWagon 28 extends Wagon 29 { 30 /** 31 * Downloads specified resource from the repository to given output stream. 32 * 33 * @param resourceName 34 * @param stream 35 * @throws TransferFailedException 36 * @throws ResourceDoesNotExistException 37 * @throws AuthorizationException 38 * @throws AuthorizationException 39 */ 40 void getToStream( String resourceName, OutputStream stream ) 41 throws ResourceDoesNotExistException, TransferFailedException, AuthorizationException; 42 43 /** 44 * Downloads specified resource from the repository if it was modified since specified date. The date is measured in 45 * milliseconds, between the current time and midnight, January 1, 1970 UTC and aligned to GMT timezone. 46 * 47 * @param resourceName 48 * @param stream 49 * @param timestamp 50 * @return <code>true</code> if newer resource has been downloaded, <code>false</code> if resource in the 51 * repository is older or has the same age. 52 * @throws TransferFailedException 53 * @throws ResourceDoesNotExistException 54 * @throws AuthorizationException 55 * @throws AuthorizationException 56 */ 57 boolean getIfNewerToStream( String resourceName, OutputStream stream, long timestamp ) 58 throws ResourceDoesNotExistException, TransferFailedException, AuthorizationException; 59 60 /** 61 * Copy from a local input stream to remote. 62 * 63 * @param stream the local stream 64 * @param destination the remote destination 65 * @throws TransferFailedException 66 * @throws ResourceDoesNotExistException 67 * @throws AuthorizationException 68 */ 69 void putFromStream( InputStream stream, String destination ) 70 throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException; 71 72 /** 73 * Copy from a local input stream to remote. 74 * 75 * @param stream the local stream 76 * @param destination the remote destination 77 * @throws TransferFailedException 78 * @throws ResourceDoesNotExistException 79 * @throws AuthorizationException 80 */ 81 void putFromStream( InputStream stream, String destination, long contentLength, long lastModified ) 82 throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException; 83 }