org.jplate.foundation.util
Class Cleanup

java.lang.Object
  extended by org.jplate.foundation.util.Cleanup

public final class Cleanup
extends java.lang.Object

Provides common cleanup code for things like streams, database connections, etc. When cleaning up, exception are silently ignored.

Modifications:
    $Date: 2008-12-02 12:32:45 -0500 (Tue, 02 Dec 2008) $
    $Revision: 479 $
    $Author: sfloess $
    $HeadURL: https://jplate.svn.sourceforge.net/svnroot/jplate/trunk/src/dev/java/org/jplate/foundation/util/Cleanup.java $
    


Constructor Summary
Cleanup()
           
 
Method Summary
static void close(java.sql.Connection connection)
          Close the connection, connection if it is not null.
static void close(java.sql.Connection connection, java.sql.Statement statement)
          Close the connection, connection, and statement, statement, if not null.
static void close(java.sql.Connection connection, java.sql.Statement statement, java.sql.ResultSet resultSet)
          Close the connection, connection, statement, statement, and result set, resultSet, if not null.
static void close(java.io.InputStream inputStream)
          Close the input stream, inputStream if not null.
static void close(java.io.OutputStream outputStream)
          Close the output stream, outputStream if not null.
static void close(java.io.Reader reader)
          Close the reader, reader if not null.
static void close(java.sql.ResultSet resultSet)
          Close the result set, resultSet if it is not null.
static void close(java.sql.Statement statement)
          Close the statement, statement if it is not null.
static void close(java.io.Writer writer)
          Close the writer, writer if not null.
static void closeCommit(java.sql.Connection connection)
          Close the connection, connection if it is not null.
static void closeFlushed(java.io.OutputStream outputStream)
          Close the output stream, outputStream if not null.
static void closeFlushed(java.io.Writer writer)
          Close the writer, writer if not null.
static void closeRollback(java.sql.Connection connection)
          Close the connection, connection if it is not null.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Cleanup

public Cleanup()
Method Detail

closeCommit

public static void closeCommit(java.sql.Connection connection)
Close the connection, connection if it is not null. It will attempt to commit the connection first. Any error is silently ignored.

Parameters:
connection - The connection to close.

closeRollback

public static void closeRollback(java.sql.Connection connection)
Close the connection, connection if it is not null. It will attempt to rollback the connection first. Any error is silently ignored.

Parameters:
connection - The connection to close.

close

public static void close(java.sql.Connection connection)
Close the connection, connection if it is not null. Any error is silently ignored.

Parameters:
connection - The connection to close.

close

public static void close(java.sql.Statement statement)
Close the statement, statement if it is not null. Any error is silently ignored.

Parameters:
statement - The statement to close.

close

public static void close(java.sql.ResultSet resultSet)
Close the result set, resultSet if it is not null. Any error is silently ignored.

Parameters:
resultSet - The result set to close.

close

public static void close(java.sql.Connection connection,
                         java.sql.Statement statement)
Close the connection, connection, and statement, statement, if not null. Any error is silently ignored.

Parameters:
connection - The connection to close.
statement - The statement to close.

close

public static void close(java.sql.Connection connection,
                         java.sql.Statement statement,
                         java.sql.ResultSet resultSet)
Close the connection, connection, statement, statement, and result set, resultSet, if not null. Any error is silently ignored.

Parameters:
connection - The connection to close.
statement - The statement to close.
resultSet - The result set to close.

close

public static void close(java.io.Reader reader)
Close the reader, reader if not null. Any error is silently ignored.

Parameters:
reader - The reader set to close.

closeFlushed

public static void closeFlushed(java.io.Writer writer)
Close the writer, writer if not null. All data will be flushed first. Any error is silently ignored.

Parameters:
writer - The writer set to close.

close

public static void close(java.io.Writer writer)
Close the writer, writer if not null. Any error is silently ignored.

Parameters:
writer - The writer set to close.

close

public static void close(java.io.InputStream inputStream)
Close the input stream, inputStream if not null. Any error is silently ignored.

Parameters:
inputStream - The input stream set to close.

closeFlushed

public static void closeFlushed(java.io.OutputStream outputStream)
Close the output stream, outputStream if not null. The output stream will be flushed first. Any error is silently ignored.

Parameters:
outputStream - The output stream set to close.

close

public static void close(java.io.OutputStream outputStream)
Close the output stream, outputStream if not null. Any error is silently ignored.

Parameters:
outputStream - The output stream set to close.