-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FBHAJ-57 Initial commit to branch: Major enhancements
- Utility class renamed - Tabulation fixed in main class - Version updates in pom.xml - Examples updated - New example app created for v0.9
- Loading branch information
1 parent
5f86c90
commit 9ba7bd5
Showing
20 changed files
with
194 additions
and
38 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
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# firebase-hosting-api-java v0.9 example | ||
This is a working example of **firebase-hosting-api-java** library with unreleased version **0.9-SNAPSHOT**. | ||
|
||
**Firebase setup: [link](https://github.com/peter-szrnka/firebase-hosting-api-java/wiki/Firebase-project-setup)** | ||
|
||
**IMPORTANT:** | ||
|
||
- You have to add a *"service-account.json"* file under *src/main/resources* folder! | ||
- You will not see anything if you do not set any listener! | ||
- Library does not catch all exceptions. The purpose of this approach is to give the control to your application instead of hiding and wrapping it. | ||
|
||
# Sample log messages | ||
|
||
## Missing service account file: | ||
![missing_service_account_file.png](assets/missing_service_account_file.png) | ||
|
||
## Invalid service account file: | ||
![invalid_service_account_file.png](assets/invalid_service_account_file.png) | ||
|
||
## With HTTP response listeners | ||
|
||
![Example 1](assets/log_example.png) | ||
|
||
## With HTTP and Service response listeners | ||
|
||
![Example 2](assets/log_example2.png) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>hu.szrnkapeter.sample</groupId> | ||
<artifactId>firebase-hosting-api-java-sample</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
|
||
<properties> | ||
<java.version>17</java.version> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>io.github.szrnka-peter</groupId> | ||
<artifactId>firebase-hosting-api-java</artifactId> | ||
<version>0.9-SNAPSHOT</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.google.code.gson</groupId> | ||
<artifactId>gson</artifactId> | ||
<version>2.10.1</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>3.10.1</version> | ||
<configuration> | ||
<source>${java.version}</source> | ||
<target>${java.version}</target> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
32 changes: 32 additions & 0 deletions
32
examples/version_0.9/src/main/java/hu/szrnkapeter/sample/GsonSerializer.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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package hu.szrnkapeter.sample; | ||
|
||
import com.google.gson.Gson; | ||
|
||
import io.github.szrnkapeter.firebase.hosting.serializer.Serializer; | ||
|
||
public class GsonSerializer implements Serializer { | ||
|
||
private final Gson gson; | ||
|
||
public GsonSerializer() { | ||
gson = new Gson(); | ||
} | ||
|
||
/* | ||
* (non-Javadoc) | ||
* @see hu.szrnkapeter.firebase.hosting.serializer.Serializer#getObject(java.lang.Class, java.lang.String) | ||
*/ | ||
@Override | ||
public <T> T getObject(Class<T> clazz, String obj) { | ||
return gson.fromJson(obj, clazz); | ||
} | ||
|
||
/* | ||
* (non-Javadoc) | ||
* @see io.github.szrnkapeter.firebase.hosting.serializer.Serializer#toJson(java.lang.Class, java.lang.Object) | ||
*/ | ||
@Override | ||
public <T> String toJson(Class<T> clazz, T obj) { | ||
return gson.toJson(obj); | ||
} | ||
} |
Oops, something went wrong.