public class FileUtil extends Object
Constructor and Description |
---|
FileUtil() |
Modifier and Type | Method and Description |
---|---|
static File |
getFile(String path) |
static URL |
getResourcePath(String resource) |
static String |
humanReadableByteCount(long bytes,
boolean si) |
static boolean |
isLocalPath(org.apache.hadoop.fs.Path path) |
static com.google.protobuf.Message |
loadProto(File file,
com.google.protobuf.Message proto) |
static com.google.protobuf.Message |
loadProto(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path path,
com.google.protobuf.Message proto) |
static com.google.protobuf.Message |
loadProto(InputStream in,
com.google.protobuf.Message proto) |
static String |
readTextFile(File file) |
static String |
readTextFileFromResource(String resource) |
static void |
writeProto(File file,
com.google.protobuf.Message proto) |
static void |
writeProto(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path path,
com.google.protobuf.Message proto) |
static void |
writeProto(OutputStream out,
com.google.protobuf.Message proto) |
public static void writeProto(File file, com.google.protobuf.Message proto) throws IOException
IOException
public static void writeProto(OutputStream out, com.google.protobuf.Message proto) throws IOException
IOException
public static void writeProto(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path, com.google.protobuf.Message proto) throws IOException
IOException
public static com.google.protobuf.Message loadProto(File file, com.google.protobuf.Message proto) throws IOException
IOException
public static com.google.protobuf.Message loadProto(InputStream in, com.google.protobuf.Message proto) throws IOException
IOException
public static com.google.protobuf.Message loadProto(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path, com.google.protobuf.Message proto) throws IOException
IOException
public static String readTextFileFromResource(String resource) throws IOException
IOException
public static String readTextFile(File file) throws IOException
IOException
public static String humanReadableByteCount(long bytes, boolean si)
public static boolean isLocalPath(org.apache.hadoop.fs.Path path)
Copyright © 2014 Apache Software Foundation. All Rights Reserved.