Class TurFileUtils

java.lang.Object
com.viglet.turing.utils.TurFileUtils

public class TurFileUtils extends Object
  • Method Details

    • readFile

      public static TurTikaFileAttributes readFile(String filePath)
    • readFile

      public static TurTikaFileAttributes readFile(File file)
    • parseFile

      public static TurTikaFileAttributes parseFile(File file)
    • parseFile

      public static TurTikaFileAttributes parseFile(org.springframework.web.multipart.MultipartFile multipartFile)
    • documentToText

      public static TurFileAttributes documentToText(org.springframework.web.multipart.MultipartFile multipartFile)
    • urlContentToText

      public static TurFileAttributes urlContentToText(URL url)
    • isAllowedRemoteUrlString

      public static boolean isAllowedRemoteUrlString(String urlString)
      Helper method to validate a URL provided as a String before it is parsed and used.
      Parameters:
      urlString - the URL string supplied by a client
      Returns:
      true if the URL is syntactically valid and allowed according to isAllowedRemoteUrl(URL)
    • isSafe

      public static boolean isSafe(InetAddress address)
    • parseDocument

      public static Optional<String> parseDocument(InputStream stream) throws IOException
      Throws:
      IOException