Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright 1&1 Internet AG, Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
package net.oneandone.jasmin.main;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
public class ServletTest {
    public void header() {
        check(true"utf-8;q=0, *");
        check(false"utf-8;q=0, *;q=0");
        check(true"utf-8;q=0, *;q=0.01");
        check(true"* ; q = 0.01");
        check(false"* ; q  =  0");
    private void check(boolean expectedString accepts) {
        boolean result;
        try {
            result = true;
        } catch (IOException e) {
            result = false;
    public void blacklisted() {
        // mozilla
                "Mozilla/4.0 (X11; U; Linux x86_64; de; rv: Gecko/2009042523 Ubuntu/9.04 (jaunty) Firefox/3.0.10"));
        // MSIE
                "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Trident/4.0; GTB6; SLCC1; .NET CLR 2.0.50727; "
                        + "Media Center PC 5.0; .NET CLR 3.5.30729; .NET CLR 3.0.30618)"));
                "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 6.0; Trident/4.0; GTB6; SLCC1; .NET CLR 2.0.50727; "
                        + "Media Center PC 5.0; .NET CLR 3.5.30729; .NET CLR 3.0.30618)"));
    public static void main(String[] argsthrows Exception {
        World world;
        Node node;
        int c;
        int count;
        world = new World();
        node = world.node(""
                + "qx-backbutton+econda-tracking+nedstat-tracking+adition-retargeting/js-min/AC:O:def");
        try (Reader reader = node.createReader()) {
            count = 0;
            while ((c = != -1) {
            ..println("count: " + count);
New to GrepCode? Check out our FAQ X