ariba.util.io
Class FileSort
java.lang.Object
ariba.util.io.FileSort
public class FileSort
- extends java.lang.Object
A utility to sort the contents of a file. The sorting is done in a resource-limited
fashion and is suitable to sort large files. The resource limit is counting lines since the size of a string
in bytes is not straightforward to determine.
Method Summary |
static java.io.File |
sort(java.io.File source,
java.io.File tempDirectory,
java.lang.String encoding)
Convenience method that sorts a file using the default resource limits (200K strings and 10 open file handles max)
and the default string comparator |
static java.io.File |
sort(java.io.File source,
java.io.File tempDirectory,
java.lang.String encoding,
int maxLines,
int maxHandles,
java.util.Comparator<java.lang.String> comparator)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FileSort
public FileSort()
sort
public static java.io.File sort(java.io.File source,
java.io.File tempDirectory,
java.lang.String encoding)
throws java.io.IOException
- Convenience method that sorts a file using the default resource limits (200K strings and 10 open file handles max)
and the default string comparator
- Parameters:
source
- file object pointing to the source file. The source file will not be changedtempDirectory
- directory to store temporary files in. The resulting sorted file will be in this directoryencoding
- encoding of the source file
- Returns:
- file object pointing to the sorted file
- Throws:
java.io.IOException
sort
public static java.io.File sort(java.io.File source,
java.io.File tempDirectory,
java.lang.String encoding,
int maxLines,
int maxHandles,
java.util.Comparator<java.lang.String> comparator)
throws java.io.IOException
- Parameters:
source
- file object pointing to the source file. The source file will not be changedtempDirectory
- directory to store temporary files in. The resulting sorted file will be in this directoryencoding
- encoding of the source filemaxLines
- maximum number of lines concurrently in memorymaxHandles
- maximum number of concurrently open file handlescomparator
- string comparator to be used
- Returns:
- file object pointing to the sorted file
- Throws:
java.io.IOException
AribaWeb User Interface Development Framework
Copyright © 2000-2014 Ariba, Inc. All Rights Reserved.