Member Avatar for

Whilst wondering around aimlessly, I came across a pack of "Afterworld" cards, and printed on these cards in quite a few places, was this script:

textOutput.append("Date : "+ new Date(usedURLConn.getDate())+"\n");
textOutput.append("Content-Type: "+usedURLConn.getContentType()+"\n");
len = usedURLConn.getContentLength();
textOutput.append("Content length: "+len+"\n\n");

if(len>0)
{
textOutput.append("The file's contents is as follows: \n--------------------\n");
InputStream input = usedURLConn.getInputStream();;
int i=len;
while (((c=input.read()) != -1) && (--i>0))
{
textOutput.append(""+(char)c);
}
input.close();
textOutput.append("\n--------------------\n");
}
else
{
textOutput.append("Sorry! That file is EMPTY, or that file does not exist!");
}
   }
});

}

}

Can anyone tell me what it is?

Looks like Java code that dumps the contents of a URL-referenced file to a text box. No idea what it might be part of.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.