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

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

public class ReplicationFileSequenceFormatter
extends java.lang.Object

Formats replication sequence numbers into file names.


Constructor Summary
ReplicationFileSequenceFormatter(java.io.File workingDirectory)
          Creates a new instance.
ReplicationFileSequenceFormatter(java.io.File workingDirectory, int minimumLength, int groupingLength)
          Creates a new instance.
 
Method Summary
 java.io.File 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

ReplicationFileSequenceFormatter

public ReplicationFileSequenceFormatter(java.io.File workingDirectory)
Creates a new instance. The minimum length and grouping length will default to 9 and 3 respectively.

Parameters:
workingDirectory - The directory from which to base all created files.

ReplicationFileSequenceFormatter

public ReplicationFileSequenceFormatter(java.io.File workingDirectory,
                                        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.
workingDirectory - The directory from which to base all created files.
Method Detail

getFormattedName

public java.io.File 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.