Class FileDevice

  • All Implemented Interfaces:
    Device

    public class FileDevice
    extends java.lang.Object
    implements Device
    Provides a way of writing the files transmitted using the Device interface to files
    Author:
    Joel HÃ¥kansson
    • Constructor Summary

      Constructors 
      Constructor Description
      FileDevice​(java.io.File parent)
      Creates a new FileDevice, using the supplied settings.
      FileDevice​(java.io.File parent, java.lang.String prefix)
      Creates a new FileDevice, using the supplied settings.
      FileDevice​(java.io.File parent, java.lang.String prefix, java.lang.String suffix)
      Creates a new FileDevice, using the supplied settings.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void transmit​(java.io.File file)
      Transmits a file to the Device
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FileDevice

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

        public FileDevice​(java.io.File parent,
                          java.lang.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:
        java.lang.IllegalArgumentException - if parent is not a directory
      • FileDevice

        public FileDevice​(java.io.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:
        java.lang.IllegalArgumentException - if parent is not a directory
    • Method Detail

      • transmit

        public void transmit​(java.io.File file)
                      throws javax.print.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:
        javax.print.PrintException