Class DataFiles


  • public class DataFiles
    extends Object
    This class contains utility methods on DataFile objects.
    Since:
    2.0
    Author:
    Laurent Jourdren
    • Constructor Detail

      • DataFiles

        public DataFiles()
    • Method Detail

      • copy

        public static void copy​(DataFile input,
                                DataFile output)
                         throws IOException
        Copy a file, if input data is compressed, data will be uncompressed and if output require to be compressed output will be compressed.
        Parameters:
        input - input file
        output - output file.
        Throws:
        IOException - if an error occurs while copying data
      • rawCopy

        public static void rawCopy​(DataFile input,
                                   DataFile output)
                            throws IOException
        Copy a file.
        Parameters:
        input - input file
        output - output file.
        Throws:
        IOException - if an error occurs while copying data
      • symlinkOrCopy

        public static void symlinkOrCopy​(DataFile input,
                                         DataFile output)
                                  throws IOException
        Create a symbolic link if the input and output use the same protocol and if symbolic links are supported by the protocol. If symbolic link cannot be created, the input file will be copied.
        Parameters:
        input - input file
        output - output file
        Throws:
        IOException - if an error occurs while copying data or creating the symbolic link
      • symlinkOrCopy

        public static void symlinkOrCopy​(DataFile input,
                                         DataFile output,
                                         boolean relativize)
                                  throws IOException
        Create a symbolic link if the input and output use the same protocol and if symbolic links are supported by the protocol. If symbolic link cannot be created, the input file will be copied.
        Parameters:
        input - input file
        output - output file
        relativize - relativize the link target path
        Throws:
        IOException - if an error occurs while copying data or creating the symbolic link