org.openmobileis.common.util.file
Class ReadWriteFileTransfertManager

java.lang.Object
  extended byorg.openmobileis.common.util.file.ReadWriteFileTransfertManager

public final class ReadWriteFileTransfertManager
extends java.lang.Object

Title: OpenMobileIS project source
Description: Use to transfert command using file between two programs. The first program write a file and why the second to answer. The second read the file and answer in a file. The first read the file and return the content.

Since:
JDK 1.1
Version:
1.0.
Author:
Philippe Delrieu

Constructor Summary
ReadWriteFileTransfertManager(java.lang.String directory)
          Define the directory where the files are writen.
 
Method Summary
 long getTimeout()
           
static void main(java.lang.String[] args)
           
 byte[] sendReadWriteCommand(byte[] command, java.lang.String inFileName, java.lang.String outFileName, java.lang.String waitfile)
          Write the command in the inFileName and write for the outFileName.
 void setTimeout(long timeout)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReadWriteFileTransfertManager

public ReadWriteFileTransfertManager(java.lang.String directory)
Define the directory where the files are writen.

Method Detail

sendReadWriteCommand

public byte[] sendReadWriteCommand(byte[] command,
                                   java.lang.String inFileName,
                                   java.lang.String outFileName,
                                   java.lang.String waitfile)
                            throws java.io.IOException
Write the command in the inFileName and write for the outFileName. Return the content of outFileName. If the timeout is define, throw IOException if the wait is greater than the timeout

Parameters:
command -
inFileName -
outFileName -
waitfile - if waitfile is not null, this file is use to wait for. Otherwise it's the out file.
Returns:
Throws:
java.io.IOException

getTimeout

public long getTimeout()

setTimeout

public void setTimeout(long timeout)

main

public static void main(java.lang.String[] args)


Copyright 2006 OpenMobileIS. All Rights Reserved.