|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ListParser
A contract for classes that are used to parse the directory listing produced by an FTP server. Since different FTP servers produce the listing in different formats, this interface helps switch between List parsers.
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. |
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 rawData)
Parses a line of output in to a RemoteFile object. |
Method Detail |
---|
RemoteFile[] parse(RemoteFile parent, BufferedReader reader) throws ParseException, IOException
parent
- 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
- propagatedRemoteFile parse(RemoteFile parent, String rawData) throws ParseException
RemoteFile
object.
parent
- Parent directory.rawData
- a line of output from the LIST command.
ParseException
- if the rawData can not be parsed by this ListParser.RemoteFile createRemoteFile(String path)
RemoteFile
object. The created object will be
marked as a directory.
path
- Absolute path name
RemoteFile createRemoteFile(String path, boolean dir)
RemoteFile
object.
path
- Absolute path namedir
- If this is true
, the created object will be
marked as a directory. Otherwise, a file.
RemoteFile createRemoteFile(String parent, String name)
RemoteFile
object.
parent
- Parent filename
- Name of the file The created object will be marked as a
directory.
RemoteFile createRemoteFile(String parent, String name, boolean dir)
RemoteFile
object.
parent
- Parent filename
- Name of the filedir
- If this is true
, the created object will be
marked as a directory. Otherwise, a file.
RemoteFile createRemoteFile(RemoteFile parent, String name)
RemoteFile
object
parent
- Parent filename
- Name of the file
RemoteFile createRemoteFile(RemoteFile parent, String name, boolean dir)
RemoteFile
object.
parent
- Parent filename
- Name of the filedir
- , if this is true
, the created object will be
marked as a directory. Otherwise a file.
String getName()
ListParser
String getDescription()
String getVendor()
String getVersion()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |