Class Utils

java.lang.Object
com.transifex.common.Utils

public class Utils extends Object
  • Constructor Details

    • Utils

      public Utils()
  • Method Details

    • readInputStream

      @NonNull public static String readInputStream(@NonNull InputStream inputStream) throws IOException
      Reads an input stream to a string.
      Throws:
      IOException
    • deleteDirectory

      public static boolean deleteDirectory(File directoryToBeDeleted)
      Deletes a directory including its contents
      Returns:
      true if and only if the file or directory is successfully deleted; false otherwise
    • deleteDirectoryContents

      public static boolean deleteDirectoryContents(File directoryToBeDeleted)
      Deletes the directory's contents
      Returns:
      true if it's a directory and it's content is successfully deleted or it's already empty; false otherwise
    • urlEncode

      public static String urlEncode(String string) throws UnsupportedEncodingException
      URL encodes the provided string.
      Throws:
      UnsupportedEncodingException