954,174 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Random Programming Script

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?

Newbie Poster
post since May 2012
Reputation Points:
Solved Threads:
 

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.

gusano79
Posting Pro
519 posts since May 2004
Reputation Points: 182
Solved Threads: 77
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You