Skip to content

Commit 026ab18

Browse files
committed
Add pom.xml; Update README
1 parent 2f80e37 commit 026ab18

File tree

8 files changed

+134
-2
lines changed

8 files changed

+134
-2
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,5 @@ hs_err_pid*
2626
*.idea
2727
*.iml
2828
/_psd
29-
/.gradle
29+
/.gradle
30+
/target

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
src="https://img.shields.io/badge/Java-8-E76E0D.svg"></a>
1717
<a href="https://docs.oracle.com/javase/8/"><img
1818
alt="Current version"
19-
src="https://img.shields.io/badge/version-0.0.9%20alpha-EB4D5C.svg"></a>
19+
src="https://img.shields.io/badge/version-0.0.10%20alpha-EB4D5C.svg"></a>
2020
<a href="https://www.patreon.com/simonwep"><img
2121
alt="Support me"
2222
src="https://img.shields.io/badge/patreon-support-DF2D41.svg"></a>
@@ -26,6 +26,9 @@
2626
<a href="https://travis-ci.org/Simonwep/java-express"><img
2727
alt="Build Status"
2828
src="https://travis-ci.org/Simonwep/java-express.svg?branch=master"></a>
29+
<a href="https://maven-badges.herokuapp.com/maven-central/com.github.Simonwep/java-express"><img
30+
alt="Build Status"
31+
src="https://maven-badges.herokuapp.com/maven-central/com.github.Simonwep/java-express/badge.svg"></a>
2932
</p>
3033

3134
<br>

pom.xml

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<name>Java Express</name>
8+
<description>HTTP Framework based on expressjs, no dependencies, simple usage.</description>
9+
<url>https://github.com/Simonwep/java-express</url>
10+
<groupId>com.github.Simonwep</groupId>
11+
<artifactId>java-express</artifactId>
12+
<packaging>jar</packaging>
13+
<version>0.0.10</version>
14+
15+
<build>
16+
<plugins>
17+
<plugin>
18+
<groupId>org.apache.maven.plugins</groupId>
19+
<artifactId>maven-compiler-plugin</artifactId>
20+
<configuration>
21+
<source>1.8</source>
22+
<target>1.8</target>
23+
</configuration>
24+
</plugin>
25+
<plugin>
26+
<groupId>org.sonatype.plugins</groupId>
27+
<artifactId>nexus-staging-maven-plugin</artifactId>
28+
<version>1.6.7</version>
29+
<extensions>true</extensions>
30+
<configuration>
31+
<serverId>ossrh</serverId>
32+
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
33+
<autoReleaseAfterClose>true</autoReleaseAfterClose>
34+
</configuration>
35+
</plugin>
36+
<plugin>
37+
<groupId>org.apache.maven.plugins</groupId>
38+
<artifactId>maven-source-plugin</artifactId>
39+
<version>3.0.1</version>
40+
<executions>
41+
<execution>
42+
<id>attach-sources</id>
43+
<goals>
44+
<goal>jar-no-fork</goal>
45+
</goals>
46+
</execution>
47+
</executions>
48+
</plugin>
49+
<plugin>
50+
<groupId>org.apache.maven.plugins</groupId>
51+
<artifactId>maven-javadoc-plugin</artifactId>
52+
<version>3.1.0</version>
53+
<executions>
54+
<execution>
55+
<id>attach-javadocs</id>
56+
<goals>
57+
<goal>jar</goal>
58+
</goals>
59+
</execution>
60+
</executions>
61+
</plugin>
62+
<plugin>
63+
<groupId>org.apache.maven.plugins</groupId>
64+
<artifactId>maven-gpg-plugin</artifactId>
65+
<version>1.6</version>
66+
<executions>
67+
<execution>
68+
<id>sign-artifacts</id>
69+
<phase>verify</phase>
70+
<goals>
71+
<goal>sign</goal>
72+
</goals>
73+
</execution>
74+
</executions>
75+
</plugin>
76+
</plugins>
77+
</build>
78+
79+
<distributionManagement>
80+
<snapshotRepository>
81+
<id>ossrh</id>
82+
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
83+
</snapshotRepository>
84+
<repository>
85+
<id>ossrh</id>
86+
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
87+
</repository>
88+
</distributionManagement>
89+
90+
<licenses>
91+
<license>
92+
<name>MIT License</name>
93+
<url>https://opensource.org/licenses/MIT</url>
94+
<distribution>repo</distribution>
95+
</license>
96+
</licenses>
97+
98+
<developers>
99+
<developer>
100+
<name>Simon Reinisch</name>
101+
<email>[email protected]</email>
102+
<organization>com.github.Simonwep</organization>
103+
<organizationUrl>https://github.com/Simonwep/java-express</organizationUrl>
104+
</developer>
105+
</developers>
106+
107+
<scm>
108+
<connection>scm:git:git://github.com/sSimonwep/java-express.git</connection>
109+
<developerConnection>scm:git:ssh://github.com:Simonwep/java-express.git</developerConnection>
110+
<url>http://github.com/Simonwep/java-express/tree/master</url>
111+
</scm>
112+
</project>

src/main/java/express/Express.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ public boolean isSecure() {
9797
*
9898
* @param param The parameter name.
9999
* @param request An request handler.
100+
* @return Express this express instance
100101
*/
101102
public Express onParam(String param, HttpRequestHandler request) {
102103
parameterListener.put(param, request);
@@ -148,6 +149,7 @@ public void setExecutor(Executor executor) throws IOException {
148149
* Add an routing object.
149150
*
150151
* @param router The router.
152+
* @return Express this express instance
151153
*/
152154
public Express use(ExpressRouter router) {
153155
this.handler.combine(router.getHandler());
@@ -160,6 +162,7 @@ public Express use(ExpressRouter router) {
160162
*
161163
* @param root The root path for all request to this router.
162164
* @param router The router.
165+
* @return Express this express instance
163166
*/
164167
@SuppressWarnings("unchecked")
165168
public Express use(String root, ExpressRouter router) {

src/main/java/express/http/request/Authorization.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public Authorization(String authHeader) {
3030
}
3131

3232
/**
33+
* @param req Request instance
3334
* @return A list of authorization options that are contained in the given request.
3435
* Authorization options can be separated by a comma in the Authorization header.
3536
*/
@@ -49,6 +50,10 @@ public static List<Authorization> get(Request req) {
4950
* Validates the given request authentication using each of the given predicates.
5051
* If any of the predicates returns <code>true</code>, the request is counted as
5152
* validly authorized and the method returns <code>true</code>.
53+
*
54+
* @param req Request instance
55+
* @param validators Validators
56+
* @return If authorization was successful
5257
*/
5358
@SafeVarargs
5459
public static boolean validate(Request req, Predicate<Authorization>... validators) {

src/main/java/express/http/request/Request.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,8 @@ public HashMap<String, String> getParams() {
381381

382382
/**
383383
* Set the params.
384+
*
385+
* @param params Request parameter
384386
*/
385387
public void setParams(HashMap<String, String> params) {
386388
this.params = params;

src/main/java/express/middleware/Middleware.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ private Middleware() {}
1818
*
1919
* @param cookieName An name for the session-cookie, it's recommend to use NOT SID for security reasons
2020
* @param maxAge An max-age for the cookie
21+
* @return New CookieSession
2122
*/
2223
public static CookieSession cookieSession(String cookieName, long maxAge) {
2324
return new CookieSession(cookieName, maxAge);
@@ -28,6 +29,8 @@ public static CookieSession cookieSession(String cookieName, long maxAge) {
2829
* web application, You can use <code>StaticOptions</code> to add som configurations.
2930
*
3031
* @param directoryPath The root directory
32+
* @return A fresh FileProvider
33+
* @throws IOException If path cannot be found or something like that
3134
*/
3235
public static FileProvider statics(String directoryPath) throws IOException {
3336
return new FileProvider(directoryPath, new FileProviderOptions());
@@ -39,6 +42,8 @@ public static FileProvider statics(String directoryPath) throws IOException {
3942
*
4043
* @param directoryPath The root directory
4144
* @param staticOptions Optional options for the file serving.
45+
* @return A fresh FileProvider
46+
* @throws IOException If path cannot be found or something like that
4247
*/
4348
public static FileProvider statics(String directoryPath, FileProviderOptions staticOptions) throws IOException {
4449
return new FileProvider(directoryPath, staticOptions);

src/main/java/express/utils/Utils.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ public static String randomToken(int byteLength, int radix) {
7272

7373
/**
7474
* @return Your ip.
75+
* @throws UnknownHostException If resolving fails
7576
*/
7677
public static String getYourIp() throws UnknownHostException {
7778
return Inet4Address.getLocalHost().getHostAddress();

0 commit comments

Comments
 (0)