Top Description Constructors Methods
org.apache.tomcat.jakartaee

public Class Util

extends Object
Class Inheritance
Imports
java.io.ByteArrayOutputStream, .IOException, .InputStream, .OutputStream, java.nio.charset.Charset, java.util.Locale

Utility methods.

Constructor Summary

AccessConstructor and Description
private
Util()

Method Summary

Modifier and TypeMethod and Description
public static void
copy(InputStream
the input
is
,
OutputStream
the output
os
)

Buffered copy.

public static String

Returns:

the extension or an empty string, if no dot is found in the filename
getExtension
(String
the name of the file
filename
)

Get the extension of a filename

The extension is the string after the last '.

public static String

Returns:

the converted string
toString
(InputStream
the input byte stream
is
,
Charset
the charset to use
charset
)

Convert the input bytes as a string.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Utilback to summary
private Util()

Method Detail

copyback to summary
public static void copy(InputStream is, OutputStream os) throws IOException

Buffered copy.

Parameters
is:InputStream

the input

os:OutputStream

the output

Exceptions
IOException:
if an exception occurs
getExtensionback to summary
public static String getExtension(String filename)

Get the extension of a filename

The extension is the string after the last '.' in the filename.

Parameters
filename:String

the name of the file

Returns:String

the extension or an empty string, if no dot is found in the filename

toStringback to summary
public static String toString(InputStream is, Charset charset) throws IOException

Convert the input bytes as a string.

Parameters
is:InputStream

the input byte stream

charset:Charset

the charset to use

Returns:String

the converted string

Exceptions
IOException:
if an exception occurs