svn-gvsig-desktop / tags / tmp_build / build / distribution / izpack_4.2.0 / doc / izpack / javadoc / com / izforge / izpack / util / os / unix / ShellScript.html @ 26384
History | View | Annotate | Download (39.6 KB)
1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
---|---|
2 |
<!--NewPage-->
|
3 |
<HTML>
|
4 |
<HEAD>
|
5 |
<!-- Generated by javadoc (build 1.5.0_16) on Wed Dec 17 09:24:18 CET 2008 -->
|
6 |
<TITLE>
|
7 |
ShellScript |
8 |
</TITLE>
|
9 |
|
10 |
<META NAME="keywords" CONTENT="com.izforge.izpack.util.os.unix.ShellScript class"> |
11 |
|
12 |
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style"> |
13 |
|
14 |
<SCRIPT type="text/javascript"> |
15 |
function windowTitle() |
16 |
{ |
17 |
parent.document.title="ShellScript"; |
18 |
} |
19 |
</SCRIPT>
|
20 |
<NOSCRIPT>
|
21 |
</NOSCRIPT>
|
22 |
|
23 |
</HEAD>
|
24 |
|
25 |
<BODY BGCOLOR="white" onload="windowTitle();"> |
26 |
|
27 |
|
28 |
<!-- ========= START OF TOP NAVBAR ======= -->
|
29 |
<A NAME="navbar_top"><!-- --></A> |
30 |
<A HREF="#skip-navbar_top" title="Skip navigation links"></A> |
31 |
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> |
32 |
<TR>
|
33 |
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> |
34 |
<A NAME="navbar_top_firstrow"><!-- --></A> |
35 |
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> |
36 |
<TR ALIGN="center" VALIGN="top"> |
37 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> |
38 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> |
39 |
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> |
40 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> |
41 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> |
42 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> |
43 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> |
44 |
</TR>
|
45 |
</TABLE>
|
46 |
</TD>
|
47 |
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> |
48 |
</EM>
|
49 |
</TD>
|
50 |
</TR>
|
51 |
|
52 |
<TR>
|
53 |
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
54 |
PREV CLASS |
55 |
<A HREF="../../../../../../com/izforge/izpack/util/os/unix/UnixConstants.html" title="class in com.izforge.izpack.util.os.unix"><B>NEXT CLASS</B></A></FONT></TD> |
56 |
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
57 |
<A HREF="../../../../../../index.html?com/izforge/izpack/util/os/unix/ShellScript.html" target="_top"><B>FRAMES</B></A> |
58 |
<A HREF="ShellScript.html" target="_top"><B>NO FRAMES</B></A> |
59 |
<SCRIPT type="text/javascript"> |
60 |
<!--
|
61 |
if(window==top) {
|
62 |
document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
|
63 |
}
|
64 |
//-->
|
65 |
</SCRIPT>
|
66 |
<NOSCRIPT>
|
67 |
<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A> |
68 |
</NOSCRIPT>
|
69 |
|
70 |
|
71 |
</FONT></TD> |
72 |
</TR>
|
73 |
<TR>
|
74 |
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
75 |
SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> |
76 |
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
77 |
DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> |
78 |
</TR>
|
79 |
</TABLE>
|
80 |
<A NAME="skip-navbar_top"></A> |
81 |
<!-- ========= END OF TOP NAVBAR ========= -->
|
82 |
|
83 |
<HR>
|
84 |
<!-- ======== START OF CLASS DATA ======== -->
|
85 |
<H2>
|
86 |
<FONT SIZE="-1"> |
87 |
com.izforge.izpack.util.os.unix</FONT>
|
88 |
<BR>
|
89 |
Class ShellScript</H2>
|
90 |
<PRE>
|
91 |
java.lang.Object |
92 |
<IMG SRC="../../../../../../resources/inherit.gif" ALT="extended by "><B>com.izforge.izpack.util.os.unix.ShellScript</B> |
93 |
</PRE>
|
94 |
<HR>
|
95 |
<DL>
|
96 |
<DT><PRE>public class <B>ShellScript</B><DT>extends java.lang.Object</DL> |
97 |
</PRE>
|
98 |
|
99 |
<P>
|
100 |
A Generator, Wrapper and Executor for Unix ShellScripts |
101 |
<P>
|
102 |
|
103 |
<P>
|
104 |
<DL>
|
105 |
<DT><B>Author:</B></DT> |
106 |
<DD>marc.eppelmann@reddot.de</DD> |
107 |
</DL>
|
108 |
<HR>
|
109 |
|
110 |
<P>
|
111 |
<!-- =========== FIELD SUMMARY =========== -->
|
112 |
|
113 |
<A NAME="field_summary"><!-- --></A> |
114 |
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
115 |
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
116 |
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> |
117 |
<B>Field Summary</B></FONT></TH> |
118 |
</TR>
|
119 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
120 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
121 |
<CODE>private static java.lang.String</CODE></FONT></TD> |
122 |
<TD><CODE><B><A HREF="../../../../../../com/izforge/izpack/util/os/unix/ShellScript.html#Author">Author</A></B></CODE> |
123 |
|
124 |
<BR>
|
125 |
Author = "marc.eppelmann_at_gmx.de"</TD> |
126 |
</TR>
|
127 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
128 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
129 |
<CODE>static java.lang.String</CODE></FONT></TD> |
130 |
<TD><CODE><B><A HREF="../../../../../../com/izforge/izpack/util/os/unix/ShellScript.html#BASH">BASH</A></B></CODE> |
131 |
|
132 |
<BR>
|
133 |
</TD> |
134 |
</TR>
|
135 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
136 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
137 |
<CODE>static java.lang.String</CODE></FONT></TD> |
138 |
<TD><CODE><B><A HREF="../../../../../../com/izforge/izpack/util/os/unix/ShellScript.html#BOURNE_AGAIN_SHELL">BOURNE_AGAIN_SHELL</A></B></CODE> |
139 |
|
140 |
<BR>
|
141 |
</TD> |
142 |
</TR>
|
143 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
144 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
145 |
<CODE>static java.lang.String</CODE></FONT></TD> |
146 |
<TD><CODE><B><A HREF="../../../../../../com/izforge/izpack/util/os/unix/ShellScript.html#BOURNE_SHELL">BOURNE_SHELL</A></B></CODE> |
147 |
|
148 |
<BR>
|
149 |
</TD> |
150 |
</TR>
|
151 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
152 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
153 |
<CODE>private static java.lang.String</CODE></FONT></TD> |
154 |
<TD><CODE><B><A HREF="../../../../../../com/izforge/izpack/util/os/unix/ShellScript.html#CommentPre">CommentPre</A></B></CODE> |
155 |
|
156 |
<BR>
|
157 |
internal comment prefix; makes a line as comment:-) :: 'CommentPre = "# "'</TD> |
158 |
</TR>
|
159 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
160 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
161 |
<CODE>private java.lang.StringBuffer</CODE></FONT></TD> |
162 |
<TD><CODE><B><A HREF="../../../../../../com/izforge/izpack/util/os/unix/ShellScript.html#content">content</A></B></CODE> |
163 |
|
164 |
<BR>
|
165 |
Internal ContentBuffer of this ShellScript</TD> |
166 |
</TR>
|
167 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
168 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
169 |
<CODE>private static java.lang.String</CODE></FONT></TD> |
170 |
<TD><CODE><B><A HREF="../../../../../../com/izforge/izpack/util/os/unix/ShellScript.html#currentDateMsg">currentDateMsg</A></B></CODE> |
171 |
|
172 |
<BR>
|
173 |
"Generated at: " + new Date().toString()</TD> |
174 |
</TR>
|
175 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
176 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
177 |
<CODE>private static java.lang.String</CODE></FONT></TD> |
178 |
<TD><CODE><B><A HREF="../../../../../../com/izforge/izpack/util/os/unix/ShellScript.html#explanation">explanation</A></B></CODE> |
179 |
|
180 |
<BR>
|
181 |
the explanation header for this generated script</TD> |
182 |
</TR>
|
183 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
184 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
185 |
<CODE>private static java.lang.String</CODE></FONT></TD> |
186 |
<TD><CODE><B><A HREF="../../../../../../com/izforge/izpack/util/os/unix/ShellScript.html#Generator">Generator</A></B></CODE> |
187 |
|
188 |
<BR>
|
189 |
Generator = "Generator: " + ShellScript.class.getName()</TD> |
190 |
</TR>
|
191 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
192 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
193 |
<CODE>private static java.lang.String</CODE></FONT></TD> |
194 |
<TD><CODE><B><A HREF="../../../../../../com/izforge/izpack/util/os/unix/ShellScript.html#H">H</A></B></CODE> |
195 |
|
196 |
<BR>
|
197 |
H = CommentPre</TD> |
198 |
</TR>
|
199 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
200 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
201 |
<CODE>private static java.lang.String</CODE></FONT></TD> |
202 |
<TD><CODE><B><A HREF="../../../../../../com/izforge/izpack/util/os/unix/ShellScript.html#header">header</A></B></CODE> |
203 |
|
204 |
<BR>
|
205 |
the header of this ShellScript</TD> |
206 |
</TR>
|
207 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
208 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
209 |
<CODE>private java.lang.String</CODE></FONT></TD> |
210 |
<TD><CODE><B><A HREF="../../../../../../com/izforge/izpack/util/os/unix/ShellScript.html#itsLocation">itsLocation</A></B></CODE> |
211 |
|
212 |
<BR>
|
213 |
internal field: where to write via write( itsLocation ) this shellscript.</TD> |
214 |
</TR>
|
215 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
216 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
217 |
<CODE>private java.lang.String</CODE></FONT></TD> |
218 |
<TD><CODE><B><A HREF="../../../../../../com/izforge/izpack/util/os/unix/ShellScript.html#itsShell">itsShell</A></B></CODE> |
219 |
|
220 |
<BR>
|
221 |
internal field: holds the shell</TD> |
222 |
</TR>
|
223 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
224 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
225 |
<CODE>private static java.lang.String</CODE></FONT></TD> |
226 |
<TD><CODE><B><A HREF="../../../../../../com/izforge/izpack/util/os/unix/ShellScript.html#lf">lf</A></B></CODE> |
227 |
|
228 |
<BR>
|
229 |
the linefeed: lf = "\n"</TD> |
230 |
</TR>
|
231 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
232 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
233 |
<CODE>private static java.lang.String</CODE></FONT></TD> |
234 |
<TD><CODE><B><A HREF="../../../../../../com/izforge/izpack/util/os/unix/ShellScript.html#lh">lh</A></B></CODE> |
235 |
|
236 |
<BR>
|
237 |
lh = lf + H = "\n#"</TD> |
238 |
</TR>
|
239 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
240 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
241 |
<CODE>private static java.lang.String</CODE></FONT></TD> |
242 |
<TD><CODE><B><A HREF="../../../../../../com/izforge/izpack/util/os/unix/ShellScript.html#Revision">Revision</A></B></CODE> |
243 |
|
244 |
<BR>
|
245 |
internal Revision = "$Revision$"</TD> |
246 |
</TR>
|
247 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
248 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
249 |
<CODE>private static java.lang.String</CODE></FONT></TD> |
250 |
<TD><CODE><B><A HREF="../../../../../../com/izforge/izpack/util/os/unix/ShellScript.html#SCM_ID">SCM_ID</A></B></CODE> |
251 |
|
252 |
<BR>
|
253 |
internal SourceCode Management ( currently 'svn') ID :: 'SCM_ID = "$Id$"'</TD> |
254 |
</TR>
|
255 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
256 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
257 |
<CODE>static java.lang.String</CODE></FONT></TD> |
258 |
<TD><CODE><B><A HREF="../../../../../../com/izforge/izpack/util/os/unix/ShellScript.html#SH">SH</A></B></CODE> |
259 |
|
260 |
<BR>
|
261 |
</TD> |
262 |
</TR>
|
263 |
</TABLE>
|
264 |
|
265 |
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
|
266 |
|
267 |
<A NAME="constructor_summary"><!-- --></A> |
268 |
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
269 |
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
270 |
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> |
271 |
<B>Constructor Summary</B></FONT></TH> |
272 |
</TR>
|
273 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
274 |
<TD><CODE><B><A HREF="../../../../../../com/izforge/izpack/util/os/unix/ShellScript.html#ShellScript()">ShellScript</A></B>()</CODE> |
275 |
|
276 |
<BR>
|
277 |
Creates and initializes the ShellScript for running on the bourne shell: "sh".</TD> |
278 |
</TR>
|
279 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
280 |
<TD><CODE><B><A HREF="../../../../../../com/izforge/izpack/util/os/unix/ShellScript.html#ShellScript(java.lang.String)">ShellScript</A></B>(java.lang.String aShell)</CODE> |
281 |
|
282 |
<BR>
|
283 |
Creates and initializes the ShellScript for running on the given shell.</TD> |
284 |
</TR>
|
285 |
</TABLE>
|
286 |
|
287 |
<!-- ========== METHOD SUMMARY =========== -->
|
288 |
|
289 |
<A NAME="method_summary"><!-- --></A> |
290 |
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
291 |
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
292 |
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> |
293 |
<B>Method Summary</B></FONT></TH> |
294 |
</TR>
|
295 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
296 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
297 |
<CODE> void</CODE></FONT></TD> |
298 |
<TD><CODE><B><A HREF="../../../../../../com/izforge/izpack/util/os/unix/ShellScript.html#append(char)">append</A></B>(char aChar)</CODE> |
299 |
|
300 |
<BR>
|
301 |
Appends a Char to this ShellScript.</TD> |
302 |
</TR>
|
303 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
304 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
305 |
<CODE> void</CODE></FONT></TD> |
306 |
<TD><CODE><B><A HREF="../../../../../../com/izforge/izpack/util/os/unix/ShellScript.html#append(java.lang.Object)">append</A></B>(java.lang.Object anObject)</CODE> |
307 |
|
308 |
<BR>
|
309 |
Appends an Object or String to this ShellScript.</TD> |
310 |
</TR>
|
311 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
312 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
313 |
<CODE> void</CODE></FONT></TD> |
314 |
<TD><CODE><B><A HREF="../../../../../../com/izforge/izpack/util/os/unix/ShellScript.html#append(java.lang.String[])">append</A></B>(java.lang.String[] anArray)</CODE> |
315 |
|
316 |
<BR>
|
317 |
Appends the Array as one Commandline Space Separated |
318 |
This is usefull with our FileExecutor</TD>
|
319 |
</TR>
|
320 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
321 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
322 |
<CODE> void</CODE></FONT></TD> |
323 |
<TD><CODE><B><A HREF="../../../../../../com/izforge/izpack/util/os/unix/ShellScript.html#appendln()">appendln</A></B>()</CODE> |
324 |
|
325 |
<BR>
|
326 |
Appends an unix linefeed to this script ("\n").</TD> |
327 |
</TR>
|
328 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
329 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
330 |
<CODE> void</CODE></FONT></TD> |
331 |
<TD><CODE><B><A HREF="../../../../../../com/izforge/izpack/util/os/unix/ShellScript.html#appendln(char)">appendln</A></B>(char aChar)</CODE> |
332 |
|
333 |
<BR>
|
334 |
Appends a Char Object or String to this ShellScript with unix linefeed ("\n").</TD> |
335 |
</TR>
|
336 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
337 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
338 |
<CODE> void</CODE></FONT></TD> |
339 |
<TD><CODE><B><A HREF="../../../../../../com/izforge/izpack/util/os/unix/ShellScript.html#appendln(java.lang.Object)">appendln</A></B>(java.lang.Object anObject)</CODE> |
340 |
|
341 |
<BR>
|
342 |
Appends an Object or String to this ShellScript with unix linefeed ("\n").</TD> |
343 |
</TR>
|
344 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
345 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
346 |
<CODE> void</CODE></FONT></TD> |
347 |
<TD><CODE><B><A HREF="../../../../../../com/izforge/izpack/util/os/unix/ShellScript.html#appendln(java.lang.String[])">appendln</A></B>(java.lang.String[] anArray)</CODE> |
348 |
|
349 |
<BR>
|
350 |
Appends the Array as ONE!</TD> |
351 |
</TR>
|
352 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
353 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
354 |
<CODE> void</CODE></FONT></TD> |
355 |
<TD><CODE><B><A HREF="../../../../../../com/izforge/izpack/util/os/unix/ShellScript.html#delete()">delete</A></B>()</CODE> |
356 |
|
357 |
<BR>
|
358 |
Deletes only if Location is not null.</TD> |
359 |
</TR>
|
360 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
361 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
362 |
<CODE> java.lang.String</CODE></FONT></TD> |
363 |
<TD><CODE><B><A HREF="../../../../../../com/izforge/izpack/util/os/unix/ShellScript.html#exec()">exec</A></B>()</CODE> |
364 |
|
365 |
<BR>
|
366 |
Execute this ShellScript.</TD> |
367 |
</TR>
|
368 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
369 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
370 |
<CODE> java.lang.String</CODE></FONT></TD> |
371 |
<TD><CODE><B><A HREF="../../../../../../com/izforge/izpack/util/os/unix/ShellScript.html#exec(java.lang.String)">exec</A></B>(java.lang.String itsParams)</CODE> |
372 |
|
373 |
<BR>
|
374 |
Executes this ShellScript with the given Params.</TD> |
375 |
</TR>
|
376 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
377 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
378 |
<CODE>static java.lang.String</CODE></FONT></TD> |
379 |
<TD><CODE><B><A HREF="../../../../../../com/izforge/izpack/util/os/unix/ShellScript.html#execAndDelete(java.lang.StringBuffer, java.lang.String)">execAndDelete</A></B>(java.lang.StringBuffer lines, |
380 |
java.lang.String aLocation)</CODE> |
381 |
|
382 |
<BR>
|
383 |
Executes and removes the script.</TD> |
384 |
</TR>
|
385 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
386 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
387 |
<CODE>static java.lang.String</CODE></FONT></TD> |
388 |
<TD><CODE><B><A HREF="../../../../../../com/izforge/izpack/util/os/unix/ShellScript.html#execAndDelete(java.lang.String, java.lang.StringBuffer, java.lang.String, java.lang.String)">execAndDelete</A></B>(java.lang.String aShell, |
389 |
java.lang.StringBuffer lines,
|
390 |
java.lang.String aLocation,
|
391 |
java.lang.String itsParams)</CODE> |
392 |
|
393 |
<BR>
|
394 |
Executes and removes the script.</TD> |
395 |
</TR>
|
396 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
397 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
398 |
<CODE>static java.lang.String</CODE></FONT></TD> |
399 |
<TD><CODE><B><A HREF="../../../../../../com/izforge/izpack/util/os/unix/ShellScript.html#execute(java.lang.StringBuffer, java.lang.String)">execute</A></B>(java.lang.StringBuffer lines, |
400 |
java.lang.String aLocation)</CODE> |
401 |
|
402 |
<BR>
|
403 |
Executes ths given lines in the created default shell (sh) stored on location.</TD> |
404 |
</TR>
|
405 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
406 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
407 |
<CODE>static java.lang.String</CODE></FONT></TD> |
408 |
<TD><CODE><B><A HREF="../../../../../../com/izforge/izpack/util/os/unix/ShellScript.html#execute(java.lang.String, java.lang.StringBuffer, java.lang.String, java.lang.String)">execute</A></B>(java.lang.String aShell, |
409 |
java.lang.StringBuffer lines,
|
410 |
java.lang.String aLocation,
|
411 |
java.lang.String itsParams)</CODE> |
412 |
|
413 |
<BR>
|
414 |
Execs ths given lines in the creted shell stored on location.</TD> |
415 |
</TR>
|
416 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
417 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
418 |
<CODE> java.lang.StringBuffer</CODE></FONT></TD> |
419 |
<TD><CODE><B><A HREF="../../../../../../com/izforge/izpack/util/os/unix/ShellScript.html#getContent()">getContent</A></B>()</CODE> |
420 |
|
421 |
<BR>
|
422 |
gets the Content of this Script.</TD> |
423 |
</TR>
|
424 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
425 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
426 |
<CODE> java.lang.String</CODE></FONT></TD> |
427 |
<TD><CODE><B><A HREF="../../../../../../com/izforge/izpack/util/os/unix/ShellScript.html#getContentAsString()">getContentAsString</A></B>()</CODE> |
428 |
|
429 |
<BR>
|
430 |
Gets the Content of this Script as String</TD> |
431 |
</TR>
|
432 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
433 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
434 |
<CODE> java.lang.String</CODE></FONT></TD> |
435 |
<TD><CODE><B><A HREF="../../../../../../com/izforge/izpack/util/os/unix/ShellScript.html#getShell()">getShell</A></B>()</CODE> |
436 |
|
437 |
<BR>
|
438 |
Gets the current used shell.</TD> |
439 |
</TR>
|
440 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
441 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
442 |
<CODE>static void</CODE></FONT></TD> |
443 |
<TD><CODE><B><A HREF="../../../../../../com/izforge/izpack/util/os/unix/ShellScript.html#main(java.lang.String[])">main</A></B>(java.lang.String[] args)</CODE> |
444 |
|
445 |
<BR>
|
446 |
Test Main Method Run test with: java -cp .jar com.izforge.izpack.util.os.unix.ShellScript</TD> |
447 |
</TR>
|
448 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
449 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
450 |
<CODE> void</CODE></FONT></TD> |
451 |
<TD><CODE><B><A HREF="../../../../../../com/izforge/izpack/util/os/unix/ShellScript.html#setShell(java.lang.String)">setShell</A></B>(java.lang.String aShell)</CODE> |
452 |
|
453 |
<BR>
|
454 |
Sets the current used shell</TD> |
455 |
</TR>
|
456 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
457 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
458 |
<CODE> java.lang.String</CODE></FONT></TD> |
459 |
<TD><CODE><B><A HREF="../../../../../../com/izforge/izpack/util/os/unix/ShellScript.html#toString()">toString</A></B>()</CODE> |
460 |
|
461 |
<BR>
|
462 |
Dumps the ShellScript Content, and Location.</TD> |
463 |
</TR>
|
464 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
465 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
466 |
<CODE> void</CODE></FONT></TD> |
467 |
<TD><CODE><B><A HREF="../../../../../../com/izforge/izpack/util/os/unix/ShellScript.html#write(java.lang.String)">write</A></B>(java.lang.String aDestination)</CODE> |
468 |
|
469 |
<BR>
|
470 |
write this to the given Destination FileName</TD> |
471 |
</TR>
|
472 |
</TABLE>
|
473 |
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> |
474 |
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
475 |
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> |
476 |
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> |
477 |
</TR>
|
478 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
479 |
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait</CODE></TD> |
480 |
</TR>
|
481 |
</TABLE>
|
482 |
|
483 |
<P>
|
484 |
|
485 |
<!-- ============ FIELD DETAIL =========== -->
|
486 |
|
487 |
<A NAME="field_detail"><!-- --></A> |
488 |
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
489 |
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
490 |
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> |
491 |
<B>Field Detail</B></FONT></TH> |
492 |
</TR>
|
493 |
</TABLE>
|
494 |
|
495 |
<A NAME="Author"><!-- --></A><H3> |
496 |
Author</H3>
|
497 |
<PRE>
|
498 |
private static final java.lang.String <B>Author</B></PRE> |
499 |
<DL>
|
500 |
<DD>Author = "marc.eppelmann_at_gmx.de"
|
501 |
<P>
|
502 |
<DL>
|
503 |
<DT><B>See Also:</B><DD><A HREF="../../../../../../constant-values.html#com.izforge.izpack.util.os.unix.ShellScript.Author">Constant Field Values</A></DL> |
504 |
</DL>
|
505 |
<HR>
|
506 |
|
507 |
<A NAME="Generator"><!-- --></A><H3> |
508 |
Generator</H3>
|
509 |
<PRE>
|
510 |
private static final java.lang.String <B>Generator</B></PRE> |
511 |
<DL>
|
512 |
<DD>Generator = "Generator: " + ShellScript.class.getName()
|
513 |
<P>
|
514 |
<DL>
|
515 |
</DL>
|
516 |
</DL>
|
517 |
<HR>
|
518 |
|
519 |
<A NAME="SCM_ID"><!-- --></A><H3> |
520 |
SCM_ID</H3>
|
521 |
<PRE>
|
522 |
private static final java.lang.String <B>SCM_ID</B></PRE> |
523 |
<DL>
|
524 |
<DD>internal SourceCode Management ( currently 'svn') ID :: 'SCM_ID = "$Id$"'
|
525 |
<P>
|
526 |
<DL>
|
527 |
<DT><B>See Also:</B><DD><A HREF="../../../../../../constant-values.html#com.izforge.izpack.util.os.unix.ShellScript.SCM_ID">Constant Field Values</A></DL> |
528 |
</DL>
|
529 |
<HR>
|
530 |
|
531 |
<A NAME="Revision"><!-- --></A><H3> |
532 |
Revision</H3>
|
533 |
<PRE>
|
534 |
private static final java.lang.String <B>Revision</B></PRE> |
535 |
<DL>
|
536 |
<DD>internal Revision = "$Revision$"
|
537 |
<P>
|
538 |
<DL>
|
539 |
<DT><B>See Also:</B><DD><A HREF="../../../../../../constant-values.html#com.izforge.izpack.util.os.unix.ShellScript.Revision">Constant Field Values</A></DL> |
540 |
</DL>
|
541 |
<HR>
|
542 |
|
543 |
<A NAME="CommentPre"><!-- --></A><H3> |
544 |
CommentPre</H3>
|
545 |
<PRE>
|
546 |
private static final java.lang.String <B>CommentPre</B></PRE> |
547 |
<DL>
|
548 |
<DD>internal comment prefix; makes a line as comment:-) :: 'CommentPre = "# "'
|
549 |
<P>
|
550 |
<DL>
|
551 |
<DT><B>See Also:</B><DD><A HREF="../../../../../../constant-values.html#com.izforge.izpack.util.os.unix.ShellScript.CommentPre">Constant Field Values</A></DL> |
552 |
</DL>
|
553 |
<HR>
|
554 |
|
555 |
<A NAME="H"><!-- --></A><H3> |
556 |
H</H3>
|
557 |
<PRE>
|
558 |
private static final java.lang.String <B>H</B></PRE> |
559 |
<DL>
|
560 |
<DD>H = CommentPre
|
561 |
<P>
|
562 |
<DL>
|
563 |
<DT><B>See Also:</B><DD><A HREF="../../../../../../constant-values.html#com.izforge.izpack.util.os.unix.ShellScript.H">Constant Field Values</A></DL> |
564 |
</DL>
|
565 |
<HR>
|
566 |
|
567 |
<A NAME="lf"><!-- --></A><H3> |
568 |
lf</H3>
|
569 |
<PRE>
|
570 |
private static final java.lang.String <B>lf</B></PRE> |
571 |
<DL>
|
572 |
<DD>the linefeed: lf = "\n"
|
573 |
<P>
|
574 |
<DL>
|
575 |
<DT><B>See Also:</B><DD><A HREF="../../../../../../constant-values.html#com.izforge.izpack.util.os.unix.ShellScript.lf">Constant Field Values</A></DL> |
576 |
</DL>
|
577 |
<HR>
|
578 |
|
579 |
<A NAME="lh"><!-- --></A><H3> |
580 |
lh</H3>
|
581 |
<PRE>
|
582 |
private static final java.lang.String <B>lh</B></PRE> |
583 |
<DL>
|
584 |
<DD>lh = lf + H = "\n#"
|
585 |
<P>
|
586 |
<DL>
|
587 |
<DT><B>See Also:</B><DD><A HREF="../../../../../../constant-values.html#com.izforge.izpack.util.os.unix.ShellScript.lh">Constant Field Values</A></DL> |
588 |
</DL>
|
589 |
<HR>
|
590 |
|
591 |
<A NAME="explanation"><!-- --></A><H3> |
592 |
explanation</H3>
|
593 |
<PRE>
|
594 |
private static final java.lang.String <B>explanation</B></PRE> |
595 |
<DL>
|
596 |
<DD>the explanation header for this generated script
|
597 |
<P>
|
598 |
<DL>
|
599 |
<DT><B>See Also:</B><DD><A HREF="../../../../../../constant-values.html#com.izforge.izpack.util.os.unix.ShellScript.explanation">Constant Field Values</A></DL> |
600 |
</DL>
|
601 |
<HR>
|
602 |
|
603 |
<A NAME="currentDateMsg"><!-- --></A><H3> |
604 |
currentDateMsg</H3>
|
605 |
<PRE>
|
606 |
private static java.lang.String <B>currentDateMsg</B></PRE> |
607 |
<DL>
|
608 |
<DD>"Generated at: " + new Date().toString()
|
609 |
<P>
|
610 |
<DL>
|
611 |
</DL>
|
612 |
</DL>
|
613 |
<HR>
|
614 |
|
615 |
<A NAME="header"><!-- --></A><H3> |
616 |
header</H3>
|
617 |
<PRE>
|
618 |
private static final java.lang.String <B>header</B></PRE> |
619 |
<DL>
|
620 |
<DD>the header of this ShellScript
|
621 |
<P>
|
622 |
<DL>
|
623 |
</DL>
|
624 |
</DL>
|
625 |
<HR>
|
626 |
|
627 |
<A NAME="content"><!-- --></A><H3> |
628 |
content</H3>
|
629 |
<PRE>
|
630 |
private java.lang.StringBuffer <B>content</B></PRE> |
631 |
<DL>
|
632 |
<DD>Internal ContentBuffer of this ShellScript
|
633 |
<P>
|
634 |
<DL>
|
635 |
</DL>
|
636 |
</DL>
|
637 |
<HR>
|
638 |
|
639 |
<A NAME="itsLocation"><!-- --></A><H3> |
640 |
itsLocation</H3>
|
641 |
<PRE>
|
642 |
private java.lang.String <B>itsLocation</B></PRE> |
643 |
<DL>
|
644 |
<DD>internal field: where to write via write( itsLocation ) this shellscript.
|
645 |
<P>
|
646 |
<DL>
|
647 |
</DL>
|
648 |
</DL>
|
649 |
<HR>
|
650 |
|
651 |
<A NAME="itsShell"><!-- --></A><H3> |
652 |
itsShell</H3>
|
653 |
<PRE>
|
654 |
private java.lang.String <B>itsShell</B></PRE> |
655 |
<DL>
|
656 |
<DD>internal field: holds the shell
|
657 |
<P>
|
658 |
<DL>
|
659 |
</DL>
|
660 |
</DL>
|
661 |
<HR>
|
662 |
|
663 |
<A NAME="SH"><!-- --></A><H3> |
664 |
SH</H3>
|
665 |
<PRE>
|
666 |
public static final java.lang.String <B>SH</B></PRE> |
667 |
<DL>
|
668 |
<DL>
|
669 |
<DT><B>See Also:</B><DD><A HREF="../../../../../../constant-values.html#com.izforge.izpack.util.os.unix.ShellScript.SH">Constant Field Values</A></DL> |
670 |
</DL>
|
671 |
<HR>
|
672 |
|
673 |
<A NAME="BOURNE_SHELL"><!-- --></A><H3> |
674 |
BOURNE_SHELL</H3>
|
675 |
<PRE>
|
676 |
public static final java.lang.String <B>BOURNE_SHELL</B></PRE> |
677 |
<DL>
|
678 |
<DL>
|
679 |
<DT><B>See Also:</B><DD><A HREF="../../../../../../constant-values.html#com.izforge.izpack.util.os.unix.ShellScript.BOURNE_SHELL">Constant Field Values</A></DL> |
680 |
</DL>
|
681 |
<HR>
|
682 |
|
683 |
<A NAME="BASH"><!-- --></A><H3> |
684 |
BASH</H3>
|
685 |
<PRE>
|
686 |
public static final java.lang.String <B>BASH</B></PRE> |
687 |
<DL>
|
688 |
<DL>
|
689 |
<DT><B>See Also:</B><DD><A HREF="../../../../../../constant-values.html#com.izforge.izpack.util.os.unix.ShellScript.BASH">Constant Field Values</A></DL> |
690 |
</DL>
|
691 |
<HR>
|
692 |
|
693 |
<A NAME="BOURNE_AGAIN_SHELL"><!-- --></A><H3> |
694 |
BOURNE_AGAIN_SHELL</H3>
|
695 |
<PRE>
|
696 |
public static final java.lang.String <B>BOURNE_AGAIN_SHELL</B></PRE> |
697 |
<DL>
|
698 |
<DL>
|
699 |
<DT><B>See Also:</B><DD><A HREF="../../../../../../constant-values.html#com.izforge.izpack.util.os.unix.ShellScript.BOURNE_AGAIN_SHELL">Constant Field Values</A></DL> |
700 |
</DL>
|
701 |
|
702 |
<!-- ========= CONSTRUCTOR DETAIL ======== -->
|
703 |
|
704 |
<A NAME="constructor_detail"><!-- --></A> |
705 |
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
706 |
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
707 |
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> |
708 |
<B>Constructor Detail</B></FONT></TH> |
709 |
</TR>
|
710 |
</TABLE>
|
711 |
|
712 |
<A NAME="ShellScript(java.lang.String)"><!-- --></A><H3> |
713 |
ShellScript</H3>
|
714 |
<PRE>
|
715 |
public <B>ShellScript</B>(java.lang.String aShell)</PRE> |
716 |
<DL>
|
717 |
<DD>Creates and initializes the ShellScript for running on the given shell.
|
718 |
<P>
|
719 |
<DL>
|
720 |
<DT><B>Parameters:</B><DD><CODE>aShell</CODE> - "sh", "bash", "ksh", "csh" and so an...</DL> |
721 |
</DL>
|
722 |
<HR>
|
723 |
|
724 |
<A NAME="ShellScript()"><!-- --></A><H3> |
725 |
ShellScript</H3>
|
726 |
<PRE>
|
727 |
public <B>ShellScript</B>()</PRE> |
728 |
<DL>
|
729 |
<DD>Creates and initializes the ShellScript for running on the bourne shell: "sh".
|
730 |
<P>
|
731 |
</DL>
|
732 |
|
733 |
<!-- ============ METHOD DETAIL ========== -->
|
734 |
|
735 |
<A NAME="method_detail"><!-- --></A> |
736 |
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
737 |
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
738 |
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> |
739 |
<B>Method Detail</B></FONT></TH> |
740 |
</TR>
|
741 |
</TABLE>
|
742 |
|
743 |
<A NAME="setShell(java.lang.String)"><!-- --></A><H3> |
744 |
setShell</H3>
|
745 |
<PRE>
|
746 |
public void <B>setShell</B>(java.lang.String aShell)</PRE> |
747 |
<DL>
|
748 |
<DD>Sets the current used shell
|
749 |
<P>
|
750 |
<DD><DL> |
751 |
<DT><B>Parameters:</B><DD><CODE>aShell</CODE> - The Shell which should set and used.</DL> |
752 |
</DD>
|
753 |
</DL>
|
754 |
<HR>
|
755 |
|
756 |
<A NAME="getShell()"><!-- --></A><H3> |
757 |
getShell</H3>
|
758 |
<PRE>
|
759 |
public java.lang.String <B>getShell</B>()</PRE> |
760 |
<DL>
|
761 |
<DD>Gets the current used shell. Can be null.
|
762 |
<P>
|
763 |
<DD><DL> |
764 |
|
765 |
<DT><B>Returns:</B><DD>the Shell</DL> |
766 |
</DD>
|
767 |
</DL>
|
768 |
<HR>
|
769 |
|
770 |
<A NAME="append(java.lang.Object)"><!-- --></A><H3> |
771 |
append</H3>
|
772 |
<PRE>
|
773 |
public void <B>append</B>(java.lang.Object anObject)</PRE> |
774 |
<DL>
|
775 |
<DD>Appends an Object or String to this ShellScript.
|
776 |
<P>
|
777 |
<DD><DL> |
778 |
<DT><B>Parameters:</B><DD><CODE>anObject</CODE> - the Object to append</DL> |
779 |
</DD>
|
780 |
</DL>
|
781 |
<HR>
|
782 |
|
783 |
<A NAME="append(char)"><!-- --></A><H3> |
784 |
append</H3>
|
785 |
<PRE>
|
786 |
public void <B>append</B>(char aChar)</PRE> |
787 |
<DL>
|
788 |
<DD>Appends a Char to this ShellScript.
|
789 |
<P>
|
790 |
<DD><DL> |
791 |
<DT><B>Parameters:</B><DD><CODE>aChar</CODE> - a char to append</DL> |
792 |
</DD>
|
793 |
</DL>
|
794 |
<HR>
|
795 |
|
796 |
<A NAME="append(java.lang.String[])"><!-- --></A><H3> |
797 |
append</H3>
|
798 |
<PRE>
|
799 |
public void <B>append</B>(java.lang.String[] anArray)</PRE> |
800 |
<DL>
|
801 |
<DD>Appends the Array as one Commandline Space Separated
|
802 |
This is usefull with our FileExecutor |
803 |
<P>
|
804 |
<DD><DL> |
805 |
<DT><B>Parameters:</B><DD><CODE>anArray</CODE> - </DL> |
806 |
</DD>
|
807 |
</DL>
|
808 |
<HR>
|
809 |
|
810 |
<A NAME="appendln(java.lang.String[])"><!-- --></A><H3> |
811 |
appendln</H3>
|
812 |
<PRE>
|
813 |
public void <B>appendln</B>(java.lang.String[] anArray)</PRE> |
814 |
<DL>
|
815 |
<DD>Appends the Array as ONE! Commandline Space Separated
|
816 |
And additionionally append an linefeed "\n" |
817 |
This is usefull with our FileExecutor |
818 |
<P>
|
819 |
<DD><DL> |
820 |
<DT><B>Parameters:</B><DD><CODE>anArray</CODE> - </DL> |
821 |
</DD>
|
822 |
</DL>
|
823 |
<HR>
|
824 |
|
825 |
<A NAME="appendln(java.lang.Object)"><!-- --></A><H3> |
826 |
appendln</H3>
|
827 |
<PRE>
|
828 |
public void <B>appendln</B>(java.lang.Object anObject)</PRE> |
829 |
<DL>
|
830 |
<DD>Appends an Object or String to this ShellScript with unix linefeed ("\n").
|
831 |
<P>
|
832 |
<DD><DL> |
833 |
<DT><B>Parameters:</B><DD><CODE>anObject</CODE> - the Object to append</DL> |
834 |
</DD>
|
835 |
</DL>
|
836 |
<HR>
|
837 |
|
838 |
<A NAME="appendln(char)"><!-- --></A><H3> |
839 |
appendln</H3>
|
840 |
<PRE>
|
841 |
public void <B>appendln</B>(char aChar)</PRE> |
842 |
<DL>
|
843 |
<DD>Appends a Char Object or String to this ShellScript with unix linefeed ("\n").
|
844 |
<P>
|
845 |
<DD><DL> |
846 |
<DT><B>Parameters:</B><DD><CODE>aChar</CODE> - a char to append</DL> |
847 |
</DD>
|
848 |
</DL>
|
849 |
<HR>
|
850 |
|
851 |
<A NAME="appendln()"><!-- --></A><H3> |
852 |
appendln</H3>
|
853 |
<PRE>
|
854 |
public void <B>appendln</B>()</PRE> |
855 |
<DL>
|
856 |
<DD>Appends an unix linefeed to this script ("\n").
|
857 |
<P>
|
858 |
<DD><DL> |
859 |
</DL>
|
860 |
</DD>
|
861 |
</DL>
|
862 |
<HR>
|
863 |
|
864 |
<A NAME="getContent()"><!-- --></A><H3> |
865 |
getContent</H3>
|
866 |
<PRE>
|
867 |
public java.lang.StringBuffer <B>getContent</B>()</PRE> |
868 |
<DL>
|
869 |
<DD>gets the Content of this Script.
|
870 |
<P>
|
871 |
<DD><DL> |
872 |
|
873 |
<DT><B>Returns:</B><DD>the Content</DL> |
874 |
</DD>
|
875 |
</DL>
|
876 |
<HR>
|
877 |
|
878 |
<A NAME="getContentAsString()"><!-- --></A><H3> |
879 |
getContentAsString</H3>
|
880 |
<PRE>
|
881 |
public java.lang.String <B>getContentAsString</B>()</PRE> |
882 |
<DL>
|
883 |
<DD>Gets the Content of this Script as String
|
884 |
<P>
|
885 |
<DD><DL> |
886 |
|
887 |
<DT><B>Returns:</B><DD>the script as String</DL> |
888 |
</DD>
|
889 |
</DL>
|
890 |
<HR>
|
891 |
|
892 |
<A NAME="toString()"><!-- --></A><H3> |
893 |
toString</H3>
|
894 |
<PRE>
|
895 |
public java.lang.String <B>toString</B>()</PRE> |
896 |
<DL>
|
897 |
<DD>Dumps the ShellScript Content, and Location.
|
898 |
Use getContentAsString() to get this ShellScripts Content |
899 |
<P>
|
900 |
<DD><DL> |
901 |
<DT><B>Overrides:</B><DD><CODE>toString</CODE> in class <CODE>java.lang.Object</CODE></DL> |
902 |
</DD>
|
903 |
<DD><DL> |
904 |
|
905 |
<DT><B>Returns:</B><DD>The ShellScript as Object dump.</DL> |
906 |
</DD>
|
907 |
</DL>
|
908 |
<HR>
|
909 |
|
910 |
<A NAME="write(java.lang.String)"><!-- --></A><H3> |
911 |
write</H3>
|
912 |
<PRE>
|
913 |
public void <B>write</B>(java.lang.String aDestination)</PRE> |
914 |
<DL>
|
915 |
<DD>write this to the given Destination FileName
|
916 |
<P>
|
917 |
<DD><DL> |
918 |
<DT><B>Parameters:</B><DD><CODE>aDestination</CODE> - a destination filename</DL> |
919 |
</DD>
|
920 |
</DL>
|
921 |
<HR>
|
922 |
|
923 |
<A NAME="exec(java.lang.String)"><!-- --></A><H3> |
924 |
exec</H3>
|
925 |
<PRE>
|
926 |
public java.lang.String <B>exec</B>(java.lang.String itsParams)</PRE> |
927 |
<DL>
|
928 |
<DD>Executes this ShellScript with the given Params.<br> |
929 |
NOTE: the params cannot be contain whitespaces.<br>
|
930 |
This (su -c <br>"cp from to"</br>) would not work:<br> |
931 |
because the underlaying java.runtime.exec("command") does not handle balanced or unbalanced |
932 |
(") correctly.<br>
|
933 |
else just whitespace separate tokens.<br>
|
934 |
This means for the sample. runtime.exec() would ever execute such as: su "-c" "\"cp" |
935 |
"fromFile" "toFile\""<br>
|
936 |
But this his hidden in Sun's native code ;-(<br>
|
937 |
This was the reason to write this class to have a Workaround :-) |
938 |
<P>
|
939 |
<DD><DL> |
940 |
<DT><B>Parameters:</B><DD><CODE>itsParams</CODE> - |
941 |
<DT><B>Returns:</B><DD>the output from stdout of the execution.</DL> |
942 |
</DD>
|
943 |
</DL>
|
944 |
<HR>
|
945 |
|
946 |
<A NAME="exec()"><!-- --></A><H3> |
947 |
exec</H3>
|
948 |
<PRE>
|
949 |
public java.lang.String <B>exec</B>()</PRE> |
950 |
<DL>
|
951 |
<DD>Execute this ShellScript.
|
952 |
<P>
|
953 |
<DD><DL> |
954 |
|
955 |
<DT><B>Returns:</B><DD>the output from stdout of the execution.</DL> |
956 |
</DD>
|
957 |
</DL>
|
958 |
<HR>
|
959 |
|
960 |
<A NAME="execute(java.lang.String, java.lang.StringBuffer, java.lang.String, java.lang.String)"><!-- --></A><H3> |
961 |
execute</H3>
|
962 |
<PRE>
|
963 |
public static java.lang.String <B>execute</B>(java.lang.String aShell, |
964 |
java.lang.StringBuffer lines,
|
965 |
java.lang.String aLocation,
|
966 |
java.lang.String itsParams)</PRE> |
967 |
<DL>
|
968 |
<DD>Execs ths given lines in the creted shell stored on location.
|
969 |
<P>
|
970 |
<DD><DL> |
971 |
<DT><B>Parameters:</B><DD><CODE>aShell</CODE> - A Shell which will be eexecute the script.<DD><CODE>lines</CODE> - The content of the script.<DD><CODE>aLocation</CODE> - The location where to store.<DD><CODE>itsParams</CODE> - Th eoptional params of the script. |
972 |
<DT><B>Returns:</B><DD>the exec result</DL> |
973 |
</DD>
|
974 |
</DL>
|
975 |
<HR>
|
976 |
|
977 |
<A NAME="execute(java.lang.StringBuffer, java.lang.String)"><!-- --></A><H3> |
978 |
execute</H3>
|
979 |
<PRE>
|
980 |
public static java.lang.String <B>execute</B>(java.lang.StringBuffer lines, |
981 |
java.lang.String aLocation)</PRE> |
982 |
<DL>
|
983 |
<DD>Executes ths given lines in the created default shell (sh) stored on location.
|
984 |
<P>
|
985 |
<DD><DL> |
986 |
<DT><B>Parameters:</B><DD><CODE>lines</CODE> - the lines of the script to exec.s<DD><CODE>aLocation</CODE> - where to store |
987 |
<DT><B>Returns:</B><DD>the stdout of the script.</DL> |
988 |
</DD>
|
989 |
</DL>
|
990 |
<HR>
|
991 |
|
992 |
<A NAME="execAndDelete(java.lang.String, java.lang.StringBuffer, java.lang.String, java.lang.String)"><!-- --></A><H3> |
993 |
execAndDelete</H3>
|
994 |
<PRE>
|
995 |
public static java.lang.String <B>execAndDelete</B>(java.lang.String aShell, |
996 |
java.lang.StringBuffer lines,
|
997 |
java.lang.String aLocation,
|
998 |
java.lang.String itsParams)</PRE> |
999 |
<DL>
|
1000 |
<DD>Executes and removes the script.<br> |
1001 |
The Lines be also written in python or perl,<br>
|
1002 |
In this case, the Shell must be python or perl or so. |
1003 |
<P>
|
1004 |
<DD><DL> |
1005 |
<DT><B>Parameters:</B><DD><CODE>aShell</CODE> - The Shell which should exec the script. Can be also be python or perl, if the |
1006 |
shellcontent is given in this language.<DD><CODE>lines</CODE> - of the script.<DD><CODE>aLocation</CODE> - where to store.<DD><CODE>itsParams</CODE> - which should be pass to the script. |
1007 |
<DT><B>Returns:</B><DD>the stdout.</DL> |
1008 |
</DD>
|
1009 |
</DL>
|
1010 |
<HR>
|
1011 |
|
1012 |
<A NAME="execAndDelete(java.lang.StringBuffer, java.lang.String)"><!-- --></A><H3> |
1013 |
execAndDelete</H3>
|
1014 |
<PRE>
|
1015 |
public static java.lang.String <B>execAndDelete</B>(java.lang.StringBuffer lines, |
1016 |
java.lang.String aLocation)</PRE> |
1017 |
<DL>
|
1018 |
<DD>Executes and removes the script.
|
1019 |
<P>
|
1020 |
<DD><DL> |
1021 |
<DT><B>Parameters:</B><DD><CODE>lines</CODE> - of the script.<DD><CODE>aLocation</CODE> - where to store. |
1022 |
<DT><B>Returns:</B><DD>the sdtout.</DL> |
1023 |
</DD>
|
1024 |
</DL>
|
1025 |
<HR>
|
1026 |
|
1027 |
<A NAME="main(java.lang.String[])"><!-- --></A><H3> |
1028 |
main</H3>
|
1029 |
<PRE>
|
1030 |
public static void <B>main</B>(java.lang.String[] args)</PRE> |
1031 |
<DL>
|
1032 |
<DD>Test Main Method Run test with: java -cp .jar com.izforge.izpack.util.os.unix.ShellScript
|
1033 |
<P>
|
1034 |
<DD><DL> |
1035 |
<DT><B>Parameters:</B><DD><CODE>args</CODE> - Arguments from Commandline</DL> |
1036 |
</DD>
|
1037 |
</DL>
|
1038 |
<HR>
|
1039 |
|
1040 |
<A NAME="delete()"><!-- --></A><H3> |
1041 |
delete</H3>
|
1042 |
<PRE>
|
1043 |
public void <B>delete</B>()</PRE> |
1044 |
<DL>
|
1045 |
<DD>Deletes only if Location is not null.
|
1046 |
<P>
|
1047 |
<DD><DL> |
1048 |
</DL>
|
1049 |
</DD>
|
1050 |
</DL>
|
1051 |
<!-- ========= END OF CLASS DATA ========= -->
|
1052 |
<HR>
|
1053 |
|
1054 |
|
1055 |
<!-- ======= START OF BOTTOM NAVBAR ====== -->
|
1056 |
<A NAME="navbar_bottom"><!-- --></A> |
1057 |
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> |
1058 |
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> |
1059 |
<TR>
|
1060 |
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> |
1061 |
<A NAME="navbar_bottom_firstrow"><!-- --></A> |
1062 |
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> |
1063 |
<TR ALIGN="center" VALIGN="top"> |
1064 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> |
1065 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> |
1066 |
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> |
1067 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> |
1068 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> |
1069 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> |
1070 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> |
1071 |
</TR>
|
1072 |
</TABLE>
|
1073 |
</TD>
|
1074 |
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> |
1075 |
</EM>
|
1076 |
</TD>
|
1077 |
</TR>
|
1078 |
|
1079 |
<TR>
|
1080 |
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
1081 |
PREV CLASS |
1082 |
<A HREF="../../../../../../com/izforge/izpack/util/os/unix/UnixConstants.html" title="class in com.izforge.izpack.util.os.unix"><B>NEXT CLASS</B></A></FONT></TD> |
1083 |
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
1084 |
<A HREF="../../../../../../index.html?com/izforge/izpack/util/os/unix/ShellScript.html" target="_top"><B>FRAMES</B></A> |
1085 |
<A HREF="ShellScript.html" target="_top"><B>NO FRAMES</B></A> |
1086 |
<SCRIPT type="text/javascript"> |
1087 |
<!--
|
1088 |
if(window==top) {
|
1089 |
document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
|
1090 |
}
|
1091 |
//-->
|
1092 |
</SCRIPT>
|
1093 |
<NOSCRIPT>
|
1094 |
<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A> |
1095 |
</NOSCRIPT>
|
1096 |
|
1097 |
|
1098 |
</FONT></TD> |
1099 |
</TR>
|
1100 |
<TR>
|
1101 |
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
1102 |
SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> |
1103 |
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
1104 |
DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> |
1105 |
</TR>
|
1106 |
</TABLE>
|
1107 |
<A NAME="skip-navbar_bottom"></A> |
1108 |
<!-- ======== END OF BOTTOM NAVBAR ======= -->
|
1109 |
|
1110 |
<HR>
|
1111 |
|
1112 |
</BODY>
|
1113 |
</HTML>
|