flux.file
Interface FtpFileListParser


public interface FtpFileListParser

Contains the methods that a custom FTP file list parser must implement in order to provide FTP actions with the ability to parse non-standard FTP directory listings.

Author:
Copyright 2014 Flux Corporation. All rights reserved.

Method Summary
 boolean isDirectory(java.lang.String line)
          Returns true if the specified line from an FTP file list represents a directory.
 boolean isFile(java.lang.String line)
          Returns true if the specified line from an FTP file list represents a file.
 boolean isHeader(java.lang.String line)
          Returns true if the specified line from an FTP file list is a header line.
 java.lang.String parseForFileName(java.lang.String line)
          Parses the specified line from an FTP file list and returns the file name within the line.
 long parseForFileSize(java.lang.String line)
          Parses the specified line from an FTP file list and returns the file size of the file name within the line.
 java.util.Date parseForTimestamp(java.lang.String line)
          Parses the specified line from an FTP file list and returns the timestamp within the line.
 

Method Detail

isDirectory

boolean isDirectory(java.lang.String line)
Returns true if the specified line from an FTP file list represents a directory. Otherwise, returns false.

Parameters:
line - A line from an FTP file list.
Returns:
true If the specified line from an FTP file list represents a directory. Otherwise, returns false.

isFile

boolean isFile(java.lang.String line)
Returns true if the specified line from an FTP file list represents a file. Otherwise, returns false.

Parameters:
line - A line from an FTP file list.
Returns:
true If the specified line from an FTP file list represents a file. Otherwise, returns false.

isHeader

boolean isHeader(java.lang.String line)
Returns true if the specified line from an FTP file list is a header line. Otherwise, returns false.

Parameters:
line - A line from an FTP file list.
Returns:
true If the specified line from an FTP file list is a header line. Otherwise, returns false.

parseForFileName

java.lang.String parseForFileName(java.lang.String line)
                                  throws java.text.ParseException
Parses the specified line from an FTP file list and returns the file name within the line.

Parameters:
line - A line from an FTP file list.
Returns:
A non-empty and non-null file name within the line.
Throws:
java.text.ParseException - If no file name was found within the line.

parseForFileSize

long parseForFileSize(java.lang.String line)
                      throws java.text.ParseException
Parses the specified line from an FTP file list and returns the file size of the file name within the line.

Parameters:
line - A line from an FTP file list.
Returns:
The file size of the file name within the line.
Throws:
java.text.ParseException - If no file size was found within the line.

parseForTimestamp

java.util.Date parseForTimestamp(java.lang.String line)
                                 throws java.text.ParseException
Parses the specified line from an FTP file list and returns the timestamp within the line.

Parameters:
line - A line from an FTP file list.
Returns:
A non-null timestamp within the line.
Throws:
java.text.ParseException - If no timestamp was found within the line.


© 2014 Flux Corporation. All rights reserved.