org.openstreetmap.osmosis.core.apidb.v0_6.impl
Class ReplicationSequenceFormatter

java.lang.Object
  extended by org.openstreetmap.osmosis.core.apidb.v0_6.impl.ReplicationSequenceFormatter

public class ReplicationSequenceFormatter
extends java.lang.Object

Formats replication sequence numbers into file names.


Constructor Summary
ReplicationSequenceFormatter(int minimumLength, int groupingLength)
          Creates a new instance.
 
Method Summary
 java.lang.String getFormattedName(long sequenceNumber, java.lang.String fileNameSuffix)
          Formats the sequence number into a file name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReplicationSequenceFormatter

public ReplicationSequenceFormatter(int minimumLength,
                                    int groupingLength)
Creates a new instance.

Parameters:
minimumLength - The minimum length file sequence string to generate. For example, setting a length of 2 will generate sequence numbers from "00" to "99".
groupingLength - The number of characters to write before separating with a '/' character. Used for creating sequence numbers to be written to files in a nested directory structure.
Method Detail

getFormattedName

public java.lang.String getFormattedName(long sequenceNumber,
                                         java.lang.String fileNameSuffix)
Formats the sequence number into a file name. Any sub-directories required will be automatically created.

Parameters:
sequenceNumber - The sequence number.
fileNameSuffix - The suffix to append to the end of the file name.
Returns:
The formatted file name.