H
heribert_m
Gast
Hallo @ all!
Ich habe ein kleines Problem. In der Methode splitText lasse ich mir einen String in einzelne Tokens zerlegen. Die einzelnen Tokens möchte ich in der Methode getFtpClient als login übergeben. Hier
ftpClient.login(strcount[0] ,strcount[1]);
gibt es jedoch eine NullpointerException. Was mache ich denn falsch? Kann mir jemand helfen?
Grüße
heribert_m
Ich habe ein kleines Problem. In der Methode splitText lasse ich mir einen String in einzelne Tokens zerlegen. Die einzelnen Tokens möchte ich in der Methode getFtpClient als login übergeben. Hier
ftpClient.login(strcount[0] ,strcount[1]);
gibt es jedoch eine NullpointerException. Was mache ich denn falsch? Kann mir jemand helfen?
Grüße
heribert_m
Code:
public String[] splitText(String messageText)
{
StringTokenizer str = new StringTokenizer(messageText);
String strcount[] = new String [6];
int count = 0;
while(str.hasMoreTokens())
{
strcount[count] = str.nextToken();
++count;
}
return (strcount);
}
/**
* Create and logon to ftp client
* @param strcount contains login information
*
* @return logged on ftp client.
* @throws SocketException
* @throws IOException
*/
public FTPClient getFtpClient(String[] strcount) throws SocketException, IOException
{
if(ftpClient == null)
{
ftpClient = new FTPClient();
ftpClient.connect(Default_FTP_NAME, Default_FTP_Port_Number);
ftpClient.login(strcount[0] ,strcount[1]);