Skip to content

Commit

Permalink
Merge pull request #14 from kadampabookings/prod
Browse files Browse the repository at this point in the history
Added BlobProvider.downloadUrl() API and fixed Javadoc generation
  • Loading branch information
salmonb authored Oct 17, 2024
2 parents 37e6898 + 235b585 commit f6e8065
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish-javadoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:

# Build JavaDoc
- name: Build JavaDoc
run: mvn -B javadoc:aggregate
run: mvn -B javadoc:aggregate -Ddoclint=none -Dmaven.compiler.release=8 # Using Java 8 for now due to JavaDoc errors with modules

- name: Publish JavaDoc to ${{ env.web-push-branch }} branch
uses: cpina/github-action-push-to-another-repository@master
Expand Down
5 changes: 1 addition & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,10 @@
</repository>
</repositories>


<properties>
<!-- Disabling the default behavior defined in the parent pom for the shade plugin -->
<plugin.shade.param.fat.phase>none</plugin.shade.param.fat.phase>
</properties>

<build>
</properties> <build>
<pluginManagement>
<plugins>
<!-- Relocating the emul.xxx.* packages to xxx.* for both classes and sources -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ public Blob createTextBlob(String text) {
}

@Override
public void exportBlob(Blob blob, String fileName) {
public void downloadUrl(String url, String fileName) {
HTMLLinkElement a = (HTMLLinkElement) DomGlobal.document.createElement("a");
a.href = blob.getObjectURL();
a.setAttribute("download", fileName);
a.href = url;
if (fileName != null)
a.setAttribute("download", fileName);
a.style.display = "none";
DomGlobal.document.body.appendChild(a);
a.click();
DomGlobal.document.body.removeChild(a);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public Blob createTextBlob(String text) {
}

@Override
public void exportBlob(Blob blob, String fileName) {
public void downloadUrl(String url, String fileName) {

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@ static BlobProvider get() {

Blob createTextBlob(String text);

void exportBlob(Blob blob, String fileName);
default void exportBlob(Blob blob) {
exportBlob(blob, null);
}

default void exportBlob(Blob blob, String fileName) {
downloadUrl(blob.getObjectURL(), fileName);
}

default void downloadUrl(String url) {
downloadUrl(url, null);
}

void downloadUrl(String url, String fileName);

}

0 comments on commit f6e8065

Please sign in to comment.