Class URLInputSource


  • public class URLInputSource
    extends Object
    Input source wrapper to load remote files locally.
    • Method Detail

      • validateSecure

        public void validateSecure()
        Ensures the URL can be safely sent to the Mindee server.

        Rejects any URL that don't follow an HTTPS scheme.

      • fetchFile

        public void fetchFile()
                       throws IOException
        Fetches the file from a remote source.
        Throws:
        IOException - Throws if the file can't be fetched.
      • saveToFile

        public void saveToFile​(String filepath)
                        throws IOException
        Fetches the file from the URL and saves it to the specified filepath.
        Parameters:
        filepath - The local path where the file should be saved.
        Throws:
        IOException - If there's an error fetching or saving the file.
      • cleanup

        public void cleanup()
      • getUrl

        public URL getUrl()
      • getLocalFilename

        public String getLocalFilename()