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 

public class Main {
    /**
     * Return well-written format for Bio2RDF REST service
     * 
     * 
     * {talendTypes} String
     * 
     * {Category} User Defined
     * 
     * {param} string("format")
     * 
     * {example} restFormat("rdf")
     */
    public static String getMimeFromFormat(String formatIn) {
        if (formatIn.toLowerCase().equals("rdf") || formatIn.toLowerCase().equals("rdfxml")) {
            return ("application/rdf+xml");
        } else if (formatIn.toLowerCase().equals("n3")) {
            return ("text/rdf+n3");
        } else if (formatIn.toLowerCase().equals("ttl") || formatIn.toLowerCase().equals("turtle")) {
            return ("text/turtle");
        } else if (formatIn.toLowerCase().equals("nt")) {
            return ("text/plain");
        } else if (formatIn.toLowerCase().equals("json")) {
            return ("application/json");
        } else if (formatIn.toLowerCase().equals("jsonld")) {
            return ("application/ld+json");
        } else if (formatIn.toLowerCase().equals("trig")) {
            return ("application/trig");
        } else {
            return ("null");
        }
    }
}