Package com.enterprisedt.net.ftp
Class FTPFileParser
java.lang.Object
com.enterprisedt.net.ftp.FTPFileParser
- Direct Known Subclasses:
MLSXEntryParser,MVSFileParser,NetwareFileParser,OS400FileParser,UnixFileParser,VMSFileParser,WindowsFileParser
Root class of all file parsers
- Version:
- $Revision$
- Author:
- Bruce Blackshaw
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanIgnore date parsing errors -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanDoes this parser parse multiple lines to get one listing?booleanisValidFormat(String[] listing) Valid format for this parserabstract FTPFileParse server supplied stringvoidsetIgnoreDateParseErrors(boolean ignore) Ignore date parse errorsabstract voidSet the locale for date parsing of listingsprotected String[]Splits string consisting of fields separated by whitespace into an array of strings.protected String[]Splits string consisting of fields separated by whitespace into an array of strings.protected String[]Splits string consisting of fields separated by whitespace into an array of strings.protected StringTrim the start of the supplied string
-
Field Details
-
ignoreDateParseErrors
protected boolean ignoreDateParseErrorsIgnore date parsing errors
-
-
Constructor Details
-
FTPFileParser
public FTPFileParser()
-
-
Method Details
-
parse
Parse server supplied string- Parameters:
raw- raw string to parse- Throws:
ParseException
-
setLocale
Set the locale for date parsing of listings- Parameters:
locale- locale to set
-
setIgnoreDateParseErrors
public void setIgnoreDateParseErrors(boolean ignore) Ignore date parse errors- Parameters:
ignore-
-
isValidFormat
Valid format for this parser- Parameters:
listing- listing to test- Returns:
- true if valid
-
isMultiLine
public boolean isMultiLine()Does this parser parse multiple lines to get one listing?- Returns:
-
trimStart
Trim the start of the supplied string- Parameters:
str- string to trim- Returns:
- string trimmed of whitespace at the start
-
split
Splits string consisting of fields separated by whitespace into an array of strings. Yes, we could use String.split() but this would restrict us to 1.4+- Parameters:
str- string to split- Returns:
- array of fields
-
split
Splits string consisting of fields separated by whitespace into an array of strings. Yes, we could use String.split() but this would restrict us to 1.4+- Parameters:
str- string to split- Returns:
- array of fields
-
split
Splits string consisting of fields separated by whitespace into an array of strings. Yes, we could use String.split() but this would restrict us to 1.4+- Parameters:
str- string to split- Returns:
- array of fields
-