Class FileInterfaceWriter

java.lang.Object
ch.software_atelier.simpleflex.interfaces.file.FileInterfaceWriter

public class FileInterfaceWriter extends Object
  • Field Details

    • ERRORCODE_TIMEOUT_EXPIERD

      public static int ERRORCODE_TIMEOUT_EXPIERD
      returned by reason() if the timeout between writing and reading by the Server-Interface is expired.
    • ERRORCODE_FILE_ALREADY_EXISTS

      public static int ERRORCODE_FILE_ALREADY_EXISTS
      returned by reason() if the file was already existing on calling execute().
    • ERRORCODE_IOEXCEPTION

      public static int ERRORCODE_IOEXCEPTION
      returned by reason() if
    • ERRORCODE_EVERYTHING_OK

      public static int ERRORCODE_EVERYTHING_OK
      returned by reason() if everything was OK
  • Constructor Details

    • FileInterfaceWriter

      public FileInterfaceWriter(File dst)
      Creates a New Instance of FileInterfaceWriter.
      This class is used to simplify the write-process of
      standard interface commands.
      Parameters:
      dst - Where to white the File. It's the same Path as specified in the main-config of simpleflex.
  • Method Details

    • addCommand

      public void addCommand(String classPath, String[][] args)
      Adds a Command that is needed to execute over FileInterface.
      Parameters:
      classPath - The classpath to the needed fileinterface
      args - The arguments that
    • execute

      public boolean execute()
      Writes the fileinterface file. It waits until the file is deleted (which means, That the File was defently readed by the Server) or till the timeout expires. But there is no warrenty, that all tasks are processed! To be shore, ask the logfile...
      Returns:
      true, if the File was successful written and deleted.
      On false, errorReason() gives more details.
    • errorReason

      public int errorReason()
      Returns the reason of returning false in calling execute() the last time.
      Returns: