Question
what does this code doing and what it mean? In detail description. while ((fromClient = in.readLine()) != null) { if (fromClient.startsWith(FileName)) { System.out.println(fromClient); fileName =
what does this code doing and what it mean? In detail description.
while
((fromClient = in.readLine()) != null)
{
if (fromClient.startsWith("FileName"))
{
System.out.println(fromClient); fileName = fromClient.split(":")[1]; System.out.println("File name from client is: "+fileName); fileName ="OnServer_"fileName;
System.out.println("File name being saved is: "+fileName);
}
try
{
byte [] decode = Base64.getDecoder() .decode(fromClient); Files.write(Paths.eget(fileName) , decode);
System.out.println("File saved.");
System.out.println("File Bytes[] "+fromClient);
successCounter++;
System.out.println("success: "+successCounter);
)catch (Exception e)
{
System.out.println(e);
}
if(successCounter==5)
{
System.out.println("Bye.");
System.out.println("Bye.");
System.out.println("Bye.");
System.out.println("Bye.");
System.out.println("Bye.");
System.out.println("Bye.");
System.out.println("Bye.");
break communicationLoop;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started