//============================================================================== // FTPResponse.java //============================================================================== package tribble.net.ftp; import java.lang.String; import java.lang.System; import java.lang.Throwable; import java.util.Arrays; import java.util.ArrayList; /******************************************************************************* * Simple FTP command response. * * * @version API 2.0 $Revision: 1.3 $ $Date: 2010/07/12 21:30:44 $ * @since API 1.0, 2006-03-16 * @author David R. Tribble (david@tribble.com). *
* Copyright ©2006-2010 by David R. Tribble, all rights reserved.
* Permission is granted to any person or entity except those designated
* by the United States Department of State as a terrorist, or terrorist
* government or agency, to use and distribute this source code provided
* that the original copyright notice remains present and unaltered.
*
* @see FTPClient
*/
class FTPResponse
{
/** Revision information. */
static final String REV =
"@(#)tribble/net/ftp/FTPResponse.java API 2.0 $Revision: 1.3 $ $Date: 2010/07/12 21:30:44 $\n";
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Variables
/** Command response 3-digit code. */
int m_code;
/** List of command response text lines. */
ArrayList m_lines;
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Constructors
/***************************************************************************
* Default constructor.
*
* @since 1.1, 2006-03-16
*/
FTPResponse()
{ }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Methods
/***************************************************************************
* Retrieve a text line response.
*
* @param n
* The index of the text line to retrieve.
*
* @since 1.1, 2006-03-16
*/
byte[] line(int n)
{
return ((byte[]) m_lines.get(n));
}
/***************************************************************************
* Finalization.
*
* @since 1.1, 2006-03-16
*/
protected void finalize()
throws Throwable
{
int i;
// Clean up
i = m_lines.size();
while (i-- > 0)
Arrays.fill((byte[]) m_lines.get(i), (byte) '\0');
// Cascade
super.finalize();
}
}
// End FTPResponse.java