URL pageUrl = new URL(baseUrl, "secure/ManageAttachments.jspa?id=" + issue.getId());
InputStream in = new BufferedInputStream(pageUrl.openStream());
StreamLexer lexer = new StreamLexer(in);
while (lexer.readToken("icons/attach") != null) {
try {
Attachment attachment = new Attachment();
String link = lexer.readToken("secure/attachment/", "\"");
URL url = new URL(pageUrl, "attachment/" + link);