Class FileHelper


  • public class FileHelper
    extends java.lang.Object
    Helper class for access to files
    • Constructor Summary

      Constructors 
      Constructor Description
      FileHelper()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.ArrayList<java.lang.String> filterOutFiles​(android.content.Context context, java.util.List<java.lang.String> paths)
      Remove from path list invalid paths like empty or incorrect paths or not existing files
      static java.lang.String getFileExtension​(java.io.File file)
      Get file extension
      static boolean isFileExists​(java.lang.String absoluteFilePath)
      Check does file exist
      static java.lang.String readFile​(java.io.File file)  
      • Methods inherited from class java.lang.Object

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

      • FileHelper

        public FileHelper()
    • Method Detail

      • filterOutFiles

        public static java.util.ArrayList<java.lang.String> filterOutFiles​(android.content.Context context,
                                                                           java.util.List<java.lang.String> paths)
        Remove from path list invalid paths like empty or incorrect paths or not existing files
        Parameters:
        context - application context
        paths - list of paths to files
        Returns:
        filtered list of file paths
      • getFileExtension

        public static java.lang.String getFileExtension​(java.io.File file)
        Get file extension
        Parameters:
        file - file whose extension will be returned
        Returns:
        file extension
      • isFileExists

        public static boolean isFileExists​(java.lang.String absoluteFilePath)
        Check does file exist
        Parameters:
        absoluteFilePath - absolute path to the file to be checked
        Returns:
        true if file exists
      • readFile

        public static java.lang.String readFile​(java.io.File file)