first commit
Some checks failed
Vulhub Format Check and Lint / format-check (push) Has been cancelled
Vulhub Format Check and Lint / markdown-check (push) Has been cancelled
Vulhub Docker Image CI / longtime-images-test (push) Has been cancelled
Vulhub Docker Image CI / images-test (push) Has been cancelled
Some checks failed
Vulhub Format Check and Lint / format-check (push) Has been cancelled
Vulhub Format Check and Lint / markdown-check (push) Has been cancelled
Vulhub Docker Image CI / longtime-images-test (push) Has been cancelled
Vulhub Docker Image CI / images-test (push) Has been cancelled
This commit is contained in:
33
base/xstream/1.4.15/.gitignore
vendored
Normal file
33
base/xstream/1.4.15/.gitignore
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
HELP.md
|
||||
target/
|
||||
!.mvn/wrapper/maven-wrapper.jar
|
||||
!**/src/main/**/target/
|
||||
!**/src/test/**/target/
|
||||
|
||||
### STS ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
.sts4-cache
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
.idea
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
|
||||
### NetBeans ###
|
||||
/nbproject/private/
|
||||
/nbbuild/
|
||||
/dist/
|
||||
/nbdist/
|
||||
/.nb-gradle/
|
||||
build/
|
||||
!**/src/main/**/build/
|
||||
!**/src/test/**/build/
|
||||
|
||||
### VS Code ###
|
||||
.vscode/
|
16
base/xstream/1.4.15/Dockerfile
Normal file
16
base/xstream/1.4.15/Dockerfile
Normal file
@@ -0,0 +1,16 @@
|
||||
FROM maven:3.8.1-jdk-8 AS builder
|
||||
|
||||
COPY ./ /usr/src/
|
||||
|
||||
RUN set -ex \
|
||||
&& cd /usr/src \
|
||||
&& mvn package
|
||||
|
||||
FROM openjdk:8-jre
|
||||
|
||||
LABEL maintainer="phithon <root@leavesongs.com>"
|
||||
|
||||
COPY --from=builder /usr/src/target/xstream-sample-1.4.15-SNAPSHOT.jar /xstream-sample.jar
|
||||
|
||||
EXPOSE 8080
|
||||
CMD ["java", "-jar", "/xstream-sample.jar"]
|
41
base/xstream/1.4.15/pom.xml
Normal file
41
base/xstream/1.4.15/pom.xml
Normal file
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.4.5</version>
|
||||
<relativePath/> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
<groupId>org.vulhub</groupId>
|
||||
<artifactId>xstream-sample</artifactId>
|
||||
<version>1.4.15-SNAPSHOT</version>
|
||||
<name>xstream-sample</name>
|
||||
<description>Demo project for Spring Boot</description>
|
||||
<properties>
|
||||
<java.version>1.8</java.version>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.thoughtworks.xstream</groupId>
|
||||
<artifactId>xstream</artifactId>
|
||||
<version>1.4.15</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
@@ -0,0 +1,24 @@
|
||||
package org.vulhub.xstreamsample;
|
||||
|
||||
import com.thoughtworks.xstream.XStream;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RestController
|
||||
public class HelloController {
|
||||
|
||||
@GetMapping(value = "/")
|
||||
public String hello()
|
||||
{
|
||||
return "hello, input your information please.";
|
||||
}
|
||||
|
||||
@PostMapping(value = "/")
|
||||
public String read(@RequestBody String data)
|
||||
{
|
||||
XStream xs = new XStream();
|
||||
xs.processAnnotations(User.class);
|
||||
User user = (User) xs.fromXML(data);
|
||||
|
||||
return "My name is " + user.getName() + ", I am " + user.getAge().toString() + " years old.";
|
||||
}
|
||||
}
|
@@ -0,0 +1,31 @@
|
||||
package org.vulhub.xstreamsample;
|
||||
|
||||
|
||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||
|
||||
@XStreamAlias("user")
|
||||
public class User {
|
||||
protected String name;
|
||||
protected Integer age;
|
||||
|
||||
public User(String name, Integer age) {
|
||||
this.name = name;
|
||||
this.age = age;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public Integer getAge() {
|
||||
return age;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public void setAge(Integer age) {
|
||||
this.age = age;
|
||||
}
|
||||
}
|
@@ -0,0 +1,13 @@
|
||||
package org.vulhub.xstreamsample;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@SpringBootApplication
|
||||
public class XstreamSampleApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(XstreamSampleApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,2 @@
|
||||
server.port=8080
|
||||
server.address=0.0.0.0
|
Reference in New Issue
Block a user