1 // $Header: /home/cvs/jakarta-jmeter/src/protocol/ftp/org/apache/jmeter/protocol/ftp/config/FtpConfig.java,v 1.5 2004/02/11 23:59:31 sebb Exp $ 2 /* 3 * Copyright 2001-2004 The Apache Software Foundation. 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); 6 * you may not use this file except in compliance with the License. 7 * You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 * 17 */ 18 19 package org.apache.jmeter.protocol.ftp.config; 20 21 import java.io.Serializable; 22 23 import org.apache.jmeter.config.ConfigTestElement; 24 import org.apache.jmeter.protocol.ftp.sampler.FTPSampler; 25 26 /** 27 * @author Michael Stover 28 * @version $Revision: 1.5 $ last updated $Date: 2004/02/11 23:59:31 $ 29 */ 30 public class FtpConfig extends ConfigTestElement implements Serializable 31 { 32 33 public FtpConfig() 34 { 35 } 36 37 public boolean isComplete() 38 { 39 if ((getServer() != null) 40 && (getFilename() != null) 41 && (!getServer().equals("")) 42 && (!getFilename().equals(""))) 43 { 44 return true; 45 } 46 else 47 { 48 return false; 49 } 50 51 } 52 53 public void setServer(String newServer) 54 { 55 this.setProperty(FTPSampler.SERVER, newServer); 56 } 57 public String getServer() 58 { 59 return getPropertyAsString(FTPSampler.SERVER); 60 } 61 public void setFilename(String newFilename) 62 { 63 this.setProperty(FTPSampler.FILENAME, newFilename); 64 } 65 public String getFilename() 66 { 67 return getPropertyAsString(FTPSampler.FILENAME); 68 } 69 70 /** 71 * Returns a formatted string label describing this sampler 72 * Example output: 73 * ftp://ftp.nowhere.com/pub/README.txt 74 * 75 * @return a formatted string label describing this sampler 76 */ 77 public String getLabel() 78 { 79 return ("ftp://" + this.getServer() + "/" + this.getFilename()); 80 } 81 }