//==============================================================================
// FTPResponse.java
//==============================================================================
package tribble.net.ftp;
// System imports
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 $Revision: 1.2 $ $Date: 2006/04/16 02:00:30 $
* @since 2006-03-16
* @author
* David R. Tribble
* (david@tribble.com).
*
*
* Copyright ©2006 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
{
// Identification
/** Revision information. */
static final String REV =
"@(#)tribble/net/ftp/FTPResponse.java $Revision: 1.2 $ $Date: 2006/04/16 02:00:30 $\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()
{
// Initialize
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// 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');
super.finalize();
}
}
// End FTPResponse.java