Package

Source Code of test

//
//$LastChangedDate: 2011-01-28 11:54:13 +0100 (Fr, 28. Jan 2011) $
//$LastChangedRevision: 7454 $
//$LastChangedBy: orbiter $
//

import net.yacy.cora.protocol.RequestHeader;
import de.anomic.server.serverObjects;
import de.anomic.server.serverSwitch;

public class test {
   
    // http://localhost:8090/test.xml?count=10
   
    public static serverObjects respond(final RequestHeader header, final serverObjects post, final serverSwitch env) {
        final serverObjects prop = new serverObjects();
        final int count = Math.min(1000, (post == null) ? 0 : post.getInt("count", 0));
       
        for (int i = 0; i < count; i++) {
            prop.put("item_" + i + "_text", Integer.toString(i));
        }
        prop.put("item", count);

        return prop;
    }
   
}
TOP

Related Classes of test

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.