|
Sun Adapter for Batch/FTP | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.stc.connector.batchadapter.util.FtpDirRegExp
public class FtpDirRegExp
Provides support for FTP directory name regular expressions. The input is a full directory name made up of some regular expressions, while the output is a set of directories that are qualified against the regular expressions. Use the following rules for FTP directory regular expressions:
(1). The directory root, the directory separators should be expressed exclusively, don't express them in regexp. Only directory names are expected to appear as regexp.
(2). Regexp shouldn't go over the directory separators. So between any two directory separators, it would be one whole regexp.
(3). Escape all directory separators in directory pattern if the separator conflicts with regexp special character (one of "*[]()|+{}:.^$?\"). According to FtpHeuristics, the possible directory separators are '\', '/' and '.'. Among them, '\' and '.' are special characters used in regexp. So '\' and '.' should be escaped as "\\" and "\.".
(4). For some ftp servers (for example, MVS PDS, MVS Sequential and MVS GDG), no directory root indicator. In fact, the directory concept is not very clear, a dataset has prefix and name. We will not know if the directory is absolute or relative directory. We will always assume the directory is absolute. So the directory root (the part before the first directory separator) should be expressed exclusively. For example, root\.regexp1\.regexp2.
The expected directory pattern would be like
(1). /regexp1/regexp2/regexp3... (Unix), for example /abc\d/def/ghi (\d means any digit char) /^PRE[0-9]{5}\.dat$/... (Begin with "PRE" followed by a 5 digit number, with a "dat" extension. "\." means a real char '.' instead of any char. So PRE12345.dat will match, PRE123456dat will not match.)
(2). root\.regexp1\.regexp2... (MVS) (\. is escaped dir separator), for example EGATEX\.STC\.SAMPLE ("EGATEX" is not regexp, "STC" and "SAMPLE" are regexps).
(3). \\regexp1\\regexp2\\regexp3... (NT), for example \\abc.efg\\123.456 ('.' means any char).
(4). [regexp1\.regexp2\.regexp3... (VMS) (\. is escaped dir separator), for example [a.b\.c.d\.efg ('.'. in "a.b" or "c.d" is regexp char, means any char).
Field Summary |
---|
Fields inherited from interface com.stc.connector.batchadapter.util.DirRegExp |
---|
regExpChars |
Constructor Summary | |
---|---|
FtpDirRegExp(java.lang.String dirPattern,
java.lang.String style,
DirectoryProvider dp)
Constructs an object based on the FtpDirRegExp class. |
Method Summary | |
---|---|
java.util.ArrayList |
getDirs()
Get the directory names. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FtpDirRegExp(java.lang.String dirPattern, java.lang.String style, DirectoryProvider dp) throws java.lang.Exception
dirPattern
- The directory pattern that is made up of directory regular expressions.ftp
- An instance of the FtpFileProvider object.
java.lang.Exception
Method Detail |
---|
public java.util.ArrayList getDirs() throws java.lang.Exception
getDirs
in interface DirRegExp
java.lang.Exception
- If some error occurs.
|
Sun Adapter for Batch/FTP | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |