|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.myjavaworld.ftp.DefaultListParser
public class DefaultListParser
The default implementation of ListParser interface. This parser
parses standard UNIX style listing produced by the FTP servers and converts
them to RemoteFile objects.
| Constructor Summary | |
|---|---|
DefaultListParser()
|
|
| Method Summary | |
|---|---|
RemoteFile |
createRemoteFile(RemoteFile parent,
String name)
Creates a RemoteFile object |
RemoteFile |
createRemoteFile(RemoteFile parent,
String name,
boolean dir)
Creates a RemoteFile object. |
RemoteFile |
createRemoteFile(String path)
Creates a RemoteFile object. |
RemoteFile |
createRemoteFile(String path,
boolean dir)
Creates a RemoteFile object. |
RemoteFile |
createRemoteFile(String parent,
String name)
Creates a RemoteFile object. |
RemoteFile |
createRemoteFile(String parent,
String name,
boolean dir)
Creates a RemoteFile object. |
String |
getDescription()
Returns the description of this parser. |
String |
getName()
Gets the name of this ListParser |
String |
getVendor()
Gets the vendor name of this parser. |
String |
getVersion()
Gets the version of this parser. |
static void |
main(String[] args)
|
RemoteFile[] |
parse(RemoteFile parent,
BufferedReader reader)
Parses the directory listing returned by an FTP server into an array of RemoteFile objects. |
RemoteFile |
parse(RemoteFile parent,
String line)
Parses a line of output in to a RemoteFile object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultListParser()
| Method Detail |
|---|
public RemoteFile[] parse(RemoteFile parent,
BufferedReader reader)
throws ParseException,
IOException
ListParser
parse in interface ListParserparent - the directory whose contents are listedreader - the reader containing the data returned by the server
ParseException - if any error occurs while parsing the directory listing.
IOException - propagated
public RemoteFile parse(RemoteFile parent,
String line)
throws ParseException
ListParserRemoteFile object.
parse in interface ListParserparent - Parent directory.line - a line of output from the LIST command.
ParseException - if the rawData can not be parsed by this ListParser.public RemoteFile createRemoteFile(String path)
ListParserRemoteFile object. The created object will be
marked as a directory.
createRemoteFile in interface ListParserpath - Absolute path name
public RemoteFile createRemoteFile(String path,
boolean dir)
ListParserRemoteFile object.
createRemoteFile in interface ListParserpath - Absolute path namedir - If this is true, the created object will be
marked as a directory. Otherwise, a file.
public RemoteFile createRemoteFile(String parent,
String name)
ListParserRemoteFile object.
createRemoteFile in interface ListParserparent - Parent filename - Name of the file The created object will be marked as a
directory.
public RemoteFile createRemoteFile(String parent,
String name,
boolean dir)
ListParserRemoteFile object.
createRemoteFile in interface ListParserparent - Parent filename - Name of the filedir - If this is true, the created object will be
marked as a directory. Otherwise, a file.
public RemoteFile createRemoteFile(RemoteFile parent,
String name)
ListParserRemoteFile object
createRemoteFile in interface ListParserparent - Parent filename - Name of the file
public RemoteFile createRemoteFile(RemoteFile parent,
String name,
boolean dir)
ListParserRemoteFile object.
createRemoteFile in interface ListParserparent - Parent filename - Name of the filedir - , if this is true, the created object will be
marked as a directory. Otherwise a file.
public String getName()
ListParserListParser
getName in interface ListParserpublic String getDescription()
ListParser
getDescription in interface ListParserpublic String getVendor()
ListParser
getVendor in interface ListParserpublic String getVersion()
ListParser
getVersion in interface ListParser
public static void main(String[] args)
throws ParseException
ParseException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||