preparing document module

This commit is contained in:
2025-07-08 22:20:00 +02:00
parent e6e3ed4052
commit a11f2f0718
12 changed files with 82 additions and 8 deletions

View File

@@ -0,0 +1,5 @@
description = "Umbrella : Documents"
dependencies{
implementation(project(":core"))
}

View File

@@ -0,0 +1,8 @@
/* © SRSoftware 2025 */
package de.srsoftware.umbrella.documents;
public class Constants {
private Constants(){}
public static final String COMPANIES = "companies";
}

View File

@@ -0,0 +1,26 @@
/* © SRSoftware 2025 */
package de.srsoftware.umbrella.documents;
import static de.srsoftware.umbrella.core.ResponseCode.HTTP_NOT_IMPLEMENTED;
import static de.srsoftware.umbrella.documents.Constants.COMPANIES;
import com.sun.net.httpserver.HttpExchange;
import de.srsoftware.tools.Path;
import de.srsoftware.umbrella.core.BaseHandler;
import java.io.IOException;
public class DocumentApi extends BaseHandler {
@Override
public boolean doGet(Path path, HttpExchange ex) throws IOException {
addCors(ex);
var head = path.pop();
return switch (head){
case COMPANIES -> getCompanies(ex);
case null, default -> super.doGet(path,ex);
};
}
private boolean getCompanies(HttpExchange ex) throws IOException {
return sendEmptyResponse(HTTP_NOT_IMPLEMENTED,ex);
}
}