public class SecureIOUtils extends Object
TaskLogsTruncater, but here it is to do
with unsecure write to a file.
| 限定符和类型 | 类和说明 |
|---|---|
static class |
SecureIOUtils.AlreadyExistsException
Signals that an attempt to create a file at a given pathname has failed
because another file already existed at that path.
|
| 构造器和说明 |
|---|
SecureIOUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static FileOutputStream |
createForWrite(File f,
int permissions)
Open the specified File for write access, ensuring that it does not exist.
|
static FileInputStream |
openForRead(File f,
String expectedOwner)
Open the given File for read access, verifying the expected user
constraints.
|
public static FileInputStream openForRead(File f, String expectedOwner) throws IOException
f - the file that we are trying to openexpectedOwner - the expected user owner for the fileIOException - if an IO Error occurred, or the user does not
matchpublic static FileOutputStream createForWrite(File f, int permissions) throws IOException
f - the file that we want to createpermissions - we want to have on the file (if security is enabled)SecureIOUtils.AlreadyExistsException - if the file already existsIOException - if any other error occurredCopyright © 2009 The Apache Software Foundation