Package com.crawljax.core

Examples of com.crawljax.core.CrawljaxException


  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


   *             this exception is always thrown when instanced.
   */
  private CrawljaxPluginsUtil() throws CrawljaxException {
    LOGGER.error("As this contructor is private and never used interal "
            + "in the CrawljaxPluginsUtil, this message may never appear");
    throw new CrawljaxException("Called private never used contructor CrawljaxPluginsUtil()");
  }
View Full Code Here

  public void setup() throws Exception {
    site = BaseCrawler.class.getResource("/site");
    try {
      server = new WebServer(Resource.newResource(site));
    } catch (IOException e) {
      throw new CrawljaxException("Could not load resource", e);
    }
    server.start();
  }
View Full Code Here

    URL sampleSites = BaseCrawler.class.getResource("/site");
    LOG.debug("Loading web server with from folder {}", sampleSites.toExternalForm());
    try {
      this.webServer = new WebServer(Resource.newResource(sampleSites));
    } catch (IOException e) {
      throw new CrawljaxException("Could not load resource", e);
    }
  }
View Full Code Here

  protected URL getUrl() {
    try {
      return new URL(webServer.getSiteUrl(), siteExtension);
    } catch (MalformedURLException e) {
      throw new CrawljaxException("Invalid URL: " + webServer.getSiteUrl() + siteExtension);
    }
  }
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

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.