Package freenet.client.filter

Examples of freenet.client.filter.UnsafeContentTypeException


        option.addChild("a", "href", '/' + key.toString(), getFilename(key, e.getExpectedMimeType()));

        String mime = writeSizeAndMIME(fileInformationList, e);
        infobox = contentNode.addChild("div", "class", "infobox infobox-error");
        infobox.addChild("div", "class", "infobox-header", l10n("explanationTitle"));
        UnsafeContentTypeException filterException = null;
        if(e.getCause() != null && e.getCause() instanceof UnsafeContentTypeException) {
          filterException = (UnsafeContentTypeException)e.getCause();
        }
        infoboxContent = infobox.addChild("div", "class", "infobox-content");
        if(filterException == null)
          infoboxContent.addChild("p", l10n("unableToRetrieve"));
        else
          infoboxContent.addChild("p", l10n("unableToSafelyDisplay"));
        if(e.isFatal() && filterException == null)
          infoboxContent.addChild("p", l10n("errorIsFatal"));
        infoboxContent.addChild("p", msg);
        if(filterException != null) {
          if(filterException.details() != null) {
            HTMLNode detailList = infoboxContent.addChild("ul");
            for(String detail : filterException.details()) {
              detailList.addChild("li", detail);
            }
          }
        }
        if(e.errorCodes != null) {
View Full Code Here


        String mime = e.getExpectedMimeType();
        if(ctx.overrideMIME != null)
          mime = ctx.overrideMIME;
        if(mime != null && !"".equals(mime)) {
          // Even if it's the default, it is set because we have the final size.
          UnsafeContentTypeException unsafe = ContentFilter.checkMIMEType(mime);
          if(unsafe != null) {
            e = unsafe.recreateFetchException(e, mime);
          }
        }
      }
    }
   
View Full Code Here

    if(mime == null || mime.equals("")) return;
        synchronized(this) {
            expectedMIME = mime;
        }
    if(ctx.filterData) {
      UnsafeContentTypeException e = ContentFilter.checkMIMEType(mime);
      if(e != null) {
        throw e.createFetchException(mime, expectedSize);
      }
      if(forceCompatibleExtension != null)
        checkCompatibleExtension(mime);
    }
    context.getJobRunner(persistent()).queueNormalOrDrop(new PersistentJob() {
View Full Code Here

TOP

Related Classes of freenet.client.filter.UnsafeContentTypeException

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.