Java Doc for Commandline.java in  » Build » cruisecontrol » net » sourceforge » cruisecontrol » util » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Build » cruisecontrol » net.sourceforge.cruisecontrol.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   net.sourceforge.cruisecontrol.util.Commandline

All known Subclasses:   net.sourceforge.cruisecontrol.util.MockCommandline,  net.sourceforge.cruisecontrol.util.EnvCommandline,
Commandline
public class Commandline implements Cloneable(Code)
Commandline objects help handling command lines specifying processes to execute. The class can be used to define a command line as nested elements or as a helper to define a command line by an application.

<someelement>
  <acommandline executable="/executable/to/run">
    <argument value="argument 1" />
    <argument line="argument_1 argument_2 argument_3" />
    <argument value="argument 4" />
  </acommandline>
</someelement>
The element someelement must provide a method createAcommandline which returns an instance of this class.
author:
   thomas.haas@softwired-inc.com
author:
   Stefan Bodewig


Inner Class :public static class Argument
Inner Class :public class Marker


Constructor Summary
public  Commandline(String toProcess, CruiseRuntime cruiseRuntime)
    
public  Commandline(String toProcess)
    
public  Commandline()
    

Method Summary
public  voidaddArguments(String[] line)
    
public  voidclear()
     Clear out the whole command line.
public  voidclearArgs()
     Clear out the arguments but leave the executable in place for another operation.
public  Objectclone()
    
public  ArgumentcreateArgument()
     Creates an argument object.

Each commandline object has at most one instance of the argument class.

public  ArgumentcreateArgument(boolean insertAtStart)
     Creates an argument object and adds it to our list of args.
public  ArgumentcreateArgument(String value)
     Same as calling createArgument().setValue(value), but much more convenient.
public  voidcreateArguments(String first, String second)
     Same as calling createArgument twice in a row, but can be used to make more obvious a relationship between to command line arguments, like "-folder c:\myfolder".
public  MarkercreateMarker()
     Return a marker.
public  Processexecute()
     Executes the command.
public  voidexecuteAndWait(Logger log)
     Executes the command and wait for it to finish.
public  String[]getArguments()
     Returns all arguments defined by addLine, addValue or the argument object.
public  String[]getCommandline()
     Returns the executable and all defined arguments.
public  StringgetExecutable()
    
protected  FilegetWorkingDir()
    
public  FilegetWorkingDirectory()
    
public static  StringquoteArgument(String argument)
     Put quotes around the given String if necessary.

If the argument doesn't include spaces or quotes, return it as is.

public  voidsetExecutable(String executable)
     Sets the executable to run.
public  voidsetWorkingDir(File workingDir)
    
public  voidsetWorkingDirectory(String path)
     Sets execution directory.
public  intsize()
    
public  StringtoString()
    
public static  StringtoString(String[] line, boolean quote)
    
public static  StringtoString(String[] line, boolean quote, String separator)
    
public  StringtoStringNoQuoting()
     Converts the command line to a string without adding quotes to any of the arguments.
public static  String[]translateCommandline(String toProcess)
    
public  voiduseSafeQuoting(boolean safe)
     Enables and disables safe quoting when executing a command.


Constructor Detail
Commandline
public Commandline(String toProcess, CruiseRuntime cruiseRuntime)(Code)



Commandline
public Commandline(String toProcess)(Code)



Commandline
public Commandline()(Code)




Method Detail
addArguments
public void addArguments(String[] line)(Code)



clear
public void clear()(Code)
Clear out the whole command line.



clearArgs
public void clearArgs()(Code)
Clear out the arguments but leave the executable in place for another operation.



clone
public Object clone() throws CloneNotSupportedException(Code)



createArgument
public Argument createArgument()(Code)
Creates an argument object.

Each commandline object has at most one instance of the argument class. This method calls this.createArgument(false).


See Also:   Commandline.createArgument(boolean) the argument object.



createArgument
public Argument createArgument(boolean insertAtStart)(Code)
Creates an argument object and adds it to our list of args.

Each commandline object has at most one instance of the argument class.


Parameters:
  insertAtStart - if true, the argument is inserted at the beginning of the list of args, otherwise it is appended.



createArgument
public Argument createArgument(String value)(Code)
Same as calling createArgument().setValue(value), but much more convenient.



createArguments
public void createArguments(String first, String second)(Code)
Same as calling createArgument twice in a row, but can be used to make more obvious a relationship between to command line arguments, like "-folder c:\myfolder".



createMarker
public Marker createMarker()(Code)
Return a marker.

This marker can be used to locate a position on the commandline - to insert something for example - when all parameters have been set.




execute
public Process execute() throws IOException(Code)
Executes the command.



executeAndWait
public void executeAndWait(Logger log) throws CruiseControlException(Code)
Executes the command and wait for it to finish.
Parameters:
  log - where the output and error streams are logged



getArguments
public String[] getArguments()(Code)
Returns all arguments defined by addLine, addValue or the argument object.



getCommandline
public String[] getCommandline()(Code)
Returns the executable and all defined arguments.



getExecutable
public String getExecutable()(Code)



getWorkingDir
protected File getWorkingDir()(Code)



getWorkingDirectory
public File getWorkingDirectory()(Code)



quoteArgument
public static String quoteArgument(String argument) throws CruiseControlException(Code)
Put quotes around the given String if necessary.

If the argument doesn't include spaces or quotes, return it as is. If it contains double quotes, use single quotes - else surround the argument by double quotes.


exception:
  CruiseControlException - if the argument contains both, single and double quotes.



setExecutable
public void setExecutable(String executable)(Code)
Sets the executable to run.



setWorkingDir
public void setWorkingDir(File workingDir) throws CruiseControlException(Code)
Sets execution directory



setWorkingDirectory
public void setWorkingDirectory(String path) throws CruiseControlException(Code)
Sets execution directory.



size
public int size()(Code)



toString
public String toString()(Code)



toString
public static String toString(String[] line, boolean quote)(Code)



toString
public static String toString(String[] line, boolean quote, String separator)(Code)



toStringNoQuoting
public String toStringNoQuoting()(Code)
Converts the command line to a string without adding quotes to any of the arguments.



translateCommandline
public static String[] translateCommandline(String toProcess) throws CruiseControlException(Code)



useSafeQuoting
public void useSafeQuoting(boolean safe)(Code)
Enables and disables safe quoting when executing a command. When enabled: Quotes any arguments that need it when executing command. This should handle filenames with spaces, but may fall over if the arguments already have quoting within them. When disables: Arguments are passed as is.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.