Class BlossomEndpoint
java.lang.Object
org.ngengine.blossom4j.BlossomEndpoint
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.ngengine.platform.AsyncTask<BlossomResponse> delete(String sha256, SignedNostrEvent authEvent) Delete a blob by its SHA256 hashbooleanorg.ngengine.platform.AsyncTask<Boolean> exists(String sha256OrPath, SignedNostrEvent authEvent) Check if a blob existsorg.ngengine.platform.AsyncTask<BlossomBlobResponse> get(String sha256OrPath, int[] byteRange, SignedNostrEvent authEvent) Get blob by SHA256inthashCode()org.ngengine.platform.AsyncTask<org.ngengine.platform.transport.NGEHttpResponse> httpRequest(String endpoint, String method, Map<String, String> headers, byte[] body, SignedNostrEvent authEvent) booleanorg.ngengine.platform.AsyncTask<BlossomResponse> list(NostrPublicKey pubkey, Instant since, Instant until, SignedNostrEvent authEvent) List blobs uploaded by a given public keyvoidsetVerifyBlobs(boolean verify) toString()org.ngengine.platform.AsyncTask<BlossomResponse> upload(byte[] data, String mimeType, SignedNostrEvent authEvent) Upload a blob
-
Constructor Details
-
BlossomEndpoint
-
-
Method Details
-
setVerifyBlobs
public void setVerifyBlobs(boolean verify) -
isVerifyBlobs
public boolean isVerifyBlobs() -
get
public org.ngengine.platform.AsyncTask<BlossomBlobResponse> get(String sha256OrPath, int[] byteRange, @Nullable SignedNostrEvent authEvent) Get blob by SHA256- Parameters:
sha256OrPath- can be just sha256 or sha256.extbyteRange- optional, the range of bytes to fetch, can be null for full rangeauthEvent- optional, can be null- Returns:
-
exists
public org.ngengine.platform.AsyncTask<Boolean> exists(String sha256OrPath, @Nullable SignedNostrEvent authEvent) Check if a blob exists- Parameters:
sha256OrPath- can be just sha256 or sha256.extauthEvent- optional, can be null- Returns:
- an AsyncTask that returns true if the blob exists, false if it does not
-
upload
public org.ngengine.platform.AsyncTask<BlossomResponse> upload(byte[] data, @Nullable String mimeType, @Nullable SignedNostrEvent authEvent) Upload a blob- Parameters:
data- the byte array to uploadmimeType- (optional), the MIME type of the blob, can be null for application/octet-streamauthEvent- (optional), a SignedNostrEvent for authorization, can be null- Returns:
- an AsyncTask that returns a BlossomResponse containing the BlobDescriptor and the HTTP response
-
list
public org.ngengine.platform.AsyncTask<BlossomResponse> list(NostrPublicKey pubkey, @Nullable Instant since, @Nullable Instant until, @Nullable SignedNostrEvent authEvent) List blobs uploaded by a given public key- Parameters:
pubkey- the public key of the user whose blobs you want to listsince- (optional) the start time for the listing, can be nulluntil- (optional) the end time for the listing, can be nullauthEvent- (optional) a SignedNostrEvent for authorization, can be null- Returns:
- an AsyncTask that returns a BlossomResponse containing a list of BlobDescriptors and the HTTP response
-
delete
public org.ngengine.platform.AsyncTask<BlossomResponse> delete(String sha256, @Nullable SignedNostrEvent authEvent) Delete a blob by its SHA256 hash- Parameters:
sha256-authEvent-- Returns:
-
toString
-
equals
-
hashCode
-
httpRequest
-