Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
Heimaufgabe2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RvS Programmierung
Heimaufgabe2
Commits
e12b1356
Commit
e12b1356
authored
2 years ago
by
mateis00
Browse files
Options
Downloads
Patches
Plain Diff
Server kann nun mit API requests antworten
parent
a396dcb0
No related branches found
Branches containing commit
No related tags found
1 merge request
!3
Ich checke nicht, warum der In und Output nicht funktioniert.
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
AufgabenStuff/ServerAnwendung/src/heimaufgaben/Server.java
+15
-1
15 additions, 1 deletion
AufgabenStuff/ServerAnwendung/src/heimaufgaben/Server.java
with
15 additions
and
1 deletion
AufgabenStuff/ServerAnwendung/src/heimaufgaben/Server.java
+
15
−
1
View file @
e12b1356
...
...
@@ -101,6 +101,20 @@ public class Server{
zumClient
.
write
(
"DATE "
+
new
SimpleDateFormat
(
"dd.MM.yyyy"
).
format
(
new
Date
())+
"\n"
);
zumClient
.
flush
();
}
else
if
(
eingabe
.
substring
(
0
,
8
).
equalsIgnoreCase
(
"HOLIDAYS"
))
{
String
year
=
eingabe
.
substring
(
10
,
14
);
String
output1
=
getHolidays
(
year
);
zumClient
.
write
(
output1
+
"\n"
);
zumClient
.
flush
();
}
else
if
(
eingabe
.
equalsIgnoreCase
(
"LATEST NEWS"
))
{
String
output2
=
getImportantNews
();
zumClient
.
write
(
output2
+
"\n"
);
zumClient
.
flush
();
}
else
if
(
eingabe
.
equalsIgnoreCase
(
"history"
))
{
String
ausg
=
"Gesamter Verlauf: "
;
for
(
int
i
=
0
;
i
<
verlauf
.
size
()-
1
;
i
++)
{
// Die gesamte Arraylist wird ausgegeben
...
...
@@ -153,7 +167,7 @@ public class Server{
zumClient
.
flush
();
}
}
catch
(
IOException
|
NullPointer
Exception
e
)
{
}
catch
(
Exception
e
)
{
System
.
err
.
println
(
"Fehler beim schreiben zum Client"
);
try
{
zumClient
.
write
(
"ERROR 500 INTERNAL SERVER ERROR\n"
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment