# Deprecated API

## Contents

- Classes
- Fields
- Methods

Deprecated Classes
Class
Description
org.codehaus.plexus.util.StringInputStream
As of version 1.5.2 this class should no longer be used because it does not properly handle character encoding. Instead, wrap the output from `String.getBytes(String)` into a `ByteArrayInputStream`.
org.codehaus.plexus.util.StringOutputStream
As of version 1.5.2 this class should no longer be used because it does not properly handle character encoding. Instead, use `ByteArrayOutputStream.toString(String)`.
org.codehaus.plexus.util.xml.XmlReader
use XmlStreamReader

Deprecated Fields
Field
Description
org.codehaus.plexus.util.cli.Commandline.executable
Use `Commandline.setExecutable(String)` instead.
org.codehaus.plexus.util.cli.Commandline.OS_NAME
Use `Os` class instead.
org.codehaus.plexus.util.cli.Commandline.WINDOWS
Use `Os` class instead.
org.codehaus.plexus.util.xml.pull.XmlPullParserException.detail
use generic getCause() method

Deprecated Methods
Method
Description
org.codehaus.plexus.util.cli.Commandline.createArgument()
Use `Commandline.createArg()` instead
org.codehaus.plexus.util.cli.Commandline.createArgument(boolean)
Use `Commandline.createArg(boolean)` instead
org.codehaus.plexus.util.cli.Commandline.quoteArgument(String)
Use `CommandLineUtils.quote(String)` instead.
org.codehaus.plexus.util.cli.Commandline.toString(String[])
Use `CommandLineUtils.toString(String[])` instead.
org.codehaus.plexus.util.cli.Commandline.translateCommandline(String)
Use `CommandLineUtils.translateCommandline(String)` instead.
org.codehaus.plexus.util.cli.CommandLineUtils.quote(String)
Use `StringUtils.quoteAndEscape(String, char, char[], char[], char, boolean)`, `StringUtils.quoteAndEscape(String, char, char[], char, boolean)`, or `StringUtils.quoteAndEscape(String, char)` instead.
org.codehaus.plexus.util.cli.CommandLineUtils.quote(String, boolean)
Use `StringUtils.quoteAndEscape(String, char, char[], char[], char, boolean)`, `StringUtils.quoteAndEscape(String, char, char[], char, boolean)`, or `StringUtils.quoteAndEscape(String, char)` instead.
org.codehaus.plexus.util.cli.CommandLineUtils.quote(String, boolean, boolean, boolean)
Use `StringUtils.quoteAndEscape(String, char, char[], char[], char, boolean)`, `StringUtils.quoteAndEscape(String, char, char[], char, boolean)`, or `StringUtils.quoteAndEscape(String, char)` instead.
org.codehaus.plexus.util.dag.DAG.getVerticies()
instead use `DAG.getVertices()`
org.codehaus.plexus.util.FileUtils.fileAppend(String, String)
use `java.nio.files.Files.write(filename, data.getBytes(encoding), StandardOpenOption.APPEND, StandardOpenOption.CREATE)`
org.codehaus.plexus.util.FileUtils.fileAppend(String, String, String)
use `java.nio.files.Files.write(filename, data.getBytes(encoding), StandardOpenOption.APPEND, StandardOpenOption.CREATE)`
org.codehaus.plexus.util.IOUtil.bufferedCopy(InputStream, OutputStream)
Buffering streams is actively harmful! See the class description as to why. Use `IOUtil.copy(InputStream, OutputStream)` instead.
org.codehaus.plexus.util.IOUtil.close(InputStream)
use try-with-resources instead
org.codehaus.plexus.util.IOUtil.close(OutputStream)
use try-with-resources instead
org.codehaus.plexus.util.IOUtil.close(Reader)
use try-with-resources instead
org.codehaus.plexus.util.IOUtil.close(Writer)
use try-with-resources instead
org.codehaus.plexus.util.IOUtil.close(Channel)
use try-with-resources instead
org.codehaus.plexus.util.StringUtils.defaultString(Object)
org.codehaus.plexus.util.StringUtils.defaultString(Object, String)
org.codehaus.plexus.util.StringUtils.equals(String, String)
org.codehaus.plexus.util.xml.pull.XmlPullParserException.getDetail()
Use the generic `getCause()` method