Package ca.carleton.gcrc.couch.onUpload.plugin

Examples of ca.carleton.gcrc.couch.onUpload.plugin.FileConversionMetaData


      boolean pluginFound = false;
      String mimeType = null;
      String mimeEncoding = null;
      String fileClass = null;
      for(FileConversionPlugin fcp : this.fileConverters) {
        FileConversionMetaData md = fcp.getFileMetaData(file);
        if( md.isFileConvertable() ) {
          mimeType = md.getMimeType();
          fileClass = md.getFileClass();
          mimeEncoding = md.getMimeEncoding();
 
          pluginFound = true;
          break;
        }
      }
View Full Code Here


  }

  @Override
  public FileConversionMetaData getFileMetaData(File file) {
   
    FileConversionMetaData result = new FileConversionMetaData();
   
    try {
      SystemFile sf = SystemFile.getSystemFile(file);
      String mimeType = sf.getMimeType();
      String mimeEncoding = sf.getMimeEncoding();
 
      // Is it a known MIME type?
      MultimediaClass aClass = MimeUtils.getMultimediaClassFromMimeType(sf.getMimeType());
      if( MultimediaClass.AUDIO == aClass
       || MultimediaClass.VIDEO == aClass
       || MultimediaClass.IMAGE == aClass
       ) {
        String fileClass = aClass.getValue();
       
        result.setMimeType(mimeType);
        result.setMimeEncoding(mimeEncoding);
        result.setFileClass(fileClass);
        result.setFileConvertable(true);
      }
    } catch(Exception e) {
      // Ignore
    }
   
View Full Code Here

TOP

Related Classes of ca.carleton.gcrc.couch.onUpload.plugin.FileConversionMetaData

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.