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.
-
-
Method Summary
Modifier and Type Method Description final StringgetUrl()The URL to store files at. final StringgetQuery()The query string that is appended to the combination of the URL and some additional path. Booleanexists(String path)Return whether the given path exists or not. InputStreamread(String path)Read the file at path. Unitwrite(String path, InputStream inputStream)Write the data from inputStream to the file at path. Booleandelete(String path)Delete the file at the given path and return whether the operation was successful. -
-
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".
-
read
InputStream read(String path)
Read the file at path. It is the caller's responsibility to close the returned InputStream after consuming it.
-
write
Unit write(String path, InputStream inputStream)
Write the data from inputStream to the file at path. If the file already exists it is overwritten. The provided inputStream is closed after writing it to the file.
-
-
-
-