-
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
59a93e9
commit eb81b5b
Showing
37 changed files
with
1,225 additions
and
342 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
24 changes: 0 additions & 24 deletions
24
cli/src/main/java/com/objectstorage/converter/ConfigExporterToContentExporterConverter.java
This file was deleted.
Oops, something went wrong.
27 changes: 0 additions & 27 deletions
27
...src/main/java/com/objectstorage/converter/ConfigLocationsToContentLocationsConverter.java
This file was deleted.
Oops, something went wrong.
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
31 changes: 31 additions & 0 deletions
31
...src/main/java/com/objectstorage/converter/SelectedProviderToContentProviderConverter.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,31 @@ | ||
package com.objectstorage.converter; | ||
|
||
import com.objectstorage.entity.ConfigEntity; | ||
import com.objectstorage.model.Provider; | ||
|
||
import java.util.Arrays; | ||
import java.util.Objects; | ||
|
||
/** | ||
* Represents selected provider to ObjectStorage API Server content provider converter. | ||
*/ | ||
public class SelectedProviderToContentProviderConverter { | ||
|
||
/** | ||
* Converts given config provider to content provider. | ||
* | ||
* @param selectedProvider given selected provider to be converted. | ||
* @return converted content provider. | ||
*/ | ||
public static Provider convert(String selectedProvider) { | ||
return Provider.valueOf( | ||
Arrays.stream( | ||
ConfigEntity.Service.Provider.values()) | ||
.toList() | ||
.stream() | ||
.filter(element -> Objects.equals(element.toString(), selectedProvider)) | ||
.map(Enum::name) | ||
.toList() | ||
.getFirst()); | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
cli/src/main/java/com/objectstorage/dto/ContentUploadObjectRequestDto.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,19 @@ | ||
package com.objectstorage.dto; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
import java.io.File; | ||
|
||
/** | ||
* Represents content upload object request details. | ||
*/ | ||
@Getter | ||
@AllArgsConstructor(staticName = "of") | ||
public class ContentUploadObjectRequestDto { | ||
private String authorization; | ||
|
||
private String location; | ||
|
||
private File file; | ||
} |
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
20 changes: 20 additions & 0 deletions
20
cli/src/main/java/com/objectstorage/dto/DownloadObjectExternalCommandDto.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,20 @@ | ||
package com.objectstorage.dto; | ||
|
||
import com.objectstorage.entity.ConfigEntity; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
/** | ||
* Represents input for download object external command. | ||
*/ | ||
@Getter | ||
@AllArgsConstructor(staticName = "of") | ||
public class DownloadObjectExternalCommandDto { | ||
private ConfigEntity config; | ||
|
||
private String provider; | ||
|
||
private String outputLocation; | ||
|
||
private String location; | ||
} |
17 changes: 17 additions & 0 deletions
17
cli/src/main/java/com/objectstorage/dto/ProcessedCredentialsDto.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,17 @@ | ||
package com.objectstorage.dto; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
/** | ||
* Represents processed credentials details. | ||
*/ | ||
@Getter | ||
@AllArgsConstructor(staticName = "of") | ||
public class ProcessedCredentialsDto { | ||
private Integer id; | ||
|
||
private String file; | ||
|
||
private String region; | ||
} |
18 changes: 18 additions & 0 deletions
18
cli/src/main/java/com/objectstorage/dto/UploadObjectExternalCommandDto.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,18 @@ | ||
package com.objectstorage.dto; | ||
|
||
import com.objectstorage.entity.ConfigEntity; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
/** | ||
* Represents input for upload object external command. | ||
*/ | ||
@Getter | ||
@AllArgsConstructor(staticName = "of") | ||
public class UploadObjectExternalCommandDto { | ||
private ConfigEntity config; | ||
|
||
private String location; | ||
|
||
private String file; | ||
} |
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
22 changes: 22 additions & 0 deletions
22
cli/src/main/java/com/objectstorage/exception/CloudCredentialsFileNotFoundException.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,22 @@ | ||
package com.objectstorage.exception; | ||
|
||
import java.io.IOException; | ||
import java.util.Arrays; | ||
import java.util.Formatter; | ||
|
||
/** | ||
* Represents exception used when given cloud credentials file is not found. | ||
*/ | ||
public class CloudCredentialsFileNotFoundException extends IOException { | ||
public CloudCredentialsFileNotFoundException() { | ||
this(""); | ||
} | ||
|
||
public CloudCredentialsFileNotFoundException(Object... message) { | ||
super( | ||
new Formatter() | ||
.format( | ||
"Given cloud credentials file is not found: %s", Arrays.stream(message).toArray()) | ||
.toString()); | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
cli/src/main/java/com/objectstorage/exception/CloudCredentialsValidationException.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 used when given cloud credentials are not valid. | ||
*/ | ||
public class CloudCredentialsValidationException extends IOException { | ||
public CloudCredentialsValidationException() { | ||
this(""); | ||
} | ||
|
||
public CloudCredentialsValidationException(Object... message) { | ||
super( | ||
new Formatter() | ||
.format("Given cloud credentials are not valid: %s", Arrays.stream(message).toArray()) | ||
.toString()); | ||
} | ||
} |
Oops, something went wrong.