Class FileDevice

  • All Implemented Interfaces:
    Device

    public class FileDevice
    extends Object
    implements Device
    Provides a way of writing the files transmitted using the Device interface to files.
    • Constructor Detail

      • FileDevice

        public FileDevice​(File parent,
                          String prefix,
                          String suffix)
        Creates a new FileDevice, using the supplied settings.
        Parameters:
        parent - the parent folder
        prefix - the file prefix
        suffix - the file suffix
        Throws:
        IllegalArgumentException - if parent is not a directory
      • FileDevice

        public FileDevice​(File parent,
                          String prefix)
        Creates a new FileDevice, using the supplied settings. File extension will be ".prn"
        Parameters:
        parent - the parent folder
        prefix - the file prefix
        Throws:
        IllegalArgumentException - if parent is not a directory
      • FileDevice

        public FileDevice​(File parent)
        Creates a new FileDevice, using the supplied settings. File extension will be ".prn" and file prefix will be "job_"
        Parameters:
        parent - the parent folder
        Throws:
        IllegalArgumentException - if parent is not a directory
    • Method Detail

      • transmit

        public void transmit​(File file)
                      throws PrintException
        Description copied from interface: Device
        Transmits a file to the Device.
        Specified by:
        transmit in interface Device
        Parameters:
        file - the file to transmit
        Throws:
        PrintException - if the file could not be transmitted