Package org.apache.tomcat.jakartaee
Class Util
java.lang.Object
org.apache.tomcat.jakartaee.Util
Utility methods.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
copy
(InputStream is, OutputStream os) Buffered copy.static String
getExtension
(String filename) Get the extension of a filenamestatic String
toString
(InputStream is, Charset charset) Convert the input bytes as a string.
-
Constructor Details
-
Util
private Util()
-
-
Method Details
-
getExtension
Get the extension of a filenameThe extension is the string after the last '
.
' in the filename.- Parameters:
filename
- the name of the file- Returns:
- the extension or an empty string, if no dot is found in the filename
-
copy
Buffered copy.- Parameters:
is
- the inputos
- the output- Throws:
IOException
- if an exception occurs
-
toString
Convert the input bytes as a string.- Parameters:
is
- the input byte streamcharset
- the charset to use- Returns:
- the converted string
- Throws:
IOException
- if an exception occurs
-