-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: split resource map from resource factory
- Loading branch information
Showing
9 changed files
with
85 additions
and
87 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
12 changes: 11 additions & 1 deletion
12
core/riot-file/src/main/java/com/redis/riot/file/ResourceMap.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 |
---|---|---|
@@ -1,9 +1,19 @@ | ||
package com.redis.riot.file; | ||
|
||
import org.springframework.core.io.Resource; | ||
import org.springframework.util.MimeType; | ||
import org.springframework.util.MimeTypeUtils; | ||
|
||
public interface ResourceMap { | ||
|
||
String getContentTypeFor(Resource resource); | ||
MimeType CSV = new MimeType("text", "csv"); | ||
MimeType PSV = new MimeType("text", "psv"); | ||
MimeType TSV = new MimeType("text", "tsv"); | ||
MimeType TEXT = new MimeType("text", "plain"); | ||
MimeType JSON = MimeTypeUtils.APPLICATION_JSON; | ||
MimeType JSON_LINES = new MimeType("application", "jsonlines"); | ||
MimeType XML = MimeTypeUtils.APPLICATION_XML; | ||
|
||
MimeType getContentTypeFor(Resource resource); | ||
|
||
} |
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