Codota Logo
InputFileInfo
Code IndexAdd Codota to your IDE (free)

How to use
InputFileInfo
in
org.nuxeo.ecm.platform.ui.web.component.file

Best Java code snippets using org.nuxeo.ecm.platform.ui.web.component.file.InputFileInfo (Showing top 3 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
BufferedReader b =
  • Codota IconInputStream in;new BufferedReader(new InputStreamReader(in))
  • Codota IconReader in;new BufferedReader(in)
  • Codota IconFile file;new BufferedReader(new FileReader(file))
  • Smart code suggestions by Codota
}
origin: toutatice-services.uar/toutatice-uar-ecm

public void validateFile(final FacesContext context, final UIComponent component,
    final Object value) throws ValidatorException {
  final InputFileInfo fileInfo = (InputFileInfo) value;
  final String mimeType = (String) fileInfo.getMimeType();
  if (TYPEMIME_INTERDIT.contains(mimeType)) {
    final FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_WARN, "Les fichiers zip, tar, gzip ne sont pas autorisés", null);
    throw new ValidatorException(message);
  }
}
origin: org.nuxeo.ecm.liveconnect/nuxeo-liveconnect-onedrive-jsf

  LiveConnectFileInfo fileInfo = new LiveConnectFileInfo(nuxeoToken.get().getServiceLogin(), fileId);
  Blob blob = blobProvider.toBlob(fileInfo);
  submitted.setBlob(blob);
  submitted.setFilename(blob.getFilename());
  submitted.setMimeType(blob.getMimeType());
} catch (IOException e) {
  throw new RuntimeException(e); // TODO better feedback
origin: opentoutatice-ecm.platform/opentoutatice-ecm-platform-web

/**
 * Checks if File has no media type file content.
 * 
 * @param context
 * @param component
 * @param value
 * @throws ValidatorException
 */
public void validateMimeType(FacesContext context, UIComponent component, Object value) throws ValidatorException {
  if(value != null){
    InputFileInfo file = (InputFileInfo) value;
    try {
      
      MimeType mimeType = new MimeType((String) file.getMimeType());
      if(ArrayUtils.contains(MEDIA_PRIMARY_MIME_TYPES, mimeType.getPrimaryType())){
        String msg = ComponentUtils.translate(context, "ottc.validator.file.bad.mime.type");
        FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR, msg, null);
        throw new ValidatorException(message);
      }
      
    } catch (MimeTypeParseException e) {
      String msg = ComponentUtils.translate(context, "ottc.validator.file.unknown.mime.type");
      FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR, msg, null);
      throw new ValidatorException(message);
    }
    
  }
}
org.nuxeo.ecm.platform.ui.web.component.fileInputFileInfo

Most used methods

  • getMimeType
  • setBlob
  • setFilename
  • setMimeType

Popular in Java

  • Making http post requests using okhttp
  • runOnUiThread (Activity)
  • getExternalFilesDir (Context)
  • getContentResolver (Context)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • JPanel (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now