org.dmonix.io
Class FileSplitter

java.lang.Object
  extended byorg.dmonix.io.FileSplitter

public abstract class FileSplitter
extends java.lang.Object

Utility class for splitting files into smaller parts.
The most obvious usage is to split large text files, e.g. log files into smaller more manageable parts.

Copyright: Copyright (c) 2004

Version:
1.0
Author:
Peter Nerg

Method Summary
static int getLineCount(java.io.File file)
           
static void splitFile(java.io.File file, int files, boolean compress)
          Splits a single file into the requested amount of parts.
static void splitFile(java.io.File file, long rowsPerFile, boolean compress)
          Splits a single file into the requested amount of parts.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getLineCount

public static int getLineCount(java.io.File file)
                        throws java.io.IOException
Throws:
java.io.IOException

splitFile

public static void splitFile(java.io.File file,
                             int files,
                             boolean compress)
                      throws java.io.IOException
Splits a single file into the requested amount of parts.
The individual files will have the same name as the original files plus a sequence number appended.

Parameters:
file - The file to split
files - The amount of parts to split the file into
compress - If the separate parts are to be compressed using ZIP
Throws:
java.io.IOException

splitFile

public static void splitFile(java.io.File file,
                             long rowsPerFile,
                             boolean compress)
                      throws java.io.IOException
Splits a single file into the requested amount of parts.
The individual files will have the same name as the original files plus a sequence number appended.

Parameters:
file - The file to split
rowsPerFile - The amount of per file
compress - If the separate parts are to be compressed using ZIP
Throws:
java.io.IOException


Copyright © 1998-2005 dmonix.org Peter Nerg, All Rights Reserved.