-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support file size limit and mime types (#38)
- Loading branch information
1 parent
72a5bf8
commit 59e2667
Showing
18 changed files
with
239 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
FROM supabase/storage-api:v0.28.0 | ||
FROM supabase/storage-api:v0.29.0 | ||
|
||
RUN apk add curl --no-cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,28 @@ | ||
package io.supabase.data.bucket; | ||
|
||
|
||
import com.google.gson.annotations.JsonAdapter; | ||
import com.google.gson.annotations.SerializedName; | ||
|
||
public class Bucket { | ||
private final String id; | ||
private final String name; | ||
private final String owner; | ||
@SerializedName("public") | ||
private final boolean isBucketPublic; | ||
@SerializedName("created_at") | ||
private final String createdAt; | ||
@SerializedName("updated_at") | ||
private final String updatedAt; | ||
|
||
public Bucket(String id, String name, String owner, boolean isBucketPublic, String createdAt, String updatedAt) { | ||
this.id = id; | ||
this.name = name; | ||
this.owner = owner; | ||
this.isBucketPublic = isBucketPublic; | ||
this.createdAt = createdAt; | ||
this.updatedAt = updatedAt; | ||
} | ||
|
||
public String getId() { | ||
return id; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public String getOwner() { | ||
return owner; | ||
} | ||
|
||
public boolean isBucketPublic() { | ||
return isBucketPublic; | ||
} | ||
|
||
public String getCreatedAt() { | ||
return createdAt; | ||
} | ||
|
||
public String getUpdatedAt() { | ||
return updatedAt; | ||
import io.supabase.utils.FileSize; | ||
|
||
import java.util.List; | ||
|
||
public record Bucket(String id, String name, String owner, | ||
@SerializedName("public") boolean isBucketPublic, | ||
@SerializedName("file_size_limit") @JsonAdapter(FileSize.class) FileSize fileSizeLimit, | ||
@SerializedName("allowed_mime_types") List<String> allowedMimeTypes, | ||
@SerializedName("created_at") String createdAt, | ||
@SerializedName("updated_at") String updatedAt) { | ||
|
||
@Override | ||
public String toString() { | ||
return "Bucket{" + | ||
"id='" + id + '\'' + | ||
", name='" + name + '\'' + | ||
", owner='" + owner + '\'' + | ||
", isBucketPublic=" + isBucketPublic + | ||
", createdAt='" + createdAt + '\'' + | ||
", updatedAt='" + updatedAt + '\'' + | ||
'}'; | ||
} | ||
} |
9 changes: 6 additions & 3 deletions
9
src/main/java/io/supabase/data/bucket/BucketCreateOptions.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
package io.supabase.data.bucket; | ||
|
||
public class BucketCreateOptions extends BucketOptions { | ||
import io.supabase.utils.FileSize; | ||
|
||
import java.util.List; | ||
|
||
public BucketCreateOptions(boolean isPublic) { | ||
super(isPublic); | ||
public class BucketCreateOptions extends BucketOptions { | ||
public BucketCreateOptions(boolean isPublic, FileSize fileSizeLimit, List<String> allowedMimeTypes) { | ||
super(isPublic, fileSizeLimit, allowedMimeTypes == null ? List.of() : allowedMimeTypes); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,29 @@ | ||
package io.supabase.data.bucket; | ||
|
||
import io.supabase.utils.FileSize; | ||
|
||
import java.util.List; | ||
|
||
public class BucketOptions { | ||
private final boolean isPublic; | ||
private final FileSize fileSizeLimit; | ||
private final List<String> allowedMimeTypes; | ||
|
||
public BucketOptions(boolean isPublic) { | ||
public BucketOptions(boolean isPublic, FileSize fileSizeLimit, List<String> allowedMimeTypes) { | ||
this.isPublic = isPublic; | ||
this.fileSizeLimit = fileSizeLimit; | ||
this.allowedMimeTypes = List.copyOf(allowedMimeTypes); | ||
} | ||
|
||
public boolean isPublic() { | ||
return isPublic; | ||
} | ||
|
||
public FileSize getFileSizeLimit() { | ||
return fileSizeLimit; | ||
} | ||
|
||
public List<String> getAllowedMimeTypes() { | ||
return List.copyOf(allowedMimeTypes); | ||
} | ||
} |
8 changes: 6 additions & 2 deletions
8
src/main/java/io/supabase/data/bucket/BucketUpdateOptions.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
package io.supabase.data.bucket; | ||
|
||
import io.supabase.utils.FileSize; | ||
|
||
import java.util.List; | ||
|
||
public class BucketUpdateOptions extends BucketOptions { | ||
public BucketUpdateOptions(boolean isPublic) { | ||
super(isPublic); | ||
public BucketUpdateOptions(boolean isPublic, FileSize fileSizeLimit, List<String> allowedMimeTypes) { | ||
super(isPublic, fileSizeLimit, allowedMimeTypes == null ? List.of() : allowedMimeTypes); | ||
} | ||
} |
Oops, something went wrong.