repo_name stringlengths 7 104 | file_path stringlengths 13 198 | context stringlengths 67 7.15k | import_statement stringlengths 16 4.43k | code stringlengths 40 6.98k | prompt stringlengths 227 8.27k | next_line stringlengths 8 795 |
|---|---|---|---|---|---|---|
starqiu/RDMP1 | src/main/java/ustc/sse/controller/UserController.java | // Path: src/main/java/ustc/sse/model/User.java
// public class User {
// /** 用户名
// @Size(min=3,max=20,message="user.length.required")
// @Pattern(regexp="^{[a-zA-Z0-9]+_?}+[a-zA-Z0-9]+$",message="user.ptn.required")*/
// private String userName ;
// /** 密码
// @Size(min=6,max=20,message="pwd.length.required")
//... | import java.util.Date;
import java.util.List;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Controller;
import org.s... | /*
* ============================================================
* The SSE USTC Software License
*
* UserController.java
* 2014-4-22
*
* Copyright (c) 2006 China Payment and Remittance Service Co.,Ltd
* All rights reserved.
* ============================================================
*/
package u... | // Path: src/main/java/ustc/sse/model/User.java
// public class User {
// /** 用户名
// @Size(min=3,max=20,message="user.length.required")
// @Pattern(regexp="^{[a-zA-Z0-9]+_?}+[a-zA-Z0-9]+$",message="user.ptn.required")*/
// private String userName ;
// /** 密码
// @Size(min=6,max=20,message="pwd.length.required")
//... | private UserService userService; |
starqiu/RDMP1 | src/main/java/ustc/sse/controller/UserController.java | // Path: src/main/java/ustc/sse/model/User.java
// public class User {
// /** 用户名
// @Size(min=3,max=20,message="user.length.required")
// @Pattern(regexp="^{[a-zA-Z0-9]+_?}+[a-zA-Z0-9]+$",message="user.ptn.required")*/
// private String userName ;
// /** 密码
// @Size(min=6,max=20,message="pwd.length.required")
//... | import java.util.Date;
import java.util.List;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Controller;
import org.s... | /*
* ============================================================
* The SSE USTC Software License
*
* UserController.java
* 2014-4-22
*
* Copyright (c) 2006 China Payment and Remittance Service Co.,Ltd
* All rights reserved.
* ============================================================
*/
package u... | // Path: src/main/java/ustc/sse/model/User.java
// public class User {
// /** 用户名
// @Size(min=3,max=20,message="user.length.required")
// @Pattern(regexp="^{[a-zA-Z0-9]+_?}+[a-zA-Z0-9]+$",message="user.ptn.required")*/
// private String userName ;
// /** 密码
// @Size(min=6,max=20,message="pwd.length.required")
//... | User param = new User(); |
apache/activemq-activeio | activeio-core/src/test/java/org/apache/activeio/journal/active/DataStruturesTest.java | // Path: activeio-core/src/main/java/org/apache/activeio/journal/active/Location.java
// final public class Location implements RecordLocation {
//
// static final public int SERIALIZED_SIZE=8;
//
// final private int logFileId;
// final private int logFileOffset;
//
// public Location(int logFil... | import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import org.apache.activeio.journal.active.Location;
import junit.framework.TestCase; | /**
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you ... | // Path: activeio-core/src/main/java/org/apache/activeio/journal/active/Location.java
// final public class Location implements RecordLocation {
//
// static final public int SERIALIZED_SIZE=8;
//
// final private int logFileId;
// final private int logFileOffset;
//
// public Location(int logFil... | Location l1 = new Location(0, 1); |
apache/activemq-activeio | activeio-core/src/main/java/org/apache/activeio/xnet/hba/ServiceAccessController.java | // Path: activeio-core/src/main/java/org/apache/activeio/xnet/ServerService.java
// public interface ServerService extends SocketService {
//
// public void init(Properties props) throws Exception;
//
// public void start() throws ServiceException;
//
// public void stop() throws ServiceException;
//
//... | import org.apache.activeio.xnet.ServerService;
import org.apache.activeio.xnet.ServiceException;
import java.io.IOException;
import java.net.Inet4Address;
import java.net.InetAddress;
import java.net.Socket;
import java.net.UnknownHostException;
import java.util.LinkedList;
import java.util.Properties;
import java.util... | /**
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you ... | // Path: activeio-core/src/main/java/org/apache/activeio/xnet/ServerService.java
// public interface ServerService extends SocketService {
//
// public void init(Properties props) throws Exception;
//
// public void start() throws ServiceException;
//
// public void stop() throws ServiceException;
//
//... | public void service(Socket socket) throws ServiceException, IOException { |
apache/activemq-activeio | activeio-core/src/main/java/org/apache/activeio/xnet/StandardServiceStack.java | // Path: activeio-core/src/main/java/org/apache/activeio/xnet/hba/IPAddressPermission.java
// public interface IPAddressPermission extends Serializable {
// public boolean implies(InetAddress address);
// }
//
// Path: activeio-core/src/main/java/org/apache/activeio/xnet/hba/ServiceAccessController.java
// public ... | import edu.emory.mathcs.backport.java.util.concurrent.Executor;
import org.apache.activeio.xnet.hba.IPAddressPermission;
import org.apache.activeio.xnet.hba.ServiceAccessController;
import java.io.IOException;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.SocketException;
import java.n... | /**
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you ... | // Path: activeio-core/src/main/java/org/apache/activeio/xnet/hba/IPAddressPermission.java
// public interface IPAddressPermission extends Serializable {
// public boolean implies(InetAddress address);
// }
//
// Path: activeio-core/src/main/java/org/apache/activeio/xnet/hba/ServiceAccessController.java
// public ... | private ServiceAccessController hba; |
apache/activemq-activeio | activeio-core/src/main/java/org/apache/activeio/xnet/StandardServiceStack.java | // Path: activeio-core/src/main/java/org/apache/activeio/xnet/hba/IPAddressPermission.java
// public interface IPAddressPermission extends Serializable {
// public boolean implies(InetAddress address);
// }
//
// Path: activeio-core/src/main/java/org/apache/activeio/xnet/hba/ServiceAccessController.java
// public ... | import edu.emory.mathcs.backport.java.util.concurrent.Executor;
import org.apache.activeio.xnet.hba.IPAddressPermission;
import org.apache.activeio.xnet.hba.ServiceAccessController;
import java.io.IOException;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.SocketException;
import java.n... | /**
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you ... | // Path: activeio-core/src/main/java/org/apache/activeio/xnet/hba/IPAddressPermission.java
// public interface IPAddressPermission extends Serializable {
// public boolean implies(InetAddress address);
// }
//
// Path: activeio-core/src/main/java/org/apache/activeio/xnet/hba/ServiceAccessController.java
// public ... | public StandardServiceStack(String name, int port, String host, IPAddressPermission[] allowHosts, String[] logOnSuccess, String[] logOnFailure, Executor executor, ServerService server) throws UnknownHostException { |
apache/activemq-activeio | activeio-core/src/main/java/org/apache/activeio/oneport/HttpRecognizer.java | // Path: activeio-core/src/main/java/org/apache/activeio/packet/Packet.java
// public interface Packet {
//
// public int position();
// public void position(int position);
// public int limit();
// public void limit(int limit);
// public void flip();
// public int remaining();
// publi... | import java.util.HashSet;
import org.apache.activeio.packet.Packet; | /**
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you ... | // Path: activeio-core/src/main/java/org/apache/activeio/packet/Packet.java
// public interface Packet {
//
// public int position();
// public void position(int position);
// public int limit();
// public void limit(int limit);
// public void flip();
// public int remaining();
// publi... | public boolean recognizes(Packet packet) { |
apache/activemq-activeio | activeio-core/src/main/java/org/apache/activeio/xnet/StandardServiceStackGBean.java | // Path: activeio-core/src/main/java/org/apache/activeio/xnet/hba/IPAddressPermission.java
// public interface IPAddressPermission extends Serializable {
// public boolean implies(InetAddress address);
// }
| import javax.management.ObjectName;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.UnknownHostException;
import java.net.SocketException;
import java.io.IOException;
import edu.emory.mathcs.backport.java.util.concurrent.Executor;
import org.apache.activeio.xnet.hba.IPAddressPermission;
... | /**
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you ... | // Path: activeio-core/src/main/java/org/apache/activeio/xnet/hba/IPAddressPermission.java
// public interface IPAddressPermission extends Serializable {
// public boolean implies(InetAddress address);
// }
// Path: activeio-core/src/main/java/org/apache/activeio/xnet/StandardServiceStackGBean.java
import javax.m... | public StandardServiceStackGBean(String name, int port, String host, IPAddressPermission[] allowHosts, String[] logOnSuccess, String[] logOnFailure, Executor executor, ServerService server) throws UnknownHostException { |
apache/activemq-activeio | activeio-core/src/main/java/org/apache/activeio/oneport/IIOPRecognizer.java | // Path: activeio-core/src/main/java/org/apache/activeio/packet/Packet.java
// public interface Packet {
//
// public int position();
// public void position(int position);
// public int limit();
// public void limit(int limit);
// public void flip();
// public int remaining();
// publi... | import org.apache.activeio.packet.Packet; | /**
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you ... | // Path: activeio-core/src/main/java/org/apache/activeio/packet/Packet.java
// public interface Packet {
//
// public int position();
// public void position(int position);
// public int limit();
// public void limit(int limit);
// public void flip();
// public int remaining();
// publi... | public boolean recognizes(Packet packet) { |
apache/activemq-activeio | activeio-core/src/main/java/org/apache/activeio/oneport/UnknownRecognizer.java | // Path: activeio-core/src/main/java/org/apache/activeio/packet/Packet.java
// public interface Packet {
//
// public int position();
// public void position(int position);
// public int limit();
// public void limit(int limit);
// public void flip();
// public int remaining();
// publi... | import org.apache.activeio.packet.Packet; | /**
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you ... | // Path: activeio-core/src/main/java/org/apache/activeio/packet/Packet.java
// public interface Packet {
//
// public int position();
// public void position(int position);
// public int limit();
// public void limit(int limit);
// public void flip();
// public int remaining();
// publi... | public boolean recognizes(Packet packet) { |
maofw/netty_push_server | src/com/netty/push/sdk/client/NettyClientHandler.java | // Path: src/com/netty/push/sdk/client/listener/INettyClientHandlerListener.java
// public interface INettyClientHandlerListener {
// public void receive(MessageResult messageResult);
// }
//
// Path: src/com/netty/push/sdk/pojo/Message.java
// public class Message implements Serializable {
// /**
// *
// */
//... | import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
import com.netty.push.sdk.client.listener.INettyClientHandlerListener;
import com.netty.push.sdk.pojo.Message;
import com.netty.push.sdk.pojo.MessageResult; | package com.netty.push.sdk.client;
/**
* 客户端消息处理Handler
*
* @author maofw
*
*/
public class NettyClientHandler extends SimpleChannelInboundHandler<Object> {
private NettyClient nettyClient; | // Path: src/com/netty/push/sdk/client/listener/INettyClientHandlerListener.java
// public interface INettyClientHandlerListener {
// public void receive(MessageResult messageResult);
// }
//
// Path: src/com/netty/push/sdk/pojo/Message.java
// public class Message implements Serializable {
// /**
// *
// */
//... | private Message message; |
maofw/netty_push_server | src/com/netty/push/sdk/client/NettyClientHandler.java | // Path: src/com/netty/push/sdk/client/listener/INettyClientHandlerListener.java
// public interface INettyClientHandlerListener {
// public void receive(MessageResult messageResult);
// }
//
// Path: src/com/netty/push/sdk/pojo/Message.java
// public class Message implements Serializable {
// /**
// *
// */
//... | import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
import com.netty.push.sdk.client.listener.INettyClientHandlerListener;
import com.netty.push.sdk.pojo.Message;
import com.netty.push.sdk.pojo.MessageResult; | package com.netty.push.sdk.client;
/**
* 客户端消息处理Handler
*
* @author maofw
*
*/
public class NettyClientHandler extends SimpleChannelInboundHandler<Object> {
private NettyClient nettyClient;
private Message message; | // Path: src/com/netty/push/sdk/client/listener/INettyClientHandlerListener.java
// public interface INettyClientHandlerListener {
// public void receive(MessageResult messageResult);
// }
//
// Path: src/com/netty/push/sdk/pojo/Message.java
// public class Message implements Serializable {
// /**
// *
// */
//... | private INettyClientHandlerListener listener; |
maofw/netty_push_server | src/com/netty/push/sdk/client/NettyClientHandler.java | // Path: src/com/netty/push/sdk/client/listener/INettyClientHandlerListener.java
// public interface INettyClientHandlerListener {
// public void receive(MessageResult messageResult);
// }
//
// Path: src/com/netty/push/sdk/pojo/Message.java
// public class Message implements Serializable {
// /**
// *
// */
//... | import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
import com.netty.push.sdk.client.listener.INettyClientHandlerListener;
import com.netty.push.sdk.pojo.Message;
import com.netty.push.sdk.pojo.MessageResult; | package com.netty.push.sdk.client;
/**
* 客户端消息处理Handler
*
* @author maofw
*
*/
public class NettyClientHandler extends SimpleChannelInboundHandler<Object> {
private NettyClient nettyClient;
private Message message;
private INettyClientHandlerListener listener;
public NettyClientHandler(NettyClient netty... | // Path: src/com/netty/push/sdk/client/listener/INettyClientHandlerListener.java
// public interface INettyClientHandlerListener {
// public void receive(MessageResult messageResult);
// }
//
// Path: src/com/netty/push/sdk/pojo/Message.java
// public class Message implements Serializable {
// /**
// *
// */
//... | if (obj != null && obj instanceof MessageResult) { |
maofw/netty_push_server | src/com/netty/push/sdk/client/NettyClient.java | // Path: src/com/netty/push/sdk/client/listener/INettyClientHandlerListener.java
// public interface INettyClientHandlerListener {
// public void receive(MessageResult messageResult);
// }
//
// Path: src/com/netty/push/sdk/pojo/Message.java
// public class Message implements Serializable {
// /**
// *
// */
//... | import io.netty.bootstrap.Bootstrap;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelFutureListener;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelOption;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.ni... | public void setCtx(ChannelHandlerContext ctx) {
this.ctx = ctx;
}
/**
* 类级的内部类,也就是静态的成员式内部类,该内部类的实例与外部类的实例 没有绑定关系,而且只有被调用到时才会装载,从而实现了延迟加载。
*/
private static class SingletonHolder {
/**
* 静态初始化器,由JVM来保证线程安全
*/
private static NettyClient instance = new NettyClient();
}
public static NettyClient ge... | // Path: src/com/netty/push/sdk/client/listener/INettyClientHandlerListener.java
// public interface INettyClientHandlerListener {
// public void receive(MessageResult messageResult);
// }
//
// Path: src/com/netty/push/sdk/pojo/Message.java
// public class Message implements Serializable {
// /**
// *
// */
//... | public void sendMessage(final Message message, final INettyClientHandlerListener listener) throws Exception { |
maofw/netty_push_server | src/com/netty/push/sdk/client/NettyClient.java | // Path: src/com/netty/push/sdk/client/listener/INettyClientHandlerListener.java
// public interface INettyClientHandlerListener {
// public void receive(MessageResult messageResult);
// }
//
// Path: src/com/netty/push/sdk/pojo/Message.java
// public class Message implements Serializable {
// /**
// *
// */
//... | import io.netty.bootstrap.Bootstrap;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelFutureListener;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelOption;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.ni... | public void setCtx(ChannelHandlerContext ctx) {
this.ctx = ctx;
}
/**
* 类级的内部类,也就是静态的成员式内部类,该内部类的实例与外部类的实例 没有绑定关系,而且只有被调用到时才会装载,从而实现了延迟加载。
*/
private static class SingletonHolder {
/**
* 静态初始化器,由JVM来保证线程安全
*/
private static NettyClient instance = new NettyClient();
}
public static NettyClient ge... | // Path: src/com/netty/push/sdk/client/listener/INettyClientHandlerListener.java
// public interface INettyClientHandlerListener {
// public void receive(MessageResult messageResult);
// }
//
// Path: src/com/netty/push/sdk/pojo/Message.java
// public class Message implements Serializable {
// /**
// *
// */
//... | public void sendMessage(final Message message, final INettyClientHandlerListener listener) throws Exception { |
maofw/netty_push_server | src/com/netty/push/Application.java | // Path: src/com/netty/push/server/IServer.java
// public interface IServer {
// public void start() throws Exception;
//
// public void stop() throws Exception;
//
// public void restart() throws Exception;
// }
| import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;
import com.netty.push.server.IServer; | package com.netty.push;
public class Application {
/**
* @param args
*/
public static void main(String[] args) throws Exception {
String params = (args != null && args.length > 0) ? args[0] : null;
// 启动服务器
ApplicationContext context = getApplicationContext(params);
if (context != null) { | // Path: src/com/netty/push/server/IServer.java
// public interface IServer {
// public void start() throws Exception;
//
// public void stop() throws Exception;
//
// public void restart() throws Exception;
// }
// Path: src/com/netty/push/Application.java
import org.springframework.context.ApplicationContext;
... | IServer server = (IServer) context.getBean("nettyServer"); |
maofw/netty_push_server | src/com/netty/push/handler/process/RegistrationProcessor.java | // Path: src/com/netty/push/pojo/DeviceInfo.java
// public class DeviceInfo {
// private String regId ;
// private Long userId ;
// private Long appId ;
// private String appKey ;
// private int isOnline ;
// private String deviceId ;
// private String imei ;
// private String channel ;
// private Date onlineT... | import io.netty.channel.ChannelHandlerContext;
import com.netty.push.pojo.DeviceInfo;
import com.xwtec.protoc.CommandProtoc;
import com.xwtec.protoc.CommandProtoc.PushMessage; | package com.netty.push.handler.process;
/**
* 设备注册消息请求
*
* @author maofw
*
*/
public class RegistrationProcessor extends AbstractHandleProcessor<CommandProtoc.Registration> {
@Override
public PushMessage process(ChannelHandlerContext ctx) {
// 服务器解析注册数据请求
// 判断注册是否成功
CommandProtoc.Registration regist... | // Path: src/com/netty/push/pojo/DeviceInfo.java
// public class DeviceInfo {
// private String regId ;
// private Long userId ;
// private Long appId ;
// private String appKey ;
// private int isOnline ;
// private String deviceId ;
// private String imei ;
// private String channel ;
// private Date onlineT... | DeviceInfo deviceInfo = applicationContext.getDeviceInfo(registration.getDeviceId()); |
maofw/netty_push_server | src/com/netty/push/handler/process/DeviceOfflineProcessor.java | // Path: src/com/netty/push/pojo/AppInfo.java
// public class AppInfo {
// private Long appId;
// private String appPackage;
// private String appKey;
// private Long userId;
// public Long getAppId() {
// return appId;
// }
// public void setAppId(Long appId) {
// this.appId = appId;
// }
// public String... | import io.netty.channel.ChannelHandlerContext;
import com.netty.push.pojo.AppInfo;
import com.netty.push.pojo.DeviceInfo;
import com.xwtec.protoc.CommandProtoc;
import com.xwtec.protoc.CommandProtoc.PushMessage; | package com.netty.push.handler.process;
/**
* 设备下线消息处理
*
* @author maofw
*
*/
public class DeviceOfflineProcessor extends AbstractHandleProcessor<CommandProtoc.DeviceOffline> {
@Override
public PushMessage process(ChannelHandlerContext ctx) {
CommandProtoc.DeviceOnoffResult.ResultCode resultCode = null;
... | // Path: src/com/netty/push/pojo/AppInfo.java
// public class AppInfo {
// private Long appId;
// private String appPackage;
// private String appKey;
// private Long userId;
// public Long getAppId() {
// return appId;
// }
// public void setAppId(Long appId) {
// this.appId = appId;
// }
// public String... | DeviceInfo deviceInfo = this.applicationContext.getDeviceInfo(deviceId); |
maofw/netty_push_server | src/com/netty/push/handler/process/DeviceOfflineProcessor.java | // Path: src/com/netty/push/pojo/AppInfo.java
// public class AppInfo {
// private Long appId;
// private String appPackage;
// private String appKey;
// private Long userId;
// public Long getAppId() {
// return appId;
// }
// public void setAppId(Long appId) {
// this.appId = appId;
// }
// public String... | import io.netty.channel.ChannelHandlerContext;
import com.netty.push.pojo.AppInfo;
import com.netty.push.pojo.DeviceInfo;
import com.xwtec.protoc.CommandProtoc;
import com.xwtec.protoc.CommandProtoc.PushMessage; | package com.netty.push.handler.process;
/**
* 设备下线消息处理
*
* @author maofw
*
*/
public class DeviceOfflineProcessor extends AbstractHandleProcessor<CommandProtoc.DeviceOffline> {
@Override
public PushMessage process(ChannelHandlerContext ctx) {
CommandProtoc.DeviceOnoffResult.ResultCode resultCode = null;
... | // Path: src/com/netty/push/pojo/AppInfo.java
// public class AppInfo {
// private Long appId;
// private String appPackage;
// private String appKey;
// private Long userId;
// public Long getAppId() {
// return appId;
// }
// public void setAppId(Long appId) {
// this.appId = appId;
// }
// public String... | AppInfo appInfo = deviceInfo == null ? null : this.applicationContext.getAppInfo(deviceInfo.getAppKey()); |
flyhero/flyapi | src/main/java/cn/iflyapi/blog/annotation/OpLog.java | // Path: src/main/java/cn/iflyapi/blog/enums/OperationEnum.java
// public enum OperationEnum {
//
// USER_REGISTER(1,"用户注册"),
// USER_LOGIN(2,"用户登录"),
//
// ARTICLE_READ(10, "阅读文章"),
// ARTICLE_WRITE(11, "发布文章"),
// ARTICLE_COMMENT(12, "评论文章"),
//
// SUBJECT_READ(15, "查询小书"),
// SUBJECT_W... | import cn.iflyapi.blog.enums.OperationEnum;
import java.lang.annotation.*; | package cn.iflyapi.blog.annotation;
/**
* @author flyhero
* @date 2018-12-21 2:42 PM
*/
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface OpLog {
| // Path: src/main/java/cn/iflyapi/blog/enums/OperationEnum.java
// public enum OperationEnum {
//
// USER_REGISTER(1,"用户注册"),
// USER_LOGIN(2,"用户登录"),
//
// ARTICLE_READ(10, "阅读文章"),
// ARTICLE_WRITE(11, "发布文章"),
// ARTICLE_COMMENT(12, "评论文章"),
//
// SUBJECT_READ(15, "查询小书"),
// SUBJECT_W... | OperationEnum op() default OperationEnum.ARTICLE_READ; |
flyhero/flyapi | src/main/java/cn/iflyapi/blog/controller/SocialController.java | // Path: src/main/java/cn/iflyapi/blog/entity/Social.java
// public class Social {
// private Long socialId;
//
// private Long userId;
//
// private Integer socialType;
//
// private String socialUrl;
//
// private Date createTime;
//
// private Date updateTime;
//
// private Boolean ... | import cn.iflyapi.blog.entity.Social;
import cn.iflyapi.blog.model.JSONResult;
import cn.iflyapi.blog.service.SocialService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
imp... | package cn.iflyapi.blog.controller;
/**
* @author flyhero
* @date 2018-12-31 8:03 PM
*/
@Api(value = "SocialController", tags = "社交接口")
@RestController
public class SocialController extends BaseController {
@Autowired | // Path: src/main/java/cn/iflyapi/blog/entity/Social.java
// public class Social {
// private Long socialId;
//
// private Long userId;
//
// private Integer socialType;
//
// private String socialUrl;
//
// private Date createTime;
//
// private Date updateTime;
//
// private Boolean ... | private SocialService socialService; |
flyhero/flyapi | src/main/java/cn/iflyapi/blog/controller/SocialController.java | // Path: src/main/java/cn/iflyapi/blog/entity/Social.java
// public class Social {
// private Long socialId;
//
// private Long userId;
//
// private Integer socialType;
//
// private String socialUrl;
//
// private Date createTime;
//
// private Date updateTime;
//
// private Boolean ... | import cn.iflyapi.blog.entity.Social;
import cn.iflyapi.blog.model.JSONResult;
import cn.iflyapi.blog.service.SocialService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
imp... | package cn.iflyapi.blog.controller;
/**
* @author flyhero
* @date 2018-12-31 8:03 PM
*/
@Api(value = "SocialController", tags = "社交接口")
@RestController
public class SocialController extends BaseController {
@Autowired
private SocialService socialService;
@ApiOperation("查询")
@GetMapping("/socials... | // Path: src/main/java/cn/iflyapi/blog/entity/Social.java
// public class Social {
// private Long socialId;
//
// private Long userId;
//
// private Integer socialType;
//
// private String socialUrl;
//
// private Date createTime;
//
// private Date updateTime;
//
// private Boolean ... | public JSONResult find() { |
flyhero/flyapi | src/main/java/cn/iflyapi/blog/controller/SocialController.java | // Path: src/main/java/cn/iflyapi/blog/entity/Social.java
// public class Social {
// private Long socialId;
//
// private Long userId;
//
// private Integer socialType;
//
// private String socialUrl;
//
// private Date createTime;
//
// private Date updateTime;
//
// private Boolean ... | import cn.iflyapi.blog.entity.Social;
import cn.iflyapi.blog.model.JSONResult;
import cn.iflyapi.blog.service.SocialService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
imp... | package cn.iflyapi.blog.controller;
/**
* @author flyhero
* @date 2018-12-31 8:03 PM
*/
@Api(value = "SocialController", tags = "社交接口")
@RestController
public class SocialController extends BaseController {
@Autowired
private SocialService socialService;
@ApiOperation("查询")
@GetMapping("/socials... | // Path: src/main/java/cn/iflyapi/blog/entity/Social.java
// public class Social {
// private Long socialId;
//
// private Long userId;
//
// private Integer socialType;
//
// private String socialUrl;
//
// private Date createTime;
//
// private Date updateTime;
//
// private Boolean ... | public JSONResult add(@RequestBody Social socials) { |
flyhero/flyapi | src/main/java/cn/iflyapi/blog/annotation/OpenApiScan.java | // Path: src/main/java/cn/iflyapi/blog/config/JwtInterceptor.java
// public class JwtInterceptor implements HandlerInterceptor {
//
// private final Logger logger = LoggerFactory.getLogger(JwtInterceptor.class);
//
// private List<String> excludedUrl = new ArrayList<>();
//
// public void register(String... | import cn.iflyapi.blog.config.JwtInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.http.HttpMethod;
import org.springframework.stereotype.Comp... | package cn.iflyapi.blog.annotation;
/**
* @author flyhero
* @date 2018-12-20 12:55 PM
*/
@Component
public class OpenApiScan implements ApplicationListener<ApplicationReadyEvent> {
@Autowired | // Path: src/main/java/cn/iflyapi/blog/config/JwtInterceptor.java
// public class JwtInterceptor implements HandlerInterceptor {
//
// private final Logger logger = LoggerFactory.getLogger(JwtInterceptor.class);
//
// private List<String> excludedUrl = new ArrayList<>();
//
// public void register(String... | private JwtInterceptor jwtInterceptor; |
flyhero/flyapi | src/main/java/cn/iflyapi/blog/controller/FileController.java | // Path: src/main/java/cn/iflyapi/blog/model/JSONResult.java
// @Getter
// @Setter
// public class JSONResult {
//
// private int code;
// private String msg;
// private boolean success;
// private Object data;
//
// private JSONResult(int code, String msg, boolean success, Object data) {
// ... | import cn.iflyapi.blog.model.JSONResult;
import cn.iflyapi.blog.service.IFileService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.we... | package cn.iflyapi.blog.controller;
/**
* @author flyhero
* @date 2018-12-22 6:48 PM
*/
@Api(value = "FileController", tags = "文件接口")
@RestController
public class FileController extends BaseController {
@Autowired
@Qualifier("qiniu") | // Path: src/main/java/cn/iflyapi/blog/model/JSONResult.java
// @Getter
// @Setter
// public class JSONResult {
//
// private int code;
// private String msg;
// private boolean success;
// private Object data;
//
// private JSONResult(int code, String msg, boolean success, Object data) {
// ... | private IFileService fileService; |
flyhero/flyapi | src/main/java/cn/iflyapi/blog/controller/FileController.java | // Path: src/main/java/cn/iflyapi/blog/model/JSONResult.java
// @Getter
// @Setter
// public class JSONResult {
//
// private int code;
// private String msg;
// private boolean success;
// private Object data;
//
// private JSONResult(int code, String msg, boolean success, Object data) {
// ... | import cn.iflyapi.blog.model.JSONResult;
import cn.iflyapi.blog.service.IFileService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.we... | package cn.iflyapi.blog.controller;
/**
* @author flyhero
* @date 2018-12-22 6:48 PM
*/
@Api(value = "FileController", tags = "文件接口")
@RestController
public class FileController extends BaseController {
@Autowired
@Qualifier("qiniu")
private IFileService fileService;
@ApiOperation("文件上传")
@Po... | // Path: src/main/java/cn/iflyapi/blog/model/JSONResult.java
// @Getter
// @Setter
// public class JSONResult {
//
// private int code;
// private String msg;
// private boolean success;
// private Object data;
//
// private JSONResult(int code, String msg, boolean success, Object data) {
// ... | public JSONResult upload(MultipartFile file) { |
flyhero/flyapi | src/main/java/cn/iflyapi/blog/config/JwtInterceptor.java | // Path: src/main/java/cn/iflyapi/blog/model/JSONResult.java
// @Getter
// @Setter
// public class JSONResult {
//
// private int code;
// private String msg;
// private boolean success;
// private Object data;
//
// private JSONResult(int code, String msg, boolean success, Object data) {
// ... | import cn.iflyapi.blog.model.JSONResult;
import cn.iflyapi.blog.util.JwtUtils;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.auth0.jwt.interfaces.Claim;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpMethod;
imp... | package cn.iflyapi.blog.config;
public class JwtInterceptor implements HandlerInterceptor {
private final Logger logger = LoggerFactory.getLogger(JwtInterceptor.class);
private List<String> excludedUrl = new ArrayList<>();
public void register(String url) {
excludedUrl.add(url);
}
@O... | // Path: src/main/java/cn/iflyapi/blog/model/JSONResult.java
// @Getter
// @Setter
// public class JSONResult {
//
// private int code;
// private String msg;
// private boolean success;
// private Object data;
//
// private JSONResult(int code, String msg, boolean success, Object data) {
// ... | Map<String, Claim> map = JwtUtils.verify(token); |
flyhero/flyapi | src/main/java/cn/iflyapi/blog/config/JwtInterceptor.java | // Path: src/main/java/cn/iflyapi/blog/model/JSONResult.java
// @Getter
// @Setter
// public class JSONResult {
//
// private int code;
// private String msg;
// private boolean success;
// private Object data;
//
// private JSONResult(int code, String msg, boolean success, Object data) {
// ... | import cn.iflyapi.blog.model.JSONResult;
import cn.iflyapi.blog.util.JwtUtils;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.auth0.jwt.interfaces.Claim;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpMethod;
imp... | }
String token = httpServletRequest.getHeader("Authorization");
if (StringUtils.isEmpty(token)) {
logger.error("token validate failed, no auth info in http header");
return setNoAuth(httpServletResponse);
}
Map<String, Claim>... | // Path: src/main/java/cn/iflyapi/blog/model/JSONResult.java
// @Getter
// @Setter
// public class JSONResult {
//
// private int code;
// private String msg;
// private boolean success;
// private Object data;
//
// private JSONResult(int code, String msg, boolean success, Object data) {
// ... | response.getWriter().write(JSONObject.toJSONString(JSONResult.fail(HttpStatus.UNAUTHORIZED.value(), HttpStatus.UNAUTHORIZED.getReasonPhrase()), SerializerFeature.WriteMapNullValue)); |
flyhero/flyapi | src/main/java/cn/iflyapi/blog/model/JSONResult.java | // Path: src/main/java/cn/iflyapi/blog/enums/CodeMsgEnum.java
// public enum CodeMsgEnum {
// OK(200, "Success"),
// FAIL(-1, "Fail"),
// USERNAME_OR_PASSWD_INVALID(40000, "用户名或密码不正确"),
// USERNAME_EXIST(40001, "用户名已存在"),
// USERNAME_MUST_MAIL_OR_PHONE(40002, "用户名必须是邮箱或手机号"),
// USER_ALREADY_REG... | import cn.iflyapi.blog.enums.CodeMsgEnum;
import lombok.Getter;
import lombok.Setter; | package cn.iflyapi.blog.model;
/**
* author: flyhero
* date: 2018-12-13 9:56 AM
*/
@Getter
@Setter
public class JSONResult {
private int code;
private String msg;
private boolean success;
private Object data;
private JSONResult(int code, String msg, boolean success, Object data) {
thi... | // Path: src/main/java/cn/iflyapi/blog/enums/CodeMsgEnum.java
// public enum CodeMsgEnum {
// OK(200, "Success"),
// FAIL(-1, "Fail"),
// USERNAME_OR_PASSWD_INVALID(40000, "用户名或密码不正确"),
// USERNAME_EXIST(40001, "用户名已存在"),
// USERNAME_MUST_MAIL_OR_PHONE(40002, "用户名必须是邮箱或手机号"),
// USER_ALREADY_REG... | public static JSONResult ok(CodeMsgEnum codeMsgEnum, Object data) { |
flyhero/flyapi | src/main/java/cn/iflyapi/blog/controller/CarouselController.java | // Path: src/main/java/cn/iflyapi/blog/entity/Carousel.java
// public class Carousel {
// private Long id;
//
// private String title;
//
// private String imgUrl;
//
// private String detailUrl;
//
// private Integer sort;
//
// private Date createTime;
//
// private Boolean isDelete;... | import cn.iflyapi.blog.annotation.OpenApi;
import cn.iflyapi.blog.entity.Carousel;
import cn.iflyapi.blog.model.JSONResult;
import cn.iflyapi.blog.service.CarouselService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import... | package cn.iflyapi.blog.controller;
/**
* @author flyhero
* @date 2018-12-31 11:14 AM
*/
@Api(value = "CarouselController", tags = "轮播图接口")
@RestController
public class CarouselController {
@Autowired | // Path: src/main/java/cn/iflyapi/blog/entity/Carousel.java
// public class Carousel {
// private Long id;
//
// private String title;
//
// private String imgUrl;
//
// private String detailUrl;
//
// private Integer sort;
//
// private Date createTime;
//
// private Boolean isDelete;... | private CarouselService carouselService; |
flyhero/flyapi | src/main/java/cn/iflyapi/blog/controller/CarouselController.java | // Path: src/main/java/cn/iflyapi/blog/entity/Carousel.java
// public class Carousel {
// private Long id;
//
// private String title;
//
// private String imgUrl;
//
// private String detailUrl;
//
// private Integer sort;
//
// private Date createTime;
//
// private Boolean isDelete;... | import cn.iflyapi.blog.annotation.OpenApi;
import cn.iflyapi.blog.entity.Carousel;
import cn.iflyapi.blog.model.JSONResult;
import cn.iflyapi.blog.service.CarouselService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import... | package cn.iflyapi.blog.controller;
/**
* @author flyhero
* @date 2018-12-31 11:14 AM
*/
@Api(value = "CarouselController", tags = "轮播图接口")
@RestController
public class CarouselController {
@Autowired
private CarouselService carouselService;
@ApiOperation("查询轮播图")
@OpenApi("/carousels")
@GetM... | // Path: src/main/java/cn/iflyapi/blog/entity/Carousel.java
// public class Carousel {
// private Long id;
//
// private String title;
//
// private String imgUrl;
//
// private String detailUrl;
//
// private Integer sort;
//
// private Date createTime;
//
// private Boolean isDelete;... | public JSONResult find() { |
flyhero/flyapi | src/main/java/cn/iflyapi/blog/controller/CarouselController.java | // Path: src/main/java/cn/iflyapi/blog/entity/Carousel.java
// public class Carousel {
// private Long id;
//
// private String title;
//
// private String imgUrl;
//
// private String detailUrl;
//
// private Integer sort;
//
// private Date createTime;
//
// private Boolean isDelete;... | import cn.iflyapi.blog.annotation.OpenApi;
import cn.iflyapi.blog.entity.Carousel;
import cn.iflyapi.blog.model.JSONResult;
import cn.iflyapi.blog.service.CarouselService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import... | package cn.iflyapi.blog.controller;
/**
* @author flyhero
* @date 2018-12-31 11:14 AM
*/
@Api(value = "CarouselController", tags = "轮播图接口")
@RestController
public class CarouselController {
@Autowired
private CarouselService carouselService;
@ApiOperation("查询轮播图")
@OpenApi("/carousels")
@GetM... | // Path: src/main/java/cn/iflyapi/blog/entity/Carousel.java
// public class Carousel {
// private Long id;
//
// private String title;
//
// private String imgUrl;
//
// private String detailUrl;
//
// private Integer sort;
//
// private Date createTime;
//
// private Boolean isDelete;... | public JSONResult add(@RequestBody Carousel carousel) { |
flyhero/flyapi | src/main/java/cn/iflyapi/blog/controller/StoreController.java | // Path: src/main/java/cn/iflyapi/blog/entity/Store.java
// public class Store {
// private Long id;
//
// private Long userId;
//
// private String ak;
//
// private String sk;
//
// private String bucket;
//
// private String domain;
//
// private Integer vip;
//
// private Stri... | import cn.iflyapi.blog.entity.Store;
import cn.iflyapi.blog.model.JSONResult;
import cn.iflyapi.blog.service.StoreService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; | package cn.iflyapi.blog.controller;
/**
* @author flyhero
* @date 2018-12-31 2:32 PM
*/
@Api(value = "StoreController", tags = "图床接口")
@RestController
public class StoreController extends BaseController {
@Autowired | // Path: src/main/java/cn/iflyapi/blog/entity/Store.java
// public class Store {
// private Long id;
//
// private Long userId;
//
// private String ak;
//
// private String sk;
//
// private String bucket;
//
// private String domain;
//
// private Integer vip;
//
// private Stri... | private StoreService storeService; |
flyhero/flyapi | src/main/java/cn/iflyapi/blog/controller/StoreController.java | // Path: src/main/java/cn/iflyapi/blog/entity/Store.java
// public class Store {
// private Long id;
//
// private Long userId;
//
// private String ak;
//
// private String sk;
//
// private String bucket;
//
// private String domain;
//
// private Integer vip;
//
// private Stri... | import cn.iflyapi.blog.entity.Store;
import cn.iflyapi.blog.model.JSONResult;
import cn.iflyapi.blog.service.StoreService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; | package cn.iflyapi.blog.controller;
/**
* @author flyhero
* @date 2018-12-31 2:32 PM
*/
@Api(value = "StoreController", tags = "图床接口")
@RestController
public class StoreController extends BaseController {
@Autowired
private StoreService storeService;
@ApiOperation("查询图床")
@GetMapping("/stores") | // Path: src/main/java/cn/iflyapi/blog/entity/Store.java
// public class Store {
// private Long id;
//
// private Long userId;
//
// private String ak;
//
// private String sk;
//
// private String bucket;
//
// private String domain;
//
// private Integer vip;
//
// private Stri... | public JSONResult find() { |
flyhero/flyapi | src/main/java/cn/iflyapi/blog/controller/StoreController.java | // Path: src/main/java/cn/iflyapi/blog/entity/Store.java
// public class Store {
// private Long id;
//
// private Long userId;
//
// private String ak;
//
// private String sk;
//
// private String bucket;
//
// private String domain;
//
// private Integer vip;
//
// private Stri... | import cn.iflyapi.blog.entity.Store;
import cn.iflyapi.blog.model.JSONResult;
import cn.iflyapi.blog.service.StoreService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; | package cn.iflyapi.blog.controller;
/**
* @author flyhero
* @date 2018-12-31 2:32 PM
*/
@Api(value = "StoreController", tags = "图床接口")
@RestController
public class StoreController extends BaseController {
@Autowired
private StoreService storeService;
@ApiOperation("查询图床")
@GetMapping("/stores")
... | // Path: src/main/java/cn/iflyapi/blog/entity/Store.java
// public class Store {
// private Long id;
//
// private Long userId;
//
// private String ak;
//
// private String sk;
//
// private String bucket;
//
// private String domain;
//
// private Integer vip;
//
// private Stri... | public JSONResult update(@PathVariable Long storeId, @RequestBody Store store) { |
flyhero/flyapi | src/main/java/cn/iflyapi/blog/util/HtmlUtils.java | // Path: src/main/java/cn/iflyapi/blog/util/StrUtils.java
// public static final String EMPTY_JSON = "{}";
| import org.apache.ibatis.reflection.ArrayUtil;
import org.springframework.util.StringUtils;
import java.nio.ByteBuffer;
import java.nio.charset.Charset;
import java.util.regex.Pattern;
import static cn.iflyapi.blog.util.StrUtils.EMPTY_JSON; | }
return format(template.toString(), params);
}
/**
* 格式化字符串<br>
* 此方法只是简单将占位符 {} 按照顺序替换为参数<br>
* 如果想输出 {} 使用 \\转义 { 即可,如果想输出 {} 之前的 \ 使用双转义符 \\\\ 即可<br>
* 例:<br>
* 通常使用:format("this is {} for {}", "a", "b") =》 this is a for b<br>
* 转义{}: format("this is \\{} for... | // Path: src/main/java/cn/iflyapi/blog/util/StrUtils.java
// public static final String EMPTY_JSON = "{}";
// Path: src/main/java/cn/iflyapi/blog/util/HtmlUtils.java
import org.apache.ibatis.reflection.ArrayUtil;
import org.springframework.util.StringUtils;
import java.nio.ByteBuffer;
import java.nio.charset.Charset;... | delimIndex = strPattern.indexOf(EMPTY_JSON, handledPosition); |
flyhero/flyapi | src/main/java/cn/iflyapi/blog/config/ErrorHandler.java | // Path: src/main/java/cn/iflyapi/blog/exception/FlyapiException.java
// public class FlyapiException extends RuntimeException {
//
// private int code = -1;
// private String msg;
//
// public FlyapiException(CodeMsgEnum codeMsgEnum) {
// this.code = codeMsgEnum.getCode();
// this.msg = c... | import cn.iflyapi.blog.exception.FlyapiException;
import cn.iflyapi.blog.model.JSONResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice; | package cn.iflyapi.blog.config;
/**
* author: flyhero
* date: 2018-12-13 11:09 AM
*/
@Slf4j
@RestControllerAdvice
public class ErrorHandler {
| // Path: src/main/java/cn/iflyapi/blog/exception/FlyapiException.java
// public class FlyapiException extends RuntimeException {
//
// private int code = -1;
// private String msg;
//
// public FlyapiException(CodeMsgEnum codeMsgEnum) {
// this.code = codeMsgEnum.getCode();
// this.msg = c... | @ExceptionHandler(FlyapiException.class) |
flyhero/flyapi | src/main/java/cn/iflyapi/blog/config/ErrorHandler.java | // Path: src/main/java/cn/iflyapi/blog/exception/FlyapiException.java
// public class FlyapiException extends RuntimeException {
//
// private int code = -1;
// private String msg;
//
// public FlyapiException(CodeMsgEnum codeMsgEnum) {
// this.code = codeMsgEnum.getCode();
// this.msg = c... | import cn.iflyapi.blog.exception.FlyapiException;
import cn.iflyapi.blog.model.JSONResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice; | package cn.iflyapi.blog.config;
/**
* author: flyhero
* date: 2018-12-13 11:09 AM
*/
@Slf4j
@RestControllerAdvice
public class ErrorHandler {
@ExceptionHandler(FlyapiException.class) | // Path: src/main/java/cn/iflyapi/blog/exception/FlyapiException.java
// public class FlyapiException extends RuntimeException {
//
// private int code = -1;
// private String msg;
//
// public FlyapiException(CodeMsgEnum codeMsgEnum) {
// this.code = codeMsgEnum.getCode();
// this.msg = c... | public JSONResult handlerFlyapiException(FlyapiException ex) { |
flyhero/flyapi | src/main/java/cn/iflyapi/blog/controller/BaseController.java | // Path: src/main/java/cn/iflyapi/blog/util/JwtUtils.java
// public class JwtUtils {
//
// private final static Logger logger = LoggerFactory.getLogger(JwtUtils.class);
//
// //一个月
// private static long EXPIRED_TIME = 60 * 60 * 24 * 30;
//
// private static String key = "secret";
//
// public s... | import cn.iflyapi.blog.util.JwtUtils;
import com.auth0.jwt.interfaces.Claim;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.ModelAttribute;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRes... | package cn.iflyapi.blog.controller;
/**
* author: flyhero
* date: 2018-12-12 7:48 PM
*/
public abstract class BaseController {
protected HttpServletRequest request;
protected HttpServletResponse response;
/**
* ModelAttribute标注的方法会在Controller类的每个映射url的控制执行方法之前执行
*
* @param request
... | // Path: src/main/java/cn/iflyapi/blog/util/JwtUtils.java
// public class JwtUtils {
//
// private final static Logger logger = LoggerFactory.getLogger(JwtUtils.class);
//
// //一个月
// private static long EXPIRED_TIME = 60 * 60 * 24 * 30;
//
// private static String key = "secret";
//
// public s... | return JwtUtils.verify(token); |
flyhero/flyapi | src/main/java/cn/iflyapi/blog/exception/FlyapiException.java | // Path: src/main/java/cn/iflyapi/blog/enums/CodeMsgEnum.java
// public enum CodeMsgEnum {
// OK(200, "Success"),
// FAIL(-1, "Fail"),
// USERNAME_OR_PASSWD_INVALID(40000, "用户名或密码不正确"),
// USERNAME_EXIST(40001, "用户名已存在"),
// USERNAME_MUST_MAIL_OR_PHONE(40002, "用户名必须是邮箱或手机号"),
// USER_ALREADY_REG... | import cn.iflyapi.blog.enums.CodeMsgEnum; | package cn.iflyapi.blog.exception;
/**
* author: flyhero
* date: 2018-12-13 11:08 AM
*/
public class FlyapiException extends RuntimeException {
private int code = -1;
private String msg;
| // Path: src/main/java/cn/iflyapi/blog/enums/CodeMsgEnum.java
// public enum CodeMsgEnum {
// OK(200, "Success"),
// FAIL(-1, "Fail"),
// USERNAME_OR_PASSWD_INVALID(40000, "用户名或密码不正确"),
// USERNAME_EXIST(40001, "用户名已存在"),
// USERNAME_MUST_MAIL_OR_PHONE(40002, "用户名必须是邮箱或手机号"),
// USER_ALREADY_REG... | public FlyapiException(CodeMsgEnum codeMsgEnum) { |
flyhero/flyapi | src/main/java/cn/iflyapi/blog/controller/SubjectController.java | // Path: src/main/java/cn/iflyapi/blog/entity/Subject.java
// public class Subject {
// private Long subjectId;
//
// private Long userId;
//
// private String cover;
//
// private String subjectTitle;
//
// private String subjectDes;
//
// private Boolean isPrivate;
//
// private Date... | import cn.iflyapi.blog.annotation.OpenApi;
import cn.iflyapi.blog.entity.Subject;
import cn.iflyapi.blog.model.JSONResult;
import cn.iflyapi.blog.service.SubjectService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import o... | package cn.iflyapi.blog.controller;
/**
* @author flyhero
* @date 2018/12/16 7:39 PM
*/
@Api(value = "SubjectController", tags = "小书接口")
@RestController
public class SubjectController extends BaseController {
@Autowired | // Path: src/main/java/cn/iflyapi/blog/entity/Subject.java
// public class Subject {
// private Long subjectId;
//
// private Long userId;
//
// private String cover;
//
// private String subjectTitle;
//
// private String subjectDes;
//
// private Boolean isPrivate;
//
// private Date... | private SubjectService subjectService; |
flyhero/flyapi | src/main/java/cn/iflyapi/blog/util/FastValidator.java | // Path: src/main/java/cn/iflyapi/blog/exception/FlyapiException.java
// public class FlyapiException extends RuntimeException {
//
// private int code = -1;
// private String msg;
//
// public FlyapiException(CodeMsgEnum codeMsgEnum) {
// this.code = codeMsgEnum.getCode();
// this.msg = c... | import cn.iflyapi.blog.exception.FlyapiException; | package cn.iflyapi.blog.util;
/**
* author: flyhero
* date: 2018-12-15 10:49 AM
*/
public class FastValidator {
public static FastValidator doit() {
return new FastValidator();
}
/**
* 校验参数不为空
*
* @param o
* @param paramName
* @return
*/
public FastValidator ... | // Path: src/main/java/cn/iflyapi/blog/exception/FlyapiException.java
// public class FlyapiException extends RuntimeException {
//
// private int code = -1;
// private String msg;
//
// public FlyapiException(CodeMsgEnum codeMsgEnum) {
// this.code = codeMsgEnum.getCode();
// this.msg = c... | throw new FlyapiException("参数[" + paramName + "]不能为空"); |
flyhero/flyapi | src/main/java/cn/iflyapi/blog/dao/custom/UserCustomMapper.java | // Path: src/main/java/cn/iflyapi/blog/pojo/po/UserFame.java
// @Data
// public class UserFame {
// private Long userId;
// private int score;
// }
//
// Path: src/main/java/cn/iflyapi/blog/pojo/vo/RankFameVo.java
// @Data
// public class RankFameVo {
//
// private String userId;
// private String nic... | import cn.iflyapi.blog.pojo.po.UserFame;
import cn.iflyapi.blog.pojo.vo.RankFameVo;
import java.util.List; | package cn.iflyapi.blog.dao.custom;
public interface UserCustomMapper {
int countUserFameVal(UserFame userFame);
int viewHomePage(Long userId);
| // Path: src/main/java/cn/iflyapi/blog/pojo/po/UserFame.java
// @Data
// public class UserFame {
// private Long userId;
// private int score;
// }
//
// Path: src/main/java/cn/iflyapi/blog/pojo/vo/RankFameVo.java
// @Data
// public class RankFameVo {
//
// private String userId;
// private String nic... | List<RankFameVo> rankDay(); |
shevek/spring-rich-client | spring-richclient-sandbox/src/main/java/org/springframework/richclient/settings/jdbc/JdbcSettings.java | // Path: spring-richclient-sandbox/src/main/java/org/springframework/richclient/settings/Settings.java
// public interface Settings {
// void setString(String key, String value);
//
// String getString(String key);
//
// void setDefaultString(String key, String value);
//
// String getDefaultString(String key);
... | import java.io.IOException;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.sql.DataSource;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.richclient.settings.AbstractSe... | /*
* Copyright 2002-2006 the original author or authors.
*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless require... | // Path: spring-richclient-sandbox/src/main/java/org/springframework/richclient/settings/Settings.java
// public interface Settings {
// void setString(String key, String value);
//
// String getString(String key);
//
// void setDefaultString(String key, String value);
//
// String getDefaultString(String key);
... | protected Settings internalCreateChild( String key ) {
|
shevek/spring-rich-client | spring-richclient-core/src/main/java/org/springframework/richclient/form/binding/swing/FormattedTextFieldBinding.java | // Path: spring-richclient-core/src/main/java/org/springframework/binding/value/swing/ValueCommitPolicy.java
// public abstract class ValueCommitPolicy extends ShortCodedLabeledEnum {
// public static final ValueCommitPolicy AS_YOU_TYPE = new ValueCommitPolicy(0, "as_you_type") {
// public void configure(JFormattedT... | import javax.swing.JComponent;
import javax.swing.JFormattedTextField;
import org.springframework.binding.form.FormModel;
import org.springframework.binding.value.ValueModel;
import org.springframework.binding.value.swing.FormattedTextFieldAdapter;
import org.springframework.binding.value.swing.ValueCommitPolicy;
impor... | /*
* Copyright 2002-2004 the original author or authors.
*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by ap... | // Path: spring-richclient-core/src/main/java/org/springframework/binding/value/swing/ValueCommitPolicy.java
// public abstract class ValueCommitPolicy extends ShortCodedLabeledEnum {
// public static final ValueCommitPolicy AS_YOU_TYPE = new ValueCommitPolicy(0, "as_you_type") {
// public void configure(JFormattedT... | new FormattedTextFieldAdapter(formattedTextField, valueModel, ValueCommitPolicy.AS_YOU_TYPE); |
ncjones/juzidian | org.juzidian.cli/src/main/java/org/juzidian/cli/DictionaryDbInitializer.java | // Path: org.juzidian.dataload/src/main/java/org/juzidian/dataload/DictionaryResource.java
// public interface DictionaryResource {
//
// /**
// * @return the URL for downloading the remote dictionary resource.
// */
// String getUrl();
//
// /**
// * @return the size of the dictionary resource in bytes.
// ... | import org.juzidian.util.IoUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import javax.inject.Inject;
import org.juzidian.core.DictionaryDataStore;
import org.juzidian.dataload.DictionaryResource;
import org.juzidian.d... | /*
* Copyright Nathan Jones 2013
*
* This file is part of Juzidian.
*
* Juzidian is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version... | // Path: org.juzidian.dataload/src/main/java/org/juzidian/dataload/DictionaryResource.java
// public interface DictionaryResource {
//
// /**
// * @return the URL for downloading the remote dictionary resource.
// */
// String getUrl();
//
// /**
// * @return the size of the dictionary resource in bytes.
// ... | final DictionaryResourceDownloader dictionaryDownloader; |
ncjones/juzidian | org.juzidian.cli/src/main/java/org/juzidian/cli/DictionaryDbInitializer.java | // Path: org.juzidian.dataload/src/main/java/org/juzidian/dataload/DictionaryResource.java
// public interface DictionaryResource {
//
// /**
// * @return the URL for downloading the remote dictionary resource.
// */
// String getUrl();
//
// /**
// * @return the size of the dictionary resource in bytes.
// ... | import org.juzidian.util.IoUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import javax.inject.Inject;
import org.juzidian.core.DictionaryDataStore;
import org.juzidian.dataload.DictionaryResource;
import org.juzidian.d... | /*
* Copyright Nathan Jones 2013
*
* This file is part of Juzidian.
*
* Juzidian is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version... | // Path: org.juzidian.dataload/src/main/java/org/juzidian/dataload/DictionaryResource.java
// public interface DictionaryResource {
//
// /**
// * @return the URL for downloading the remote dictionary resource.
// */
// String getUrl();
//
// /**
// * @return the size of the dictionary resource in bytes.
// ... | final DictionaryResource resource = this.getDictionaryResource(); |
ncjones/juzidian | org.juzidian.pinyin/src/test/java/org/juzidian/pinyin/ToneDiacriticCharacterTest.java | // Path: org.juzidian.pinyin/src/main/java/org/juzidian/pinyin/Tone.java
// public enum Tone {
//
// FIRST(1, "ĀāĒēĪīŌōŪūǕǖ"),
//
// SECOND(2, "ÁáÉéÍíÓóÚúǗǘ"),
//
// THIRD(3, "ǍǎĚĕǏǐǑǒǓǔǙǚ"),
//
// FOURTH(4, "ÀàÈèÌìÒòÙùǛǜ"),
//
// NEUTRAL(5, "AaEeIiOoUuÜü"),
//
// ANY(null, "AaEeIiOoUuÜü");
//
// private ... | import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
import org.juzidian.pinyin.Tone;
import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertThat;
import static org.juzidian.pinyin.Tone.ANY;
import s... | /*
* Copyright Nathan Jones 2012
*
* This file is part of Juzidian.
*
* Juzidian is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version... | // Path: org.juzidian.pinyin/src/main/java/org/juzidian/pinyin/Tone.java
// public enum Tone {
//
// FIRST(1, "ĀāĒēĪīŌōŪūǕǖ"),
//
// SECOND(2, "ÁáÉéÍíÓóÚúǗǘ"),
//
// THIRD(3, "ǍǎĚĕǏǐǑǒǓǔǙǚ"),
//
// FOURTH(4, "ÀàÈèÌìÒòÙùǛǜ"),
//
// NEUTRAL(5, "AaEeIiOoUuÜü"),
//
// ANY(null, "AaEeIiOoUuÜü");
//
// private ... | private final Tone tone; |
ncjones/juzidian | org.juzidian.dataload/src/test/java/org/juzidian/dataload/DictionaryResourceRegistryDeserializerTest.java | // Path: org.juzidian.dataload/src/main/java/org/juzidian/dataload/DictionaryResource.java
// public interface DictionaryResource {
//
// /**
// * @return the URL for downloading the remote dictionary resource.
// */
// String getUrl();
//
// /**
// * @return the size of the dictionary resource in bytes.
// ... | import org.juzidian.dataload.DictionaryResource;
import org.juzidian.dataload.DictionaryResourceRegistry;
import org.juzidian.dataload.DictionaryResourceRegistryDeserializer;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.hasSize;
import static org.junit.Assert.assertThat;
import java.... | /*
* Copyright Nathan Jones 2013
*
* This file is part of Juzidian.
*
* Juzidian is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version... | // Path: org.juzidian.dataload/src/main/java/org/juzidian/dataload/DictionaryResource.java
// public interface DictionaryResource {
//
// /**
// * @return the URL for downloading the remote dictionary resource.
// */
// String getUrl();
//
// /**
// * @return the size of the dictionary resource in bytes.
// ... | final List<DictionaryResource> dictionaryResources = registry.getDictionaryResources(); |
ncjones/juzidian | org.juzidian.dataload/src/test/java/org/juzidian/dataload/DictionaryResourceDownloaderTest.java | // Path: org.juzidian.dataload/src/main/java/org/juzidian/dataload/DictionaryResource.java
// public interface DictionaryResource {
//
// /**
// * @return the URL for downloading the remote dictionary resource.
// */
// String getUrl();
//
// /**
// * @return the size of the dictionary resource in bytes.
// ... | import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertThat;
import static org.mockito.Matchers.anyInt;
import static org.mockito.Mockito.atLeastOnce;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import java.io.ByteArrayOutputStream;
import java.io.IOExcep... | /*
* Copyright Nathan Jones 2013
*
* This file is part of Juzidian.
*
* Juzidian is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version... | // Path: org.juzidian.dataload/src/main/java/org/juzidian/dataload/DictionaryResource.java
// public interface DictionaryResource {
//
// /**
// * @return the URL for downloading the remote dictionary resource.
// */
// String getUrl();
//
// /**
// * @return the size of the dictionary resource in bytes.
// ... | private DictionaryResource mockResource; |
ncjones/juzidian | org.juzidian.dataload/src/test/java/org/juzidian/dataload/DictionaryResourceDownloaderTest.java | // Path: org.juzidian.dataload/src/main/java/org/juzidian/dataload/DictionaryResource.java
// public interface DictionaryResource {
//
// /**
// * @return the URL for downloading the remote dictionary resource.
// */
// String getUrl();
//
// /**
// * @return the size of the dictionary resource in bytes.
// ... | import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertThat;
import static org.mockito.Matchers.anyInt;
import static org.mockito.Mockito.atLeastOnce;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import java.io.ByteArrayOutputStream;
import java.io.IOExcep... | final byte[] gzipContent = gzip(content);
final String sha1 = sha1(gzipContent);
MockUrlHandler.delegate = Mockito.mock(MockUrlHandler.class);
when(MockUrlHandler.delegate.openConnection(Matchers.any(URL.class))).thenReturn(new MockUrlConnection(gzipContent));
this.mockResource = createMockDictionaryResource(... | // Path: org.juzidian.dataload/src/main/java/org/juzidian/dataload/DictionaryResource.java
// public interface DictionaryResource {
//
// /**
// * @return the URL for downloading the remote dictionary resource.
// */
// String getUrl();
//
// /**
// * @return the size of the dictionary resource in bytes.
// ... | @Test(expected = DictionaryResourceDownloaderException.class) |
ncjones/juzidian | org.juzidian.android/src/main/java/org/juzidian/android/SearchResultItemView.java | // Path: org.juzidian.core/src/main/java/org/juzidian/core/DictionaryEntry.java
// public class DictionaryEntry {
//
// private final String traditional;
//
// private final String simplified;
//
// private final List<PinyinSyllable> pinyin;
//
// private final List<String> definitions;
//
// public Dictionar... | import android.widget.TextView.BufferType;
import java.util.List;
import org.juzidian.core.DictionaryEntry;
import org.juzidian.pinyin.PinyinSyllable;
import android.content.Context;
import android.text.Spannable;
import android.text.Spanned;
import android.text.style.RelativeSizeSpan;
import android.view.LayoutInflate... | /*
* Copyright Nathan Jones 2012
*
* This file is part of Juzidian.
*
* Juzidian is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version... | // Path: org.juzidian.core/src/main/java/org/juzidian/core/DictionaryEntry.java
// public class DictionaryEntry {
//
// private final String traditional;
//
// private final String simplified;
//
// private final List<PinyinSyllable> pinyin;
//
// private final List<String> definitions;
//
// public Dictionar... | public SearchResultItemView(final Context context, final DictionaryEntry entry) { |
ncjones/juzidian | org.juzidian.dataload/src/main/java/org/juzidian/dataload/EntryCollector.java | // Path: org.juzidian.cedict/src/main/java/org/juzidian/cedict/CedictEntry.java
// public interface CedictEntry {
//
// String getTraditionalCharacters();
//
// String getSimplifiedCharacters();
//
// List<CedictPinyinSyllable> getPinyinSyllables();
//
// List<String> getDefinitions();
//
// }
//
// Path: org... | import java.util.Collection;
import java.util.LinkedList;
import java.util.List;
import javax.inject.Inject;
import org.juzidian.cedict.CedictEntry;
import org.juzidian.cedict.CedictLoadHandler;
import org.juzidian.core.DictionaryEntry;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory; | /*
* Copyright Nathan Jones 2012
*
* This file is part of Juzidian.
*
* Juzidian is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version... | // Path: org.juzidian.cedict/src/main/java/org/juzidian/cedict/CedictEntry.java
// public interface CedictEntry {
//
// String getTraditionalCharacters();
//
// String getSimplifiedCharacters();
//
// List<CedictPinyinSyllable> getPinyinSyllables();
//
// List<String> getDefinitions();
//
// }
//
// Path: org... | private final List<DictionaryEntry> entries = new LinkedList<DictionaryEntry>(); |
ncjones/juzidian | org.juzidian.dataload/src/main/java/org/juzidian/dataload/EntryCollector.java | // Path: org.juzidian.cedict/src/main/java/org/juzidian/cedict/CedictEntry.java
// public interface CedictEntry {
//
// String getTraditionalCharacters();
//
// String getSimplifiedCharacters();
//
// List<CedictPinyinSyllable> getPinyinSyllables();
//
// List<String> getDefinitions();
//
// }
//
// Path: org... | import java.util.Collection;
import java.util.LinkedList;
import java.util.List;
import javax.inject.Inject;
import org.juzidian.cedict.CedictEntry;
import org.juzidian.cedict.CedictLoadHandler;
import org.juzidian.core.DictionaryEntry;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory; | /*
* Copyright Nathan Jones 2012
*
* This file is part of Juzidian.
*
* Juzidian is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version... | // Path: org.juzidian.cedict/src/main/java/org/juzidian/cedict/CedictEntry.java
// public interface CedictEntry {
//
// String getTraditionalCharacters();
//
// String getSimplifiedCharacters();
//
// List<CedictPinyinSyllable> getPinyinSyllables();
//
// List<String> getDefinitions();
//
// }
//
// Path: org... | public void entryLoaded(final CedictEntry cedictEntry) { |
ncjones/juzidian | org.juzidian.core/src/test/java/org/juzidian/core/DictionaryEntryTest.java | // Path: org.juzidian.pinyin/src/main/java/org/juzidian/pinyin/Tone.java
// public enum Tone {
//
// FIRST(1, "ĀāĒēĪīŌōŪūǕǖ"),
//
// SECOND(2, "ÁáÉéÍíÓóÚúǗǘ"),
//
// THIRD(3, "ǍǎĚĕǏǐǑǒǓǔǙǚ"),
//
// FOURTH(4, "ÀàÈèÌìÒòÙùǛǜ"),
//
// NEUTRAL(5, "AaEeIiOoUuÜü"),
//
// ANY(null, "AaEeIiOoUuÜü");
//
// private ... | import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import java.util.Arrays;
import java.util.List;
import org.junit.Test;
import org.juzidian.pinyin.PinyinSyllable;
import org.juzidian.pinyin.Tone; | /*
* Copyright Nathan Jones 2012
*
* This file is part of Juzidian.
*
* Juzidian is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later versio... | // Path: org.juzidian.pinyin/src/main/java/org/juzidian/pinyin/Tone.java
// public enum Tone {
//
// FIRST(1, "ĀāĒēĪīŌōŪūǕǖ"),
//
// SECOND(2, "ÁáÉéÍíÓóÚúǗǘ"),
//
// THIRD(3, "ǍǎĚĕǏǐǑǒǓǔǙǚ"),
//
// FOURTH(4, "ÀàÈèÌìÒòÙùǛǜ"),
//
// NEUTRAL(5, "AaEeIiOoUuÜü"),
//
// ANY(null, "AaEeIiOoUuÜü");
//
// private ... | final DictionaryEntry entry = this.createChineseWord(new PinyinSyllable("hao", Tone.THIRD)); |
punkbrwstr/pinto | src/main/java/tech/pinto/time/PeriodicRange.java | // Path: src/main/java/tech/pinto/tools/ID.java
// public class ID {
//
// private static final AtomicInteger current = new AtomicInteger();
//
// public static String getId() {
// return toBase26(current.getAndIncrement());
// }
//
// private static String toBase26(int i){
// String s = "... | import java.time.LocalDate;
import java.time.ZoneId;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import com.google.common.base.Joiner;
import com.google.common.collect.ImmutableMap;
import tech.pinto.tools.ID;
| package tech.pinto.time;
public final class PeriodicRange<P extends Period<P>> {
private final Periodicity<P> periodicity;
private final P startInclusive;
private final P endInclusive;
| // Path: src/main/java/tech/pinto/tools/ID.java
// public class ID {
//
// private static final AtomicInteger current = new AtomicInteger();
//
// public static String getId() {
// return toBase26(current.getAndIncrement());
// }
//
// private static String toBase26(int i){
// String s = "... | private final String id = ID.getId();
|
punkbrwstr/pinto | src/main/java/tech/pinto/Namespace.java | // Path: src/main/java/tech/pinto/Pinto.java
// public static class Expression implements TableFunction {
//
// private final boolean isSubExpression;
// private ArrayList<TableFunction> functions = new ArrayList<>();
// private Optional<Indexer> indexer = null;
// private Optional<TerminalFunction> termin... | import java.util.List;
import java.util.Map.Entry;
import java.util.Set;
import java.util.SortedSet;
import java.util.TreeMap;
import java.util.TreeSet;
import java.util.stream.Collectors;
import javax.inject.Inject;
import com.google.common.base.Joiner;
import jline.console.completer.Completer;
import tech.p... | package tech.pinto;
public class Namespace implements Completer {
private final String DELIMITER = "::";
private final TreeMap<String,Name> names = new TreeMap<>();
private final TreeSet<String> dependencyGraph = new TreeSet<>();
@Inject
public Namespace(Vocabulary vocabulary) {
if(names.i... | // Path: src/main/java/tech/pinto/Pinto.java
// public static class Expression implements TableFunction {
//
// private final boolean isSubExpression;
// private ArrayList<TableFunction> functions = new ArrayList<>();
// private Optional<Indexer> indexer = null;
// private Optional<TerminalFunction> termin... | public synchronized String define(Pinto pinto, Expression expression, boolean onlyIfUndefined) {
|
punkbrwstr/pinto | src/main/java/tech/pinto/Namespace.java | // Path: src/main/java/tech/pinto/Pinto.java
// public static class Expression implements TableFunction {
//
// private final boolean isSubExpression;
// private ArrayList<TableFunction> functions = new ArrayList<>();
// private Optional<Indexer> indexer = null;
// private Optional<TerminalFunction> termin... | import java.util.List;
import java.util.Map.Entry;
import java.util.Set;
import java.util.SortedSet;
import java.util.TreeMap;
import java.util.TreeSet;
import java.util.stream.Collectors;
import javax.inject.Inject;
import com.google.common.base.Joiner;
import jline.console.completer.Completer;
import tech.p... | }
public synchronized boolean contains(String name) {
return names.containsKey(name);
}
public synchronized String define(Pinto pinto, Expression expression, boolean onlyIfUndefined) {
String name = expression.getNameLiteral()
.orElseThrow(() -> new PintoSyntaxException("A name literal is require... | // Path: src/main/java/tech/pinto/Pinto.java
// public static class Expression implements TableFunction {
//
// private final boolean isSubExpression;
// private ArrayList<TableFunction> functions = new ArrayList<>();
// private Optional<Indexer> indexer = null;
// private Optional<TerminalFunction> termin... | names.put(name, Name.nameBuilder(name, (TableFunction) (p,t) -> expression.accept(p, t))
|
punkbrwstr/pinto | src/main/java/tech/pinto/Console.java | // Path: src/main/java/tech/pinto/tools/LogAppender.java
// public class LogAppender extends AppenderBase<ILoggingEvent> {
// public static ArrayBlockingQueue<String> LOG = new ArrayBlockingQueue<String>(1000);
// static int DEFAULT_LIMIT = 100000;
// int counter = 0;
// int limit = DEFAULT_LIMIT;
//
//... | import java.io.IOException;
import java.io.PrintWriter;
import java.text.NumberFormat;
import java.util.Arrays;
import java.util.List;
import jline.console.ConsoleReader;
import tech.pinto.tools.LogAppender;
| private boolean trace = false;
public Console(Pinto pinto, int port, String build, Runnable...shutdownCommands) {
this.pinto = pinto;
this.port = port;
this.build = build;
this.shutdownCommands = shutdownCommands;
}
@Override
public void run() {
try {
NumberFormat nf = NumberFormat.getIn... | // Path: src/main/java/tech/pinto/tools/LogAppender.java
// public class LogAppender extends AppenderBase<ILoggingEvent> {
// public static ArrayBlockingQueue<String> LOG = new ArrayBlockingQueue<String>(1000);
// static int DEFAULT_LIMIT = 100000;
// int counter = 0;
// int limit = DEFAULT_LIMIT;
//
//... | while(!LogAppender.LOG.isEmpty()) {
|
punkbrwstr/pinto | src/main/java/tech/pinto/Indexer.java | // Path: src/main/java/tech/pinto/Pinto.java
// public static class Expression implements TableFunction {
//
// private final boolean isSubExpression;
// private ArrayList<TableFunction> functions = new ArrayList<>();
// private Optional<Indexer> indexer = null;
// private Optional<TerminalFunction> termin... | import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import java.util.function.Predicate;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import tech.pinto.Pinto.Expression;
import tech.... | sb.append(this.indexString.charAt(i));
} else {
if (this.indexString.charAt(i) == ',') {
indexes.add(new Index(pinto, dependencies, sb.toString().trim()));
sb = new StringBuilder();
Arrays.setAll(open, x -> 0);
} else {
sb.append(this.indexString.charAt(i));
}
}
}
... | // Path: src/main/java/tech/pinto/Pinto.java
// public static class Expression implements TableFunction {
//
// private final boolean isSubExpression;
// private ArrayList<TableFunction> functions = new ArrayList<>();
// private Optional<Indexer> indexer = null;
// private Optional<TerminalFunction> termin... | LinkedList<Stack> unused = new LinkedList<>();
|
punkbrwstr/pinto | src/main/java/tech/pinto/Indexer.java | // Path: src/main/java/tech/pinto/Pinto.java
// public static class Expression implements TableFunction {
//
// private final boolean isSubExpression;
// private ArrayList<TableFunction> functions = new ArrayList<>();
// private Optional<Indexer> indexer = null;
// private Optional<TerminalFunction> termin... | import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import java.util.function.Predicate;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import tech.pinto.Pinto.Expression;
import tech.... | }
unused.addLast(thisUnused);
}
t.insertAtTop(unused);
t.push(indexForExpression, indexedStacks);
}
public String toString() {
return "[" + indexString + "]";
}
public Indexer clone() {
try {
Indexer clone = (Indexer) super.clone();
return clone;
} catch (CloneNotSupported... | // Path: src/main/java/tech/pinto/Pinto.java
// public static class Expression implements TableFunction {
//
// private final boolean isSubExpression;
// private ArrayList<TableFunction> functions = new ArrayList<>();
// private Optional<Indexer> indexer = null;
// private Optional<TerminalFunction> termin... | private Optional<Expression> orFunction = Optional.empty();
|
punkbrwstr/pinto | src/main/java/tech/pinto/Window.java | // Path: src/main/java/tech/pinto/time/PeriodicRange.java
// public final class PeriodicRange<P extends Period<P>> {
//
// private final Periodicity<P> periodicity;
// private final P startInclusive;
// private final P endInclusive;
// private final String id = ID.getId();
//
// PeriodicRange(Periodicity... | import java.time.LocalDate;
import java.util.List;
import java.util.function.DoubleBinaryOperator;
import java.util.function.DoubleUnaryOperator;
import org.ejml.data.DMatrix;
import org.ejml.data.DMatrixRMaj;
import org.ejml.data.Matrix;
import org.ejml.data.MatrixType;
import tech.pinto.time.PeriodicRange;
|
@Override
public void apply(DoubleUnaryOperator duo) {
for(int i = 0; i < d.length; i++) {
for(int j = 0; i < d.length; i++) {
d[i][j] = duo.applyAsDouble(d[i][j]);
}
}
}
@Override
public void apply(DoubleBinaryOperator duo, Window other) {
if(!other.getClass().equals(Cross... | // Path: src/main/java/tech/pinto/time/PeriodicRange.java
// public final class PeriodicRange<P extends Period<P>> {
//
// private final Periodicity<P> periodicity;
// private final P startInclusive;
// private final P endInclusive;
// private final String id = ID.getId();
//
// PeriodicRange(Periodicity... | final PeriodicRange<?> dataRange;
|
punkbrwstr/pinto | src/main/java/tech/pinto/Servlet.java | // Path: src/main/java/tech/pinto/Pinto.java
// public static class Expression implements TableFunction {
//
// private final boolean isSubExpression;
// private ArrayList<TableFunction> functions = new ArrayList<>();
// private Optional<Indexer> indexer = null;
// private Optional<TerminalFunction> termin... | import java.io.BufferedInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
impo... | getReport(pinto, request, response);
}
}
private void getCSV(Pinto pinto, HttpServletRequest request, HttpServletResponse response) throws IOException {
getCSV(pinto,request,response,"NA", 10);
}
private void getSas(Pinto pinto, HttpServletRequest request, HttpServletResponse response) throws IOE... | // Path: src/main/java/tech/pinto/Pinto.java
// public static class Expression implements TableFunction {
//
// private final boolean isSubExpression;
// private ArrayList<TableFunction> functions = new ArrayList<>();
// private Optional<Indexer> indexer = null;
// private Optional<TerminalFunction> termin... | var e = new Pinto.Expression(false);
|
punkbrwstr/pinto | src/main/java/tech/pinto/HeaderLiteral.java | // Path: src/main/java/tech/pinto/Pinto.java
// @FunctionalInterface
// public static interface StackFunction extends TableFunction {
// void accept(Pinto p, Stack s);
//
// default void accept(Pinto p, Table t) {
// List<Stack> inputs = t.takeTop();
// for(int i = 0; i < inputs.size(); i++) {
// ac... | import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import tech.pinto.Pinto.StackFunction;
import tech.pinto.Pinto.Stack;
| }
// don't count colons of commas if anything's open
if(Arrays.stream(open).sum() > 0) {
h[position].append(header.charAt(i));
} else {
if(header.charAt(i) == ':') {
position = 1;
} else if(header.charAt(i) == ',') {
this.headers.add(new Header(pinto, dependencies,
... | // Path: src/main/java/tech/pinto/Pinto.java
// @FunctionalInterface
// public static interface StackFunction extends TableFunction {
// void accept(Pinto p, Stack s);
//
// default void accept(Pinto p, Table t) {
// List<Stack> inputs = t.takeTop();
// for(int i = 0; i < inputs.size(); i++) {
// ac... | public void accept(Pinto pinto, Stack stack) {
|
punkbrwstr/pinto | src/main/java/tech/pinto/Name.java | // Path: src/main/java/tech/pinto/Pinto.java
// @FunctionalInterface
// public static interface StackFunction extends TableFunction {
// void accept(Pinto p, Stack s);
//
// default void accept(Pinto p, Table t) {
// List<Stack> inputs = t.takeTop();
// for(int i = 0; i < inputs.size(); i++) {
// ac... | import java.util.HashSet;
import java.util.Optional;
import tech.pinto.Pinto.StackFunction;
import tech.pinto.Pinto.TableFunction;
import tech.pinto.Pinto.TerminalFunction;
| package tech.pinto;
public class Name {
final private String name;
| // Path: src/main/java/tech/pinto/Pinto.java
// @FunctionalInterface
// public static interface StackFunction extends TableFunction {
// void accept(Pinto p, Stack s);
//
// default void accept(Pinto p, Table t) {
// List<Stack> inputs = t.takeTop();
// for(int i = 0; i < inputs.size(); i++) {
// ac... | final private Optional<TableFunction> tableFunction;
|
punkbrwstr/pinto | src/main/java/tech/pinto/Name.java | // Path: src/main/java/tech/pinto/Pinto.java
// @FunctionalInterface
// public static interface StackFunction extends TableFunction {
// void accept(Pinto p, Stack s);
//
// default void accept(Pinto p, Table t) {
// List<Stack> inputs = t.takeTop();
// for(int i = 0; i < inputs.size(); i++) {
// ac... | import java.util.HashSet;
import java.util.Optional;
import tech.pinto.Pinto.StackFunction;
import tech.pinto.Pinto.TableFunction;
import tech.pinto.Pinto.TerminalFunction;
| package tech.pinto;
public class Name {
final private String name;
final private Optional<TableFunction> tableFunction;
| // Path: src/main/java/tech/pinto/Pinto.java
// @FunctionalInterface
// public static interface StackFunction extends TableFunction {
// void accept(Pinto p, Stack s);
//
// default void accept(Pinto p, Table t) {
// List<Stack> inputs = t.takeTop();
// for(int i = 0; i < inputs.size(); i++) {
// ac... | final private Optional<TerminalFunction> terminalFunction;
|
punkbrwstr/pinto | src/main/java/tech/pinto/Name.java | // Path: src/main/java/tech/pinto/Pinto.java
// @FunctionalInterface
// public static interface StackFunction extends TableFunction {
// void accept(Pinto p, Stack s);
//
// default void accept(Pinto p, Table t) {
// List<Stack> inputs = t.takeTop();
// for(int i = 0; i < inputs.size(); i++) {
// ac... | import java.util.HashSet;
import java.util.Optional;
import tech.pinto.Pinto.StackFunction;
import tech.pinto.Pinto.TableFunction;
import tech.pinto.Pinto.TerminalFunction;
| }
public boolean isBuiltIn() {
return isBuiltIn;
}
public String getDescription() {
return description;
}
public String getIndexString() {
return indexString.orElse("[:]");
}
public String getHelp(String name) {
StringBuilder sb = new StringBuilder();
String crlf = System.getP... | // Path: src/main/java/tech/pinto/Pinto.java
// @FunctionalInterface
// public static interface StackFunction extends TableFunction {
// void accept(Pinto p, Stack s);
//
// default void accept(Pinto p, Table t) {
// List<Stack> inputs = t.takeTop();
// for(int i = 0; i < inputs.size(); i++) {
// ac... | public static Builder nameBuilder(String name, StackFunction function) {
|
punkbrwstr/pinto | src/main/java/tech/pinto/Table.java | // Path: src/main/java/tech/pinto/time/PeriodicRange.java
// public final class PeriodicRange<P extends Period<P>> {
//
// private final Periodicity<P> periodicity;
// private final P startInclusive;
// private final P endInclusive;
// private final String id = ID.getId();
//
// PeriodicRange(Periodicity... | import static java.util.stream.Collectors.toList;
import java.text.NumberFormat;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
impo... | package tech.pinto;
public class Table {
private final LinkedList<Level> levels = new LinkedList<>();
private Optional<String> status = Optional.empty();
| // Path: src/main/java/tech/pinto/time/PeriodicRange.java
// public final class PeriodicRange<P extends Period<P>> {
//
// private final Periodicity<P> periodicity;
// private final P startInclusive;
// private final P endInclusive;
// private final String id = ID.getId();
//
// PeriodicRange(Periodicity... | private Optional<PeriodicRange<?>> range = Optional.empty();
|
punkbrwstr/pinto | src/main/java/tech/pinto/Table.java | // Path: src/main/java/tech/pinto/time/PeriodicRange.java
// public final class PeriodicRange<P extends Period<P>> {
//
// private final Periodicity<P> periodicity;
// private final P startInclusive;
// private final P endInclusive;
// private final String id = ID.getId();
//
// PeriodicRange(Periodicity... | import static java.util.stream.Collectors.toList;
import java.text.NumberFormat;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
impo... | package tech.pinto;
public class Table {
private final LinkedList<Level> levels = new LinkedList<>();
private Optional<String> status = Optional.empty();
private Optional<PeriodicRange<?>> range = Optional.empty();
| // Path: src/main/java/tech/pinto/time/PeriodicRange.java
// public final class PeriodicRange<P extends Period<P>> {
//
// private final Periodicity<P> periodicity;
// private final P startInclusive;
// private final P endInclusive;
// private final String id = ID.getId();
//
// PeriodicRange(Periodicity... | private Optional<Stack> flattenedStack = Optional.empty();
|
f2prateek/device-frame-generator | src/main/java/com/f2prateek/dfg/Events.java | // Path: src/main/java/com/f2prateek/dfg/model/Device.java
// @AutoValue public abstract class Device implements Parcelable {
//
// // Unique identifier for each device, also used to identify resources.
// public abstract String id();
//
// // Device name to display
// public abstract String name();
//
// ... | import android.net.Uri;
import com.f2prateek.dfg.model.Device;
import java.util.List; | /*
* Copyright 2014 Prateek Srivastava (@f2prateek)
*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicab... | // Path: src/main/java/com/f2prateek/dfg/model/Device.java
// @AutoValue public abstract class Device implements Parcelable {
//
// // Unique identifier for each device, also used to identify resources.
// public abstract String id();
//
// // Device name to display
// public abstract String name();
//
// ... | public final Device newDevice; |
f2prateek/device-frame-generator | src/main/java/com/f2prateek/dfg/ui/activities/BaseActivity.java | // Path: src/main/java/com/f2prateek/dfg/DFGApplication.java
// public class DFGApplication extends Application {
// ObjectGraph applicationGraph;
// @Inject ActivityHierarchyServer activityHierarchyServer;
// @Inject Bus bus;
//
// @Inject WindowManager windowManager;
// @Inject DeviceProvider deviceProvide... | import android.annotation.SuppressLint;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.ViewGroup;
import butterknife.ButterKnife;
import com.f2prateek.dart.Dart;
import com.f2prateek.dfg.DFGApplication;
import com.f2prateek.dfg.ui.AppContainer;
import com.squareup.otto.Bu... | /*
* Copyright 2014 Prateek Srivastava (@f2prateek)
*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicab... | // Path: src/main/java/com/f2prateek/dfg/DFGApplication.java
// public class DFGApplication extends Application {
// ObjectGraph applicationGraph;
// @Inject ActivityHierarchyServer activityHierarchyServer;
// @Inject Bus bus;
//
// @Inject WindowManager windowManager;
// @Inject DeviceProvider deviceProvide... | @Inject AppContainer appContainer; |
f2prateek/device-frame-generator | src/main/java/com/f2prateek/dfg/ui/activities/BaseActivity.java | // Path: src/main/java/com/f2prateek/dfg/DFGApplication.java
// public class DFGApplication extends Application {
// ObjectGraph applicationGraph;
// @Inject ActivityHierarchyServer activityHierarchyServer;
// @Inject Bus bus;
//
// @Inject WindowManager windowManager;
// @Inject DeviceProvider deviceProvide... | import android.annotation.SuppressLint;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.ViewGroup;
import butterknife.ButterKnife;
import com.f2prateek.dart.Dart;
import com.f2prateek.dfg.DFGApplication;
import com.f2prateek.dfg.ui.AppContainer;
import com.squareup.otto.Bu... | /*
* Copyright 2014 Prateek Srivastava (@f2prateek)
*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicab... | // Path: src/main/java/com/f2prateek/dfg/DFGApplication.java
// public class DFGApplication extends Application {
// ObjectGraph applicationGraph;
// @Inject ActivityHierarchyServer activityHierarchyServer;
// @Inject Bus bus;
//
// @Inject WindowManager windowManager;
// @Inject DeviceProvider deviceProvide... | DFGApplication app = DFGApplication.get(this); |
f2prateek/device-frame-generator | src/main/java/com/f2prateek/dfg/DeviceModule.java | // Path: src/main/java/com/f2prateek/dfg/model/Device.java
// @AutoValue public abstract class Device implements Parcelable {
//
// // Unique identifier for each device, also used to identify resources.
// public abstract String id();
//
// // Device name to display
// public abstract String name();
//
// ... | import com.f2prateek.dfg.model.Device;
import dagger.Module;
import dagger.Provides;
import static dagger.Provides.Type.SET; | /*
* Copyright 2014 Prateek Srivastava (@f2prateek)
*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicab... | // Path: src/main/java/com/f2prateek/dfg/model/Device.java
// @AutoValue public abstract class Device implements Parcelable {
//
// // Unique identifier for each device, also used to identify resources.
// public abstract String id();
//
// // Device name to display
// public abstract String name();
//
// ... | @Provides(type = SET) Device provideNexusS() { |
f2prateek/device-frame-generator | src/debug/java/com/f2prateek/dfg/DebugDFGApplicationModule.java | // Path: src/debug/java/com/f2prateek/dfg/prefs/DebugPreferencesModule.java
// @Module(complete = false, library = true) public class DebugPreferencesModule {
// private static final int DEFAULT_ANIMATION_SPEED = 1; // 1x (normal) speed.
// private static final boolean DEFAULT_PICASSO_DEBUGGING = false; // Debug in... | import android.content.Context;
import com.f2prateek.dfg.prefs.DebugPreferencesModule;
import com.f2prateek.dfg.ui.DebugUiModule;
import com.segment.analytics.Analytics;
import dagger.Module;
import dagger.Provides;
import javax.inject.Singleton; | /*
* Copyright 2014 Prateek Srivastava (@f2prateek)
*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicab... | // Path: src/debug/java/com/f2prateek/dfg/prefs/DebugPreferencesModule.java
// @Module(complete = false, library = true) public class DebugPreferencesModule {
// private static final int DEFAULT_ANIMATION_SPEED = 1; // 1x (normal) speed.
// private static final boolean DEFAULT_PICASSO_DEBUGGING = false; // Debug in... | DebugUiModule.class, DebugPreferencesModule.class |
pentaho/pentaho-mongodb-plugin | pentaho-mongodb-plugin/src/test/java/org/pentaho/di/trans/steps/mongodboutput/MongoDbOutputDataTest.java | // Path: pentaho-mongodb-plugin/src/main/java/org/pentaho/di/trans/steps/mongodboutput/MongoDbOutputMeta.java
// public static class MongoIndex {
//
// /**
// * Dot notation for accessing a fields - e.g. person.address.street. Can also specify entire embedded documents as
// * an index (rather than a primitive... | import com.mongodb.BasicDBObject;
import com.mongodb.DBCollection;
import com.mongodb.DBObject;
import com.mongodb.util.JSON;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.mockit... | .thenAnswer( new Answer<String>() {
@Override public String answer( InvocationOnMock invocationOnMock ) throws Throwable {
return (String) invocationOnMock.getArguments()[0];
}
} );
when( space.environmentSubstitute( any( String.class ), anyBoolean() ) )
.thenAn... | // Path: pentaho-mongodb-plugin/src/main/java/org/pentaho/di/trans/steps/mongodboutput/MongoDbOutputMeta.java
// public static class MongoIndex {
//
// /**
// * Dot notation for accessing a fields - e.g. person.address.street. Can also specify entire embedded documents as
// * an index (rather than a primitive... | MongoIndex index = new MongoDbOutputMeta.MongoIndex(); |
googlearchive/android-AutofillFramework | afservice/src/main/java/com/example/android/autofill/service/data/source/DigitalAssetLinksDataSource.java | // Path: afservice/src/main/java/com/example/android/autofill/service/data/DataCallback.java
// public interface DataCallback<T> {
// void onLoaded(T object);
//
// void onDataNotAvailable(String msg, Object... params);
// }
//
// Path: afservice/src/main/java/com/example/android/autofill/service/model/DalChe... | import com.example.android.autofill.service.data.DataCallback;
import com.example.android.autofill.service.model.DalCheck;
import com.example.android.autofill.service.model.DalInfo;
import static com.example.android.autofill.service.util.Util.DalCheckRequirement; | /*
* Copyright (C) 2017 The Android Open Source Project
*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | // Path: afservice/src/main/java/com/example/android/autofill/service/data/DataCallback.java
// public interface DataCallback<T> {
// void onLoaded(T object);
//
// void onDataNotAvailable(String msg, Object... params);
// }
//
// Path: afservice/src/main/java/com/example/android/autofill/service/model/DalChe... | DataCallback<DalCheck> dalCheckCallback); |
googlearchive/android-AutofillFramework | afservice/src/main/java/com/example/android/autofill/service/data/source/DigitalAssetLinksDataSource.java | // Path: afservice/src/main/java/com/example/android/autofill/service/data/DataCallback.java
// public interface DataCallback<T> {
// void onLoaded(T object);
//
// void onDataNotAvailable(String msg, Object... params);
// }
//
// Path: afservice/src/main/java/com/example/android/autofill/service/model/DalChe... | import com.example.android.autofill.service.data.DataCallback;
import com.example.android.autofill.service.model.DalCheck;
import com.example.android.autofill.service.model.DalInfo;
import static com.example.android.autofill.service.util.Util.DalCheckRequirement; | /*
* Copyright (C) 2017 The Android Open Source Project
*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | // Path: afservice/src/main/java/com/example/android/autofill/service/data/DataCallback.java
// public interface DataCallback<T> {
// void onLoaded(T object);
//
// void onDataNotAvailable(String msg, Object... params);
// }
//
// Path: afservice/src/main/java/com/example/android/autofill/service/model/DalChe... | DataCallback<DalCheck> dalCheckCallback); |
googlearchive/android-AutofillFramework | afservice/src/main/java/com/example/android/autofill/service/data/source/local/SharedPrefsPackageVerificationRepository.java | // Path: afservice/src/main/java/com/example/android/autofill/service/data/source/PackageVerificationDataSource.java
// public interface PackageVerificationDataSource {
//
// /**
// * Verifies that the signatures in the passed {@code Context} match what is currently in
// * storage. If there are no curre... | import android.content.Context;
import android.content.SharedPreferences;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import com.example.android.autofill.service.data.source.PackageVerificationDataSource;
import com.example.android.autofill.service.util.SecurityHelper;
import static... | /*
* Copyright (C) 2017 The Android Open Source Project
*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | // Path: afservice/src/main/java/com/example/android/autofill/service/data/source/PackageVerificationDataSource.java
// public interface PackageVerificationDataSource {
//
// /**
// * Verifies that the signatures in the passed {@code Context} match what is currently in
// * storage. If there are no curre... | hash = SecurityHelper.getFingerprint(packageInfo, packageName); |
googlearchive/android-AutofillFramework | afservice/src/main/java/com/example/android/autofill/service/data/source/local/SharedPrefsPackageVerificationRepository.java | // Path: afservice/src/main/java/com/example/android/autofill/service/data/source/PackageVerificationDataSource.java
// public interface PackageVerificationDataSource {
//
// /**
// * Verifies that the signatures in the passed {@code Context} match what is currently in
// * storage. If there are no curre... | import android.content.Context;
import android.content.SharedPreferences;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import com.example.android.autofill.service.data.source.PackageVerificationDataSource;
import com.example.android.autofill.service.util.SecurityHelper;
import static... | /*
* Copyright (C) 2017 The Android Open Source Project
*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | // Path: afservice/src/main/java/com/example/android/autofill/service/data/source/PackageVerificationDataSource.java
// public interface PackageVerificationDataSource {
//
// /**
// * Verifies that the signatures in the passed {@code Context} match what is currently in
// * storage. If there are no curre... | logd("Hash for %s: %s", packageName, hash); |
googlearchive/android-AutofillFramework | afservice/src/main/java/com/example/android/autofill/service/data/source/local/SharedPrefsPackageVerificationRepository.java | // Path: afservice/src/main/java/com/example/android/autofill/service/data/source/PackageVerificationDataSource.java
// public interface PackageVerificationDataSource {
//
// /**
// * Verifies that the signatures in the passed {@code Context} match what is currently in
// * storage. If there are no curre... | import android.content.Context;
import android.content.SharedPreferences;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import com.example.android.autofill.service.data.source.PackageVerificationDataSource;
import com.example.android.autofill.service.util.SecurityHelper;
import static... | private final Context mContext;
private SharedPrefsPackageVerificationRepository(Context context) {
mSharedPrefs = context.getApplicationContext()
.getSharedPreferences(SHARED_PREF_KEY, Context.MODE_PRIVATE);
mContext = context.getApplicationContext();
}
public static P... | // Path: afservice/src/main/java/com/example/android/autofill/service/data/source/PackageVerificationDataSource.java
// public interface PackageVerificationDataSource {
//
// /**
// * Verifies that the signatures in the passed {@code Context} match what is currently in
// * storage. If there are no curre... | logw(e, "Error getting hash for %s.", packageName); |
googlearchive/android-AutofillFramework | afservice/src/main/java/com/example/android/autofill/service/model/DalInfo.java | // Path: afservice/src/main/java/com/example/android/autofill/service/data/source/local/DigitalAssetLinksRepository.java
// public static String getCanonicalDomain(String domain) {
// InternetDomainName idn = InternetDomainName.from(domain);
// while (idn != null && !idn.isTopPrivateDomain()) {
// idn =... | import static com.example.android.autofill.service.data.source.local.DigitalAssetLinksRepository.getCanonicalDomain; | /*
* Copyright (C) 2017 The Android Open Source Project
*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | // Path: afservice/src/main/java/com/example/android/autofill/service/data/source/local/DigitalAssetLinksRepository.java
// public static String getCanonicalDomain(String domain) {
// InternetDomainName idn = InternetDomainName.from(domain);
// while (idn != null && !idn.isTopPrivateDomain()) {
// idn =... | String canonicalDomain = getCanonicalDomain(webDomain); |
googlearchive/android-AutofillFramework | afservice/src/main/java/com/example/android/autofill/service/data/source/DalService.java | // Path: afservice/src/main/java/com/example/android/autofill/service/model/DalCheck.java
// public class DalCheck {
// public boolean linked;
// public String maxAge;
// public String debugString;
// }
| import com.example.android.autofill.service.model.DalCheck;
import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Query; | /*
* Copyright (C) 2017 The Android Open Source Project
*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | // Path: afservice/src/main/java/com/example/android/autofill/service/model/DalCheck.java
// public class DalCheck {
// public boolean linked;
// public String maxAge;
// public String debugString;
// }
// Path: afservice/src/main/java/com/example/android/autofill/service/data/source/DalService.java
impor... | Call<DalCheck> check(@Query("source.web.site") String webDomain, |
googlearchive/android-AutofillFramework | afservice/src/main/java/com/example/android/autofill/service/AutofillHintProperties.java | // Path: afservice/src/main/java/com/example/android/autofill/service/model/FilledAutofillField.java
// @Entity(primaryKeys = {"datasetId", "fieldTypeName"}, foreignKeys = {
// @ForeignKey(entity = AutofillDataset.class, parentColumns = "id",
// childColumns = "datasetId", onDelete = ForeignKey.... | import android.view.View;
import com.example.android.autofill.service.model.FilledAutofillField;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set; | /*
* Copyright (C) 2017 The Android Open Source Project
*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | // Path: afservice/src/main/java/com/example/android/autofill/service/model/FilledAutofillField.java
// @Entity(primaryKeys = {"datasetId", "fieldTypeName"}, foreignKeys = {
// @ForeignKey(entity = AutofillDataset.class, parentColumns = "id",
// childColumns = "datasetId", onDelete = ForeignKey.... | public FilledAutofillField generateFakeField(int seed, String datasetId) { |
googlearchive/android-AutofillFramework | afservice/src/main/java/com/example/android/autofill/service/model/FieldType.java | // Path: afservice/src/main/java/com/example/android/autofill/service/data/source/local/db/Converters.java
// public static class IntList {
// public final List<Integer> ints;
//
// public IntList(List<Integer> ints) {
// this.ints = ints;
// }
// }
| import android.arch.persistence.room.ColumnInfo;
import android.arch.persistence.room.Embedded;
import android.arch.persistence.room.Entity;
import android.support.annotation.NonNull;
import static com.example.android.autofill.service.data.source.local.db.Converters.IntList; | /*
* Copyright (C) 2018 The Android Open Source Project
*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | // Path: afservice/src/main/java/com/example/android/autofill/service/data/source/local/db/Converters.java
// public static class IntList {
// public final List<Integer> ints;
//
// public IntList(List<Integer> ints) {
// this.ints = ints;
// }
// }
// Path: afservice/src/main/java/com/example/an... | private final IntList mAutofillTypes; |
googlearchive/android-AutofillFramework | afservice/src/main/java/com/example/android/autofill/service/data/ClientViewMetadataBuilder.java | // Path: afservice/src/main/java/com/example/android/autofill/service/ClientParser.java
// public final class ClientParser {
// private final List<AssistStructure> mStructures;
//
// public ClientParser(@NonNull List<AssistStructure> structures) {
// Preconditions.checkNotNull(structures);
// m... | import android.app.assist.AssistStructure;
import android.util.MutableInt;
import android.view.autofill.AutofillId;
import com.example.android.autofill.service.ClientParser;
import com.example.android.autofill.service.model.FieldType;
import com.example.android.autofill.service.model.FieldTypeWithHeuristics;
import jav... | /*
* Copyright (C) 2017 The Android Open Source Project
*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | // Path: afservice/src/main/java/com/example/android/autofill/service/ClientParser.java
// public final class ClientParser {
// private final List<AssistStructure> mStructures;
//
// public ClientParser(@NonNull List<AssistStructure> structures) {
// Preconditions.checkNotNull(structures);
// m... | private HashMap<String, FieldTypeWithHeuristics> mFieldTypesByAutofillHint; |
dragonite-network/dragonite-java | dragonite-proxy/src/main/java/com/vecsight/dragonite/proxy/acl/item/IPv4CIDRACLItem.java | // Path: dragonite-proxy/src/main/java/com/vecsight/dragonite/proxy/acl/ACLItemMethod.java
// public enum ACLItemMethod {
// DIRECT,
// PROXY,
// REJECT
// }
//
// Path: dragonite-proxy/src/main/java/com/vecsight/dragonite/proxy/acl/ACLItemType.java
// public enum ACLItemType {
// DOMAIN,
// DOMAIN... | import com.vecsight.dragonite.proxy.acl.ACLItemMethod;
import com.vecsight.dragonite.proxy.acl.ACLItemType;
import com.vecsight.dragonite.proxy.exception.InvalidAddressException;
import java.net.InetAddress;
import java.net.UnknownHostException; | /*
* The Dragonite Project
* -------------------------
* See the LICENSE file in the root directory for license information.
*/
package com.vecsight.dragonite.proxy.acl.item;
public class IPv4CIDRACLItem implements ACLItem {
private final int lowest;
private final int highest;
| // Path: dragonite-proxy/src/main/java/com/vecsight/dragonite/proxy/acl/ACLItemMethod.java
// public enum ACLItemMethod {
// DIRECT,
// PROXY,
// REJECT
// }
//
// Path: dragonite-proxy/src/main/java/com/vecsight/dragonite/proxy/acl/ACLItemType.java
// public enum ACLItemType {
// DOMAIN,
// DOMAIN... | private final ACLItemMethod method; |
dragonite-network/dragonite-java | dragonite-proxy/src/main/java/com/vecsight/dragonite/proxy/acl/item/IPv4CIDRACLItem.java | // Path: dragonite-proxy/src/main/java/com/vecsight/dragonite/proxy/acl/ACLItemMethod.java
// public enum ACLItemMethod {
// DIRECT,
// PROXY,
// REJECT
// }
//
// Path: dragonite-proxy/src/main/java/com/vecsight/dragonite/proxy/acl/ACLItemType.java
// public enum ACLItemType {
// DOMAIN,
// DOMAIN... | import com.vecsight.dragonite.proxy.acl.ACLItemMethod;
import com.vecsight.dragonite.proxy.acl.ACLItemType;
import com.vecsight.dragonite.proxy.exception.InvalidAddressException;
import java.net.InetAddress;
import java.net.UnknownHostException; | /*
* The Dragonite Project
* -------------------------
* See the LICENSE file in the root directory for license information.
*/
package com.vecsight.dragonite.proxy.acl.item;
public class IPv4CIDRACLItem implements ACLItem {
private final int lowest;
private final int highest;
private final ACLI... | // Path: dragonite-proxy/src/main/java/com/vecsight/dragonite/proxy/acl/ACLItemMethod.java
// public enum ACLItemMethod {
// DIRECT,
// PROXY,
// REJECT
// }
//
// Path: dragonite-proxy/src/main/java/com/vecsight/dragonite/proxy/acl/ACLItemType.java
// public enum ACLItemType {
// DOMAIN,
// DOMAIN... | public IPv4CIDRACLItem(final String string, final ACLItemMethod method) throws InvalidAddressException { |
dragonite-network/dragonite-java | dragonite-proxy/src/main/java/com/vecsight/dragonite/proxy/acl/item/IPv4CIDRACLItem.java | // Path: dragonite-proxy/src/main/java/com/vecsight/dragonite/proxy/acl/ACLItemMethod.java
// public enum ACLItemMethod {
// DIRECT,
// PROXY,
// REJECT
// }
//
// Path: dragonite-proxy/src/main/java/com/vecsight/dragonite/proxy/acl/ACLItemType.java
// public enum ACLItemType {
// DOMAIN,
// DOMAIN... | import com.vecsight.dragonite.proxy.acl.ACLItemMethod;
import com.vecsight.dragonite.proxy.acl.ACLItemType;
import com.vecsight.dragonite.proxy.exception.InvalidAddressException;
import java.net.InetAddress;
import java.net.UnknownHostException; | }
final int mask;
try {
final int shift = Integer.parseInt(stringSplit[1]);
if (shift < 1 || shift > 32)
throw new InvalidAddressException(string + " is not a valid IPv4 CIDR address");
mask = (-1) << (32 - shift);
} catch (final Num... | // Path: dragonite-proxy/src/main/java/com/vecsight/dragonite/proxy/acl/ACLItemMethod.java
// public enum ACLItemMethod {
// DIRECT,
// PROXY,
// REJECT
// }
//
// Path: dragonite-proxy/src/main/java/com/vecsight/dragonite/proxy/acl/ACLItemType.java
// public enum ACLItemType {
// DOMAIN,
// DOMAIN... | public ACLItemType getType() { |
dragonite-network/dragonite-java | dragonite-proxy/src/main/java/com/vecsight/dragonite/proxy/header/mux/MuxConnectionRequestHeader.java | // Path: dragonite-proxy/src/main/java/com/vecsight/dragonite/proxy/exception/IncorrectHeaderException.java
// public class IncorrectHeaderException extends Exception {
//
// public IncorrectHeaderException(final String msg) {
// super(msg);
// }
//
// }
//
// Path: dragonite-proxy/src/main/java/com/... | import com.vecsight.dragonite.proxy.exception.IncorrectHeaderException;
import com.vecsight.dragonite.proxy.header.AddressType;
import com.vecsight.dragonite.utils.binary.BinaryReader;
import com.vecsight.dragonite.utils.binary.BinaryWriter;
import java.nio.BufferUnderflowException; | /*
* The Dragonite Project
* -------------------------
* See the LICENSE file in the root directory for license information.
*/
package com.vecsight.dragonite.proxy.header.mux;
/*
* addrType 1 SB
* addr [4B/16B/1+length]
* port 2 US
* UDP mode 1 BOOL
*/
public class MuxConnectionRequestHeader {
... | // Path: dragonite-proxy/src/main/java/com/vecsight/dragonite/proxy/exception/IncorrectHeaderException.java
// public class IncorrectHeaderException extends Exception {
//
// public IncorrectHeaderException(final String msg) {
// super(msg);
// }
//
// }
//
// Path: dragonite-proxy/src/main/java/com/... | public MuxConnectionRequestHeader(final byte[] header) throws IncorrectHeaderException { |
dragonite-network/dragonite-java | dragonite-proxy/src/main/java/com/vecsight/dragonite/proxy/header/mux/MuxConnectionRequestHeader.java | // Path: dragonite-proxy/src/main/java/com/vecsight/dragonite/proxy/exception/IncorrectHeaderException.java
// public class IncorrectHeaderException extends Exception {
//
// public IncorrectHeaderException(final String msg) {
// super(msg);
// }
//
// }
//
// Path: dragonite-proxy/src/main/java/com/... | import com.vecsight.dragonite.proxy.exception.IncorrectHeaderException;
import com.vecsight.dragonite.proxy.header.AddressType;
import com.vecsight.dragonite.utils.binary.BinaryReader;
import com.vecsight.dragonite.utils.binary.BinaryWriter;
import java.nio.BufferUnderflowException; | /*
* The Dragonite Project
* -------------------------
* See the LICENSE file in the root directory for license information.
*/
package com.vecsight.dragonite.proxy.header.mux;
/*
* addrType 1 SB
* addr [4B/16B/1+length]
* port 2 US
* UDP mode 1 BOOL
*/
public class MuxConnectionRequestHeader {
... | // Path: dragonite-proxy/src/main/java/com/vecsight/dragonite/proxy/exception/IncorrectHeaderException.java
// public class IncorrectHeaderException extends Exception {
//
// public IncorrectHeaderException(final String msg) {
// super(msg);
// }
//
// }
//
// Path: dragonite-proxy/src/main/java/com/... | final BinaryReader reader = new BinaryReader(header); |
dragonite-network/dragonite-java | dragonite-proxy/src/main/java/com/vecsight/dragonite/proxy/header/mux/MuxConnectionRequestHeader.java | // Path: dragonite-proxy/src/main/java/com/vecsight/dragonite/proxy/exception/IncorrectHeaderException.java
// public class IncorrectHeaderException extends Exception {
//
// public IncorrectHeaderException(final String msg) {
// super(msg);
// }
//
// }
//
// Path: dragonite-proxy/src/main/java/com/... | import com.vecsight.dragonite.proxy.exception.IncorrectHeaderException;
import com.vecsight.dragonite.proxy.header.AddressType;
import com.vecsight.dragonite.utils.binary.BinaryReader;
import com.vecsight.dragonite.utils.binary.BinaryWriter;
import java.nio.BufferUnderflowException; | this.type = type;
}
public byte[] getAddr() {
return addr;
}
public void setAddr(final byte[] addr) {
this.addr = addr;
}
public int getPort() {
return port;
}
public void setPort(final int port) {
this.port = port;
}
public boolean is... | // Path: dragonite-proxy/src/main/java/com/vecsight/dragonite/proxy/exception/IncorrectHeaderException.java
// public class IncorrectHeaderException extends Exception {
//
// public IncorrectHeaderException(final String msg) {
// super(msg);
// }
//
// }
//
// Path: dragonite-proxy/src/main/java/com/... | final BinaryWriter writer = new BinaryWriter(4 + addrTotalLength); |
dragonite-network/dragonite-java | dragonite-sdk/src/main/java/com/vecsight/dragonite/sdk/socket/ACKSender.java | // Path: dragonite-sdk/src/main/java/com/vecsight/dragonite/sdk/msg/types/ACKMessage.java
// public class ACKMessage implements Message {
//
// private static final byte VERSION = DragoniteGlobalConstants.PROTOCOL_VERSION;
//
// private static final MessageType TYPE = MessageType.ACK;
//
// public static... | import com.vecsight.dragonite.sdk.msg.types.ACKMessage;
import java.io.IOException;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set; | /*
* The Dragonite Project
* -------------------------
* See the LICENSE file in the root directory for license information.
*/
package com.vecsight.dragonite.sdk.socket;
public class ACKSender {
private final DragoniteSocket socket;
private final int MTU;
private final PacketSender action;
... | // Path: dragonite-sdk/src/main/java/com/vecsight/dragonite/sdk/msg/types/ACKMessage.java
// public class ACKMessage implements Message {
//
// private static final byte VERSION = DragoniteGlobalConstants.PROTOCOL_VERSION;
//
// private static final MessageType TYPE = MessageType.ACK;
//
// public static... | if (ACKMessage.FIXED_LENGTH + ackarray.length * Integer.BYTES > MTU) { |
dragonite-network/dragonite-java | dragonite-proxy/src/main/java/com/vecsight/dragonite/proxy/acl/ACLFileParser.java | // Path: dragonite-proxy/src/main/java/com/vecsight/dragonite/proxy/exception/ACLException.java
// public class ACLException extends Exception {
//
// public ACLException(final String msg) {
// super(msg);
// }
//
// }
//
// Path: dragonite-proxy/src/main/java/com/vecsight/dragonite/proxy/exception/I... | import com.vecsight.dragonite.proxy.acl.item.*;
import com.vecsight.dragonite.proxy.exception.ACLException;
import com.vecsight.dragonite.proxy.exception.InvalidAddressException;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.Reader;
import java.util.LinkedList;
import java.util.List;
import ... | /*
* The Dragonite Project
* -------------------------
* See the LICENSE file in the root directory for license information.
*/
package com.vecsight.dragonite.proxy.acl;
public final class ACLFileParser {
private static final Pattern INFO_PATTERN = Pattern.compile("(\\w+?):(.+)");
private static fina... | // Path: dragonite-proxy/src/main/java/com/vecsight/dragonite/proxy/exception/ACLException.java
// public class ACLException extends Exception {
//
// public ACLException(final String msg) {
// super(msg);
// }
//
// }
//
// Path: dragonite-proxy/src/main/java/com/vecsight/dragonite/proxy/exception/I... | public static ParsedACL parse(final Reader reader) throws IOException, ACLException { |
dragonite-network/dragonite-java | dragonite-proxy/src/main/java/com/vecsight/dragonite/proxy/acl/ACLFileParser.java | // Path: dragonite-proxy/src/main/java/com/vecsight/dragonite/proxy/exception/ACLException.java
// public class ACLException extends Exception {
//
// public ACLException(final String msg) {
// super(msg);
// }
//
// }
//
// Path: dragonite-proxy/src/main/java/com/vecsight/dragonite/proxy/exception/I... | import com.vecsight.dragonite.proxy.acl.item.*;
import com.vecsight.dragonite.proxy.exception.ACLException;
import com.vecsight.dragonite.proxy.exception.InvalidAddressException;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.Reader;
import java.util.LinkedList;
import java.util.List;
import ... | final ACLItemType aclItemType;
try {
aclItemType = typeFromString(type);
} catch (final ACLException e) {
throw new ACLException("Line " + lineCount + " - " + e.getMessage());
}
... | // Path: dragonite-proxy/src/main/java/com/vecsight/dragonite/proxy/exception/ACLException.java
// public class ACLException extends Exception {
//
// public ACLException(final String msg) {
// super(msg);
// }
//
// }
//
// Path: dragonite-proxy/src/main/java/com/vecsight/dragonite/proxy/exception/I... | } catch (final InvalidAddressException e) { |
dragonite-network/dragonite-java | dragonite-sdk/src/main/java/com/vecsight/dragonite/sdk/socket/RTTEstimator.java | // Path: dragonite-sdk/src/main/java/com/vecsight/dragonite/sdk/misc/DragoniteGlobalConstants.java
// public final class DragoniteGlobalConstants {
//
// public static final String LIBRARY_VERSION = DragoniteBuildConfig.VERSION;
//
// public static final byte PROTOCOL_VERSION = 2;
//
// public static fin... | import com.vecsight.dragonite.sdk.misc.DragoniteGlobalConstants;
import com.vecsight.dragonite.sdk.misc.NumUtils; | /*
* The Dragonite Project
* -------------------------
* See the LICENSE file in the root directory for license information.
*/
package com.vecsight.dragonite.sdk.socket;
public class RTTEstimator {
private final static float estimatedRTTUpdateFactor = 0.125f, devRTTUpdateFactor = 0.25f;
private final... | // Path: dragonite-sdk/src/main/java/com/vecsight/dragonite/sdk/misc/DragoniteGlobalConstants.java
// public final class DragoniteGlobalConstants {
//
// public static final String LIBRARY_VERSION = DragoniteBuildConfig.VERSION;
//
// public static final byte PROTOCOL_VERSION = 2;
//
// public static fin... | private long estimatedRTT = DragoniteGlobalConstants.INIT_RTT_MS, devRTT; |
dragonite-network/dragonite-java | dragonite-sdk/src/main/java/com/vecsight/dragonite/sdk/socket/RTTEstimator.java | // Path: dragonite-sdk/src/main/java/com/vecsight/dragonite/sdk/misc/DragoniteGlobalConstants.java
// public final class DragoniteGlobalConstants {
//
// public static final String LIBRARY_VERSION = DragoniteBuildConfig.VERSION;
//
// public static final byte PROTOCOL_VERSION = 2;
//
// public static fin... | import com.vecsight.dragonite.sdk.misc.DragoniteGlobalConstants;
import com.vecsight.dragonite.sdk.misc.NumUtils; | /*
* The Dragonite Project
* -------------------------
* See the LICENSE file in the root directory for license information.
*/
package com.vecsight.dragonite.sdk.socket;
public class RTTEstimator {
private final static float estimatedRTTUpdateFactor = 0.125f, devRTTUpdateFactor = 0.25f;
private final... | // Path: dragonite-sdk/src/main/java/com/vecsight/dragonite/sdk/misc/DragoniteGlobalConstants.java
// public final class DragoniteGlobalConstants {
//
// public static final String LIBRARY_VERSION = DragoniteBuildConfig.VERSION;
//
// public static final byte PROTOCOL_VERSION = 2;
//
// public static fin... | final long tmpRTT = NumUtils.min(stat.getRTT(), maxCRTT); |
dragonite-network/dragonite-java | dragonite-sdk/src/main/java/com/vecsight/dragonite/sdk/config/DragoniteSocketParameters.java | // Path: dragonite-sdk/src/main/java/com/vecsight/dragonite/sdk/cryptor/PacketCryptor.java
// public interface PacketCryptor {
//
// /**
// * Encrypt the message and return the ciphertext.
// * This function may be called by multiple threads at the same time.
// *
// * @param rawData Content to... | import com.vecsight.dragonite.sdk.cryptor.PacketCryptor;
import com.vecsight.dragonite.sdk.misc.DragoniteGlobalConstants;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import static com.vecsight.dragonite.utils.flow.Preconditions.checkArgument;
import static com.vecsight.dragonite.utils.flow.Precondit... | /*
* The Dragonite Project
* -------------------------
* See the LICENSE file in the root directory for license information.
*/
package com.vecsight.dragonite.sdk.config;
public class DragoniteSocketParameters {
private int packetSize = 1300;
private boolean autoSplit = true;
private int maxPac... | // Path: dragonite-sdk/src/main/java/com/vecsight/dragonite/sdk/cryptor/PacketCryptor.java
// public interface PacketCryptor {
//
// /**
// * Encrypt the message and return the ciphertext.
// * This function may be called by multiple threads at the same time.
// *
// * @param rawData Content to... | private InetSocketAddress webPanelBindAddress = new InetSocketAddress(InetAddress.getLoopbackAddress(), DragoniteGlobalConstants.WEB_PANEL_PORT); |
dragonite-network/dragonite-java | dragonite-sdk/src/main/java/com/vecsight/dragonite/sdk/config/DragoniteSocketParameters.java | // Path: dragonite-sdk/src/main/java/com/vecsight/dragonite/sdk/cryptor/PacketCryptor.java
// public interface PacketCryptor {
//
// /**
// * Encrypt the message and return the ciphertext.
// * This function may be called by multiple threads at the same time.
// *
// * @param rawData Content to... | import com.vecsight.dragonite.sdk.cryptor.PacketCryptor;
import com.vecsight.dragonite.sdk.misc.DragoniteGlobalConstants;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import static com.vecsight.dragonite.utils.flow.Preconditions.checkArgument;
import static com.vecsight.dragonite.utils.flow.Precondit... | /*
* The Dragonite Project
* -------------------------
* See the LICENSE file in the root directory for license information.
*/
package com.vecsight.dragonite.sdk.config;
public class DragoniteSocketParameters {
private int packetSize = 1300;
private boolean autoSplit = true;
private int maxPac... | // Path: dragonite-sdk/src/main/java/com/vecsight/dragonite/sdk/cryptor/PacketCryptor.java
// public interface PacketCryptor {
//
// /**
// * Encrypt the message and return the ciphertext.
// * This function may be called by multiple threads at the same time.
// *
// * @param rawData Content to... | private PacketCryptor packetCryptor = null; |
dragonite-network/dragonite-java | dragonite-sdk/src/main/java/com/vecsight/dragonite/sdk/config/DragoniteSocketParameters.java | // Path: dragonite-sdk/src/main/java/com/vecsight/dragonite/sdk/cryptor/PacketCryptor.java
// public interface PacketCryptor {
//
// /**
// * Encrypt the message and return the ciphertext.
// * This function may be called by multiple threads at the same time.
// *
// * @param rawData Content to... | import com.vecsight.dragonite.sdk.cryptor.PacketCryptor;
import com.vecsight.dragonite.sdk.misc.DragoniteGlobalConstants;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import static com.vecsight.dragonite.utils.flow.Preconditions.checkArgument;
import static com.vecsight.dragonite.utils.flow.Precondit... | /*
* The Dragonite Project
* -------------------------
* See the LICENSE file in the root directory for license information.
*/
package com.vecsight.dragonite.sdk.config;
public class DragoniteSocketParameters {
private int packetSize = 1300;
private boolean autoSplit = true;
private int maxPac... | // Path: dragonite-sdk/src/main/java/com/vecsight/dragonite/sdk/cryptor/PacketCryptor.java
// public interface PacketCryptor {
//
// /**
// * Encrypt the message and return the ciphertext.
// * This function may be called by multiple threads at the same time.
// *
// * @param rawData Content to... | checkArgument(packetSize >= 500, "Packet size is too small"); |
dragonite-network/dragonite-java | dragonite-sdk/src/main/java/com/vecsight/dragonite/sdk/config/DragoniteSocketParameters.java | // Path: dragonite-sdk/src/main/java/com/vecsight/dragonite/sdk/cryptor/PacketCryptor.java
// public interface PacketCryptor {
//
// /**
// * Encrypt the message and return the ciphertext.
// * This function may be called by multiple threads at the same time.
// *
// * @param rawData Content to... | import com.vecsight.dragonite.sdk.cryptor.PacketCryptor;
import com.vecsight.dragonite.sdk.misc.DragoniteGlobalConstants;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import static com.vecsight.dragonite.utils.flow.Preconditions.checkArgument;
import static com.vecsight.dragonite.utils.flow.Precondit... | public boolean isEnableWebPanel() {
return enableWebPanel;
}
public void setEnableWebPanel(final boolean enableWebPanel) {
this.enableWebPanel = enableWebPanel;
}
public InetSocketAddress getWebPanelBindAddress() {
return webPanelBindAddress;
}
public void setWebPa... | // Path: dragonite-sdk/src/main/java/com/vecsight/dragonite/sdk/cryptor/PacketCryptor.java
// public interface PacketCryptor {
//
// /**
// * Encrypt the message and return the ciphertext.
// * This function may be called by multiple threads at the same time.
// *
// * @param rawData Content to... | checkArgument(inTrafficClassRange(trafficClass), "TC must be in the range 0 <= tc <= 255"); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.