override func point(inside point: CGPoint, with event: UIEvent?) -> Bool {
return background.frame.contains(point)
}
在执行try {
URL url = new URL(urlString);
HttpURLConnection repCon = (HttpURLConnection) url.openConnection();
repCon.setRequestMethod("GET");
repCon.setRequestProperty("User-Agent", "Chrome");
InputStream repInStream = repCon.getInputStream();
BufferedInputStream bis = new BufferedInputStream(repInStream);
byte[] buff = new byte[BUFFER_SIZE];
int bytesRead;
String strFileContents = new String();
while (-1 != (bytesRead = bis.read(buff, 0, BUFFER_SIZE))) {
strFileContents += new String(buff, 0, bytesRead);
}
String tempS = "";
String sb = "";
if (!strFileContents.toString().equalsIgnoreCase("") && strFileContents.toString() != null) {
// to do if strfile content has an index of ------=
if (strFileContents.contains("base64") && strFileContents.contains("------=")) {
tempS = strFileContents.substring(strFileContents.indexOf("base64") + 6,
strFileContents.lastIndexOf("------="));
bis.close();
byte[] content = new BASE64Decoder().decodeBuffer(tempS.toString());
sb = new String(content, "UTF-8") + "\n";
}
}
request.setAttribute("Content", sb);
} catch (IOException ioe) {
logger.error("ERROR :", ioe);
request.setAttribute("Content", ioe.getMessage() + "Check Report URL and Try Again.");
} catch (Exception e) {
logger.error("ERROR :", e);
request.setAttribute("Content", e.getMessage() + "Error file.");
}
return "success";
}
和其余语句之前查看渲染。因此,视图不显示任何数据,但我在渲染视图后检查了日志,查看了Inputstream
执行后的语句,并且数据在Inputstream
中可用。