Package com.crawljax.core

Examples of com.crawljax.core.CrawljaxException


      if (parameters.hasOption(OVERRIDE)) {
        System.out.println("Overriding output directory...");
        try {
          FileUtils.deleteDirectory(out);
        } catch (IOException e) {
          throw new CrawljaxException(e.getMessage(), e);
        }
      } else {
        throw new IllegalStateException(
                "Output directory is not empty. If you want to override, use the -override option");
      }
View Full Code Here


        String encodedPassword = URLEncoder.encode(password, "UTF-8");
        String hostPrefix = encodedUsername + ":" + encodedPassword + "@";
        config.url = URI.create(config.url.toString().replaceFirst("://", "://" + hostPrefix));
      }
      catch (UnsupportedEncodingException e) {
        throw new CrawljaxException("Could not parse the username/password to a URL", e);
      }
      return this;
    }
View Full Code Here

  private String getCrawljaxVersion() {
    try {
      return Resources
              .toString(JarRunner.class.getResource("/project.version"), Charsets.UTF_8);
    } catch (IOException e) {
      throw new CrawljaxException(e.getMessage(), e);
    }
  }
View Full Code Here

        if (!f.exists()) {
          Files.createParentDirs(f);
          Files.touch(f);
        }
      } catch (IOException e) {
        throw new CrawljaxException("Could not create log file: " + e.getMessage(), e);
      }
      Preconditions.checkArgument(f.canWrite());
      LogUtil.logToFile(f.getPath());
    }
View Full Code Here

      transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
      transformer.setOutputProperty(OutputKeys.METHOD, "html");
      transformer.transform(source, result);
      return stringWriter.getBuffer().toString();
    } catch (TransformerException e) {
      throw new CrawljaxException("Could not tranform the DOM", e);
    }

  }
View Full Code Here

    try {
      JavascriptExecutor js = (JavascriptExecutor) browser;
      return js.executeScript(code);
    } catch (WebDriverException e) {
      throwIfConnectionException(e);
      throw new CrawljaxException(e);
    }
  }
View Full Code Here

    try {
      Document document = DomUtils.asDocument(browser.getPageSource());
      appendFrameContent(document.getDocumentElement(), document, "");
      return document;
    } catch (IOException e) {
      throw new CrawljaxException(e.getMessage(), e);
    }

  }
View Full Code Here

    try {
      File tmpfile = takeScreenShotOnBrowser(browser, OutputType.FILE);
      try {
        Files.copy(tmpfile, file);
      } catch (IOException e) {
        throw new CrawljaxException(e);
      }
    } catch (WebDriverException e) {
      throw wrapWebDriverExceptionIfConnectionException(e);
    }
  }
View Full Code Here

      WebDriver augmentedWebdriver = new Augmenter().augment(driver);
      return takeScreenShotOnBrowser(augmentedWebdriver, outType);
    } else if (driver instanceof WrapsDriver) {
      return takeScreenShotOnBrowser(((WrapsDriver) driver).getWrappedDriver(), outType);
    } else {
      throw new CrawljaxException("Your current WebDriver doesn't support screenshots.");
    }
  }
View Full Code Here

    try {
      Image image = ImageIO.read(new ByteArrayInputStream(png));
      writeFullSizeJpeg(fullFile, image);
      writeThumbNail(thumnail, image);
    } catch (IOException e) {
      throw new CrawljaxException("Could not write screenshots to disk", e);
    }

  }
View Full Code Here

TOP

Related Classes of com.crawljax.core.CrawljaxException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.