-
Bug
-
Resolution: Done
-
Minor
-
2.8.2.Final
-
None
This causing jvm to keep handlers and may cause issues.
Correct implementation may be:
public long getResourceLength(Node node) throws RepositoryException, IOException { InputStream is = null; long size = 0; int bytesRead; byte[] buff = new byte[255]; try { is = getResourceContent(node); while (-1 != (bytesRead = is.read(buff, 0, 255))) { size += bytesRead; } } finally { if (is != null) { try { is.close(); } catch (IOException e) { e.printStackTrace(); } } } return size; }