Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

import java.util.List;
import java.util.ArrayList;

public class Main {
    /**
     * Return the priority (0 is the preferred, -1 is not supported) of the rdf MIME type for the REST content negotiation
     * 
     * 
     * {talendTypes} String
     * 
     * {Category} User Defined
     * 
     * {param} string("mimeString")
     * 
     * {example} getAcceptableMime("application/rdf+xml")
     */
    public static int getMimePriority(String mimeString) {
        List<String> acceptableMime = new ArrayList<String>();

        acceptableMime.add("application/rdf+xml");
        acceptableMime.add("text/rdf+n3");
        acceptableMime.add("text/turtle");
        acceptableMime.add("text/plain");
        acceptableMime.add("text/html");
        acceptableMime.add("application/x-json+ld");
        acceptableMime.add("application/json");
        acceptableMime.add("application/ld+json");
        acceptableMime.add("application/trig");
        acceptableMime.add("application/x-trig");
        acceptableMime.add("application/rdf+json");

        // Add mime type here if you want to parse them

        return (acceptableMime.indexOf(mimeString));
    }
}