Java Reference
In-Depth Information
Table 9-3.
(
continued
)
Function
Description
mkdirs(dir)
Creates a directory named
dir
, including any necessary but
nonexistent parent directories.
mv(from, to)
Moves a file to another directory.
printf(format, args)
A C-like printf.
pwd()
Prints the working directory.
quit(code)
A synonym for
exit(code)
.
read(prompt,
multiline)
Reads and returns one or more lines from standard input
after printing the specified
prompt
. The default prompt is a
>
. If
multiline
is 0, it reads one line. If
multiline
is other
than 0, it reads multiple lines. You need to press
Enter
to
stop entering text.
ren(from, to)
A synonym for
mv
.
rm(filePath)
Removes the file with the specified
filePath
.
rmdir(dirPath)
Removes the directory with the specified
dirPath
.
which(cmd)
Unix-like which
command
to print the path of the specified
cmd
command based on the PATH environment variable.
XMLDocument(input)
Converts
input
that can be a filepath or a
Reader
to DOM
Document object. If
input
is not specified, an empty DOM
document is returned.
XMLResult(input)
Convert an arbitrary stream or file to an
XMLResult
. If
input
is an instance of
javax.xml.transform.Result
,
input
is
returned; if
input
is an instance of
org.w3c.dom.Document
,
a
javax.xml.transform.dom.DOMResult
is returned;
otherwise, a
javax.xml.transform.stream.StreamResult
is returned.
XMLSource(input)
Converts an arbitrary stream, file, URL to an
XMLSource
. If
input
is an instance of
javax.xml.transform.Source
,
input
is returned; if
input
is an instance of
org.w3c.dom.Document
,
a
javax.xml.transform.dom.DOMSource
is returned;
otherwise, a
javax.xml.transform.stream.StreamSource
is
returned.
XSLTransform(input,
style, output)
Perform an XSLT transform;
input
is the input XML;
style
is the XML stylesheet;
output
is the output XML.
Input
and
style
can be a
URL
, a
File
or an
InputStream
; output can
be a
File
or an
OutputStream
.
Search WWH ::
Custom Search