Class IoUtil


  • public class IoUtil
    extends Object
    IO utility class.
    Since:
    2.0.0
    Author:
    Lijun Liao (xipki)
    • Method Detail

      • closeQuietly

        public static void closeQuietly​(Closeable closable)
      • deleteFile

        public static boolean deleteFile​(String path)
      • deleteFile

        public static boolean deleteFile​(String path,
                                         boolean prependBaseDir)
      • deleteFile

        public static boolean deleteFile​(File file)
      • deleteFile

        public static boolean deleteFile​(File file,
                                         boolean prependBaseDir)
      • deleteDir

        public static boolean deleteDir​(File dir)
      • deleteDir

        public static boolean deleteDir​(File dir,
                                        boolean prependBaseDir)
      • expandFilepath

        public static String expandFilepath​(String path)
      • expandFilepath

        public static String expandFilepath​(String path,
                                            boolean prependBaseDir)
      • expandFilepath

        public static File expandFilepath​(File file)
      • expandFilepath

        public static File expandFilepath​(File file,
                                          boolean prependBaseDir)
      • convertSequenceName

        public static String convertSequenceName​(String sequenceName)
      • writeShort

        public static void writeShort​(short value,
                                      byte[] dest,
                                      int destOffset)
      • parseShort

        public static short parseShort​(byte[] bytes,
                                       int offset)
      • writeInt

        public static void writeInt​(int value,
                                    byte[] dest,
                                    int destOffset)
      • parseInt

        public static int parseInt​(byte[] bytes,
                                   int offset)
      • getIndex

        public static int getIndex​(byte[] arrayA,
                                   byte[] arrayB)
      • base64Encode

        public static String base64Encode​(byte[] data,
                                          boolean withLineBreak)
      • readPasswordFromConsole

        public static char[] readPasswordFromConsole​(String prompt)
      • readLineFromConsole

        public static String readLineFromConsole​(String prompt)
      • detectPath

        public static String detectPath​(String path)