Package org.eclipse.jetty.util
Class IO
java.lang.Object
org.eclipse.jetty.util.IO
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
FieldsModifier and TypeFieldDescriptionstatic final intDeprecated.static final StringDeprecated.static final byte[]Deprecated. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidDeprecated.Closes an arbitrary closable, and logs exceptions at ignore levelstatic voidclose(InputStream is) Deprecated.closes an input stream, and logs exceptionsstatic voidclose(OutputStream os) Deprecated.closes an output stream, and logs exceptionsstatic voidDeprecated.closes a reader, and logs exceptionsstatic voidDeprecated.closes a writer, and logs exceptionsstatic voidDeprecated.Copy files or directoriesstatic voidcopy(InputStream in, OutputStream out) Deprecated.Copy Stream in to Stream out until EOF or exception.static voidcopy(InputStream in, OutputStream out, long byteCount) Deprecated.Copy Stream in to Stream for byteCount bytes or until EOF or exception.static voidDeprecated.Copy Reader to Writer out until EOF or exception.static voidDeprecated.Copy Reader to Writer for byteCount bytes or until EOF or exception.static voidDeprecated.static voidDeprecated.static booleanDeprecated.Delete File.static InputStreamDeprecated.static PrintWriterDeprecated.static OutputStreamDeprecated.static WriterDeprecated.static booleanisEmptyDir(File dir) Deprecated.Test if directory is empty.static byte[]readBytes(InputStream in) Deprecated.static StringtoString(InputStream in) Deprecated.Read input stream to string.static StringtoString(InputStream in, String encoding) Deprecated.Read input stream to string.static StringtoString(InputStream in, Charset encoding) Deprecated.Read input stream to string.static StringDeprecated.Read input stream to string.static StringDeprecated.Read Path to string.static longwrite(GatheringByteChannel out, ByteBuffer[] buffers, int offset, int length) Deprecated.A gathering write utility wrapper.
-
Field Details
-
CRLF
Deprecated.- See Also:
-
CRLF_BYTES
public static final byte[] CRLF_BYTESDeprecated. -
bufferSize
public static final int bufferSizeDeprecated.- See Also:
-
-
Constructor Details
-
IO
public IO()Deprecated.
-
-
Method Details
-
copy
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:
IOException- if unable to copy streams
-
copy
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:
IOException- if unable to copy the streams
-
copy
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:
IOException- if unable to copy the streams
-
copy
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:
IOException- if unable to copy streams
-
copy
Deprecated.Copy files or directories- Parameters:
from- the file to copyto- the destination to copy to- Throws:
IOException- if unable to copy
-
copyDir
Deprecated.- Throws:
IOException
-
copyFile
Deprecated.- Throws:
IOException
-
toString
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:
IOException- if unable to read the path (or handle the charset)
-
toString
Deprecated.Read input stream to string.- Parameters:
in- the stream to read from (until EOF)- Returns:
- the String parsed from stream (default Charset)
- Throws:
IOException- if unable to read the stream (or handle the charset)
-
toString
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:
IOException- if unable to read the stream (or handle the charset)
-
toString
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:
IOException- if unable to read the stream (or handle the charset)
-
toString
Deprecated.Read input stream to string.- Parameters:
in- the reader to read from (until EOF)- Returns:
- the String parsed from the reader
- Throws:
IOException- if unable to read the stream (or handle the charset)
-
delete
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
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
Deprecated.Closes an arbitrary closable, and logs exceptions at ignore level- Parameters:
closeable- the closeable to close
-
close
Deprecated.closes an input stream, and logs exceptions- Parameters:
is- the input stream to close
-
close
Deprecated.closes an output stream, and logs exceptions- Parameters:
os- the output stream to close
-
close
Deprecated.closes a reader, and logs exceptions- Parameters:
reader- the reader to close
-
close
Deprecated.closes a writer, and logs exceptions- Parameters:
writer- the writer to close
-
readBytes
Deprecated.- Throws:
IOException
-
write
public static long write(GatheringByteChannel out, ByteBuffer[] buffers, int offset, int length) throws 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:
IOException- if unable write to the GatheringByteChannel
-
getNullStream
Deprecated.- Returns:
- An outputstream to nowhere
-
getClosedStream
Deprecated.- Returns:
- An outputstream to nowhere
-
getNullWriter
Deprecated.- Returns:
- An writer to nowhere
-
getNullPrintWriter
Deprecated.- Returns:
- An writer to nowhere
-