001    /**
002     * Licensed to the Apache Software Foundation (ASF) under one or more
003     * contributor license agreements.  See the NOTICE file distributed with
004     * this work for additional information regarding copyright ownership.
005     * The ASF licenses this file to You under the Apache License, Version 2.0
006     * (the "License"); you may not use this file except in compliance with
007     * the License.  You may obtain a copy of the License at
008     *
009     *      http://www.apache.org/licenses/LICENSE-2.0
010     *
011     * Unless required by applicable law or agreed to in writing, software
012     * distributed under the License is distributed on an "AS IS" BASIS,
013     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014     * See the License for the specific language governing permissions and
015     * limitations under the License.
016     */
017    package org.apache.camel.component.file.remote;
018    
019    import java.net.URI;
020    
021    /**
022     * FTP Secure (FTP over SSL/TLS) configuration
023     * 
024     * @version 
025     */
026    public class FtpsConfiguration extends FtpConfiguration {
027    
028        private String securityProtocol = "TLS";
029        private boolean isImplicit;
030        private boolean disableSecureDataChannelDefaults;
031        private String execProt;
032        private Long execPbsz;
033    
034        public FtpsConfiguration() {
035            setProtocol("ftps");
036        }
037    
038        public FtpsConfiguration(URI uri) {
039            super(uri);
040        }
041    
042        /**
043         * Returns the underlying security protocol.
044         */
045        public String getSecurityProtocol() {
046            return securityProtocol;
047        }
048    
049        /**
050         * Set the underlying security protocol.
051         */
052        public void setSecurityProtocol(String securityProtocol) {
053            this.securityProtocol = securityProtocol;
054        }
055    
056        /**
057         * Returns the security mode(Implicit/Explicit).
058         * true - Implicit Mode / False - Explicit Mode
059         */
060        public boolean isImplicit() {
061            return isImplicit;
062        }
063    
064        /**
065         * Set the security mode(Implicit/Explicit).
066         * true - Implicit Mode / False - Explicit Mode
067         */
068        public void setIsImplicit(boolean isImplicit) {
069            this.isImplicit = isImplicit;
070        }
071    
072        public boolean isDisableSecureDataChannelDefaults() {
073            return disableSecureDataChannelDefaults;
074        }
075    
076        /**
077         * Use this option to disable default options when using secure data channel.
078         * <p/>
079         * This allows you to be in full control what the execPbsz and execProt setting should be used.
080         * <p/>
081         * Default is <tt>false</tt>
082         * @see #setExecPbsz(Long)
083         * @see #setExecProt(String)
084         */
085        public void setDisableSecureDataChannelDefaults(boolean disableSecureDataChannelDefaults) {
086            this.disableSecureDataChannelDefaults = disableSecureDataChannelDefaults;
087        }
088    
089        public String getExecProt() {
090            return execProt;
091        }
092    
093        /**
094         * The exec protection level
095         * <p/>
096         * PROT command. C - Clear S - Safe(SSL protocol only) E - Confidential(SSL protocol only) P - Private
097         *
098         * @param execProt either C, S, E or P
099         */
100        public void setExecProt(String execProt) {
101            this.execProt = execProt;
102        }
103    
104        public Long getExecPbsz() {
105            return execPbsz;
106        }
107    
108        /**
109         * When using secure data channel you can set the exec protection buffer size
110         *
111         * @param execPbsz the buffer size
112         */
113        public void setExecPbsz(Long execPbsz) {
114            this.execPbsz = execPbsz;
115        }
116    }