commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christopher Yeleighton (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (NET-528) FTPListParseEngine does not provide access to raw responses
Date Sat, 05 Apr 2014 18:51:15 GMT

    [ https://issues.apache.org/jira/browse/NET-528?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13961198#comment-13961198
] 

Christopher Yeleighton edited comment on NET-528 at 4/5/14 6:51 PM:
--------------------------------------------------------------------

{code}
public class StealFTPFileEntryParser implements FTPFileEntryParser
{
BufferedWriter cache;
@Override
public String readNextEntry(BufferedReader reader) throws IOException
{
// TODO: Implement this method
char [] buffer = new char [0400]; 
for ( ; ; ){
final int count = reader .read (buffer, 0, buffer .length); 
if (count > 0) cache .write(buffer, 0, count); else break;
} 
return null;
}

@Override
public FTPFile parseFTPEntry(String p1)
{
// TODO: Implement this method
return null;
}

@Override
public List<String> preParse(List<String> p1)
{
// TODO: Implement this method
return null;
}

};
{code}



was (Author: yecril71pl):
{code}
public class StealFTPFileEntryParser implements FTPFileEntryParser
{
BufferedWriter cache;

	@Override
	public String readNextEntry(BufferedReader reader) 
	throws IOException
	{
		// TODO: Implement this method

		char [] buffer = new char [0400]; 
		
		for ( ; ; ){
			final int count = reader .read (buffer, 0, buffer .length); 
			if (count > 0) cache .write(buffer, 0, count); else break;
		} 
		return null;
	}

	@Override
	public FTPFile parseFTPEntry(String p1)
	{
		// TODO: Implement this method
		return null;
	}

	@Override
	public java .util .List<String> preParse(java .util .List<String> p1)
	{
		// TODO: Implement this method
		return null;
	}

};
{code}


> FTPListParseEngine does not provide access to raw responses
> -----------------------------------------------------------
>
>                 Key: NET-528
>                 URL: https://issues.apache.org/jira/browse/NET-528
>             Project: Commons Net
>          Issue Type: Improvement
>            Reporter: Sebb
>
> The FTPListParseEngine class reads the responses from the server and stores the lines
in a list during the preparse phase.
> The parse phase creates the FTPFile entries from the raw strings. However, if parsing
fails, nothing is returned. There is currently no way to access the unparsed string that failed
the parsing.
> It would be useful to provide this access somehow.
> The FTPFile class does include the unparsed entry as one of its fields.
> However, currently the expectation is that only parsed entries will be returned, so it
would be necessary to add a configuration option for the engine. This would probably need
to be an FTPClient option that could be passed to the engine on construction or perhaps as
a getFiles() parameter.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message