1 package org.apache.maven.wagon.providers.ftp; 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 org.apache.commons.net.ftp.FTPClient; 23 import org.apache.commons.net.ftp.FTPSClient; 24 import org.slf4j.Logger; 25 import org.slf4j.LoggerFactory; 26 27 /** 28 * FtpsWagon 29 * 30 * 31 * @plexus.component role="org.apache.maven.wagon.Wagon" 32 * role-hint="ftps" 33 * instantiation-strategy="per-lookup" 34 */ 35 public class FtpsWagon 36 extends FtpWagon 37 { 38 private static final Logger LOG = LoggerFactory.getLogger( FtpsWagon.class ); 39 40 /** 41 * @plexus.configuration default-value="TLS" 42 */ 43 private String securityProtocol = "TLS"; 44 45 /** 46 * @plexus.configuration default-value="false" 47 */ 48 private boolean implicit = false; 49 50 /** 51 * @plexus.configuration default-value="true" 52 */ 53 private boolean endpointChecking = true; 54 55 @Override 56 protected FTPClient createClient() 57 { 58 LOG.debug( "Creating secure FTP client. Protocol: [{}], implicit mode: [{}], endpoint checking: [{}].", 59 securityProtocol, implicit, endpointChecking ); 60 FTPSClient client = new FTPSClient( securityProtocol, implicit ); 61 client.setEndpointCheckingEnabled( endpointChecking ); 62 return client; 63 } 64 }