1 18 package org.apache.tools.ant.taskdefs.optional.sos; 19 20 import org.apache.tools.ant.types.Commandline; 21 22 28 public class SOSGet extends SOS { 29 30 37 public final void setFile(String filename) { 38 super.setInternalFilename(filename); 39 } 40 41 46 public void setRecursive(boolean recursive) { 47 super.setInternalRecursive(recursive); 48 } 49 50 56 public void setVersion(String version) { 57 super.setInternalVersion(version); 58 } 59 60 65 public void setLabel(String label) { 66 super.setInternalLabel(label); 67 } 68 69 81 protected Commandline buildCmdLine() { 82 commandLine = new Commandline(); 83 84 if (getFilename() != null) { 86 commandLine.createArgument().setValue(SOSCmd.FLAG_COMMAND); 88 commandLine.createArgument().setValue(SOSCmd.COMMAND_GET_FILE); 89 commandLine.createArgument().setValue(SOSCmd.FLAG_FILE); 91 commandLine.createArgument().setValue(getFilename()); 92 if (getVersion() != null) { 94 commandLine.createArgument().setValue(SOSCmd.FLAG_VERSION); 96 commandLine.createArgument().setValue(getVersion()); 97 } 98 } else { 99 commandLine.createArgument().setValue(SOSCmd.FLAG_COMMAND); 101 commandLine.createArgument().setValue(SOSCmd.COMMAND_GET_PROJECT); 102 commandLine.createArgument().setValue(getRecursive()); 104 if (getLabel() != null) { 106 commandLine.createArgument().setValue(SOSCmd.FLAG_LABEL); 107 commandLine.createArgument().setValue(getLabel()); 108 } 109 } 110 111 getRequiredAttributes(); 112 getOptionalAttributes(); 113 114 return commandLine; 115 } 116 } 117 | Popular Tags |