-
-
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.
Initial commit: Full refactor with tests
- Loading branch information
1 parent
1369cdb
commit 4b980d5
Showing
21 changed files
with
1,312 additions
and
476 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
26 changes: 26 additions & 0 deletions
26
.../src/main/java/io/github/szrnkapeter/firebase/hosting/service/AbstractUtilityService.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,26 @@ | ||
package io.github.szrnkapeter.firebase.hosting.service; | ||
|
||
import io.github.szrnkapeter.firebase.hosting.config.FirebaseHostingApiConfig; | ||
|
||
/** | ||
* @author Peter Szrnka | ||
* @since 0.8 | ||
*/ | ||
public abstract class AbstractUtilityService { | ||
|
||
protected final FirebaseHostingApiConfig config; | ||
protected final String accessToken; | ||
|
||
protected AbstractUtilityService(FirebaseHostingApiConfig config, String accessToken) { | ||
this.config = config; | ||
this.accessToken = accessToken; | ||
} | ||
|
||
protected void responseCallback(String function, Object response) { | ||
if(config.getServiceResponseListener() == null) { | ||
return; | ||
} | ||
|
||
config.getServiceResponseListener().getResponse(function, response); | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
code/src/main/java/io/github/szrnkapeter/firebase/hosting/service/FileService.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,27 @@ | ||
package io.github.szrnkapeter.firebase.hosting.service; | ||
|
||
import io.github.szrnkapeter.firebase.hosting.model.DeployItem; | ||
import io.github.szrnkapeter.firebase.hosting.model.GetVersionFilesResponse; | ||
import io.github.szrnkapeter.firebase.hosting.model.PopulateFilesRequest; | ||
import io.github.szrnkapeter.firebase.hosting.model.PopulateFilesResponse; | ||
import io.github.szrnkapeter.firebase.hosting.model.UploadFileRequest; | ||
|
||
import java.io.IOException; | ||
import java.security.NoSuchAlgorithmException; | ||
import java.util.List; | ||
import java.util.Set; | ||
|
||
/** | ||
* @author Peter Szrnka | ||
* @since 0.8 | ||
*/ | ||
public interface FileService { | ||
|
||
GetVersionFilesResponse getVersionFiles(String versionName) throws IOException; | ||
|
||
PopulateFilesResponse populateFiles(PopulateFilesRequest request, String version) throws IOException; | ||
|
||
void uploadFile(UploadFileRequest request) throws NoSuchAlgorithmException, IOException; | ||
|
||
void uploadFiles(String versionId, Set<DeployItem> files, List<String> requiredHashes) throws IOException, NoSuchAlgorithmException; | ||
} |
Oops, something went wrong.