-
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.
- Loading branch information
1 parent
e05399c
commit ce3350c
Showing
37 changed files
with
236 additions
and
80 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
21 changes: 21 additions & 0 deletions
21
cli/src/main/java/com/objectstorage/exception/ProviderIsNotValidException.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,21 @@ | ||
package com.objectstorage.exception; | ||
|
||
import java.io.IOException; | ||
import java.util.Arrays; | ||
import java.util.Formatter; | ||
|
||
/** Represents exception, when given provider is not valid. */ | ||
public class ProviderIsNotValidException extends IOException { | ||
public ProviderIsNotValidException() { | ||
this(""); | ||
} | ||
|
||
public ProviderIsNotValidException(Object... message) { | ||
super( | ||
new Formatter() | ||
.format( | ||
"Given provider is not valid: %s", | ||
Arrays.stream(message).toArray()) | ||
.toString()); | ||
} | ||
} |
21 changes: 0 additions & 21 deletions
21
cli/src/main/java/com/objectstorage/exception/UploadFileInvalidException.java
This file was deleted.
Oops, something went wrong.
21 changes: 21 additions & 0 deletions
21
cli/src/main/java/com/objectstorage/exception/UploadFileIsNotValidException.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,21 @@ | ||
package com.objectstorage.exception; | ||
|
||
import java.io.IOException; | ||
import java.util.Arrays; | ||
import java.util.Formatter; | ||
|
||
/** Represents exception, when provided file to be uploaded is not valid. */ | ||
public class UploadFileIsNotValidException extends IOException { | ||
public UploadFileIsNotValidException() { | ||
this(""); | ||
} | ||
|
||
public UploadFileIsNotValidException(Object... message) { | ||
super( | ||
new Formatter() | ||
.format( | ||
"Provided file to be uploaded is not valid: %s", | ||
Arrays.stream(message).toArray()) | ||
.toString()); | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
...c/main/java/com/objectstorage/service/client/common/helper/ClientConfigurationHelper.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,16 @@ | ||
package com.objectstorage.service.client.common.helper; | ||
|
||
/** | ||
* Represents client configuration helper. | ||
*/ | ||
public class ClientConfigurationHelper { | ||
/** | ||
* Converts given raw token value to a wrapped format. | ||
* | ||
* @param token given raw token value. | ||
* @return wrapped token. | ||
*/ | ||
public static String getWrappedToken(String token) { | ||
return String.format("Bearer: %s", token); | ||
} | ||
} |
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
27 changes: 27 additions & 0 deletions
27
...main/java/com/objectstorage/service/command/common/helper/CommandConfigurationHelper.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 com.objectstorage.service.command.common.helper; | ||
|
||
import com.objectstorage.entity.ConfigEntity; | ||
|
||
import java.util.Arrays; | ||
import java.util.Objects; | ||
|
||
/** | ||
* Represents command configuration helper. | ||
*/ | ||
public class CommandConfigurationHelper { | ||
/** | ||
* Checks if given provider is valid. | ||
* | ||
* @param provider given provider value. | ||
* @return result of the check. | ||
*/ | ||
public static Boolean isProviderValid(String provider) { | ||
return !Arrays.stream(ConfigEntity.Service.Provider.values()) | ||
.toList() | ||
.stream() | ||
.filter(element -> Objects.equals(element.toString(), provider)) | ||
.map(Enum::name) | ||
.toList() | ||
.isEmpty(); | ||
} | ||
} |
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
Oops, something went wrong.