|
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.NamePattern
public class NamePattern
Provides utilities for the Batch e*Way's file-name expansion feature. You must use the percent symbol (%) to indicate any special character that needs to be expanded. The characters %% indicate the escaped character %. For example, abc%%d means abc%d, and %d is not expanded again.
The e*Way provides the following types of name expansions:
1. Time stamps (%[GyMdhHmsSEDFwWakKz]). The e*Way uses the Java simple date/time format. For example, abc%y%y%y%y means abc2001.
2. Sequence number (%#, %5#). For example, abc%# means abc1, abc2, abc3, etc. abc%5# (zero padded) means abc00001, abc00002, abc00003, ..., abc00010, ..., abc00100, etc.
3. Working file name replacement (%f). Normally, it is used for RenameOrArchiveName. For example, %f.abc means working_filename.abc.
Here are some additional examples:
abc.%y%y%y%y%M%M%d%d.%h%h%m%m%s%s%S%S%S means abc.20011112.162532678
abc%#.def%# means abc2.def3
%f.%# means xxxxx.4, xxxxx.5, ... (where xxxxx is the working file name).
Constructor Summary | |
---|---|
NamePattern(java.lang.String rawFileName)
Constructs a new NamePattern object. |
Method Summary | |
---|---|
java.lang.String |
expand()
This method is exposed to other classes for them to call. |
java.lang.String |
getFileNameFromEgate()
Gets the original working file name (used for pattern %f). |
long |
getMaxSeqNo()
Gets the max sequence number. |
long |
getSeqNo()
Gets the current sequence number. |
long |
getStartSeqNo()
Gets the start sequence number. |
static void |
main(java.lang.String[] args)
Used to do stand-alone testing. |
void |
setFileNameFromEgate(java.lang.String newFileNameFromEgate)
Sets the start sequence number. |
void |
setMaxSeqNo(long newMaxSeqNo)
Sets the max sequence number. |
void |
setSeqNo(long sequenceNo)
Sets the sequence number. |
void |
setStartSeqNo(long newStartSeqNo)
Sets the start sequence number. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NamePattern(java.lang.String rawFileName)
rawFileName
- The file name that needs to be expanded.Method Detail |
---|
public static void main(java.lang.String[] args) throws java.lang.Exception
args
- Command line parameters.
java.lang.Exception
- If some error occurs.public java.lang.String expand() throws java.lang.Exception
java.lang.Exception
- If some error occurs.public long getMaxSeqNo()
public long getStartSeqNo()
public void setMaxSeqNo(long newMaxSeqNo)
newMaxSeqNo
- The max sequence number.public void setStartSeqNo(long newStartSeqNo)
newMaxSeqNo
- The start sequence number.public void setFileNameFromEgate(java.lang.String newFileNameFromEgate)
newFileNameFromEgate
- The working file name from eGate.public java.lang.String getFileNameFromEgate()
public long getSeqNo()
public void setSeqNo(long sequenceNo) throws java.lang.Exception
sequenceNo
- The sequence number.
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 |