Package org.olat.core.logging

Examples of org.olat.core.logging.OLATRuntimeException


      SAXReader reader = new SAXReader();
      reader.setEntityResolver(er);
      reader.setValidation(validateXML);
      document = reader.read(in, "");
    } catch (Exception e) {
      throw new OLATRuntimeException(XMLParser.class, "Exception reading XML", e);
    }
    return document;
  }
View Full Code Here


    try {
      e = new XMLEncoder(new BufferedOutputStream(new FileOutputStream(file)));
      e.writeObject(o);
      e.close();
    } catch (FileNotFoundException e1) {
      throw new OLATRuntimeException(Util.class, "Error writing object to XML.", e1);
    }

  }
View Full Code Here

    try {
      fis = new FileInputStream(file);
      bis = new BufferedInputStream(fis);
      return readObject(xStream, bis);
    } catch (IOException e) {
      throw new OLATRuntimeException(XStreamHelper.class,
          "could not read Object from file: "
              + file.getAbsolutePath(), e);
    } finally {
      try {
        if (fis != null)
View Full Code Here

    try {
      fis = file.getInputStream();
      bis = new BufferedInputStream(fis);
      return readObject(xStream, bis);
    } catch (Exception e) {
      throw new OLATRuntimeException(XStreamHelper.class,
          "could not read Object from file: "
              + file.getName(), e);
    } finally {
      try {
        if (fis != null)
View Full Code Here

      Object obj = xStream.fromXML(isr);
      isr.close();
      is.close();
      return obj;
    } catch (Exception e) {
      throw new OLATRuntimeException(XStreamHelper.class,
          "could not read Object from inputstream: " + is, e);
    } finally {
      FileUtils.closeSafely(is);
    }
  }
View Full Code Here

   */
  public static void writeObject(XStream xStream, File file, Object obj) {
    try {
      writeObject(xStream, new FileOutputStream(file), obj);
    } catch (Exception e) {
      throw new OLATRuntimeException(
          XStreamHelper.class,
          "Could not write object to file: " + file.getAbsolutePath(),
          e);
    }
  }
View Full Code Here

      data = "<?xml version=\"1.0\" encoding=\"" + ENCODING + "\"?>\n"
          + data; // give a decent header with the encoding used
      osw.write(data);
      osw.close();
    } catch (Exception e) {
      throw new OLATRuntimeException(XStreamHelper.class,
          "Could not write object to stream.", e);
    } finally {
      FileUtils.closeSafely(os);
    }
  }
View Full Code Here

                logWarn("Could not read uploaded file >"+fileName+"< from stream. Possibly an attempt to upload a directory instead of a file (happens on Mac)",e);
                if (tmpFile.exists()) tmpFile.delete();
                return;
              }
             
              throw new OLATRuntimeException("Could not save uploaded file",e);             
            }
          }
        }
      } catch (SizeLimitExceededException sizeLimitExceededException) {
        logError("Error while dispatching multipart form: file limit (" + uploadSize + ") exceeded", sizeLimitExceededException);
View Full Code Here

          sb.append(instr.getString(accepted));
          sb.append("\" ");
        }
      }
    } catch (JSONException e) {
      throw new OLATRuntimeException(
          "error retrieving JSON style render instruction", e);
    }
  }
View Full Code Here

    }
   
    // add multiselect form actions
    List multiSelectActionsi18nKeys = table.getMultiSelectActionsI18nKeys();
    List multiSelectActionsIdentifiers = table.getMultiSelectActionsIdentifiers();
    if (table.isMultiSelect() && multiSelectActionsi18nKeys.size() == 0) throw new OLATRuntimeException(null,
        "Action key in multiselect table is undefined. Use addMultiSelectI18nAction(\"i18nkey\", \"action\"); to set an action for this multiselect table.", null);
    target.append("<div class=\"b_table_buttons\">");
    for (int i = 0; i < multiSelectActionsi18nKeys.size(); i++) {
      String multiSelectActionsi18nKey = (String)multiSelectActionsi18nKeys.get(i);
      String multiSelectActionIdentifer = (String)multiSelectActionsIdentifiers.get(i);
View Full Code Here

TOP

Related Classes of org.olat.core.logging.OLATRuntimeException

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.