Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace Guava Charsets with JDK StandardCharsets
- Loading branch information
Showing
21 changed files
with
87 additions
and
71 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
10 changes: 5 additions & 5 deletions
10
dropwizard-example/src/main/java/com/example/helloworld/resources/ViewResource.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,43 +1,43 @@ | ||
package com.example.helloworld.resources; | ||
|
||
import com.google.common.base.Charsets; | ||
import io.dropwizard.views.View; | ||
|
||
import javax.ws.rs.GET; | ||
import javax.ws.rs.Path; | ||
import javax.ws.rs.Produces; | ||
import java.nio.charset.StandardCharsets; | ||
|
||
@Path("/views") | ||
public class ViewResource { | ||
@GET | ||
@Produces("text/html;charset=UTF-8") | ||
@Path("/utf8.ftl") | ||
public View freemarkerUTF8() { | ||
return new View("/views/ftl/utf8.ftl", Charsets.UTF_8) { | ||
return new View("/views/ftl/utf8.ftl", StandardCharsets.UTF_8) { | ||
}; | ||
} | ||
|
||
@GET | ||
@Produces("text/html;charset=ISO-8859-1") | ||
@Path("/iso88591.ftl") | ||
public View freemarkerISO88591() { | ||
return new View("/views/ftl/iso88591.ftl", Charsets.ISO_8859_1) { | ||
return new View("/views/ftl/iso88591.ftl", StandardCharsets.ISO_8859_1) { | ||
}; | ||
} | ||
|
||
@GET | ||
@Produces("text/html;charset=UTF-8") | ||
@Path("/utf8.mustache") | ||
public View mustacheUTF8() { | ||
return new View("/views/mustache/utf8.mustache", Charsets.UTF_8) { | ||
return new View("/views/mustache/utf8.mustache", StandardCharsets.UTF_8) { | ||
}; | ||
} | ||
|
||
@GET | ||
@Produces("text/html;charset=ISO-8859-1") | ||
@Path("/iso88591.mustache") | ||
public View mustacheISO88591() { | ||
return new View("/views/mustache/iso88591.mustache", Charsets.ISO_8859_1) { | ||
return new View("/views/mustache/iso88591.mustache", StandardCharsets.ISO_8859_1) { | ||
}; | ||
} | ||
} |
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
Oops, something went wrong.