Package br.com.caelum.tubaina

Examples of br.com.caelum.tubaina.TubainaException


    try {
      PrintStream stream = new PrintStream(new FileOutputStream(new File("todo.log"), true));
      stream.println("<==========================================================>");
      stream.println(string.trim());
    } catch (FileNotFoundException e) {
      throw new TubainaException("File could not be read", e);
    }
    return "";
  }
View Full Code Here


    root.mkdir();
    dirTree.add(rootDir);
    for (Chapter c : b.getChapters()) {
      String chapDir = rootDir + "/" + Utilities.toDirectoryName(null, c.getTitle());
      if (dirTree.contains(chapDir)) {
        throw new TubainaException("Doubled archive name: " + c.getTitle());
      }
      File chapter = new File(parent, chapDir);
      chapter.mkdir();

      dirTree.add(chapDir);
View Full Code Here

    file.mkdir();
    saveToFile(file, sb);
   
   
    if (resourceCopyFailed)
      throw new TubainaException("Couldn't copy some resources. See the Logger for further information");
  }
View Full Code Here

        foundInvalidXHTML = true;
        LOG.warn("This is not a xhtml valid file: " + s + "/index.html");
      }
    }
    if (foundInvalidXHTML)
      throw new TubainaException("Some xhtml generated is not valid. See " + XHTMLValidator.validatorLogFile + " for further information");

  }
View Full Code Here

    this.columns = columns;
  }

  public String parse(String text, String title) {
    if (this.columns <= 0)
      throw new TubainaException("There are no columns inside table " + title);
    String tag =  "\\begin{table}[!h]\n\\caption{" + title + "}\n\\begin{center}\n";
    if (!noborder)
      tag += "\\rowcolors[]{1}{gray!30}{gray!15}\n";
    tag += "\\begin{tabular}{";
    for (int i = 0; i < columns; i++)
View Full Code Here

        }

      }
    }
    if (resourceCopyFailed)
      throw new TubainaException("Couldn't copy some resources. See the Logger for further information");
  }
View Full Code Here

    try {
      PrintStream stream = new PrintStream(new FileOutputStream(new File("todo.log"), true));
      stream.println("<==========================================================>");
      stream.println(string.trim());
    } catch (FileNotFoundException e) {
      throw new TubainaException("File could not be read", e);
    }
    return "";
  }
View Full Code Here

    try {
      BufferedImage src = ImageIO.read(srcImage);
      return src.getWidth();
    } catch (IOException e) {
      LOG.warn("Couldn't get image width for: " + srcImage.getPath());
      throw new TubainaException("Couldn't get image width");
    }
  }
View Full Code Here

          accepted = true;
          break;
        }
      }
      if (!accepted)
        throw new TubainaException("There is a syntax error on chapter "+ Chapter.getChaptersCount() +
          ": Probably, there is some text inside an exercise tag, but outside a question tag");
    }
    return chunks;
  }
View Full Code Here

    locator = new ResourceLocator(rootDir);
  }

  public static ResourceLocator getInstance() {
    if (locator == null) {
      throw new TubainaException("ResourceLocator has not been initialized");
    }
    return locator;
  }
View Full Code Here

TOP

Related Classes of br.com.caelum.tubaina.TubainaException

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.