Package org.olat.core.logging

Examples of org.olat.core.logging.OLATRuntimeException


    return output;
  }

  private void printOriginStackTrace() {
    // use stacktrace to find out more where the filter was used
    OLATRuntimeException ore = new OLATRuntimeException("XSSFilter dummy", null);
    final Writer result = new StringWriter();
    final PrintWriter printWriter = new PrintWriter(result);
    ore.printStackTrace(printWriter);
  }
View Full Code Here


      }
      // disable drag&drop support
      node.put(AjaxTreeNode.CONF_ALLOWDRAG, false);
      node.put(AjaxTreeNode.CONF_ALLOWDROP, false);
    } catch (JSONException e) {
      throw new OLATRuntimeException("Error while creating AjaxTreeNode for VFSItem::" + vfsItem, e);
    }

    return node;
  }
View Full Code Here

    sb.append(": in ").append(packageName);
    sb.append(" (fallback:").append(fallBack);
    String babel = fallBackTranslator == null ? "-" : fallBackTranslator.toString();
    sb.append(", fallBackTranslator:").append(babel);
    sb.append(") for locale ").append(locale);
    OLATRuntimeException ore = new OLATRuntimeException("transl dummy",null);
    //use stracktrace to find out more where the missing translation comes from
    final Writer result = new StringWriter();
    final PrintWriter printWriter = new PrintWriter(result);
    ore.printStackTrace(printWriter);
   
    sb.append(result.toString());
    return sb.toString();
  }
View Full Code Here

    String rootDir = servletContext.getRealPath("/");
    File fContextRoot = new File(rootDir);
    try {
      contextRoot = fContextRoot.getCanonicalPath();
    } catch (IOException ioe) {
      throw new OLATRuntimeException(WebappHelper.class, "Error getting canonical context root.", ioe);
    }
    testUtf8FileSystem();
    logStartup();
  }
View Full Code Here

        } else {
          break;
        } // hit eof
      } // end while
    } catch (MalformedStreamException e) {
      throw new OLATRuntimeException("Could not read stream", e);
    } catch (IOException e) {
      // don't log as error - happens all the time (ClientAbortException)
      if (log.isDebug()) log.debug("Could not copy stream::" + e.getMessage());
      return false;
    }
View Full Code Here

   */
  public static void save(File target, String data, String encoding) {
    try {
      save(new FileOutputStream(target), data, StringHelper.check4xMacRoman(encoding));
    } catch (IOException e) {
      throw new OLATRuntimeException(FileUtils.class, "could not save file", e);
    }
  }
View Full Code Here

    try {
      byte[] ba = data.getBytes(StringHelper.check4xMacRoman(encoding));
      ByteArrayInputStream bis = new ByteArrayInputStream(ba);
      return bis;
    } catch (IOException e) {
      throw new OLATRuntimeException(FileUtils.class, "could not save to output stream", e);
    }
  }
View Full Code Here

      byte[] ba = data.getBytes(StringHelper.check4xMacRoman(encoding));
      ByteArrayInputStream bis = new ByteArrayInputStream(ba);
      boolean success = FileUtils.copy(bis, target);
      bis.close();
      target.close();
      if (!success) throw new OLATRuntimeException(FileUtils.class, "could not save to output stream",null);
    } catch (IOException e) {
      throw new OLATRuntimeException(FileUtils.class, "could not save to output stream", e);
    }
  }
View Full Code Here

      BufferedOutputStream bos = new BufferedOutputStream(fos);
      boolean success = FileUtils.copy(bis, bos);
      bis.close();
      bos.close();
      fos.close();
      if (!success) throw new OLATRuntimeException(FileUtils.class, "could not save stream to file::" + target.getAbsolutePath(),null);
    } catch (IOException e) {
      throw new OLATRuntimeException(FileUtils.class, "could not save stream to file::" + target.getAbsolutePath(), e);
    }   
  }
View Full Code Here

      source.close();
      bas.close();
      if (!success) throw new RuntimeException("could not copy inputstream to ram");
      htmltext = bas.toString(StringHelper.check4xMacRoman(encoding));
    } catch (IOException e) {
      throw new OLATRuntimeException(FileUtils.class, "could not load from inputstream", e);
    }
    return htmltext;
  }
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.