Package org.eclipse.jetty.util
Class IO
- java.lang.Object
-
- org.eclipse.jetty.util.IO
-
@Deprecated(since="2021-05-27") public class IO extends java.lang.Object
Deprecated.The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.IO Utilities. Provides stream handling utilities in singleton Threadpool implementation accessed by static members.
-
-
Field Summary
Fields Modifier and Type Field Description static int
bufferSize
Deprecated.static java.lang.String
CRLF
Deprecated.static byte[]
CRLF_BYTES
Deprecated.
-
Constructor Summary
Constructors Constructor Description IO()
Deprecated.
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static void
close(java.io.Closeable closeable)
Deprecated.Closes an arbitrary closable, and logs exceptions at ignore levelstatic void
close(java.io.InputStream is)
Deprecated.closes an input stream, and logs exceptionsstatic void
close(java.io.OutputStream os)
Deprecated.closes an output stream, and logs exceptionsstatic void
close(java.io.Reader reader)
Deprecated.closes a reader, and logs exceptionsstatic void
close(java.io.Writer writer)
Deprecated.closes a writer, and logs exceptionsstatic void
copy(java.io.File from, java.io.File to)
Deprecated.Copy files or directoriesstatic void
copy(java.io.InputStream in, java.io.OutputStream out)
Deprecated.Copy Stream in to Stream out until EOF or exception.static void
copy(java.io.InputStream in, java.io.OutputStream out, long byteCount)
Deprecated.Copy Stream in to Stream for byteCount bytes or until EOF or exception.static void
copy(java.io.Reader in, java.io.Writer out)
Deprecated.Copy Reader to Writer out until EOF or exception.static void
copy(java.io.Reader in, java.io.Writer out, long byteCount)
Deprecated.Copy Reader to Writer for byteCount bytes or until EOF or exception.static void
copyDir(java.io.File from, java.io.File to)
Deprecated.static void
copyFile(java.io.File from, java.io.File to)
Deprecated.static boolean
delete(java.io.File file)
Deprecated.Delete File.static java.io.InputStream
getClosedStream()
Deprecated.static java.io.PrintWriter
getNullPrintWriter()
Deprecated.static java.io.OutputStream
getNullStream()
Deprecated.static java.io.Writer
getNullWriter()
Deprecated.static boolean
isEmptyDir(java.io.File dir)
Deprecated.Test if directory is empty.static byte[]
readBytes(java.io.InputStream in)
Deprecated.static java.lang.String
toString(java.io.InputStream in)
Deprecated.Read input stream to string.static java.lang.String
toString(java.io.InputStream in, java.lang.String encoding)
Deprecated.Read input stream to string.static java.lang.String
toString(java.io.InputStream in, java.nio.charset.Charset encoding)
Deprecated.Read input stream to string.static java.lang.String
toString(java.io.Reader in)
Deprecated.Read input stream to string.static java.lang.String
toString(java.nio.file.Path path, java.nio.charset.Charset charset)
Deprecated.Read Path to string.static long
write(java.nio.channels.GatheringByteChannel out, java.nio.ByteBuffer[] buffers, int offset, int length)
Deprecated.A gathering write utility wrapper.
-
-
-
Field Detail
-
CRLF
public static final java.lang.String CRLF
Deprecated.- See Also:
- Constant Field Values
-
CRLF_BYTES
public static final byte[] CRLF_BYTES
Deprecated.
-
bufferSize
public static final int bufferSize
Deprecated.- See Also:
- Constant Field Values
-
-
Method Detail
-
copy
public static void copy(java.io.InputStream in, java.io.OutputStream out) throws java.io.IOException
Deprecated.Copy Stream in to Stream out until EOF or exception.- Parameters:
in
- the input stream to read from (until EOF)out
- the output stream to write to- Throws:
java.io.IOException
- if unable to copy streams
-
copy
public static void copy(java.io.Reader in, java.io.Writer out) throws java.io.IOException
Deprecated.Copy Reader to Writer out until EOF or exception.- Parameters:
in
- the read to read from (until EOF)out
- the writer to write to- Throws:
java.io.IOException
- if unable to copy the streams
-
copy
public static void copy(java.io.InputStream in, java.io.OutputStream out, long byteCount) throws java.io.IOException
Deprecated.Copy Stream in to Stream for byteCount bytes or until EOF or exception.- Parameters:
in
- the stream to read fromout
- the stream to write tobyteCount
- the number of bytes to copy- Throws:
java.io.IOException
- if unable to copy the streams
-
copy
public static void copy(java.io.Reader in, java.io.Writer out, long byteCount) throws java.io.IOException
Deprecated.Copy Reader to Writer for byteCount bytes or until EOF or exception.- Parameters:
in
- the Reader to read fromout
- the Writer to write tobyteCount
- the number of bytes to copy- Throws:
java.io.IOException
- if unable to copy streams
-
copy
public static void copy(java.io.File from, java.io.File to) throws java.io.IOException
Deprecated.Copy files or directories- Parameters:
from
- the file to copyto
- the destination to copy to- Throws:
java.io.IOException
- if unable to copy
-
copyDir
public static void copyDir(java.io.File from, java.io.File to) throws java.io.IOException
Deprecated.- Throws:
java.io.IOException
-
copyFile
public static void copyFile(java.io.File from, java.io.File to) throws java.io.IOException
Deprecated.- Throws:
java.io.IOException
-
toString
public static java.lang.String toString(java.nio.file.Path path, java.nio.charset.Charset charset) throws java.io.IOException
Deprecated.Read Path to string.- Parameters:
path
- the path to read from (until EOF)charset
- the charset to read with- Returns:
- the String parsed from path (default Charset)
- Throws:
java.io.IOException
- if unable to read the path (or handle the charset)
-
toString
public static java.lang.String toString(java.io.InputStream in) throws java.io.IOException
Deprecated.Read input stream to string.- Parameters:
in
- the stream to read from (until EOF)- Returns:
- the String parsed from stream (default Charset)
- Throws:
java.io.IOException
- if unable to read the stream (or handle the charset)
-
toString
public static java.lang.String toString(java.io.InputStream in, java.lang.String encoding) throws java.io.IOException
Deprecated.Read input stream to string.- Parameters:
in
- the stream to read from (until EOF)encoding
- the encoding to use (can be null to use default Charset)- Returns:
- the String parsed from the stream
- Throws:
java.io.IOException
- if unable to read the stream (or handle the charset)
-
toString
public static java.lang.String toString(java.io.InputStream in, java.nio.charset.Charset encoding) throws java.io.IOException
Deprecated.Read input stream to string.- Parameters:
in
- the stream to read from (until EOF)encoding
- the Charset to use (can be null to use default Charset)- Returns:
- the String parsed from the stream
- Throws:
java.io.IOException
- if unable to read the stream (or handle the charset)
-
toString
public static java.lang.String toString(java.io.Reader in) throws java.io.IOException
Deprecated.Read input stream to string.- Parameters:
in
- the reader to read from (until EOF)- Returns:
- the String parsed from the reader
- Throws:
java.io.IOException
- if unable to read the stream (or handle the charset)
-
delete
public static boolean delete(java.io.File file)
Deprecated.Delete File. This delete will recursively delete directories - BE CAREFUL- Parameters:
file
- The file (or directory) to be deleted.- Returns:
- true if file was deleted, or directory referenced was deleted. false if file doesn't exist, or was null.
-
isEmptyDir
public static boolean isEmptyDir(java.io.File dir)
Deprecated.Test if directory is empty.- Parameters:
dir
- the directory- Returns:
- true if directory is null, doesn't exist, or has no content. false if not a directory, or has contents
-
close
public static void close(java.io.Closeable closeable)
Deprecated.Closes an arbitrary closable, and logs exceptions at ignore level- Parameters:
closeable
- the closeable to close
-
close
public static void close(java.io.InputStream is)
Deprecated.closes an input stream, and logs exceptions- Parameters:
is
- the input stream to close
-
close
public static void close(java.io.OutputStream os)
Deprecated.closes an output stream, and logs exceptions- Parameters:
os
- the output stream to close
-
close
public static void close(java.io.Reader reader)
Deprecated.closes a reader, and logs exceptions- Parameters:
reader
- the reader to close
-
close
public static void close(java.io.Writer writer)
Deprecated.closes a writer, and logs exceptions- Parameters:
writer
- the writer to close
-
readBytes
public static byte[] readBytes(java.io.InputStream in) throws java.io.IOException
Deprecated.- Throws:
java.io.IOException
-
write
public static long write(java.nio.channels.GatheringByteChannel out, java.nio.ByteBuffer[] buffers, int offset, int length) throws java.io.IOException
Deprecated.A gathering write utility wrapper.This method wraps a gather write with a loop that handles the limitations of some operating systems that have a limit on the number of buffers written. The method loops on the write until either all the content is written or no progress is made.
- Parameters:
out
- The GatheringByteChannel to write tobuffers
- The buffers to writeoffset
- The offset into the buffers arraylength
- The length in buffers to write- Returns:
- The total bytes written
- Throws:
java.io.IOException
- if unable write to the GatheringByteChannel
-
getNullStream
public static java.io.OutputStream getNullStream()
Deprecated.- Returns:
- An outputstream to nowhere
-
getClosedStream
public static java.io.InputStream getClosedStream()
Deprecated.- Returns:
- An outputstream to nowhere
-
getNullWriter
public static java.io.Writer getNullWriter()
Deprecated.- Returns:
- An writer to nowhere
-
getNullPrintWriter
public static java.io.PrintWriter getNullPrintWriter()
Deprecated.- Returns:
- An writer to nowhere
-
-