Class ClasUtilsFile

java.lang.Object
org.jlab.utils.system.ClasUtilsFile

public class ClasUtilsFile extends Object
Author:
gavalian
  • Constructor Details Link icon

    • ClasUtilsFile Link icon

      public ClasUtilsFile()
  • Method Details Link icon

    • getName Link icon

      public static String getName()
    • printLog Link icon

      public static void printLog(String log)
      prints a log message with the module name included.
      Parameters:
      log -
    • getResourceDir Link icon

      public static String getResourceDir(String env, String rpath)
      returns package resource directory with given enviromental variable and relative path.
      Parameters:
      env -
      rpath -
      Returns:
    • getFileList Link icon

      public static List<String> getFileList(String directory)
      returns list of files in the directory. absolute path is given. This function will not exclude ".*" and "*~" files.
      Parameters:
      directory -
      Returns:
    • getFileList Link icon

      public static List<String> getFileList(String env, String rpath)
      returns list of files in the directory defined by environment variable and a relative path.
      Parameters:
      env -
      rpath -
      Returns:
    • getFileList Link icon

      public static List<String> getFileList(String env, String rpath, String ext)
      returns a file list that contains files with given extension
      Parameters:
      env -
      rpath -
      ext -
      Returns:
    • writeFile Link icon

      public static void writeFile(String filename, List<String> lines)
    • readFile Link icon

      public static List<String> readFile(String filename)
      Reads a text file into a list of strings
      Parameters:
      filename -
      Returns:
    • readFileString Link icon

      public static String readFileString(String filename)
      Reads a text file into one string.
      Parameters:
      filename -
      Returns:
    • getFileNamesRelative Link icon

      public static List<String> getFileNamesRelative(List<String> files)
      Returs relative paths of file names from list of absolute paths.
      Parameters:
      files -
      Returns:
    • createFileName Link icon

      public static String createFileName(String filename, String addition, boolean preservePath)
      returns a new file name which is composed of the file name given and then by adding given string to it. if flag preservePath is true, then file name will have the same path as the original file name.
      Parameters:
      filename -
      addition -
      preservePath -
      Returns:
    • main Link icon

      public static void main(String[] args)