Class Strip


  • public class Strip
    extends Object
    Strip Windows (cr/lf) Text files to Unix (cr) Text files
    Version:
    $Id: Strip.java,v 1.2 2006/07/30 00:51:06 jjanke Exp $
    Author:
    Jorg Janke
    • Constructor Detail

      • Strip

        public Strip()
        Constructor
    • Method Detail

      • stripDirectory

        public void stripDirectory​(String directory,
                                   String nameMustContain)
        Strip a directory (and its subdirectories recursively)
        Parameters:
        directory - directory
        nameMustContain - file name must include characters - e.g. .sh (do not include wildcards like *). If null, all files are stripped
      • strip

        public boolean strip​(String infile,
                             String outfile)
        Strip infile to outfile
        Parameters:
        infile - input file
        outfile - (can be null)
        Returns:
        true if copied
      • strip

        public boolean strip​(File infile,
                             File outfile)
        Strip infile to outfile
        Parameters:
        infile - input file
        outfile - if the output file is null, the infile is renamed to ".bak"
        Returns:
        true if copied
      • main

        public static void main​(String[] args)
        Strip file in args
        Parameters:
        args - infile outfile