Package com.crawljax.core

Examples of com.crawljax.core.CrawljaxException


   */
  public static CrawljaxConfigurationBuilder builderFor(String url) {
    try {
      return new CrawljaxConfigurationBuilder(new URL(url));
    } catch (MalformedURLException e) {
      throw new CrawljaxException("Could not read that URL", e);
    }
  }
View Full Code Here


   *             when not can be determined whether xpath contains needed xpath locaton
   */
  public boolean checkXpathStartsWithXpathEventableCondition(Document dom,
          EventableCondition eventableCondition, String xpath) throws XPathExpressionException {
    if (eventableCondition == null || Strings.isNullOrEmpty(eventableCondition.getInXPath())) {
      throw new CrawljaxException("Eventable has no XPath condition");
    }
    List<String> expressions =
            XPathHelper.getXpathForXPathExpressions(dom, eventableCondition.getInXPath());

    return checkXPathUnderXPaths(xpath, expressions);
View Full Code Here

  private StateVertex getSuperField(String name) throws CrawljaxException {
    try {
      return (StateVertex) searchSuperField(name).get(this);
    } catch (IllegalArgumentException e) {
      throw new CrawljaxException(e.getMessage(), e);
    } catch (IllegalAccessException e) {
      throw new CrawljaxException(e.getMessage(), e);
    }

  }
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

  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

      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

    } else {
      LOG.debug("Loading skeleton as file");
      try {
        FileUtils.copyDirectory(new File(skeleton.toURI()), outputDir);
      } catch (IOException | URISyntaxException e) {
        throw new CrawljaxException(
                "Could not copy required resources: " + e.getMessage(), e);
      }
    }

  }
View Full Code Here

          ByteStreams.copy(zis, out);
          out.close();
        }
      }
    } catch (IOException e1) {
      throw new CrawljaxException("Could not copy required resources: " + e1.getMessage(),
              e1);
    }
  }
View Full Code Here

  private File getJar(URL skeleton) {
    String path;
    try {
      path = URLDecoder.decode(skeleton.getPath(), "UTF-8");
    } catch (UnsupportedEncodingException e) {
      throw new CrawljaxException("Could not process the path of the Overview skeleton "
              + skeleton, e);
    }
    String jarpath = path.substring("file:".length(), path.indexOf("jar!") + "jar".length());
    File jar = new File(jarpath);
    LOG.debug("Jar file {} from path {}", jar, path);
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.