Enum FileUtils

    • Method Detail

      • values

        public static FileUtils[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (FileUtils c : FileUtils.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static FileUtils valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • expandUserHome

        public static String expandUserHome​(String path)
        Attempts to expand paths that may contain unix-style home shorthand.
        Parameters:
        path - The path
        Returns:
        The path after expanding the home directory, if needed.
      • contentEquals

        public static boolean contentEquals​(File f1,
                                            File f2)
                                     throws IOException
        Return true if the content of both files is the same.
        Parameters:
        f1 - first file
        f2 - second file
        Returns:
        true if the same
        Throws:
        IOException
      • contentEquals

        public static boolean contentEquals​(InputStream is1,
                                            InputStream is2)
                                     throws IOException
        Return true if the content of both streams is the same.
        Parameters:
        is1 - first stream
        is2 - second stream
        Returns:
        true if the same
        Throws:
        IOException
      • copy

        public static long copy​(InputStream source,
                                OutputStream destination)
                         throws IOException
        Copy the contents of the input stream to the output stream.
        Parameters:
        source - input stream
        destination - output stream
        Returns:
        number of bytes read
        Throws:
        IOException