You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by th...@apache.org on 2006/10/30 14:44:11 UTC

svn commit: r469146 - in /webservices/axis2/branches/java/1_1/modules/samples/soapwithattachments: build.xml src/sample/soapwithattachments/client/SWAClient.java

Author: thilina
Date: Mon Oct 30 05:44:10 2006
New Revision: 469146

URL: http://svn.apache.org/viewvc?view=rev&rev=469146
Log:
adding input parameter validation

Modified:
    webservices/axis2/branches/java/1_1/modules/samples/soapwithattachments/build.xml
    webservices/axis2/branches/java/1_1/modules/samples/soapwithattachments/src/sample/soapwithattachments/client/SWAClient.java

Modified: webservices/axis2/branches/java/1_1/modules/samples/soapwithattachments/build.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/samples/soapwithattachments/build.xml?view=diff&rev=469146&r1=469145&r2=469146
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/samples/soapwithattachments/build.xml (original)
+++ webservices/axis2/branches/java/1_1/modules/samples/soapwithattachments/build.xml Mon Oct 30 05:44:10 2006
@@ -29,7 +29,22 @@
 			<classpath refid="axis.classpath" />
 		</javac>
 	</target>
-	<target name="client" depends="compile">
+	<target name="check-parameters">
+		<condition property="parameters.set">
+			<and>
+				<isset property="dest" />
+				<isset property="file" />
+			</and>
+		</condition>
+		<!-- This is a hack to get a if-else working in ant. Some much more "ANTy" person is welcome to improve this -->
+		<antcall target="print-usage" />
+	</target>
+
+	<target name="print-usage" unless="parameters.set">
+		<echo message="ant -Dfile &lt;file to be transfered&gt;  -Ddest &lt;name of the destination file&gt;" />
+	</target>
+
+	<target name="client" depends="compile,check-parameters" if="parameters.set">
 		<jar destfile="${build.dir}/swaSampleClient.jar">
 			<fileset dir="${build.dir}/classes">
 				<include name="sample/soapwithattachments/client/**/*.class" />

Modified: webservices/axis2/branches/java/1_1/modules/samples/soapwithattachments/src/sample/soapwithattachments/client/SWAClient.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/samples/soapwithattachments/src/sample/soapwithattachments/client/SWAClient.java?view=diff&rev=469146&r1=469145&r2=469146
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/samples/soapwithattachments/src/sample/soapwithattachments/client/SWAClient.java (original)
+++ webservices/axis2/branches/java/1_1/modules/samples/soapwithattachments/src/sample/soapwithattachments/client/SWAClient.java Mon Oct 30 05:44:10 2006
@@ -62,7 +62,7 @@
 
 		if ((invalidOptionsList.size() > 0) || (args.length != 4)) {
 			// printUsage();
-			System.out.println("Invalid Parameters.");
+			System.out.println("Invalid Parameters.  Usage -file <file to be send> -dest <destination file>");
 			return;
 		}
 



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org