public class FileIOUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static long |
KB |
static org.apache.log4j.Logger |
LOG |
| Constructor and Description |
|---|
FileIOUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
closeQuietly(Closeable closeable)
Closes
Closeable quietly. |
static void |
copy(org.apache.hadoop.fs.FileSystem fileSystem,
org.apache.hadoop.fs.Path sourceFilePath,
org.apache.hadoop.fs.Path destFilePath)
Copies the file content from source path to destination path.
|
static void |
copy(InputStream inputStream,
OutputStream outputStream) |
static void |
createFileInPath(org.apache.hadoop.fs.FileSystem fileSystem,
org.apache.hadoop.fs.Path fullPath,
Option<byte[]> content) |
static void |
createFileInPath(org.apache.hadoop.fs.FileSystem fileSystem,
org.apache.hadoop.fs.Path fullPath,
Option<byte[]> content,
boolean ignoreIOE) |
static void |
deleteDirectory(File directory) |
static String[] |
getConfiguredLocalDirs()
Return the configured local directories where hudi can write files.
|
static void |
mkdir(File directory) |
static byte[] |
readAsByteArray(InputStream input) |
static byte[] |
readAsByteArray(InputStream input,
int outputSize) |
static String |
readAsUTFString(InputStream input) |
static String |
readAsUTFString(InputStream input,
int length) |
static List<String> |
readAsUTFStringLines(InputStream input)
Reads the input stream into String lines.
|
static Option<byte[]> |
readDataFromPath(org.apache.hadoop.fs.FileSystem fileSystem,
org.apache.hadoop.fs.Path detailPath) |
static Option<byte[]> |
readDataFromPath(org.apache.hadoop.fs.FileSystem fileSystem,
org.apache.hadoop.fs.Path detailPath,
boolean ignoreIOE) |
static void |
writeStringToFile(String str,
String filePath) |
public static final org.apache.log4j.Logger LOG
public static final long KB
public static void deleteDirectory(File directory) throws IOException
IOExceptionpublic static void mkdir(File directory) throws IOException
IOExceptionpublic static String readAsUTFString(InputStream input) throws IOException
IOExceptionpublic static String readAsUTFString(InputStream input, int length) throws IOException
IOExceptionpublic static List<String> readAsUTFStringLines(InputStream input)
input - InputStream instance.public static void copy(InputStream inputStream, OutputStream outputStream) throws IOException
IOExceptionpublic static void copy(org.apache.hadoop.fs.FileSystem fileSystem,
org.apache.hadoop.fs.Path sourceFilePath,
org.apache.hadoop.fs.Path destFilePath)
fileSystem - FileSystem instance.sourceFilePath - Source file path.destFilePath - Destination file path.public static byte[] readAsByteArray(InputStream input) throws IOException
IOExceptionpublic static byte[] readAsByteArray(InputStream input, int outputSize) throws IOException
IOExceptionpublic static void writeStringToFile(String str, String filePath) throws IOException
IOExceptionpublic static void closeQuietly(Closeable closeable)
Closeable quietly.closeable - Closeable to closepublic static void createFileInPath(org.apache.hadoop.fs.FileSystem fileSystem,
org.apache.hadoop.fs.Path fullPath,
Option<byte[]> content,
boolean ignoreIOE)
public static void createFileInPath(org.apache.hadoop.fs.FileSystem fileSystem,
org.apache.hadoop.fs.Path fullPath,
Option<byte[]> content)
public static Option<byte[]> readDataFromPath(org.apache.hadoop.fs.FileSystem fileSystem, org.apache.hadoop.fs.Path detailPath, boolean ignoreIOE)
public static Option<byte[]> readDataFromPath(org.apache.hadoop.fs.FileSystem fileSystem, org.apache.hadoop.fs.Path detailPath)
public static String[] getConfiguredLocalDirs()
Copyright © 2022 The Apache Software Foundation. All rights reserved.