org.hudsonci.utils.io
Class FileBeheader

java.lang.Object
  extended by org.hudsonci.utils.io.FileBeheader

public class FileBeheader
extends Object

Removes the beginning of a file.

Since:
2.1.0
Author:
Jamie Whitehouse

Constructor Summary
FileBeheader()
           
 
Method Summary
static File chop(File original, long tailToKeep)
          Beware, the original file is modified when chopping; you relinquish all control of the original file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileBeheader

public FileBeheader()
Method Detail

chop

public static File chop(File original,
                        long tailToKeep)
Beware, the original file is modified when chopping; you relinquish all control of the original file. Requires write access to the same directory as the original.

Parameters:
original - the original file
tailToKeep - the number of bytes to keep at the end of the file
Returns:
the original file chopped; for convenience
Throws:
IllegalArgumentException - if original is a directory
IllegalStateException - if some error occurs; it's unreasonable to try and recover from this


Copyright © 2004-2012 Hudson. All Rights Reserved.