@Override public int getContentLength() { return jarURLConnection.getContentLength(); }
@Override public int getContentLength() { return jarURLConnection.getContentLength(); }
@Override public int getContentLength() { return jarURLConnection.getContentLength(); }
/** * * @param jarUrl * @return */ protected byte[] _getData(URL jarUrl) { if (jarUrl != null) { try { JarURLConnection jar = (JarURLConnection) jarUrl.openConnection(); BufferedInputStream bis = new BufferedInputStream(jar.getInputStream()); ByteBuffer b = ByteBuffer.allocate(jar.getContentLength()).order(ByteOrder.nativeOrder()); byte[] r = new byte[512]; int rB = 0; while ((rB = bis.read(r)) != -1) { b.put(r, 0, rB); } bis.close(); return b.array(); } catch (IOException ex) { if (isDebugEnabled()) { ex.printStackTrace(); } } } return null; }
if (connection.getContentLength() == -1 || connection.getJarEntry() == null) { return Response.status(Status.NOT_FOUND).build(); } else if (connection.getJarEntry().isDirectory()) {
throw new HttpRequestFailure(HttpResponseStatus.FORBIDDEN, "Directory listing refused"); int length = jarConnection.getContentLength(); internalPath = entry.getName(); internalDate = new Date(entry.getLastModifiedTime().toMillis());