Examples of MimeTypes


Examples of org.apache.tika.mime.MimeTypes

    String productId = "123";
    int refIndex = 0;

    // Create a new ReferenceResource using a Reference instance.
    Reference reference = new Reference("original", "dataStore", 1000,
      new MimeTypes().forName("text/plain"));

    ReferenceResource resource = new ReferenceResource(productId, refIndex,
      reference, new File("/tmp"));

View Full Code Here

Examples of org.apache.tika.mime.MimeTypes

    metadataEntries.put("CAS.Test", "test value");
    Metadata metadata = new Metadata();
    metadata.addMetadata(metadataEntries);

    Reference reference = new Reference("original", "dataStore", 1000,
      new MimeTypes().forName("text/plain"));
    List<Reference> references = new ArrayList<Reference>();
    references.add(reference);

    ProductType productType = new ProductType("1", "GenericFile", "test type",
      "repository", "versioner");
View Full Code Here

Examples of org.apache.tika.mime.MimeTypes

    ProductType productType = new ProductType("1", "GenericFile", "test type",
      "repository", "versioner");

    // Create a ProductResource using Reference, Metadata and Product instances.
    Reference reference1 = new Reference("original1", "dataStore1", 500,
      new MimeTypes().forName("text/plain"));
    List<Reference> references1 = new ArrayList<Reference>();
    references1.add(reference1);

    Hashtable metadataEntries1 = new Hashtable<String, Object>();
    metadataEntries1.put("product1_meta", "test1");
    Metadata metadata1 = new Metadata();
    metadata1.addMetadata(metadataEntries1);

    Product product1 = new Product();
    product1.setProductId("123");
    product1.setProductName("test.txt");
    product1.setProductType(productType);

    ProductResource productResource1 = new ProductResource(product1, metadata1,
      references1, new File("/tmp"));


    // Create another ProductResource using Reference, Metadata and Product
    // instances.
    Reference reference2 = new Reference("original2", "dataStore2", 1000,
      new MimeTypes().forName("application/pdf"));
    List<Reference> references2 = new ArrayList<Reference>();
    references2.add(reference2);

    Hashtable metadataEntries2 = new Hashtable<String, Object>();
    metadataEntries2.put("product2_meta", "test2");
View Full Code Here

Examples of org.apache.tika.mime.MimeTypes

    metadataEntries1.put("CAS.ProductReceivedTime", "2013-09-12T16:25:50.662Z");
    Metadata metadata1 = new Metadata();
    metadata1.addMetadata(metadataEntries1);

    Reference reference1 = new Reference("original1", "dataStore1", 1000,
      new MimeTypes().forName("text/plain"));

    ProductType productType1 = new ProductType("1", "TestType", "test type 1",
      "repository1", "versioner1");

    Product product1 = new Product();
    product1.setProductId("123");
    product1.setProductName("test product");
    product1.setProductStructure("flat");
    product1.setProductType(productType1);

    FileTransferStatus status1 = new FileTransferStatus(reference1, 1000, 100,
      product1);


    // Create another FileTransferStatus instance using Metadata, Reference,
    // ProductType and Product instances.
    Hashtable metadataEntries2 = new Hashtable<String, Object>();
    metadataEntries2.put("CAS.ProductReceivedTime", "2011-04-11T11:59:59.662Z");
    Metadata metadata2 = new Metadata();
    metadata2.addMetadata(metadataEntries2);

    Reference reference2 = new Reference("original2", "dataStore2", 500,
      new MimeTypes().forName("application/pdf"));

    ProductType productType2 = new ProductType("2", "TestType2", "test type 2",
        "repository2", "versioner2");

    Product product2 = new Product();
View Full Code Here

Examples of org.apache.tika.mime.MimeTypes

    metadataEntries.put("CAS.ProductReceivedTime", "2013-09-12T16:25:50.662Z");
    Metadata metadata = new Metadata();
    metadata.addMetadata(metadataEntries);

    Reference reference = new Reference("original", "dataStore", 1000,
      new MimeTypes().forName("text/plain"));

    ProductType productType = new ProductType("1", "GenericFile", "test type",
      "repository", "versioner");

    Product product = new Product();
View Full Code Here

Examples of org.apache.tika.mime.MimeTypes

    */
   public static void main(String[] args) throws DataTransferException,
         IOException, URISyntaxException {
      String usage = "LocalFileTransfer --productName <name> --productRepo <repo> [--dir <dirRef>] [--files <origRef 1>...<origRef N>]\n";

      MimeTypes mimeTypeRepo;
      try {
         mimeTypeRepo = MimeTypesFactory
               .create(System
                     .getProperty("org.apache.oodt.cas.filemgr.mime.type.repository"));
      } catch (MimeTypeException e) {
         e.printStackTrace();
         throw new IOException(e.getMessage());
      }

      String productName = null;
      String productRepo = null;
      String transferType = null;
      Reference dirReference = null;

      List<Reference> fileReferences = null;

      for (int i = 0; i < args.length; i++) {
         if (args[i].equals("--dir")) {
            transferType = "dir";
            dirReference = new Reference();
            dirReference.setOrigReference(new File(new URI(args[++i])).toURI()
                  .toString());
            LOG.log(Level.FINER,
                  "LocalFileTransfer.main: Generated orig reference: "
                        + dirReference.getOrigReference());
         } else if (args[i].equals("--files")) {
            transferType = "files";
            fileReferences = new Vector<Reference>();
            for (int j = i + 1; j < args.length; j++) {
               LOG.log(Level.FINER, "LocalFileTransfer.main: Adding file ref: "
                     + args[j]);
               fileReferences.add(new Reference(args[j], null,
                     new File(args[j]).length(), mimeTypeRepo
                           .getMimeType(args[j])));
            }
         } else if (args[i].equals("--productName")) {
            productName = args[++i];
         } else if (args[i].equals("--productRepo")) {
View Full Code Here

Examples of org.apache.tika.mime.MimeTypes

     */
    public static void main(String[] args) throws DataTransferException,
            IOException, URISyntaxException {
        String usage = "LocalFileTransfer --productName <name> --productRepo <repo> [--dir <dirRef>] [--files <origRef 1>...<origRef N>]\n";

        MimeTypes mimeTypeRepo;
        try {
          mimeTypeRepo = MimeTypesFactory.create(System
                          .getProperty("org.apache.oodt.cas.filemgr.mime.type.repository"));
        } catch (MimeTypeException e) {
          e.printStackTrace();
          throw new IOException(e.getMessage());
        }

        String productName = null;
        String productRepo = null;
        String transferType = null;
        Reference dirReference = null;

        List<Reference> fileReferences = null;

        for (int i = 0; i < args.length; i++) {
            if (args[i].equals("--dir")) {
                transferType = "dir";
                dirReference = new Reference();
                dirReference.setOrigReference(new File(new URI(args[++i]))
                        .toURI().toString());
                LOG.log(Level.FINER,
                        "LocalFileTransfer.main: Generated orig reference: "
                                + dirReference.getOrigReference());
            } else if (args[i].equals("--files")) {
                transferType = "files";
                fileReferences = new Vector<Reference>();
                for (int j = i + 1; j < args.length; j++) {
                    LOG.log(Level.FINER,
                            "LocalFileTransfer.main: Adding file ref: "
                                    + args[j]);
                    fileReferences.add(new Reference(args[j], null, new File(
                            args[j]).length(), mimeTypeRepo
                            .getMimeType(args[j])));
                }
            } else if (args[i].equals("--productName")) {
                productName = args[++i];
            } else if (args[i].equals("--productRepo")) {
View Full Code Here

Examples of org.apache.tika.mime.MimeTypes

    */
   public static void main(String[] args) throws DataTransferException,
         IOException, URISyntaxException {
      String usage = "LocalFileTransfer --productName <name> --productRepo <repo> [--dir <dirRef>] [--files <origRef 1>...<origRef N>]\n";

      MimeTypes mimeTypeRepo;
      try {
         mimeTypeRepo = MimeTypesFactory
               .create(System
                     .getProperty("org.apache.oodt.cas.filemgr.mime.type.repository"));
      } catch (MimeTypeException e) {
         e.printStackTrace();
         throw new IOException(e.getMessage());
      }

      String productName = null;
      String productRepo = null;
      String transferType = null;
      Reference dirReference = null;

      List<Reference> fileReferences = null;

      for (int i = 0; i < args.length; i++) {
         if (args[i].equals("--dir")) {
            transferType = "dir";
            dirReference = new Reference();
            dirReference.setOrigReference(new File(new URI(args[++i])).toURI()
                  .toString());
            LOG.log(Level.FINER,
                  "LocalFileTransfer.main: Generated orig reference: "
                        + dirReference.getOrigReference());
         } else if (args[i].equals("--files")) {
            transferType = "files";
            fileReferences = new Vector<Reference>();
            for (int j = i + 1; j < args.length; j++) {
               LOG.log(Level.FINER, "LocalFileTransfer.main: Adding file ref: "
                     + args[j]);
               fileReferences.add(new Reference(args[j], null,
                     new File(args[j]).length(), mimeTypeRepo
                           .getMimeType(args[j])));
            }
         } else if (args[i].equals("--productName")) {
            productName = args[++i];
         } else if (args[i].equals("--productRepo")) {
View Full Code Here

Examples of org.apache.tika.mime.MimeTypes

  /* our log stream */
  private static final Logger LOG = Logger.getLogger(MimeUtil.class.getName());

  public MimeUtil(Configuration conf) {
    ObjectCache objectCache = ObjectCache.get(conf);
    MimeTypes mimeTypez = (MimeTypes) objectCache.getObject(MimeTypes.class
        .getName());
    if (mimeTypez == null) {
      mimeTypez = MimeTypesFactory.create(conf
          .getConfResourceAsInputStream(conf.get("mime.types.file")));
      objectCache.setObject(MimeTypes.class.getName(), mimeTypez);
View Full Code Here

Examples of org.codehaus.plexus.webdav.util.MimeTypes

{
    public void testArchivaTypes()
        throws Exception
    {
        lookup( ArchivaMimeTypeLoader.class );
        MimeTypes mimeTypes = (MimeTypes) lookup( MimeTypes.class );
        assertNotNull( mimeTypes );

        // Test for some added types.
        assertEquals( "sha1", "text/plain", mimeTypes.getMimeType( "foo.sha1" ) );
        assertEquals( "md5", "text/plain", mimeTypes.getMimeType( "foo.md5" ) );
        assertEquals( "pgp", "application/pgp-encrypted", mimeTypes.getMimeType( "foo.pgp" ) );
        assertEquals( "jar", "application/java-archive", mimeTypes.getMimeType( "foo.jar" ) );
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.