Class FileUtils


  • public final class FileUtils
    extends java.lang.Object
    File related utilities methods
    Version:
    $Id: FileUtils.java,v 1.3 2004/09/19 20:07:04 thlee Exp $ $Name: $
    Author:
    TiongHiang Lee (thlee@onemindsoft.org)
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.lang.String BSLASH
      the back slash *
      private static java.lang.String FSLASH
      the forward slash *
      private static java.lang.String SEPARATOR
      the separator *
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private FileUtils()
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String concatFilePath​(java.lang.String[] args)
      Concat the strings to be a valid file path
      private static java.lang.String concatFilePath​(java.lang.StringBuffer prefix, java.lang.String suffix)
      concat a meaning file path
      static java.lang.String concatFilePath​(java.lang.String prefix, java.lang.String suffix)
      Concat filepath with the prefix and suffix
      static void copyStream​(java.io.InputStream input, java.io.OutputStream output, int chunkSize)
      Copy the input to the output.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FileUtils

        private FileUtils()
    • Method Detail

      • concatFilePath

        public static java.lang.String concatFilePath​(java.lang.String[] args)
        Concat the strings to be a valid file path
        Parameters:
        args - the string
        Returns:
        the file path
      • concatFilePath

        public static java.lang.String concatFilePath​(java.lang.String prefix,
                                                      java.lang.String suffix)
        Concat filepath with the prefix and suffix
        Parameters:
        prefix - the prefix
        suffix - the suffix
        Returns:
        the file path
      • concatFilePath

        private static java.lang.String concatFilePath​(java.lang.StringBuffer prefix,
                                                       java.lang.String suffix)
        concat a meaning file path
        Parameters:
        prefix - the prefix
        suffix - the suffix
        Returns:
        the concat'ed file path
      • copyStream

        public static void copyStream​(java.io.InputStream input,
                                      java.io.OutputStream output,
                                      int chunkSize)
                               throws java.io.IOException
        Copy the input to the output. Will not close the output after copying
        Parameters:
        input - the input stream
        output - the output
        chunkSize - the chunk size
        Throws:
        java.io.IOException