Class HttpFileStorage

  • All Implemented Interfaces:
    org.ossreviewtoolkit.utils.ort.storage.FileStorage

    
    public final class HttpFileStorage
     implements FileStorage
                        

    A FileStorage that stores files on an HTTP server.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private final String url
      private final String query
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final String getUrl() The URL to store files at.
      final String getQuery() The query string that is appended to the combination of the URL and some additional path.
      Boolean exists(String path) Return whether the given path exists or not.
      InputStream read(String path) Read the file at path.
      Unit write(String path, InputStream inputStream) Write the data from inputStream to the file at path.
      Boolean delete(String path) Delete the file at the given path and return whether the operation was successful.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getQuery

         final String getQuery()

        The query string that is appended to the combination of the URL and some additional path. Some storages process authentication via parameters that are within the final URL, so certain credentials can be stored in this query, e.g, "?user=standard&pwd=123". Thus, the final URL could be "https://example.com/storage/path?user=standard&pwd=123".

      • delete

         Boolean delete(String path)

        Delete the file at the given path and return whether the operation was successful.