Class IOUtil


  • public class IOUtil
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static org.apache.commons.logging.Log logger  
    • Constructor Summary

      Constructors 
      Constructor Description
      IOUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String cleanFilename​(java.lang.String filename)  
      private static void createDirs​(java.io.File dir)  
      static void deleteFile​(java.io.File f)  
      static java.io.File getDirectoryFile​(java.lang.String directory)  
      static java.io.FileOutputStream getFileOutPutStream​(java.lang.String target, boolean createDirectories)  
      static java.io.File[] getFiles​(java.io.File dir, java.util.List<java.lang.String> allowedExtensions, java.util.List<java.lang.String> excludedExtensions)  
      static java.io.OutputStreamWriter getOutPutStreamWriter​(java.lang.String target, boolean createDirectories, java.lang.String charsetName)  
      static java.lang.String getTransferRate​(int bytes, ProfilerStub stub)  
      private static java.lang.String getTransferRate​(long bytesPerSecond)  
      static java.io.File getUnique​(java.io.File dir, java.lang.String filename)  
      static void handleError​(java.io.File file, java.lang.String errorDirectory)  
      static java.io.File moveFile​(java.io.File src, java.io.File dest, boolean overwrite)  
      private static void moveFileAtomic​(java.io.File src, java.io.File dest, boolean overwrite)  
      • Methods inherited from class java.lang.Object

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

      • logger

        private static final org.apache.commons.logging.Log logger
    • Constructor Detail

      • IOUtil

        public IOUtil()
    • Method Detail

      • getOutPutStreamWriter

        public static java.io.OutputStreamWriter getOutPutStreamWriter​(java.lang.String target,
                                                                       boolean createDirectories,
                                                                       java.lang.String charsetName)
                                                                throws java.io.IOException
        Throws:
        java.io.IOException
      • getFileOutPutStream

        public static java.io.FileOutputStream getFileOutPutStream​(java.lang.String target,
                                                                   boolean createDirectories)
                                                            throws java.io.IOException
        Throws:
        java.io.IOException
      • getDirectoryFile

        public static java.io.File getDirectoryFile​(java.lang.String directory)
                                             throws java.io.IOException
        Throws:
        java.io.IOException
      • getTransferRate

        public static java.lang.String getTransferRate​(int bytes,
                                                       ProfilerStub stub)
      • getTransferRate

        private static java.lang.String getTransferRate​(long bytesPerSecond)
      • getUnique

        public static java.io.File getUnique​(java.io.File dir,
                                             java.lang.String filename)
      • cleanFilename

        public static java.lang.String cleanFilename​(java.lang.String filename)
      • moveFile

        public static java.io.File moveFile​(java.io.File src,
                                            java.io.File dest,
                                            boolean overwrite)
                                     throws java.io.IOException
        Throws:
        java.io.IOException
      • moveFileAtomic

        private static void moveFileAtomic​(java.io.File src,
                                           java.io.File dest,
                                           boolean overwrite)
                                    throws java.io.IOException
        Throws:
        java.io.IOException
      • createDirs

        private static void createDirs​(java.io.File dir)
                                throws java.io.IOException
        Throws:
        java.io.IOException
      • deleteFile

        public static void deleteFile​(java.io.File f)
                               throws java.io.IOException
        Throws:
        java.io.IOException
      • getFiles

        public static java.io.File[] getFiles​(java.io.File dir,
                                              java.util.List<java.lang.String> allowedExtensions,
                                              java.util.List<java.lang.String> excludedExtensions)