Config.Builder b = new Config.Builder(); b.resource("./app") .initParam("com.twitter.consumer.key", key) .initParam("com.twitter.consumer.secret", secret) .initParam("com.sun.jersey.config.property.packages", NettoSphere.class.getPackage().getName()) .interceptor(new SwaggerSocketProtocolInterceptor()) .port(p) .host("127.0.0.1") .build(); Nettosphere s = new Nettosphere.Builder().config(b.build()).build(); s.start(); String a = "";
Config.Builder b = new Config.Builder(); b.resource("./app") .initParam(ApplicationConfig.WEBSOCKET_CONTENT_TYPE, "application/json") .initParam(ApplicationConfig.WEBSOCKET_METHOD, "POST") .initParam("jaxrs.serviceClasses", SwaggerSocketResource.class.getName() + "," + FileServiceResource.class.getName()) .initParam("jaxrs.providers", JacksonJsonProvider.class.getName()) .initParam("org.atmosphere.websocket.WebSocketProtocol.executeAsync", "true") .initParam("io.swagger.swaggersocket.protocol.lazywrite", "true") .initParam("io.swagger.swaggersocket.protocol.emptyentity", "true") .interceptor(new SwaggerSocketProtocolInterceptor()) .resource("/*", rsp) .port(p) .host("127.0.0.1") .build(); Nettosphere s = new Nettosphere.Builder().config(b.build()).build(); s.start(); String a = "";
new Config.Builder() .host(SERVER_HOST) .port(SERVER_PORT)
private void getImages() { Intent intent = new Intent(mContext, ImagePickerActivity.class); Config config = new Config.Builder() .setTabBackgroundColor(R.color.white) // set tab background color. Default white. .setTabSelectionIndicatorColor(R.color.blue) .setCameraButtonColor(R.color.green) .setSelectionLimit(2) // set photo selection limit. Default unlimited selection. .build(); ImagePickerActivity.setConfig(config); startActivityForResult(intent, INTENT_REQUEST_GET_IMAGES);}
public static void main(String[] args) throws Exception { Config.Builder b = new Config.Builder(); b.resource(args[0]).port(8080).host("127.0.0.1"); Nettosphere s = new Nettosphere(b.build()); s.start(); String a = ""; logger.info("NettoSphere Server started"); logger.info("Type quit to stop the server"); BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); while (!(a.equals("quit"))) { a = br.readLine(); } System.exit(-1); }
/** * Add an {@link Handler} mapped to the default, which is '/*' * * @param handler {@link Handler} * @return this */ public Builder resource(Handler handler) { return resource("/*", handler); }
public static void main(String[] args) throws Exception { Config.Builder b = new Config.Builder(); b.resource(args[0]).port(8080).host("127.0.0.1"); Nettosphere s = new Nettosphere(b.build()); s.start(); String a = ""; logger.info("NettoSphere Server started"); logger.info("Type quit to stop the server"); BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); while (!(a.equals("quit"))) { a = br.readLine(); } System.exit(-1); }
/** * Add an {@link Handler} mapped to the default, which is '/*' * * @param handler {@link Handler} * @return this */ public Builder resource(Handler handler) { return resource("/*", handler); }