Package org.apache.tomcat.jakartaee
Class Util
- java.lang.Object
-
- org.apache.tomcat.jakartaee.Util
-
public class Util extends java.lang.ObjectUtility methods.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcopy(java.io.InputStream is, java.io.OutputStream os)Buffered copy.static java.lang.StringgetExtension(java.lang.String filename)Get the extension of a filenamestatic java.lang.StringtoString(java.io.InputStream is, java.nio.charset.Charset charset)Convert the input bytes as a string.
-
-
-
Method Detail
-
getExtension
public static java.lang.String getExtension(java.lang.String filename)
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
public static void copy(java.io.InputStream is, java.io.OutputStream os) throws java.io.IOExceptionBuffered copy.- Parameters:
is- the inputos- the output- Throws:
java.io.IOException- if an exception occurs
-
toString
public static java.lang.String toString(java.io.InputStream is, java.nio.charset.Charset charset) throws java.io.IOExceptionConvert the input bytes as a string.- Parameters:
is- the input byte streamcharset- the charset to use- Returns:
- the converted string
- Throws:
java.io.IOException- if an exception occurs
-
-