com.myjavaworld.ftp
Class DosListParser

java.lang.Object
  extended by com.myjavaworld.ftp.DosListParser
All Implemented Interfaces:
ListParser

public class DosListParser
extends java.lang.Object
implements ListParser

An implementation of ListParser interface used to parse the directory listing of FTP servers, which produce the output in MS-DOS format.

Version:
2.0
Author:
Sai Pullabhotla, psai [at] jMethods [dot] com

Constructor Summary
DosListParser()
           
 
Method Summary
 RemoteFile createRemoteFile(RemoteFile parent, java.lang.String name)
          Creates a RemoteFile object
 RemoteFile createRemoteFile(RemoteFile parent, java.lang.String name, boolean dir)
          Creates a RemoteFile object.
 RemoteFile createRemoteFile(java.lang.String path)
          Creates a RemoteFile object.
 RemoteFile createRemoteFile(java.lang.String path, boolean dir)
          Creates a RemoteFile object.
 RemoteFile createRemoteFile(java.lang.String parent, java.lang.String name)
          Creates a RemoteFile object.
 RemoteFile createRemoteFile(java.lang.String parent, java.lang.String name, boolean dir)
          Creates a RemoteFile object.
 java.lang.String getDescription()
          Returns the description of this parser.
 java.lang.String getName()
          Gets the name of this ListParser
 java.lang.String getVendor()
          Gets the vendor name of this parser.
 java.lang.String getVersion()
          Gets the version of this parser.
 RemoteFile parse(RemoteFile parent, java.lang.String rawData)
          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

DosListParser

public DosListParser()
Method Detail

parse

public RemoteFile parse(RemoteFile parent,
                        java.lang.String rawData)
                 throws java.text.ParseException
Description copied from interface: ListParser
Parses a line of output in to a RemoteFile object.

Specified by:
parse in interface ListParser
Parameters:
parent - Parent directory.
rawData - a line of output from the LIST command.
Returns:
RemoteFile object.
Throws:
java.text.ParseException - if the rawData can not be parsed by this ListParser.

createRemoteFile

public RemoteFile createRemoteFile(java.lang.String path)
Description copied from interface: ListParser
Creates a RemoteFile object. The created object will be marked as a directory.

Specified by:
createRemoteFile in interface ListParser
Parameters:
path - Absolute path name
Returns:
RemoteFile object.

createRemoteFile

public RemoteFile createRemoteFile(java.lang.String path,
                                   boolean dir)
Description copied from interface: ListParser
Creates a RemoteFile object.

Specified by:
createRemoteFile in interface ListParser
Parameters:
path - Absolute path name
dir - If this is true, the created object will be marked as a directory. Otherwise, a file.
Returns:
RemoteFile object.

createRemoteFile

public RemoteFile createRemoteFile(java.lang.String parent,
                                   java.lang.String name)
Description copied from interface: ListParser
Creates a RemoteFile object.

Specified by:
createRemoteFile in interface ListParser
Parameters:
parent - Parent file
name - Name of the file The created object will be marked as a directory.
Returns:
RemoteFile object.

createRemoteFile

public RemoteFile createRemoteFile(java.lang.String parent,
                                   java.lang.String name,
                                   boolean dir)
Description copied from interface: ListParser
Creates a RemoteFile object.

Specified by:
createRemoteFile in interface ListParser
Parameters:
parent - Parent file
name - Name of the file
dir - If this is true, the created object will be marked as a directory. Otherwise, a file.
Returns:
RemoteFile object.

createRemoteFile

public RemoteFile createRemoteFile(RemoteFile parent,
                                   java.lang.String name)
Description copied from interface: ListParser
Creates a RemoteFile object

Specified by:
createRemoteFile in interface ListParser
Parameters:
parent - Parent file
name - Name of the file
Returns:
RemoteFile object.

createRemoteFile

public RemoteFile createRemoteFile(RemoteFile parent,
                                   java.lang.String name,
                                   boolean dir)
Description copied from interface: ListParser
Creates a RemoteFile object.

Specified by:
createRemoteFile in interface ListParser
Parameters:
parent - Parent file
name - Name of the file
Returns:
RemoteFile object.

getName

public java.lang.String getName()
Description copied from interface: ListParser
Gets the name of this ListParser

Specified by:
getName in interface ListParser
Returns:
Name of this parser.

getDescription

public java.lang.String getDescription()
Description copied from interface: ListParser
Returns the description of this parser.

Specified by:
getDescription in interface ListParser
Returns:
Description

getVendor

public java.lang.String getVendor()
Description copied from interface: ListParser
Gets the vendor name of this parser.

Specified by:
getVendor in interface ListParser
Returns:
Vendor name.

getVersion

public java.lang.String getVersion()
Description copied from interface: ListParser
Gets the version of this parser.

Specified by:
getVersion in interface ListParser
Returns:
Version number of this parser.