/** * {@inheritDoc} * The default behavior of this method is to return getContentAsBytes() on the wrapped connection object. */ public byte[] getContentAsBytes() { return wrappedWebResponse_.getContentAsBytes(); }
/** * {@inheritDoc} * The default behavior of this method is to return getContentAsBytes() on the wrapped connection object. */ public byte[] getContentAsBytes() { return wrappedWebResponse_.getContentAsBytes(); }
/** * {@inheritDoc} * The default behavior of this method is to return getContentAsBytes() on the wrapped connection object. */ public byte[] getContentAsBytes() { return wrappedWebResponse_.getContentAsBytes(); }
private static String extractStackTrace(WebResponse response) { String responseBody = new String(response.getContentAsBytes()); int beginning = responseBody.indexOf(STACK_TRACE_BEGIN) + STACK_TRACE_BEGIN.length(); int ending = responseBody.indexOf(STACK_TRACE_END, beginning); return HEADER + responseBody.substring(beginning, ending) + FOOTER; } }
/** * Reads the class name from the bytes of a .class file. * @param webResponse response containing the bytes the class * @return the full class name */ public static String readClassName(final WebResponse webResponse) { return readClassName(webResponse.getContentAsBytes()); }
/** * Reads the class name from the bytes of a .class file. * @param webResponse response containing the bytes the class * @return the full class name */ public static String readClassName(final WebResponse webResponse) { return readClassName(webResponse.getContentAsBytes()); }
/** * Reads the class name from the bytes of a .class file. * @param webResponse response containing the bytes the class * @return the full class name */ public static String readClassName(final WebResponse webResponse) { return readClassName(webResponse.getContentAsBytes()); }
private void readClassesFromJar(final WebResponse webResponse) throws IOException { final File tmpFile = File.createTempFile("HtmlUnit", "jar"); tmpFile.deleteOnExit(); FileUtils.writeByteArrayToFile(tmpFile, webResponse.getContentAsBytes()); final JarFile jarFile = new JarFile(tmpFile); final Enumeration<JarEntry> entries = jarFile.entries(); while (entries.hasMoreElements()) { final JarEntry entry = entries.nextElement(); final String name = entry.getName(); if (name.endsWith(".class")) { final String className = name.replace('/', '.').substring(0, name.length() - 6); jarFiles_.put(className, jarFile); LOG.trace("Jar entry: " + className); } } }
private void readClassesFromJar(final WebResponse webResponse) throws IOException { final File tmpFile = File.createTempFile("HtmlUnit", "jar"); tmpFile.deleteOnExit(); FileUtils.writeByteArrayToFile(tmpFile, webResponse.getContentAsBytes()); final JarFile jarFile = new JarFile(tmpFile); final Enumeration<JarEntry> entries = jarFile.entries(); while (entries.hasMoreElements()) { final JarEntry entry = entries.nextElement(); final String name = entry.getName(); if (name.endsWith(".class")) { final String className = name.replace('/', '.').substring(0, name.length() - 6); jarFiles_.put(className, jarFile); LOG.trace("Jar entry: " + className); } } }
private void readClassesFromJar(final WebResponse webResponse) throws IOException { final File tmpFile = File.createTempFile("HtmlUnit", "jar"); tmpFile.deleteOnExit(); FileUtils.writeByteArrayToFile(tmpFile, webResponse.getContentAsBytes()); final JarFile jarFile = new JarFile(tmpFile); final Enumeration<JarEntry> entries = jarFile.entries(); while (entries.hasMoreElements()) { final JarEntry entry = entries.nextElement(); final String name = entry.getName(); if (name.endsWith(".class")) { final String className = name.replace('/', '.').substring(0, name.length() - 6); jarFiles_.put(className, jarFile); LOG.trace("Jar entry: " + className); } } }
buffer.append("responseSize: " + response.getContentAsBytes().length + ", "); buffer.append("responseHeaders: " + nameValueListToJsMap(response.getResponseHeaders())); buffer.append("};\n");
buffer.append("responseSize: " + response.getContentAsBytes().length + ", "); buffer.append("responseHeaders: " + nameValueListToJsMap(response.getResponseHeaders())); buffer.append("};\n");
buffer.append("responseSize: " + response.getContentAsBytes().length + ", "); buffer.append("responseHeaders: " + nameValueListToJsMap(response.getResponseHeaders())); buffer.append("};\n");