public class ManagedFile extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
ManagedFile.ManagedLock |
| Constructor and Description |
|---|
ManagedFile(File file,
int timeOut,
int maxHoldingTime)
Creates a new managed file.
|
| Modifier and Type | Method and Description |
|---|---|
ManagedFile.ManagedLock |
accessRead()
Blocks for
timeOut milliseconds for the read access
to the managed file. |
ManagedFile.ManagedLock |
accessWrite()
Blocks for
timeOut milliseconds for the write access
to the managed file. |
public ManagedFile(File file, int timeOut, int maxHoldingTime) throws IOException
file - the file to managetimeOut - the max time in milliseconds to wait for a read or write lockmaxHoldingTime - the max time in milliseconds to hold the read or write lockIOException - when the file cannot be lockedpublic ManagedFile.ManagedLock accessWrite() throws IOException, TimeoutException
timeOut milliseconds for the write access
to the managed file.IOException - if the file cannot be lockedTimeoutException - if the lock cannot be obtained before the timeOut
expiration.public ManagedFile.ManagedLock accessRead() throws IOException, TimeoutException
timeOut milliseconds for the read access
to the managed file.IOException - if the file cannot be lockedTimeoutException - if the lock cannot be obtained before the timeOut
expiration.Copyright © 2017–2020 Eclipse Foundation. All rights reserved.