org.sonatype.gshell.command
Class IO

java.lang.Object
  extended by org.sonatype.gshell.command.IO
Direct Known Subclasses:
AnsiIO

public class IO
extends Object

Provides access to input/output handles.

Since:
2.0
Author:
Jason Dillon

Nested Class Summary
static class IO.Verbosity
          Defines the valid values of the IO containers verbosity settings.
 
Field Summary
 PrintWriter err
          Error output writer.
 Reader in
          Input reader.
 PrintWriter out
          Output writer.
 StreamSet streams
           
 
Constructor Summary
IO()
          Helper which uses current values from StreamSet.system().
IO(StreamSet streams, boolean autoFlush)
           
IO(StreamSet streams, Reader in, PrintWriter out, PrintWriter err, boolean autoFlush)
           
 
Method Summary
 void close()
          Close all streams.
protected  Reader createReader(InputStream in)
           
protected  PrintWriter createWriter(PrintStream out, boolean autoFlush)
           
 void error(Object msg)
           
 void error(String format, Object... args)
           
 void flush()
          Flush both output streams.
 jline.Terminal getTerminal()
           
 IO.Verbosity getVerbosity()
          Returns the verbosity level.
 boolean isNormal()
           
 boolean isQuiet()
           
 boolean isSilent()
           
 void println(Object msg)
           
 void println(String format, Object... args)
           
 void setVerbosity(IO.Verbosity verbosity)
          Set the verbosity level.
 void warn(Object msg)
           
 void warn(String format, Object... args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

streams

public final StreamSet streams

in

public final Reader in
Input reader.


out

public final PrintWriter out
Output writer.


err

public final PrintWriter err
Error output writer.

Constructor Detail

IO

public IO(StreamSet streams,
          boolean autoFlush)

IO

public IO(StreamSet streams,
          Reader in,
          PrintWriter out,
          PrintWriter err,
          boolean autoFlush)

IO

public IO()
Helper which uses current values from StreamSet.system().

Method Detail

createReader

protected Reader createReader(InputStream in)

createWriter

protected PrintWriter createWriter(PrintStream out,
                                   boolean autoFlush)

flush

public void flush()
Flush both output streams.


close

public void close()
           throws IOException
Close all streams.

Throws:
IOException

getTerminal

public jline.Terminal getTerminal()

setVerbosity

public void setVerbosity(IO.Verbosity verbosity)
Set the verbosity level.


getVerbosity

public IO.Verbosity getVerbosity()
Returns the verbosity level.


isNormal

public boolean isNormal()
Since:
2.5

isQuiet

public boolean isQuiet()

isSilent

public boolean isSilent()

println

public void println(Object msg)
Since:
2.5

println

public void println(String format,
                    Object... args)
Since:
2.5

warn

public void warn(Object msg)

warn

public void warn(String format,
                 Object... args)

error

public void error(Object msg)

error

public void error(String format,
                  Object... args)


Copyright © 2008-2011 Sonatype. All Rights Reserved.