Package ca.carleton.gcrc.couch.onUpload

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


  }

  @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


    return false;
  }

  @Override
  public FileConversionMetaData getFileMetaData(File file) {
    FileConversionMetaData result = new FileConversionMetaData();
   
    GpxFactory factory = new GpxFactory();
    try {
      Gpx gpx = factory.loadFromFile(file);
      if( null != gpx ) {
        result.setFileConvertable(true);
        result.setMimeType("application/xml");
        result.setFileClass("gpx");
      }
     
    } catch(Exception e) {
      result.setFileConvertable(false);
    }
   
    return result;
  }
View Full Code Here

    return false;
  }

  @Override
  public FileConversionMetaData getFileMetaData(File file) {
    FileConversionMetaData result = new FileConversionMetaData();
   
    GpxFactory factory = new GpxFactory();
    try {
      Gpx gpx = factory.loadFromFile(file);
      if( null != gpx ) {
        result.setFileConvertable(true);
        result.setMimeType("application/xml");
        result.setFileClass("gpx");
      }
     
    } catch(Exception e) {
      result.setFileConvertable(false);
    }
   
    return result;
  }
View Full Code Here

TOP

Related Classes of ca.carleton.gcrc.couch.onUpload.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.