Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Franz Reischl
tomcat-miniREST
Commits
edc706d2
Commit
edc706d2
authored
Jul 14, 2019
by
Franz Reischl
Browse files
Request version
parent
d5584f64
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/university/at/jku/ce/resource/VersionResource.java
0 → 100644
View file @
edc706d2
package
university.at.jku.ce.resource
;
import
university.at.jku.ce.exception.ExceptionParam
;
import
javax.annotation.security.PermitAll
;
import
javax.ws.rs.GET
;
import
javax.ws.rs.Path
;
import
javax.ws.rs.Produces
;
import
javax.ws.rs.core.*
;
import
java.util.HashMap
;
@Path
(
"/version"
)
public
class
VersionResource
{
@PermitAll
@GET
@Produces
({
MediaType
.
APPLICATION_JSON
,
MediaType
.
APPLICATION_XML
})
public
Response
getUsers
(
@Context
HttpHeaders
headers
)
{
System
.
out
.
println
(
"Version requested"
);
ExceptionParam
.
setMediaType
(
headers
.
getMediaType
());
HashMap
<
String
,
String
>
versionNumber
=
new
HashMap
<>();
versionNumber
.
put
(
"version"
,
"2.0"
);
GenericEntity
<
HashMap
<
String
,
String
>>
entity
=
new
GenericEntity
<
HashMap
<
String
,
String
>>(
versionNumber
)
{
};
return
Response
.
ok
(
entity
).
build
();
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment