Sun Adapter for File API

com.stc.connector.fileadapter.eway
Class InboundFile

java.lang.Object
  extended by com.stc.connector.fileadapter.eway.InboundFile

public class InboundFile
extends java.lang.Object

Class representing a file found by the poller and used by the scheduler


Constructor Summary
InboundFile(java.io.File aFile)
          Creates a new instance representing a lockable file
 
Method Summary
 boolean equals(java.lang.Object aTest)
           
 java.io.File getFile(long aTimeout)
          Tries to get a hold onto the lock and if it succeeds then it will return the file.
 int hashCode()
           
 void release()
          Release the lock
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InboundFile

public InboundFile(java.io.File aFile)
            throws java.lang.IllegalArgumentException
Creates a new instance representing a lockable file

Parameters:
aFile - File this instance represents
Throws:
java.lang.IllegalArgumentException - If any of the parameters are null
Method Detail

getFile

public java.io.File getFile(long aTimeout)
                     throws java.lang.InterruptedException
Tries to get a hold onto the lock and if it succeeds then it will return the file. ATTENTION: Please release the lock after usage!!!

Parameters:
aTimeout - Time in milliseconds to wait for the lock
Returns:
The file if the locking the lock was successful otherwise null
Throws:
java.lang.InterruptedException - If the lock could not be aquired

release

public void release()
Release the lock


equals

public boolean equals(java.lang.Object aTest)
Overrides:
equals in class java.lang.Object
See Also:
Object.equals(java.lang.Object)

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object
See Also:
Object.hashCode()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

Sun Adapter for File API

Copyright © 2008 Sun Microsystems, Inc. All Rights Reserved.