AnsweredAssumed Answered

Getting a filename with myExtracter class

Question asked by alf983 on Dec 25, 2007
Latest reply on Jan 16, 2008 by kevinr
Hi,
Can I get the filename with the extracter class?

This is myExtracter.java (example)

package org.alfresco.repo.content.metadata;


import java.io.Serializable;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Map;


import org.alfresco.repo.content.metadata.AbstractMetadataExtracter;
import org.alfresco.service.cmr.repository.ContentReader;
import org.alfresco.service.namespace.QName;

public class myExtracter extends AbstractMetadataExtracter {
   public static String[] SUPPORTED_MIMETYPES = new String[] {
         newMimeType.MIMETYPE_MPEG
        };

   //static final QName PROP_AUTHOR = QName.createQName("http://www.alfresco.org/model/content/1.0", "author");

   static final QName PROP_DURATA = QName.createQName("my.video.model", "durata");
   static final QName PROP_RISOL = QName.createQName("my.video.model", "resolution");
   static final QName PROP_ARTISTA = QName.createQName("my.video.model", "artista");
  // static final QName PROP_NAMEFILE = QName.createQName("http://www.alfresco.org/model/content/1.0','filename");

   public myExtracter() {
      super(new HashSet<String>(Arrays.asList(SUPPORTED_MIMETYPES)), 1.0,
            1000);
   }

   public void extractInternal(ContentReader reader,final Map<QName, Serializable> destination) throws Throwable {

      String content2=reader.getContentUrl();
      Long size=reader.getSize();
      trimPut(PROP_DURATA, content2 , destination);
      trimPut(PROP_RISOL, size.toString() , destination);
      trimPut(PROP_ARTISTA, content2 , destination);
     
     
     
     
   }
}

Help me!!!
Thanks!! :lol:

Outcomes