public class IoUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
base64Encode(byte[] data,
boolean withLineBreak) |
static void |
closeQuietly(Closeable closable) |
static String |
convertSequenceName(String sequenceName) |
static boolean |
deleteDir(File dir) |
static boolean |
deleteDir(File dir,
boolean prependBaseDir) |
static boolean |
deleteFile(File file) |
static boolean |
deleteFile(File file,
boolean prependBaseDir) |
static boolean |
deleteFile(String path) |
static boolean |
deleteFile(String path,
boolean prependBaseDir) |
static String |
detectPath(String path) |
static File |
expandFilepath(File file) |
static File |
expandFilepath(File file,
boolean prependBaseDir) |
static String |
expandFilepath(String path) |
static String |
expandFilepath(String path,
boolean prependBaseDir) |
static String |
getHostAddress() |
static int |
getIndex(byte[] arrayA,
byte[] arrayB) |
static Properties |
loadProperties(String path) |
static Properties |
loadProperties(String path,
boolean prependBaseDir) |
static void |
mkdirsParent(Path path) |
static HttpURLConnection |
openHttpConn(URL url) |
static int |
parseInt(byte[] bytes,
int offset) |
static short |
parseShort(byte[] bytes,
int offset) |
static byte[] |
read(File file) |
static byte[] |
read(File file,
boolean prependBaseDir) |
static byte[] |
read(InputStream in) |
static byte[] |
read(String fileName) |
static byte[] |
read(String fileName,
boolean prependBaseDir) |
static String |
readLastNonBlankLine(File file) |
static String |
readLineFromConsole(String prompt) |
static char[] |
readPasswordFromConsole(String prompt) |
static void |
save(File file,
byte[] content) |
static void |
save(File file,
byte[] content,
boolean prependBaseDir) |
static void |
save(String fileName,
byte[] encoded) |
static void |
save(String fileName,
byte[] encoded,
boolean prependBaseDir) |
static void |
writeInt(int value,
byte[] dest,
int destOffset) |
static void |
writeShort(short value,
byte[] dest,
int destOffset) |
public static void closeQuietly(Closeable closable)
public static byte[] read(String fileName) throws IOException
IOExceptionpublic static byte[] read(String fileName, boolean prependBaseDir) throws IOException
IOExceptionpublic static byte[] read(File file) throws IOException
IOExceptionpublic static byte[] read(File file, boolean prependBaseDir) throws IOException
IOExceptionpublic static byte[] read(InputStream in) throws IOException
IOExceptionpublic static void save(String fileName, byte[] encoded) throws IOException
IOExceptionpublic static void save(String fileName, byte[] encoded, boolean prependBaseDir) throws IOException
IOExceptionpublic static void save(File file, byte[] content) throws IOException
IOExceptionpublic static void save(File file, byte[] content, boolean prependBaseDir) throws IOException
IOExceptionpublic static void mkdirsParent(Path path) throws IOException
IOExceptionpublic static String getHostAddress() throws SocketException
SocketExceptionpublic static boolean deleteFile(String path)
public static boolean deleteFile(String path, boolean prependBaseDir)
public static boolean deleteFile(File file)
public static boolean deleteFile(File file, boolean prependBaseDir)
public static boolean deleteDir(File dir)
public static boolean deleteDir(File dir, boolean prependBaseDir)
public static void writeShort(short value,
byte[] dest,
int destOffset)
public static short parseShort(byte[] bytes,
int offset)
public static void writeInt(int value,
byte[] dest,
int destOffset)
public static int parseInt(byte[] bytes,
int offset)
public static int getIndex(byte[] arrayA,
byte[] arrayB)
public static String base64Encode(byte[] data, boolean withLineBreak)
public static HttpURLConnection openHttpConn(URL url) throws IOException
IOExceptionpublic static char[] readPasswordFromConsole(String prompt)
public static Properties loadProperties(String path) throws IOException
IOExceptionpublic static Properties loadProperties(String path, boolean prependBaseDir) throws IOException
IOExceptionpublic static String readLastNonBlankLine(File file) throws IOException
IOExceptionCopyright © 2023. All rights reserved.