Class FileUtil

java.lang.Object
org.eclipse.epsilon.egl.util.FileUtil

public abstract class FileUtil extends Object
  • Field Details

    • FILE_SEP

      public static final String FILE_SEP
    • NEWLINE

      public static final String NEWLINE
    • ESCAPED_NEWLINE

      public static final String ESCAPED_NEWLINE
  • Method Details

    • resolve

      public static String resolve(String path, File parent)
      Returns the absolute path for the given path. The given path may be relative, in which case it is resolved using parent as its parent path. If parent is null, the path is resolved using the default relative path (typically the directory from which the JVM was launched).
      Parameters:
      path - a relative or absolute path.
      parent - the parent directory to use when resolving a relative path.
      Returns:
      The absolute path for the given path.
      Throws:
      NullPointerException - when path is null
    • readIfExists

      public static String readIfExists(File file) throws IOException
      Returns:
      null if the file doesn't exist
      Throws:
      IOException
    • read

      public static String read(File file) throws IOException
      Throws:
      IOException
    • write

      public static void write(String path, String contents) throws IOException
      Throws:
      IOException
    • write

      public static void write(String path, String contents, boolean append) throws IOException
      Throws:
      IOException
    • write

      public static void write(File file, String contents) throws IOException
      Throws:
      IOException
    • write

      public static void write(File file, String contents, boolean append) throws IOException
      Throws:
      IOException