@InterfaceAudience.Private @InterfaceStability.Unstable public class NativeIO extends Object
Modifier and Type | Class and Description |
---|---|
static class |
NativeIO.POSIX |
static class |
NativeIO.Windows |
Constructor and Description |
---|
NativeIO() |
Modifier and Type | Method and Description |
---|---|
static FileOutputStream |
getCreateForWriteFileOutputStream(File f,
int permissions)
Create the specified File for write access, ensuring that it does not exist.
|
static String |
getOwner(FileDescriptor fd) |
static FileInputStream |
getShareDeleteFileInputStream(File f)
Create a FileInputStream that shares delete permission on the
file opened, i.e.
|
static FileInputStream |
getShareDeleteFileInputStream(File f,
long seekOffset)
Create a FileInputStream that shares delete permission on the
file opened at a given offset, i.e.
|
static boolean |
isAvailable()
Return true if the JNI-based native IO extensions are available.
|
static void |
renameTo(File src,
File dst)
A version of renameTo that throws a descriptive exception when it fails.
|
public static boolean isAvailable()
public static String getOwner(FileDescriptor fd) throws IOException
IOException
public static FileInputStream getShareDeleteFileInputStream(File f) throws IOException
IOException
public static FileInputStream getShareDeleteFileInputStream(File f, long seekOffset) throws IOException
IOException
public static FileOutputStream getCreateForWriteFileOutputStream(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 occurredpublic static void renameTo(File src, File dst) throws IOException
src
- The source pathdst
- The destination pathNativeIOException
- On failure.IOException
Copyright © 2013 Apache Software Foundation. All rights reserved.