Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
// Use of this source code is governed by a BSD-style license that can be

import android.util.Pair;
import java.util.ArrayList;
import java.util.List;

public class Main {
    public static List<Pair<String, String>> getTextHtmlHeaders(boolean disableCache) {
        return getContentTypeAndCacheHeaders("text/html", disableCache);
    }

    public static List<Pair<String, String>> getContentTypeAndCacheHeaders(String contentType,
            boolean disableCache) {
        List<Pair<String, String>> headers = new ArrayList<Pair<String, String>>();
        headers.add(Pair.create("Content-Type", contentType));
        if (disableCache)
            headers.add(Pair.create("Cache-Control", "no-store"));
        return headers;
    }
}