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
popo1379/popomusic
app/src/main/java/com/popomusic/adapter/PicAdapter.java
// Path: app/src/main/java/com/popomusic/picBean/Contentlist.java // public class Contentlist { // // @SerializedName("itemId") // @Expose // private String itemId; // @SerializedName("list") // @Expose // private java.util.List<Picbean> list = null; // @SerializedName("title") // @Expo...
import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; import com.bumptech.glide.Glide; import com.popo.popomusic.R; import com.popomusic.picBean.Contentlist; import com....
} //动态加载数据至配适器中 public void addAll(List<Contentlist> lists) { list.addAll(lists); } public void removeAll() { if (list.size() != 0) { list.clear(); } this.notifyDataSetChanged(); } @Override public RecyclerView.ViewHolder onCreateViewHolder(ViewG...
// Path: app/src/main/java/com/popomusic/picBean/Contentlist.java // public class Contentlist { // // @SerializedName("itemId") // @Expose // private String itemId; // @SerializedName("list") // @Expose // private java.util.List<Picbean> list = null; // @SerializedName("title") // @Expo...
Glide.with(UIcollector.getContext())
popo1379/popomusic
app/src/main/java/com/popomusic/fragment/BaseFragment.java
// Path: app/src/main/java/com/popomusic/util/UIcollector.java // @SuppressWarnings("ALL") // public class UIcollector { // // // public static Context getContext() { // return BaseActivity.getContext(); // } // // public static Activity getActivity() { // return BaseActivity.getActivity(...
import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.FrameLayout; import android.widget.Toast; import com.popomusic.util.UI...
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = initView(); Log.i("BaseFragment", getClass().getSimpleName()); ButterKnife.bind(this,view); return view; } @Override ...
// Path: app/src/main/java/com/popomusic/util/UIcollector.java // @SuppressWarnings("ALL") // public class UIcollector { // // // public static Context getContext() { // return BaseActivity.getContext(); // } // // public static Activity getActivity() { // return BaseActivity.getActivity(...
Toast.makeText(UIcollector.getContext(), content, Toast.LENGTH_LONG).show();
popo1379/popomusic
app/src/main/java/com/popomusic/data/PicData.java
// Path: app/src/main/java/com/popomusic/picBean/Contentlist.java // public class Contentlist { // // @SerializedName("itemId") // @Expose // private String itemId; // @SerializedName("list") // @Expose // private java.util.List<Picbean> list = null; // @SerializedName("title") // @Expo...
import com.popomusic.picBean.Contentlist; import com.popomusic.picBean.Picbean; import com.popomusic.videoModel.ItemList; import com.popomusic.view.BaseView; import java.util.List;
package com.popomusic.data; /** * Created by Administrator on 2017/5/31 0031. */ public interface PicData { interface View extends BaseView {
// Path: app/src/main/java/com/popomusic/picBean/Contentlist.java // public class Contentlist { // // @SerializedName("itemId") // @Expose // private String itemId; // @SerializedName("list") // @Expose // private java.util.List<Picbean> list = null; // @SerializedName("title") // @Expo...
void setData(List<Contentlist> list);
popo1379/popomusic
app/src/main/java/com/popomusic/util/UIcollector.java
// Path: app/src/main/java/com/popomusic/activity/BaseActivity.java // public abstract class BaseActivity extends AppCompatActivity { // // private static Context context; // private static Activity activity; // // @Override // protected void onCreate(@Nullable Bundle savedInstanceState) { // ...
import android.app.Activity; import android.content.Context; import android.graphics.drawable.Drawable; import com.popomusic.activity.BaseActivity;
package com.popomusic.util; /** * by popo on 2016/4/28. */ @SuppressWarnings("ALL") public class UIcollector { public static Context getContext() {
// Path: app/src/main/java/com/popomusic/activity/BaseActivity.java // public abstract class BaseActivity extends AppCompatActivity { // // private static Context context; // private static Activity activity; // // @Override // protected void onCreate(@Nullable Bundle savedInstanceState) { // ...
return BaseActivity.getContext();
popo1379/popomusic
app/src/main/java/com/popomusic/videoModel/VideoBeanDao.java
// Path: app/src/main/java/com/popomusic/bean/DaoSession.java // public class DaoSession extends AbstractDaoSession { // // private final DaoConfig musicBeanDaoConfig; // private final DaoConfig searchNameBeanDaoConfig; // private final DaoConfig videoBeanDaoConfig; // // private final MusicBeanDao mu...
import android.database.Cursor; import android.database.sqlite.SQLiteStatement; import org.greenrobot.greendao.AbstractDao; import org.greenrobot.greendao.Property; import org.greenrobot.greendao.internal.DaoConfig; import org.greenrobot.greendao.database.Database; import org.greenrobot.greendao.database.DatabaseStatem...
package com.popomusic.videoModel; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. /** * DAO for table "VIDEO_BEAN". */ public class VideoBeanDao extends AbstractDao<VideoBean, Long> { public static final String TABLENAME = "VIDEO_BEAN"; /** * Properties of entity VideoBean.<br/> * Can be u...
// Path: app/src/main/java/com/popomusic/bean/DaoSession.java // public class DaoSession extends AbstractDaoSession { // // private final DaoConfig musicBeanDaoConfig; // private final DaoConfig searchNameBeanDaoConfig; // private final DaoConfig videoBeanDaoConfig; // // private final MusicBeanDao mu...
public VideoBeanDao(DaoConfig config, DaoSession daoSession) {
amplify-education/honeydew
server/src/main/java/com/amplify/honeydew_server/actions/AbstractChildCountAction.java
// Path: server/src/main/java/com/amplify/honeydew_server/Action.java // public abstract class Action { // protected final UiDevice uiDevice; // // protected final String TAG = getClass().getSimpleName(); // // public Action(UiDevice uiDevice) { // this.uiDevice = uiDevice; // } // // pub...
import android.util.Log; import com.amplify.honeydew_server.Action; import com.amplify.honeydew_server.Result; import com.android.uiautomator.core.UiCollection; import com.android.uiautomator.core.UiDevice; import com.android.uiautomator.core.UiObjectNotFoundException; import com.android.uiautomator.core.UiSelector; im...
package com.amplify.honeydew_server.actions; public abstract class AbstractChildCountAction extends Action { public AbstractChildCountAction(UiDevice uiDevice) { super(uiDevice); } protected abstract boolean isTrue(int childCount, int count); @Override
// Path: server/src/main/java/com/amplify/honeydew_server/Action.java // public abstract class Action { // protected final UiDevice uiDevice; // // protected final String TAG = getClass().getSimpleName(); // // public Action(UiDevice uiDevice) { // this.uiDevice = uiDevice; // } // // pub...
public final Result execute(Map<String, Object> arguments) throws UiObjectNotFoundException {
amplify-education/honeydew
server/src/main/java/com/amplify/honeydew_server/actions/IsRegexMatchPresent.java
// Path: server/src/main/java/com/amplify/honeydew_server/Action.java // public abstract class Action { // protected final UiDevice uiDevice; // // protected final String TAG = getClass().getSimpleName(); // // public Action(UiDevice uiDevice) { // this.uiDevice = uiDevice; // } // // pub...
import com.amplify.honeydew_server.Action; import com.amplify.honeydew_server.Result; import com.android.uiautomator.core.UiDevice; import com.android.uiautomator.core.UiObjectNotFoundException; import java.util.Map;
package com.amplify.honeydew_server.actions; public class IsRegexMatchPresent extends Action { public IsRegexMatchPresent(UiDevice uiDevice){ super(uiDevice); } @Override
// Path: server/src/main/java/com/amplify/honeydew_server/Action.java // public abstract class Action { // protected final UiDevice uiDevice; // // protected final String TAG = getClass().getSimpleName(); // // public Action(UiDevice uiDevice) { // this.uiDevice = uiDevice; // } // // pub...
public Result execute(Map<String, Object> arguments) throws UiObjectNotFoundException {
amplify-education/honeydew
server/src/main/java/com/amplify/honeydew_server/TestRunner.java
// Path: server/src/main/java/com/amplify/honeydew_server/httpd/RemoteCommandReceiver.java // public class RemoteCommandReceiver extends NanoHTTPD { // // private static final String PLAIN_TEXT = "plain/text"; // public static final Type ARGUMENTS_COLLECTION_TYPE = new TypeToken<Map<String, Object>>() { // ...
import android.util.Log; import android.view.KeyEvent; import com.amplify.honeydew_server.httpd.RemoteCommandReceiver; import com.android.uiautomator.core.UiDevice; import com.android.uiautomator.testrunner.UiAutomatorTestCase;
package com.amplify.honeydew_server; public class TestRunner extends UiAutomatorTestCase { private static final String TAG = TestRunner.class.getSimpleName(); public void testRemoteLoop() throws Exception { Log.d(TAG, "Starting honeydew-server..."); UiDevice uiDevice = getUiDevice(); ...
// Path: server/src/main/java/com/amplify/honeydew_server/httpd/RemoteCommandReceiver.java // public class RemoteCommandReceiver extends NanoHTTPD { // // private static final String PLAIN_TEXT = "plain/text"; // public static final Type ARGUMENTS_COLLECTION_TYPE = new TypeToken<Map<String, Object>>() { // ...
RemoteCommandReceiver remoteCommandReceiver = new RemoteCommandReceiver(new ActionsExecutor(uiDevice));
amplify-education/honeydew
server/src/main/java/com/amplify/honeydew_server/actions/InspectOptionInSettingsMenu.java
// Path: server/src/main/java/com/amplify/honeydew_server/Result.java // public class Result { // public final boolean success; // public String description; // public String errorMessage; // public String stackTrace; // // public static Result OK = new Result(); // public static Result FAILURE...
import android.widget.TextView; import com.amplify.honeydew_server.Result; import com.android.uiautomator.core.*; import java.util.*;
package com.amplify.honeydew_server.actions; public abstract class InspectOptionInSettingsMenu extends SelectMenuInSettings { private Boolean enabled; public InspectOptionInSettingsMenu(UiDevice uiDevice, boolean enabled) { super(uiDevice); this.enabled = enabled; } @Override
// Path: server/src/main/java/com/amplify/honeydew_server/Result.java // public class Result { // public final boolean success; // public String description; // public String errorMessage; // public String stackTrace; // // public static Result OK = new Result(); // public static Result FAILURE...
public Result execute(Map<String, Object> arguments) throws UiObjectNotFoundException {
amplify-education/honeydew
server/src/main/java/com/amplify/honeydew_server/actions/IsTextGone.java
// Path: server/src/main/java/com/amplify/honeydew_server/Action.java // public abstract class Action { // protected final UiDevice uiDevice; // // protected final String TAG = getClass().getSimpleName(); // // public Action(UiDevice uiDevice) { // this.uiDevice = uiDevice; // } // // pub...
import com.amplify.honeydew_server.Action; import com.amplify.honeydew_server.Result; import com.android.uiautomator.core.UiDevice; import com.android.uiautomator.core.UiObjectNotFoundException; import java.util.Map;
package com.amplify.honeydew_server.actions; public class IsTextGone extends Action { public IsTextGone(UiDevice uiDevice) { super(uiDevice); } @Override
// Path: server/src/main/java/com/amplify/honeydew_server/Action.java // public abstract class Action { // protected final UiDevice uiDevice; // // protected final String TAG = getClass().getSimpleName(); // // public Action(UiDevice uiDevice) { // this.uiDevice = uiDevice; // } // // pub...
public Result execute(Map<String, Object> arguments) throws UiObjectNotFoundException {
amplify-education/honeydew
server/src/main/java/com/amplify/honeydew_server/httpd/RemoteCommandReceiver.java
// Path: server/src/main/java/com/amplify/honeydew_server/ActionsExecutor.java // public class ActionsExecutor { // // protected final UiDevice uiDevice; // private final Map<String, Action> actions; // private static final String TAG = ActionsExecutor.class.getName(); // // public ActionsExecutor(UiD...
import android.util.Log; import com.amplify.honeydew_server.ActionsExecutor; import com.amplify.honeydew_server.Command; import com.amplify.honeydew_server.Result; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; import fi.iki.elonen.NanoHTTPD; import java.io.IOException; import java.lang.reflect....
package com.amplify.honeydew_server.httpd; public class RemoteCommandReceiver extends NanoHTTPD { private static final String PLAIN_TEXT = "plain/text"; public static final Type ARGUMENTS_COLLECTION_TYPE = new TypeToken<Map<String, Object>>() { }.getType();
// Path: server/src/main/java/com/amplify/honeydew_server/ActionsExecutor.java // public class ActionsExecutor { // // protected final UiDevice uiDevice; // private final Map<String, Action> actions; // private static final String TAG = ActionsExecutor.class.getName(); // // public ActionsExecutor(UiD...
private final ActionsExecutor actionsExecutor;
amplify-education/honeydew
server/src/main/java/com/amplify/honeydew_server/httpd/RemoteCommandReceiver.java
// Path: server/src/main/java/com/amplify/honeydew_server/ActionsExecutor.java // public class ActionsExecutor { // // protected final UiDevice uiDevice; // private final Map<String, Action> actions; // private static final String TAG = ActionsExecutor.class.getName(); // // public ActionsExecutor(UiD...
import android.util.Log; import com.amplify.honeydew_server.ActionsExecutor; import com.amplify.honeydew_server.Command; import com.amplify.honeydew_server.Result; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; import fi.iki.elonen.NanoHTTPD; import java.io.IOException; import java.lang.reflect....
return terminate(); } if (method == Method.POST && uri.equalsIgnoreCase("/command")) { return performCommand(params); } if (method == Method.GET && uri.equalsIgnoreCase("/status")) { return status(); } return BAD_REQUEST; } pr...
// Path: server/src/main/java/com/amplify/honeydew_server/ActionsExecutor.java // public class ActionsExecutor { // // protected final UiDevice uiDevice; // private final Map<String, Action> actions; // private static final String TAG = ActionsExecutor.class.getName(); // // public ActionsExecutor(UiD...
Result result = actionsExecutor.execute(new Command(action, arguments));
amplify-education/honeydew
server/src/main/java/com/amplify/honeydew_server/httpd/RemoteCommandReceiver.java
// Path: server/src/main/java/com/amplify/honeydew_server/ActionsExecutor.java // public class ActionsExecutor { // // protected final UiDevice uiDevice; // private final Map<String, Action> actions; // private static final String TAG = ActionsExecutor.class.getName(); // // public ActionsExecutor(UiD...
import android.util.Log; import com.amplify.honeydew_server.ActionsExecutor; import com.amplify.honeydew_server.Command; import com.amplify.honeydew_server.Result; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; import fi.iki.elonen.NanoHTTPD; import java.io.IOException; import java.lang.reflect....
return terminate(); } if (method == Method.POST && uri.equalsIgnoreCase("/command")) { return performCommand(params); } if (method == Method.GET && uri.equalsIgnoreCase("/status")) { return status(); } return BAD_REQUEST; } pr...
// Path: server/src/main/java/com/amplify/honeydew_server/ActionsExecutor.java // public class ActionsExecutor { // // protected final UiDevice uiDevice; // private final Map<String, Action> actions; // private static final String TAG = ActionsExecutor.class.getName(); // // public ActionsExecutor(UiD...
Result result = actionsExecutor.execute(new Command(action, arguments));
chocotan/lolibox
lolibox-server/src/main/java/io/loli/box/SecurityConfig.java
// Path: lolibox-server/src/main/java/io/loli/box/dao/JpaReMemberMeRepository.java // public interface JpaReMemberMeRepository extends JpaRepository<PersistentLogins, String>, PersistentTokenRepository { // // @Modifying // @Transactional // default void createNewToken(PersistentRememberMeToken token) { //...
import io.loli.box.dao.JpaReMemberMeRepository; import io.loli.box.entity.Role; import io.loli.box.social.RepositoryUserDetailsService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import o...
package io.loli.box; /** * @author choco */ @EnableWebSecurity @Configuration @EnableGlobalMethodSecurity(prePostEnabled = true) @Order(6) public class SecurityConfig extends WebSecurityConfigurerAdapter { @Override protected void configure(HttpSecurity http) throws Exception { ExpressionUrlAuthor...
// Path: lolibox-server/src/main/java/io/loli/box/dao/JpaReMemberMeRepository.java // public interface JpaReMemberMeRepository extends JpaRepository<PersistentLogins, String>, PersistentTokenRepository { // // @Modifying // @Transactional // default void createNewToken(PersistentRememberMeToken token) { //...
registry.antMatchers("/admin/**").hasAuthority(Role.ADMIN.toString())
chocotan/lolibox
lolibox-server/src/main/java/io/loli/box/SecurityConfig.java
// Path: lolibox-server/src/main/java/io/loli/box/dao/JpaReMemberMeRepository.java // public interface JpaReMemberMeRepository extends JpaRepository<PersistentLogins, String>, PersistentTokenRepository { // // @Modifying // @Transactional // default void createNewToken(PersistentRememberMeToken token) { //...
import io.loli.box.dao.JpaReMemberMeRepository; import io.loli.box.entity.Role; import io.loli.box.social.RepositoryUserDetailsService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import o...
package io.loli.box; /** * @author choco */ @EnableWebSecurity @Configuration @EnableGlobalMethodSecurity(prePostEnabled = true) @Order(6) public class SecurityConfig extends WebSecurityConfigurerAdapter { @Override protected void configure(HttpSecurity http) throws Exception { ExpressionUrlAuthor...
// Path: lolibox-server/src/main/java/io/loli/box/dao/JpaReMemberMeRepository.java // public interface JpaReMemberMeRepository extends JpaRepository<PersistentLogins, String>, PersistentTokenRepository { // // @Modifying // @Transactional // default void createNewToken(PersistentRememberMeToken token) { //...
private JpaReMemberMeRepository reMemberMeRepository;
chocotan/lolibox
lolibox-server/src/main/java/io/loli/box/SecurityConfig.java
// Path: lolibox-server/src/main/java/io/loli/box/dao/JpaReMemberMeRepository.java // public interface JpaReMemberMeRepository extends JpaRepository<PersistentLogins, String>, PersistentTokenRepository { // // @Modifying // @Transactional // default void createNewToken(PersistentRememberMeToken token) { //...
import io.loli.box.dao.JpaReMemberMeRepository; import io.loli.box.entity.Role; import io.loli.box.social.RepositoryUserDetailsService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import o...
.and().formLogin().loginPage("/signin").defaultSuccessUrl("/").permitAll() .and().logout().logoutRequestMatcher(new AntPathRequestMatcher("/logout")).permitAll() .and().csrf().ignoringAntMatchers("/admin/**"/*,"/oauth*//**"*/); http.headers().frameOptions().disab...
// Path: lolibox-server/src/main/java/io/loli/box/dao/JpaReMemberMeRepository.java // public interface JpaReMemberMeRepository extends JpaRepository<PersistentLogins, String>, PersistentTokenRepository { // // @Modifying // @Transactional // default void createNewToken(PersistentRememberMeToken token) { //...
private RepositoryUserDetailsService userDetailsService;
chocotan/lolibox
lolibox-server/src/main/java/io/loli/box/service/impl/BaiduStorageService.java
// Path: lolibox-server/src/main/java/io/loli/box/service/AbstractStorageService.java // public abstract class AbstractStorageService implements StorageService { // @Autowired // protected ImgFileRepository imgFileRepository; // // public void deleteFile(String name) { // imgFileRepository.updateDe...
import com.baidubce.auth.DefaultBceCredentials; import com.baidubce.services.bos.BosClient; import com.baidubce.services.bos.BosClientConfiguration; import com.baidubce.services.bos.model.ObjectMetadata; import com.baidubce.services.bos.model.PutObjectResponse; import io.loli.box.service.AbstractStorageService; import ...
package io.loli.box.service.impl; /** * @author choco */ @Component @ConditionalOnProperty(name = "storage.type", havingValue = "baidu") @ConfigurationProperties(prefix = "storage.baidu")
// Path: lolibox-server/src/main/java/io/loli/box/service/AbstractStorageService.java // public abstract class AbstractStorageService implements StorageService { // @Autowired // protected ImgFileRepository imgFileRepository; // // public void deleteFile(String name) { // imgFileRepository.updateDe...
public class BaiduStorageService extends AbstractStorageService {
chocotan/lolibox
lolibox-server/src/main/java/io/loli/box/service/impl/UserService.java
// Path: lolibox-server/src/main/java/io/loli/box/exception/UserExistsException.java // public class UserExistsException extends Exception { // public UserExistsException() { // super(); // } // // public UserExistsException(String reason) { // super(reason); // } // } // // Path: loli...
import io.loli.box.exception.UserExistsException; import io.loli.box.entity.User; import io.loli.box.dao.UserRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import javax.transaction.Transactional;
package io.loli.box.service.impl; /** * @author choco */ @Service public class UserService { @Autowired
// Path: lolibox-server/src/main/java/io/loli/box/exception/UserExistsException.java // public class UserExistsException extends Exception { // public UserExistsException() { // super(); // } // // public UserExistsException(String reason) { // super(reason); // } // } // // Path: loli...
private UserRepository userRepository;
chocotan/lolibox
lolibox-server/src/main/java/io/loli/box/service/impl/UserService.java
// Path: lolibox-server/src/main/java/io/loli/box/exception/UserExistsException.java // public class UserExistsException extends Exception { // public UserExistsException() { // super(); // } // // public UserExistsException(String reason) { // super(reason); // } // } // // Path: loli...
import io.loli.box.exception.UserExistsException; import io.loli.box.entity.User; import io.loli.box.dao.UserRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import javax.transaction.Transactional;
package io.loli.box.service.impl; /** * @author choco */ @Service public class UserService { @Autowired private UserRepository userRepository; @Transactional
// Path: lolibox-server/src/main/java/io/loli/box/exception/UserExistsException.java // public class UserExistsException extends Exception { // public UserExistsException() { // super(); // } // // public UserExistsException(String reason) { // super(reason); // } // } // // Path: loli...
public User registerNewUser(User user) throws UserExistsException {
chocotan/lolibox
lolibox-server/src/main/java/io/loli/box/service/impl/UserService.java
// Path: lolibox-server/src/main/java/io/loli/box/exception/UserExistsException.java // public class UserExistsException extends Exception { // public UserExistsException() { // super(); // } // // public UserExistsException(String reason) { // super(reason); // } // } // // Path: loli...
import io.loli.box.exception.UserExistsException; import io.loli.box.entity.User; import io.loli.box.dao.UserRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import javax.transaction.Transactional;
package io.loli.box.service.impl; /** * @author choco */ @Service public class UserService { @Autowired private UserRepository userRepository; @Transactional
// Path: lolibox-server/src/main/java/io/loli/box/exception/UserExistsException.java // public class UserExistsException extends Exception { // public UserExistsException() { // super(); // } // // public UserExistsException(String reason) { // super(reason); // } // } // // Path: loli...
public User registerNewUser(User user) throws UserExistsException {
chocotan/lolibox
lolibox-server/src/main/java/io/loli/box/oauth2/AuthorizationServerConfiguration.java
// Path: lolibox-server/src/main/java/io/loli/box/util/FinalValueHolder.java // public class FinalValueHolder<T> { // private T value; // // public FinalValueHolder(T t) { // this.value = t; // } // // public T getValue() { // return value; // } // // public void setValue(T va...
import io.loli.box.util.FinalValueHolder; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.domain.EntityScan; import org.springframework.boot.context.properties.ConfigurationP...
package io.loli.box.oauth2; /** * @author choco */ @Configuration @EnableAuthorizationServer @Order(3) @EntityScan("io.loli.box.oauth2") @ConfigurationProperties(prefix = "oauth2") public class AuthorizationServerConfiguration extends AuthorizationServerConfigurerAdapter { private static final Log logger = Lo...
// Path: lolibox-server/src/main/java/io/loli/box/util/FinalValueHolder.java // public class FinalValueHolder<T> { // private T value; // // public FinalValueHolder(T t) { // this.value = t; // } // // public T getValue() { // return value; // } // // public void setValue(T va...
FinalValueHolder<ClientDetailsServiceBuilder> detailHolder = new FinalValueHolder<>(builder);
chocotan/lolibox
lolibox-server/src/main/java/io/loli/box/green/AliGreenConfiguration.java
// Path: lolibox-server/src/main/java/io/loli/box/dao/ImgFileRepository.java // public interface ImgFileRepository extends JpaRepository<ImgFile, Long> { // public ImgFile save(ImgFile file); // // int deleteByShortName(String name); // // ImgFile findByShortName(String name); // // @Transactional //...
import io.loli.box.dao.ImgFileRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springf...
package io.loli.box.green; /** * Created by chocotan on 2016/8/6. */ @Configuration @ConditionalOnProperty(name = "admin.green.enabled", havingValue = "aliyun") public class AliGreenConfiguration { @Bean public GreenService greenService() { return new AliGreenService(); } ...
// Path: lolibox-server/src/main/java/io/loli/box/dao/ImgFileRepository.java // public interface ImgFileRepository extends JpaRepository<ImgFile, Long> { // public ImgFile save(ImgFile file); // // int deleteByShortName(String name); // // ImgFile findByShortName(String name); // // @Transactional //...
ImgFileRepository imgFileRepository;
chocotan/lolibox
lolibox-server/src/main/java/io/loli/box/social/RepositoryUserDetailsService.java
// Path: lolibox-server/src/main/java/io/loli/box/AdminProperties.java // @ConfigurationProperties("admin") // @Component // public class AdminProperties { // @NotNull // private String email; // // private boolean anonymous = false; // // private boolean signupInvitation = true; // // private In...
import io.loli.box.AdminProperties; import io.loli.box.dao.UserRepository; import io.loli.box.entity.Role; import io.loli.box.entity.User; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails...
package io.loli.box.social; @Component public class RepositoryUserDetailsService implements UserDetailsService {
// Path: lolibox-server/src/main/java/io/loli/box/AdminProperties.java // @ConfigurationProperties("admin") // @Component // public class AdminProperties { // @NotNull // private String email; // // private boolean anonymous = false; // // private boolean signupInvitation = true; // // private In...
private UserRepository repository;
chocotan/lolibox
lolibox-server/src/main/java/io/loli/box/social/RepositoryUserDetailsService.java
// Path: lolibox-server/src/main/java/io/loli/box/AdminProperties.java // @ConfigurationProperties("admin") // @Component // public class AdminProperties { // @NotNull // private String email; // // private boolean anonymous = false; // // private boolean signupInvitation = true; // // private In...
import io.loli.box.AdminProperties; import io.loli.box.dao.UserRepository; import io.loli.box.entity.Role; import io.loli.box.entity.User; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails...
package io.loli.box.social; @Component public class RepositoryUserDetailsService implements UserDetailsService { private UserRepository repository; @Autowired public RepositoryUserDetailsService(UserRepository repository) { this.repository = repository; } @Autowired
// Path: lolibox-server/src/main/java/io/loli/box/AdminProperties.java // @ConfigurationProperties("admin") // @Component // public class AdminProperties { // @NotNull // private String email; // // private boolean anonymous = false; // // private boolean signupInvitation = true; // // private In...
private AdminProperties adminProperties;
chocotan/lolibox
lolibox-server/src/main/java/io/loli/box/social/RepositoryUserDetailsService.java
// Path: lolibox-server/src/main/java/io/loli/box/AdminProperties.java // @ConfigurationProperties("admin") // @Component // public class AdminProperties { // @NotNull // private String email; // // private boolean anonymous = false; // // private boolean signupInvitation = true; // // private In...
import io.loli.box.AdminProperties; import io.loli.box.dao.UserRepository; import io.loli.box.entity.Role; import io.loli.box.entity.User; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails...
package io.loli.box.social; @Component public class RepositoryUserDetailsService implements UserDetailsService { private UserRepository repository; @Autowired public RepositoryUserDetailsService(UserRepository repository) { this.repository = repository; } @Autowired private AdminPro...
// Path: lolibox-server/src/main/java/io/loli/box/AdminProperties.java // @ConfigurationProperties("admin") // @Component // public class AdminProperties { // @NotNull // private String email; // // private boolean anonymous = false; // // private boolean signupInvitation = true; // // private In...
User user = repository.findByEmail(email);
chocotan/lolibox
lolibox-server/src/main/java/io/loli/box/controller/AdminController.java
// Path: lolibox-server/src/main/java/io/loli/box/service/StorageService.java // public interface StorageService { // // /** // * Upload an InputStream with file name // * // * @param is file to upload. After uploaded, file name will be changed to // * nano time. // ...
import io.loli.box.service.StorageService; import io.loli.box.util.FileBean; import io.loli.box.util.StatusBean; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web....
package io.loli.box.controller; /** * @author choco */ @Controller @RequestMapping("/admin") public class AdminController { @Autowired
// Path: lolibox-server/src/main/java/io/loli/box/service/StorageService.java // public interface StorageService { // // /** // * Upload an InputStream with file name // * // * @param is file to upload. After uploaded, file name will be changed to // * nano time. // ...
private StorageService ss;
chocotan/lolibox
lolibox-server/src/main/java/io/loli/box/controller/AdminController.java
// Path: lolibox-server/src/main/java/io/loli/box/service/StorageService.java // public interface StorageService { // // /** // * Upload an InputStream with file name // * // * @param is file to upload. After uploaded, file name will be changed to // * nano time. // ...
import io.loli.box.service.StorageService; import io.loli.box.util.FileBean; import io.loli.box.util.StatusBean; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web....
package io.loli.box.controller; /** * @author choco */ @Controller @RequestMapping("/admin") public class AdminController { @Autowired private StorageService ss;
// Path: lolibox-server/src/main/java/io/loli/box/service/StorageService.java // public interface StorageService { // // /** // * Upload an InputStream with file name // * // * @param is file to upload. After uploaded, file name will be changed to // * nano time. // ...
private static Comparator<FileBean> fileComparator = new Comparator<FileBean>() {
chocotan/lolibox
lolibox-server/src/main/java/io/loli/box/LoliboxApplication.java
// Path: lolibox-server/src/main/java/io/loli/box/oauth2/AuthorizationServerConfiguration.java // @Configuration // @EnableAuthorizationServer // @Order(3) // @EntityScan("io.loli.box.oauth2") // @ConfigurationProperties(prefix = "oauth2") // public class AuthorizationServerConfiguration extends AuthorizationServerConf...
import io.loli.box.oauth2.AuthorizationServerConfiguration; import io.loli.box.oauth2.ResourceServer; import org.hashids.Hashids; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import ...
package io.loli.box; @SpringBootApplication @EnableZuulProxy @EnableJpaRepositories
// Path: lolibox-server/src/main/java/io/loli/box/oauth2/AuthorizationServerConfiguration.java // @Configuration // @EnableAuthorizationServer // @Order(3) // @EntityScan("io.loli.box.oauth2") // @ConfigurationProperties(prefix = "oauth2") // public class AuthorizationServerConfiguration extends AuthorizationServerConf...
@Import({MvcConfig.class, SecurityConfig.class, AuthorizationServerConfiguration.class, ResourceServer.class})
chocotan/lolibox
lolibox-server/src/main/java/io/loli/box/LoliboxApplication.java
// Path: lolibox-server/src/main/java/io/loli/box/oauth2/AuthorizationServerConfiguration.java // @Configuration // @EnableAuthorizationServer // @Order(3) // @EntityScan("io.loli.box.oauth2") // @ConfigurationProperties(prefix = "oauth2") // public class AuthorizationServerConfiguration extends AuthorizationServerConf...
import io.loli.box.oauth2.AuthorizationServerConfiguration; import io.loli.box.oauth2.ResourceServer; import org.hashids.Hashids; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import ...
package io.loli.box; @SpringBootApplication @EnableZuulProxy @EnableJpaRepositories
// Path: lolibox-server/src/main/java/io/loli/box/oauth2/AuthorizationServerConfiguration.java // @Configuration // @EnableAuthorizationServer // @Order(3) // @EntityScan("io.loli.box.oauth2") // @ConfigurationProperties(prefix = "oauth2") // public class AuthorizationServerConfiguration extends AuthorizationServerConf...
@Import({MvcConfig.class, SecurityConfig.class, AuthorizationServerConfiguration.class, ResourceServer.class})
chocotan/lolibox
lolibox-server/src/main/java/io/loli/box/service/impl/FileSystemStorageService.java
// Path: lolibox-server/src/main/java/io/loli/box/entity/User.java // @Entity // @Table(name = "user_accounts") // public class User { // // @Id // @GeneratedValue(strategy = GenerationType.AUTO) // private Long id; // // @Column(name = "email", length = 100, nullable = false, unique = true) // pr...
import io.loli.box.entity.User; import io.loli.box.service.AbstractStorageService; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.stereotype.Component; import java.io.File; import java....
package io.loli.box.service.impl; @Component @ConditionalOnProperty(name = "storage.type", havingValue = "filesystem") @ConfigurationProperties(prefix = "storage.filesystem")
// Path: lolibox-server/src/main/java/io/loli/box/entity/User.java // @Entity // @Table(name = "user_accounts") // public class User { // // @Id // @GeneratedValue(strategy = GenerationType.AUTO) // private Long id; // // @Column(name = "email", length = 100, nullable = false, unique = true) // pr...
public class FileSystemStorageService extends AbstractStorageService {
chocotan/lolibox
lolibox-server/src/main/java/io/loli/box/service/impl/FileSystemStorageService.java
// Path: lolibox-server/src/main/java/io/loli/box/entity/User.java // @Entity // @Table(name = "user_accounts") // public class User { // // @Id // @GeneratedValue(strategy = GenerationType.AUTO) // private Long id; // // @Column(name = "email", length = 100, nullable = false, unique = true) // pr...
import io.loli.box.entity.User; import io.loli.box.service.AbstractStorageService; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.stereotype.Component; import java.io.File; import java....
if (day < 10) { dayStr = "0" + dayStr; } String path = year + File.separator + monthStr + File.separator + dayStr; String savePath = this.imgFolder; if (savePath.endsWith(File.separator)) { } else { savePath += File.separator; ...
// Path: lolibox-server/src/main/java/io/loli/box/entity/User.java // @Entity // @Table(name = "user_accounts") // public class User { // // @Id // @GeneratedValue(strategy = GenerationType.AUTO) // private Long id; // // @Column(name = "email", length = 100, nullable = false, unique = true) // pr...
public boolean deleteFile(String name, User user) {
chocotan/lolibox
lolibox-server/src/main/java/io/loli/box/service/StorageService.java
// Path: lolibox-server/src/main/java/io/loli/box/entity/User.java // @Entity // @Table(name = "user_accounts") // public class User { // // @Id // @GeneratedValue(strategy = GenerationType.AUTO) // private Long id; // // @Column(name = "email", length = 100, nullable = false, unique = true) // pr...
import io.loli.box.entity.User; import javax.transaction.Transactional; import java.io.IOException; import java.io.InputStream;
package io.loli.box.service; /** * All storage service should implements this interface * * @author choco */ public interface StorageService { /** * Upload an InputStream with file name * * @param is file to upload. After uploaded, file name will be changed to * ...
// Path: lolibox-server/src/main/java/io/loli/box/entity/User.java // @Entity // @Table(name = "user_accounts") // public class User { // // @Id // @GeneratedValue(strategy = GenerationType.AUTO) // private Long id; // // @Column(name = "email", length = 100, nullable = false, unique = true) // pr...
boolean deleteFile(String name, User user);
chocotan/lolibox
lolibox-server/src/main/java/io/loli/box/service/impl/QiniuStorageService.java
// Path: lolibox-server/src/main/java/io/loli/box/service/AbstractStorageService.java // public abstract class AbstractStorageService implements StorageService { // @Autowired // protected ImgFileRepository imgFileRepository; // // public void deleteFile(String name) { // imgFileRepository.updateDe...
import com.qiniu.api.auth.AuthException; import com.qiniu.api.auth.digest.Mac; import com.qiniu.api.io.IoApi; import com.qiniu.api.io.PutExtra; import com.qiniu.api.io.PutRet; import com.qiniu.api.rs.PutPolicy; import com.qiniu.api.rs.RSClient; import io.loli.box.service.AbstractStorageService; import org.apache.common...
package io.loli.box.service.impl; /** * @author choco */ @Component @ConditionalOnProperty(name = "storage.type", havingValue = "qiniu") @ConfigurationProperties(prefix = "storage.qiniu")
// Path: lolibox-server/src/main/java/io/loli/box/service/AbstractStorageService.java // public abstract class AbstractStorageService implements StorageService { // @Autowired // protected ImgFileRepository imgFileRepository; // // public void deleteFile(String name) { // imgFileRepository.updateDe...
public class QiniuStorageService extends AbstractStorageService {
chocotan/lolibox
lolibox-server/src/main/java/io/loli/box/service/impl/CosStorageService.java
// Path: lolibox-server/src/main/java/io/loli/box/service/AbstractStorageService.java // public abstract class AbstractStorageService implements StorageService { // @Autowired // protected ImgFileRepository imgFileRepository; // // public void deleteFile(String name) { // imgFileRepository.updateDe...
import com.qcloud.cos.COSClient; import com.qcloud.cos.ClientConfig; import com.qcloud.cos.auth.BasicCOSCredentials; import com.qcloud.cos.auth.COSCredentials; import com.qcloud.cos.model.ObjectMetadata; import com.qcloud.cos.region.Region; import io.loli.box.service.AbstractStorageService; import org.springframework.b...
package io.loli.box.service.impl; /** * 腾讯云cos存储服务 */ @Component @ConditionalOnProperty(name = "storage.type", havingValue = "cos") @ConfigurationProperties(prefix = "storage.cos")
// Path: lolibox-server/src/main/java/io/loli/box/service/AbstractStorageService.java // public abstract class AbstractStorageService implements StorageService { // @Autowired // protected ImgFileRepository imgFileRepository; // // public void deleteFile(String name) { // imgFileRepository.updateDe...
public class CosStorageService extends AbstractStorageService {
chocotan/lolibox
lolibox-server/src/main/java/io/loli/box/service/impl/AliStorageService.java
// Path: lolibox-server/src/main/java/io/loli/box/service/AbstractStorageService.java // public abstract class AbstractStorageService implements StorageService { // @Autowired // protected ImgFileRepository imgFileRepository; // // public void deleteFile(String name) { // imgFileRepository.updateDe...
import com.aliyun.openservices.oss.OSSClient; import com.aliyun.openservices.oss.model.ObjectMetadata; import io.loli.box.service.AbstractStorageService; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.ConfigurationProperties; import org....
package io.loli.box.service.impl; /** * @author choco */ @Component @ConditionalOnProperty(name = "storage.type", havingValue = "aliyun") @ConfigurationProperties(prefix = "storage.aliyun")
// Path: lolibox-server/src/main/java/io/loli/box/service/AbstractStorageService.java // public abstract class AbstractStorageService implements StorageService { // @Autowired // protected ImgFileRepository imgFileRepository; // // public void deleteFile(String name) { // imgFileRepository.updateDe...
public class AliStorageService extends AbstractStorageService {
chocotan/lolibox
lolibox-server/src/main/java/io/loli/box/entity/User.java
// Path: lolibox-server/src/main/java/io/loli/box/social/SocialMediaService.java // public enum SocialMediaService { // WEIBO // }
import io.loli.box.social.SocialMediaService; import javax.persistence.*; import java.util.Date;
package io.loli.box.entity; @Entity @Table(name = "user_accounts") public class User { @Id @GeneratedValue(strategy = GenerationType.AUTO) private Long id; @Column(name = "email", length = 100, nullable = false, unique = true) private String email; @Column(name = "user_name", length = 100,...
// Path: lolibox-server/src/main/java/io/loli/box/social/SocialMediaService.java // public enum SocialMediaService { // WEIBO // } // Path: lolibox-server/src/main/java/io/loli/box/entity/User.java import io.loli.box.social.SocialMediaService; import javax.persistence.*; import java.util.Date; package io.loli.bo...
private SocialMediaService signInProvider;
chocotan/lolibox
lolibox-server/src/main/java/io/loli/box/social/SocialUserDetails.java
// Path: lolibox-server/src/main/java/io/loli/box/entity/Role.java // public enum Role { // ROLE_USER("ROLE_USER"), ADMIN("ROLE_ADMIN"); // // private String name; // // // Role(String name) { // this.name = name; // } // // @Override // public String toString() { // return n...
import io.loli.box.entity.Role; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.social.security.SocialUser; import java.util.Collection; import java.util.HashSet; import java.util.Set;
package io.loli.box.social; public class SocialUserDetails extends SocialUser { private Long id; private String email;
// Path: lolibox-server/src/main/java/io/loli/box/entity/Role.java // public enum Role { // ROLE_USER("ROLE_USER"), ADMIN("ROLE_ADMIN"); // // private String name; // // // Role(String name) { // this.name = name; // } // // @Override // public String toString() { // return n...
private Role role;
anyjava/FiveStonesGame
omok/gameServer/GameRoom.java
// Path: omok/protocolData/ChatData.java // public class ChatData implements Protocol { // public static final short ENTER = 1000; // public static final short LOGIN_CHECK = 1100; // public static final short LOGIN_ERROR = 1200; // public static final short MESSAGE = 2000; // public static final short MESSAGE_SLIP...
import java.io.Serializable; import java.util.ArrayList; import java.util.Vector; import protocolData.ChatData; import protocolData.Protocol;
package gameServer; public class GameRoom implements GameRoomInterface , Serializable { private static final long serialVersionUID = 1L; private static int roomNO = 1; private ClientManager userList; private int number; private String roomName; private StoneAlgol analysisStone; private boolean isStart =...
// Path: omok/protocolData/ChatData.java // public class ChatData implements Protocol { // public static final short ENTER = 1000; // public static final short LOGIN_CHECK = 1100; // public static final short LOGIN_ERROR = 1200; // public static final short MESSAGE = 2000; // public static final short MESSAGE_SLIP...
public void broadcasting(Protocol data) {
anyjava/FiveStonesGame
omok/gameServer/GameRoom.java
// Path: omok/protocolData/ChatData.java // public class ChatData implements Protocol { // public static final short ENTER = 1000; // public static final short LOGIN_CHECK = 1100; // public static final short LOGIN_ERROR = 1200; // public static final short MESSAGE = 2000; // public static final short MESSAGE_SLIP...
import java.io.Serializable; import java.util.ArrayList; import java.util.Vector; import protocolData.ChatData; import protocolData.Protocol;
package gameServer; public class GameRoom implements GameRoomInterface , Serializable { private static final long serialVersionUID = 1L; private static int roomNO = 1; private ClientManager userList; private int number; private String roomName; private StoneAlgol analysisStone; private boolean isStart =...
// Path: omok/protocolData/ChatData.java // public class ChatData implements Protocol { // public static final short ENTER = 1000; // public static final short LOGIN_CHECK = 1100; // public static final short LOGIN_ERROR = 1200; // public static final short MESSAGE = 2000; // public static final short MESSAGE_SLIP...
public void sendSlip(ChatData data) {
anyjava/FiveStonesGame
omok/gui/SlipFrame.java
// Path: omok/gameClient/ClientInterface.java // public interface ClientInterface { // void sendMessage(String message, short state); // void sendSlip(String to, String text, short message_slip); // GuiInterface getGui(); // void changeGui(GuiInterface gui); // void sendMessage(int[] is); // void setSlipTo(String...
import gameClient.ClientInterface; import java.awt.BorderLayout; import java.awt.Container; import java.awt.FlowLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing...
package gui; public class SlipFrame extends JFrame { private static final long serialVersionUID = 1L; private boolean isSend;
// Path: omok/gameClient/ClientInterface.java // public interface ClientInterface { // void sendMessage(String message, short state); // void sendSlip(String to, String text, short message_slip); // GuiInterface getGui(); // void changeGui(GuiInterface gui); // void sendMessage(int[] is); // void setSlipTo(String...
private ClientInterface client;
anyjava/FiveStonesGame
omok/gui/SlipFrame.java
// Path: omok/gameClient/ClientInterface.java // public interface ClientInterface { // void sendMessage(String message, short state); // void sendSlip(String to, String text, short message_slip); // GuiInterface getGui(); // void changeGui(GuiInterface gui); // void sendMessage(int[] is); // void setSlipTo(String...
import gameClient.ClientInterface; import java.awt.BorderLayout; import java.awt.Container; import java.awt.FlowLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing...
"Cancel"); /* * 쪽지 보낼때의 생성자. */ public SlipFrame(final String to, String message, boolean isSend, final ClientInterface client) { this.to = to; this.message = message; this.client = client; this.isSend = isSend; if (isSend) { // send this.setTitle("쪽지 보내기"); m_labelID = new JLabel("To.....
// Path: omok/gameClient/ClientInterface.java // public interface ClientInterface { // void sendMessage(String message, short state); // void sendSlip(String to, String text, short message_slip); // GuiInterface getGui(); // void changeGui(GuiInterface gui); // void sendMessage(int[] is); // void setSlipTo(String...
ChatData.MESSAGE_SLIP);
anyjava/FiveStonesGame
omok/gui/GameLobby.java
// Path: omok/gameClient/ClientInterface.java // public interface ClientInterface { // void sendMessage(String message, short state); // void sendSlip(String to, String text, short message_slip); // GuiInterface getGui(); // void changeGui(GuiInterface gui); // void sendMessage(int[] is); // void setSlipTo(String...
import gameClient.ClientInterface; import java.awt.Container; import java.awt.Graphics; import java.awt.event.AdjustmentEvent; import java.awt.event.AdjustmentListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.util.Vector; import javax.swing.AbstractButton; import javax.swing....
private JTextArea m_logWindow = new JTextArea(5, 20); private JTextField m_textInput = new JTextField(); private ImageButton m_sendButton = new ImageButton("image/gameLobbySendButton.jpg", "SEND", "image/gameLobbySendButtonOver.jpg"); private JScrollPane m_scPaneLogWin; private JScrollBar m_vScroll; /* * C...
// Path: omok/gameClient/ClientInterface.java // public interface ClientInterface { // void sendMessage(String message, short state); // void sendSlip(String to, String text, short message_slip); // GuiInterface getGui(); // void changeGui(GuiInterface gui); // void sendMessage(int[] is); // void setSlipTo(String...
private ClientInterface client;
anyjava/FiveStonesGame
omok/gui/GameRoomGui.java
// Path: omok/gameClient/ClientInterface.java // public interface ClientInterface { // void sendMessage(String message, short state); // void sendSlip(String to, String text, short message_slip); // GuiInterface getGui(); // void changeGui(GuiInterface gui); // void sendMessage(int[] is); // void setSlipTo(String...
import gameClient.ClientInterface; import java.awt.Canvas; import java.awt.Color; import java.awt.Container; import java.awt.Graphics; import java.awt.Image; import java.awt.MediaTracker; import java.awt.Toolkit; import java.awt.event.AdjustmentEvent; import java.awt.event.AdjustmentListener; import java.awt.event.Mous...
package gui; @SuppressWarnings("serial") public class GameRoomGui extends JPanel implements RoomGuiInter { private UserListFrame userListFrame; /* * Left Panel */ private JLabel m_titleLabel; private GameBoardCanvas m_board = new GameBoardCanvas(); private JTextField m_input; private JPanel m_canvasPa...
// Path: omok/gameClient/ClientInterface.java // public interface ClientInterface { // void sendMessage(String message, short state); // void sendSlip(String to, String text, short message_slip); // GuiInterface getGui(); // void changeGui(GuiInterface gui); // void sendMessage(int[] is); // void setSlipTo(String...
private ClientInterface client;
anyjava/FiveStonesGame
omok/gameServer/ServerInterface.java
// Path: omok/protocolData/ChatData.java // public class ChatData implements Protocol { // public static final short ENTER = 1000; // public static final short LOGIN_CHECK = 1100; // public static final short LOGIN_ERROR = 1200; // public static final short MESSAGE = 2000; // public static final short MESSAGE_SLIP...
import java.util.Vector; import protocolData.ChatData; import protocolData.Protocol;
package gameServer; public interface ServerInterface { static int LOBBY = 1; static int IN_GAME_ROOMKING = 2; static int IN_GAME_CRHARANGER = 3; static int IN_GAME_VIWER = 4;
// Path: omok/protocolData/ChatData.java // public class ChatData implements Protocol { // public static final short ENTER = 1000; // public static final short LOGIN_CHECK = 1100; // public static final short LOGIN_ERROR = 1200; // public static final short MESSAGE = 2000; // public static final short MESSAGE_SLIP...
void broadcasting(Protocol data);
anyjava/FiveStonesGame
omok/gameServer/ServerInterface.java
// Path: omok/protocolData/ChatData.java // public class ChatData implements Protocol { // public static final short ENTER = 1000; // public static final short LOGIN_CHECK = 1100; // public static final short LOGIN_ERROR = 1200; // public static final short MESSAGE = 2000; // public static final short MESSAGE_SLIP...
import java.util.Vector; import protocolData.ChatData; import protocolData.Protocol;
package gameServer; public interface ServerInterface { static int LOBBY = 1; static int IN_GAME_ROOMKING = 2; static int IN_GAME_CRHARANGER = 3; static int IN_GAME_VIWER = 4; void broadcasting(Protocol data); void subSocket(String name);
// Path: omok/protocolData/ChatData.java // public class ChatData implements Protocol { // public static final short ENTER = 1000; // public static final short LOGIN_CHECK = 1100; // public static final short LOGIN_ERROR = 1200; // public static final short MESSAGE = 2000; // public static final short MESSAGE_SLIP...
void sendSlip(ChatData data);
anyjava/FiveStonesGame
omok/gameServer/GameRoomInterface.java
// Path: omok/protocolData/Protocol.java // public interface Protocol extends Serializable { // // public short getProtocol(); // public String getName(); // public String getMessage(); // public void setMessage(String message); // public void setName(String name); // }
import protocolData.Protocol;
package gameServer; public interface GameRoomInterface extends ServerInterface { String getRoomName(); String getRoomKingName(); void subRoom(); int getNumber(); boolean isAllReady();
// Path: omok/protocolData/Protocol.java // public interface Protocol extends Serializable { // // public short getProtocol(); // public String getName(); // public String getMessage(); // public void setMessage(String message); // public void setName(String name); // } // Path: omok/gameServer/GameRoomInterfa...
void sendTo(int toGamer, Protocol data);
anyjava/FiveStonesGame
omok/gui/RoomGuiInter.java
// Path: omok/gui/GameRoomGui.java // class GameBoardCanvas extends Canvas { // // /* // * Image Size is 590,593 // */ // // private static final long serialVersionUID = 1L; // // private ArrayList<StoneHistory> historyOfStone = new ArrayList<StoneHistory>(); // // private Toolkit toolkit = Toolkit.g...
import gui.GameRoomGui.GameBoardCanvas; import java.util.Vector;
package gui; public interface RoomGuiInter extends PanelInterface { int BLACK_STONE = 0; int WHITE_STONE = 1; void drawStone(int[] stoneLocation, boolean b); void backOneStep(int n); void setGameRoomInfo(String info); void newGame(); void setRoomList(Vector<String> roomList);
// Path: omok/gui/GameRoomGui.java // class GameBoardCanvas extends Canvas { // // /* // * Image Size is 590,593 // */ // // private static final long serialVersionUID = 1L; // // private ArrayList<StoneHistory> historyOfStone = new ArrayList<StoneHistory>(); // // private Toolkit toolkit = Toolkit.g...
GameBoardCanvas getM_board();
anyjava/FiveStonesGame
omok/gui/UserListFrame.java
// Path: omok/gameClient/ClientInterface.java // public interface ClientInterface { // void sendMessage(String message, short state); // void sendSlip(String to, String text, short message_slip); // GuiInterface getGui(); // void changeGui(GuiInterface gui); // void sendMessage(int[] is); // void setSlipTo(String...
import gameClient.ClientInterface; import java.awt.Container; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.util.Vector; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JList; import ...
package gui; public class UserListFrame extends JFrame { private static final long serialVersionUID = 1L; private Container cp; private JList m_userList; private JScrollPane m_scList; private JButton m_sendButton, m_closeButton;
// Path: omok/gameClient/ClientInterface.java // public interface ClientInterface { // void sendMessage(String message, short state); // void sendSlip(String to, String text, short message_slip); // GuiInterface getGui(); // void changeGui(GuiInterface gui); // void sendMessage(int[] is); // void setSlipTo(String...
protected ClientInterface client;
anyjava/FiveStonesGame
omok/gui/LobbyGui.java
// Path: omok/gameClient/ClientInterface.java // public interface ClientInterface { // void sendMessage(String message, short state); // void sendSlip(String to, String text, short message_slip); // GuiInterface getGui(); // void changeGui(GuiInterface gui); // void sendMessage(int[] is); // void setSlipTo(String...
import gameClient.ClientInterface; import java.awt.Container; import java.awt.Graphics; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.AdjustmentEvent; import java.awt.event.AdjustmentListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import j...
package gui; /* * Version 1.01 챗티창 라인보호. */ @SuppressWarnings("serial") public class LobbyGui extends JPanel implements LobbyGuiInter, PanelInterface{
// Path: omok/gameClient/ClientInterface.java // public interface ClientInterface { // void sendMessage(String message, short state); // void sendSlip(String to, String text, short message_slip); // GuiInterface getGui(); // void changeGui(GuiInterface gui); // void sendMessage(int[] is); // void setSlipTo(String...
private ClientInterface client;
anyjava/FiveStonesGame
omok/gameClient/ClientInterface.java
// Path: omok/gui/GuiInterface.java // public interface GuiInterface { // public void setTextToLogWindow(String str); // public void setUserList(Vector<String> userList); // public void showMessageBox(String sender, String message, boolean option); // public JList getJList(); // public void unShow(); // public St...
import gui.GuiInterface;
package gameClient; public interface ClientInterface { void sendMessage(String message, short state); void sendSlip(String to, String text, short message_slip);
// Path: omok/gui/GuiInterface.java // public interface GuiInterface { // public void setTextToLogWindow(String str); // public void setUserList(Vector<String> userList); // public void showMessageBox(String sender, String message, boolean option); // public JList getJList(); // public void unShow(); // public St...
GuiInterface getGui();
johnlcox/dagger-servlet
dagger-servlet/src/test/java/com/leacox/dagger/servlet/MultipleServletObjectGraphsTest.java
// Path: dagger-servlet/src/main/java/com/leacox/dagger/servlet/DaggerServletContextListener.java // public static final String OBJECT_GRAPH_NAME = ObjectGraph.class.getName();
import dagger.Module; import dagger.ObjectGraph; import dagger.Provides; import org.testng.annotations.Test; import javax.inject.Singleton; import javax.servlet.ServletContext; import javax.servlet.ServletContextEvent; import javax.servlet.http.HttpServlet; import static com.leacox.dagger.servlet.DaggerServletContextLi...
/** * Copyright (C) 2010 Google Inc. * Copyright (C) 2014 John Leacox * * 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 requi...
// Path: dagger-servlet/src/main/java/com/leacox/dagger/servlet/DaggerServletContextListener.java // public static final String OBJECT_GRAPH_NAME = ObjectGraph.class.getName(); // Path: dagger-servlet/src/test/java/com/leacox/dagger/servlet/MultipleServletObjectGraphsTest.java import dagger.Module; import dagger.Obje...
fakeContextOne.setAttribute(eq(OBJECT_GRAPH_NAME), isA(ObjectGraph.class));
johnlcox/dagger-servlet
dagger-servlet/src/test/java/com/leacox/dagger/servlet/ScopeRequestIntegrationTest.java
// Path: dagger-servlet/src/main/java/dagger/ScopingObjectGraph.java // public class ScopingObjectGraph extends ObjectGraph { // private final ObjectGraph objectGraph; // private final Map<Class<? extends Annotation>, Object[]> scopedModules; // // private final Scope requestScope = ServletScopes.REQUEST; ...
import com.google.common.collect.ImmutableMap; import com.google.common.collect.Maps; import dagger.Module; import dagger.ObjectGraph; import dagger.Provides; import dagger.ScopingObjectGraph; import org.testng.annotations.Test; import javax.inject.Inject; import javax.inject.Named; import javax.inject.Singleton; impor...
ObjectGraph.class }, includes = { ServletModule.class } ) static class TestAppModule { } @Module( injects = { SomeObject.class }, includes = { ServletR...
// Path: dagger-servlet/src/main/java/dagger/ScopingObjectGraph.java // public class ScopingObjectGraph extends ObjectGraph { // private final ObjectGraph objectGraph; // private final Map<Class<? extends Annotation>, Object[]> scopedModules; // // private final Scope requestScope = ServletScopes.REQUEST; ...
ObjectGraph scopingGraph = ScopingObjectGraph.create(baseGraph)
johnlcox/dagger-servlet
dagger-servlet/src/main/java/com/leacox/dagger/servlet/ServletDefinition.java
// Path: dagger-servlet/src/main/java/com/leacox/dagger/servlet/ManagedServletPipeline.java // public static final String REQUEST_DISPATCHER_REQUEST = "javax.servlet.forward.servlet_path";
import java.util.Collections; import java.util.Enumeration; import java.util.Map; import java.util.Set; import java.util.concurrent.atomic.AtomicReference; import static com.leacox.dagger.servlet.ManagedServletPipeline.REQUEST_DISPATCHER_REQUEST; import com.google.common.collect.Iterators; import com.google.common.coll...
private String path; private boolean pathComputed = false; //must use a boolean on the memo field, because null is a legal value (TODO no, it's not) private boolean pathInfoComputed = false; private String pathInfo; @Override public S...
// Path: dagger-servlet/src/main/java/com/leacox/dagger/servlet/ManagedServletPipeline.java // public static final String REQUEST_DISPATCHER_REQUEST = "javax.servlet.forward.servlet_path"; // Path: dagger-servlet/src/main/java/com/leacox/dagger/servlet/ServletDefinition.java import java.util.Collections; import java....
&& !(null != servletRequest.getAttribute(REQUEST_DISPATCHER_REQUEST));
johnlcox/dagger-servlet
dagger-servlet/src/test/java/com/leacox/dagger/servlet/FilterDispatchIntegrationTest.java
// Path: dagger-servlet/src/main/java/com/leacox/dagger/servlet/ManagedServletPipeline.java // public static final String REQUEST_DISPATCHER_REQUEST = "javax.servlet.forward.servlet_path";
import dagger.Module; import dagger.ObjectGraph; import org.easymock.EasyMock; import org.easymock.IMocksControl; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; import javax.inject.Inject; import javax.inject.Singleton; import javax.servlet.*; import javax.servlet.http.HttpServlet; impo...
filter("/*").through(TestFilter.class); filter("*.html").through(TestFilter.class); filter("/*").through(TestFilter.class); // These filters should never fire filter("/index/*").through(TestFilter.class); filter("*.jsp").th...
// Path: dagger-servlet/src/main/java/com/leacox/dagger/servlet/ManagedServletPipeline.java // public static final String REQUEST_DISPATCHER_REQUEST = "javax.servlet.forward.servlet_path"; // Path: dagger-servlet/src/test/java/com/leacox/dagger/servlet/FilterDispatchIntegrationTest.java import dagger.Module; import d...
requestMock.setAttribute(REQUEST_DISPATCHER_REQUEST, true);
johnlcox/dagger-servlet
dagger-servlet/src/test/java/com/leacox/dagger/servlet/ServletPipelineRequestDispatcherTest.java
// Path: dagger-servlet/src/main/java/com/leacox/dagger/servlet/ManagedServletPipeline.java // public static final String REQUEST_DISPATCHER_REQUEST = "javax.servlet.forward.servlet_path";
import com.google.common.collect.Maps; import com.google.common.collect.Sets; import dagger.ObjectGraph; import org.testng.annotations.Test; import javax.servlet.RequestDispatcher; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.se...
/** * Copyright (C) 2008 Google Inc. * Copyright (C) 2014 John Leacox * * 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 requi...
// Path: dagger-servlet/src/main/java/com/leacox/dagger/servlet/ManagedServletPipeline.java // public static final String REQUEST_DISPATCHER_REQUEST = "javax.servlet.forward.servlet_path"; // Path: dagger-servlet/src/test/java/com/leacox/dagger/servlet/ServletPipelineRequestDispatcherTest.java import com.google.commo...
requestMock.setAttribute(REQUEST_DISPATCHER_REQUEST, true);
johnlcox/dagger-servlet
dagger-jersey/src/main/java/com/leacox/dagger/jersey/JerseyModule.java
// Path: dagger-servlet/src/main/java/com/leacox/dagger/servlet/ServletModule.java // @Module( // injects = { // ServletContext.class // }, // includes = { // InternalServletModule.class // } // ) // public class ServletModule { // @Provides // @Si...
import com.leacox.dagger.servlet.ServletModule; import com.leacox.dagger.servlet.internal.ModuleClasses; import com.sun.jersey.api.core.ResourceContext; import com.sun.jersey.core.util.FeaturesAndProperties; import com.sun.jersey.spi.MessageBodyWorkers; import com.sun.jersey.spi.container.ExceptionMapperContext; import...
/** * Copyright (C) 2014 John Leacox * * 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 applicable law or agreed to...
// Path: dagger-servlet/src/main/java/com/leacox/dagger/servlet/ServletModule.java // @Module( // injects = { // ServletContext.class // }, // includes = { // InternalServletModule.class // } // ) // public class ServletModule { // @Provides // @Si...
ServletModule.class
johnlcox/dagger-servlet
examples/jersey-simple/src/main/java/com/leacox/dagger/example/simple/SimpleModule.java
// Path: dagger-jersey/src/main/java/com/leacox/dagger/jersey/JerseyModule.java // @Module( // injects = { // DaggerContainer.class // }, // includes = { // ServletModule.class // }, // library = true // ) // public class JerseyModule { // @Pro...
import com.leacox.dagger.jersey.JerseyModule; import com.leacox.dagger.servlet.ServletModule; import dagger.Module; import dagger.Provides; import javax.inject.Singleton;
/** * Copyright (C) 2014 John Leacox * * 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 applicable law or agreed to...
// Path: dagger-jersey/src/main/java/com/leacox/dagger/jersey/JerseyModule.java // @Module( // injects = { // DaggerContainer.class // }, // includes = { // ServletModule.class // }, // library = true // ) // public class JerseyModule { // @Pro...
ServletModule.class,
johnlcox/dagger-servlet
examples/jersey-simple/src/main/java/com/leacox/dagger/example/simple/SimpleModule.java
// Path: dagger-jersey/src/main/java/com/leacox/dagger/jersey/JerseyModule.java // @Module( // injects = { // DaggerContainer.class // }, // includes = { // ServletModule.class // }, // library = true // ) // public class JerseyModule { // @Pro...
import com.leacox.dagger.jersey.JerseyModule; import com.leacox.dagger.servlet.ServletModule; import dagger.Module; import dagger.Provides; import javax.inject.Singleton;
/** * Copyright (C) 2014 John Leacox * * 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 applicable law or agreed to...
// Path: dagger-jersey/src/main/java/com/leacox/dagger/jersey/JerseyModule.java // @Module( // injects = { // DaggerContainer.class // }, // includes = { // ServletModule.class // }, // library = true // ) // public class JerseyModule { // @Pro...
JerseyModule.class
johnlcox/dagger-servlet
dagger-servlet/src/main/java/com/leacox/dagger/servlet/ContinuingHttpServletRequest.java
// Path: dagger-servlet/src/main/java/com/leacox/dagger/servlet/scope/OutOfScopeException.java // public final class OutOfScopeException extends RuntimeException { // // public OutOfScopeException(String message) { // super(message); // } // // public OutOfScopeException(String message, Throwable ...
import com.google.common.collect.Maps; import com.leacox.dagger.servlet.scope.OutOfScopeException; import javax.servlet.ServletInputStream; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequestWrapper; import javax.servlet.http.HttpSession; import j...
/** * Copyright (C) 2010 Google Inc. * * 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 applicable law or agreed to...
// Path: dagger-servlet/src/main/java/com/leacox/dagger/servlet/scope/OutOfScopeException.java // public final class OutOfScopeException extends RuntimeException { // // public OutOfScopeException(String message) { // super(message); // } // // public OutOfScopeException(String message, Throwable ...
throw new OutOfScopeException("Cannot access the session in a continued request");
johnlcox/dagger-servlet
dagger-servlet/src/test/java/com/leacox/dagger/servlet/ServletTest.java
// Path: dagger-servlet/src/main/java/com/leacox/dagger/servlet/ServletScopes.java // enum NullObject { // INSTANCE // }
import dagger.Module; import dagger.ObjectGraph; import dagger.Provides; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; import javax.inject.Singleton; import javax.servlet.FilterChain; import javax.servlet.ServletContext; import javax.servlet.ServletContextEvent; import javax.servlet.Se...
@Override protected Class<?>[] getRequestScopedModules() { return new Class<?>[]{TestRequestModule.class}; } @Override protected void configureServlets() { } }; ServletContext servletContext = createMock(ServletCo...
// Path: dagger-servlet/src/main/java/com/leacox/dagger/servlet/ServletScopes.java // enum NullObject { // INSTANCE // } // Path: dagger-servlet/src/test/java/com/leacox/dagger/servlet/ServletTest.java import dagger.Module; import dagger.ObjectGraph; import dagger.Provides; import org.testng.annotations.BeforeMet...
request.setAttribute(eq(inRequestNullKey), eq(NullObject.INSTANCE));
johnlcox/dagger-servlet
dagger-servlet/src/main/java/com/leacox/dagger/servlet/ServletScopes.java
// Path: dagger-servlet/src/main/java/com/leacox/dagger/servlet/scope/Scope.java // public interface Scope { // public <T> T scope(Class<T> type, ObjectGraph baseGraph, Object[] scopedModules); // // public <T> T scopeInstance(T value, ObjectGraph baseGraph, Object[] scopedModules); // // String toString(...
import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Objects; import com.google.common.base.Preconditions; import com.google.common.collect.Maps; import com.leacox.dagger.servlet.scope.Scope; import dagger.ObjectGraph; import javax.servlet.http.HttpServletRequest; import javax.servlet.h...
this.type = type; } public static DaggerKey get(Class<?> type) { return new DaggerKey(type); } @Override public final boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false...
// Path: dagger-servlet/src/main/java/com/leacox/dagger/servlet/scope/Scope.java // public interface Scope { // public <T> T scope(Class<T> type, ObjectGraph baseGraph, Object[] scopedModules); // // public <T> T scopeInstance(T value, ObjectGraph baseGraph, Object[] scopedModules); // // String toString(...
public static final Scope REQUEST = new Scope() {
johnlcox/dagger-servlet
dagger-servlet/src/test/java/com/leacox/dagger/servlet/ServletDispatchIntegrationTest.java
// Path: dagger-servlet/src/main/java/com/leacox/dagger/servlet/ManagedServletPipeline.java // public static final String REQUEST_DISPATCHER_REQUEST = "javax.servlet.forward.servlet_path";
import java.io.IOException; import javax.inject.Inject; import javax.inject.Singleton; import javax.servlet.Filter; import javax.servlet.FilterChain; import javax.servlet.FilterConfig; import javax.servlet.ServletConfig; import javax.servlet.ServletContext; import javax.servlet.ServletContextEvent; import javax.servlet...
@Singleton public static class ForwardingServlet extends HttpServlet { @Inject ForwardingServlet() {} @Override public void service(ServletRequest servletRequest, ServletResponse servletResponse) throws IOException, ServletException { final HttpServle...
// Path: dagger-servlet/src/main/java/com/leacox/dagger/servlet/ManagedServletPipeline.java // public static final String REQUEST_DISPATCHER_REQUEST = "javax.servlet.forward.servlet_path"; // Path: dagger-servlet/src/test/java/com/leacox/dagger/servlet/ServletDispatchIntegrationTest.java import java.io.IOException; i...
assertTrue((Boolean) request.getAttribute(REQUEST_DISPATCHER_REQUEST));
johnlcox/dagger-servlet
dagger-servlet/src/test/java/com/leacox/dagger/servlet/ServletDefinitionPathsTest.java
// Path: dagger-servlet/src/main/java/com/leacox/dagger/servlet/ManagedServletPipeline.java // public static final String REQUEST_DISPATCHER_REQUEST = "javax.servlet.forward.servlet_path";
import com.google.common.collect.Maps; import com.google.common.collect.Sets; import dagger.ObjectGraph; import org.testng.annotations.Test; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import j...
protected void service(HttpServletRequest servletRequest, HttpServletResponse httpServletResponse) throws ServletException, IOException { final String path = servletRequest.getPathInfo(); if (null == expecte...
// Path: dagger-servlet/src/main/java/com/leacox/dagger/servlet/ManagedServletPipeline.java // public static final String REQUEST_DISPATCHER_REQUEST = "javax.servlet.forward.servlet_path"; // Path: dagger-servlet/src/test/java/com/leacox/dagger/servlet/ServletDefinitionPathsTest.java import com.google.common.collect....
expect(request.getAttribute(REQUEST_DISPATCHER_REQUEST)).andReturn(null);
fieldexpert/fbapi4j
src/com/fieldexpert/fbapi4j/Configuration.java
// Path: src/com/fieldexpert/fbapi4j/dispatch/Dispatch.java // public interface Dispatch { // // Response invoke(String method, URL url); // // Response invoke(Request request); // // Response invoke(String method, URL url, Request request); // // URL getEndpoint(); // // URL getUrl(); // // Properties getP...
import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.net.URL; import java.util.Properties; import com.fieldexpert.fbapi4j.dispatch.Dispatch; import com.fieldexpert.fbapi4j.dispatch.HttpDispatch;
package com.fieldexpert.fbapi4j; public final class Configuration { private static final String ENDPOINT = "endpoint"; private static final String EMAIL = "email"; private static final String PASSWORD = "password"; private static final String PATH = "path"; private Properties properties; public Configuratio...
// Path: src/com/fieldexpert/fbapi4j/dispatch/Dispatch.java // public interface Dispatch { // // Response invoke(String method, URL url); // // Response invoke(Request request); // // Response invoke(String method, URL url, Request request); // // URL getEndpoint(); // // URL getUrl(); // // Properties getP...
public Dispatch buildDispatch() {
fieldexpert/fbapi4j
src/com/fieldexpert/fbapi4j/Configuration.java
// Path: src/com/fieldexpert/fbapi4j/dispatch/Dispatch.java // public interface Dispatch { // // Response invoke(String method, URL url); // // Response invoke(Request request); // // Response invoke(String method, URL url, Request request); // // URL getEndpoint(); // // URL getUrl(); // // Properties getP...
import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.net.URL; import java.util.Properties; import com.fieldexpert.fbapi4j.dispatch.Dispatch; import com.fieldexpert.fbapi4j.dispatch.HttpDispatch;
package com.fieldexpert.fbapi4j; public final class Configuration { private static final String ENDPOINT = "endpoint"; private static final String EMAIL = "email"; private static final String PASSWORD = "password"; private static final String PATH = "path"; private Properties properties; public Configuratio...
// Path: src/com/fieldexpert/fbapi4j/dispatch/Dispatch.java // public interface Dispatch { // // Response invoke(String method, URL url); // // Response invoke(Request request); // // Response invoke(String method, URL url, Request request); // // URL getEndpoint(); // // URL getUrl(); // // Properties getP...
return new HttpDispatch(this);
fieldexpert/fbapi4j
src/com/fieldexpert/fbapi4j/http/MultiPartOutputStream.java
// Path: src/com/fieldexpert/fbapi4j/common/Assert.java // public class Assert { // // public static void notNull(Object object, String message) { // if (object == null) { // throw new IllegalArgumentException(message); // } // } // // public static void notNull(Object object) { // notNull(object, "[Asser...
import java.io.DataOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import com.fieldexpert.fbapi4j.common.Assert;
package com.fieldexpert.fbapi4j.http; class MultiPartOutputStream { private static final String NEWLINE = "\r\n"; private static final String PREFIX = "--"; private final DataOutputStream out; private final String boundary; MultiPartOutputStream(OutputStream os, String boundary) { if (os == null) { thro...
// Path: src/com/fieldexpert/fbapi4j/common/Assert.java // public class Assert { // // public static void notNull(Object object, String message) { // if (object == null) { // throw new IllegalArgumentException(message); // } // } // // public static void notNull(Object object) { // notNull(object, "[Asser...
Assert.notNull(name);
fieldexpert/fbapi4j
src/com/fieldexpert/fbapi4j/MuxSession.java
// Path: src/com/fieldexpert/fbapi4j/dispatch/Dispatch.java // public interface Dispatch { // // Response invoke(String method, URL url); // // Response invoke(Request request); // // Response invoke(String method, URL url, Request request); // // URL getEndpoint(); // // URL getUrl(); // // Properties getP...
import java.util.List; import com.fieldexpert.fbapi4j.dispatch.Dispatch;
package com.fieldexpert.fbapi4j; class MuxSession implements Session { private ConnectedSession connected; private Session disconnected; private Session state;
// Path: src/com/fieldexpert/fbapi4j/dispatch/Dispatch.java // public interface Dispatch { // // Response invoke(String method, URL url); // // Response invoke(Request request); // // Response invoke(String method, URL url, Request request); // // URL getEndpoint(); // // URL getUrl(); // // Properties getP...
public MuxSession(Dispatch dispatch) {
fieldexpert/fbapi4j
src/com/fieldexpert/fbapi4j/Case.java
// Path: src/com/fieldexpert/fbapi4j/common/StringUtil.java // public static String collectionToCommaDelimitedString(Collection<?> col) { // return collectionToDelimitedString(col, ","); // } // // Path: src/com/fieldexpert/fbapi4j/common/Assert.java // public class Assert { // // public static void notNull(Object ...
import static com.fieldexpert.fbapi4j.common.StringUtil.collectionToCommaDelimitedString; import static java.util.Arrays.asList; import java.io.File; import java.io.InputStream; import java.nio.charset.Charset; import java.util.ArrayList; import java.util.Collections; import java.util.Date; import java.util.List; impor...
package com.fieldexpert.fbapi4j; @EntityConfig(element = "case", list = Fbapi4j.QUERY, single = Fbapi4j.QUERY, id = Fbapi4j.IX_BUG) public class Case extends Entity {
// Path: src/com/fieldexpert/fbapi4j/common/StringUtil.java // public static String collectionToCommaDelimitedString(Collection<?> col) { // return collectionToDelimitedString(col, ","); // } // // Path: src/com/fieldexpert/fbapi4j/common/Assert.java // public class Assert { // // public static void notNull(Object ...
private List<Attachment> attachments;
fieldexpert/fbapi4j
src/com/fieldexpert/fbapi4j/Case.java
// Path: src/com/fieldexpert/fbapi4j/common/StringUtil.java // public static String collectionToCommaDelimitedString(Collection<?> col) { // return collectionToDelimitedString(col, ","); // } // // Path: src/com/fieldexpert/fbapi4j/common/Assert.java // public class Assert { // // public static void notNull(Object ...
import static com.fieldexpert.fbapi4j.common.StringUtil.collectionToCommaDelimitedString; import static java.util.Arrays.asList; import java.io.File; import java.io.InputStream; import java.nio.charset.Charset; import java.util.ArrayList; import java.util.Collections; import java.util.Date; import java.util.List; impor...
package com.fieldexpert.fbapi4j; @EntityConfig(element = "case", list = Fbapi4j.QUERY, single = Fbapi4j.QUERY, id = Fbapi4j.IX_BUG) public class Case extends Entity { private List<Attachment> attachments; private List<Event> events; private Set<AllowedOperation> allowedOperations; public Case(String project, S...
// Path: src/com/fieldexpert/fbapi4j/common/StringUtil.java // public static String collectionToCommaDelimitedString(Collection<?> col) { // return collectionToDelimitedString(col, ","); // } // // Path: src/com/fieldexpert/fbapi4j/common/Assert.java // public class Assert { // // public static void notNull(Object ...
Assert.notNull(attachment);
fieldexpert/fbapi4j
src/com/fieldexpert/fbapi4j/Case.java
// Path: src/com/fieldexpert/fbapi4j/common/StringUtil.java // public static String collectionToCommaDelimitedString(Collection<?> col) { // return collectionToDelimitedString(col, ","); // } // // Path: src/com/fieldexpert/fbapi4j/common/Assert.java // public class Assert { // // public static void notNull(Object ...
import static com.fieldexpert.fbapi4j.common.StringUtil.collectionToCommaDelimitedString; import static java.util.Arrays.asList; import java.io.File; import java.io.InputStream; import java.nio.charset.Charset; import java.util.ArrayList; import java.util.Collections; import java.util.Date; import java.util.List; impor...
} public String getTitle() { return (String) fields.get(Fbapi4j.S_TITLE); } public String getScoutDescription() { return (String) fields.get(Fbapi4j.S_SCOUT_DESCRIPTION); } public List<Attachment> getAttachments() { return Collections.unmodifiableList(this.attachments); } public List<Event> getEvents(...
// Path: src/com/fieldexpert/fbapi4j/common/StringUtil.java // public static String collectionToCommaDelimitedString(Collection<?> col) { // return collectionToDelimitedString(col, ","); // } // // Path: src/com/fieldexpert/fbapi4j/common/Assert.java // public class Assert { // // public static void notNull(Object ...
fields.put(Fbapi4j.S_TAGS, collectionToCommaDelimitedString(asList(tags)));
fieldexpert/fbapi4j
src/com/fieldexpert/fbapi4j/Case.java
// Path: src/com/fieldexpert/fbapi4j/common/StringUtil.java // public static String collectionToCommaDelimitedString(Collection<?> col) { // return collectionToDelimitedString(col, ","); // } // // Path: src/com/fieldexpert/fbapi4j/common/Assert.java // public class Assert { // // public static void notNull(Object ...
import static com.fieldexpert.fbapi4j.common.StringUtil.collectionToCommaDelimitedString; import static java.util.Arrays.asList; import java.io.File; import java.io.InputStream; import java.nio.charset.Charset; import java.util.ArrayList; import java.util.Collections; import java.util.Date; import java.util.List; impor...
fields.put(Fbapi4j.S_AREA, area); } public void setParent(Case parent) { if (parent.getId() == null) { throw new Fbapi4jException("The parent case must be persisted first"); } fields.put(Fbapi4j.IX_BUG_PARENT, parent.getId()); } public void setTags(String... tags) { fields.put(Fbapi4j.S_TAGS, collect...
// Path: src/com/fieldexpert/fbapi4j/common/StringUtil.java // public static String collectionToCommaDelimitedString(Collection<?> col) { // return collectionToDelimitedString(col, ","); // } // // Path: src/com/fieldexpert/fbapi4j/common/Assert.java // public class Assert { // // public static void notNull(Object ...
fields.put(Fbapi4j.DT_DUE, DateFormatUtil.format(date));
fieldexpert/fbapi4j
src/com/fieldexpert/fbapi4j/SessionFactory.java
// Path: src/com/fieldexpert/fbapi4j/dispatch/Dispatch.java // public interface Dispatch { // // Response invoke(String method, URL url); // // Response invoke(Request request); // // Response invoke(String method, URL url, Request request); // // URL getEndpoint(); // // URL getUrl(); // // Properties getP...
import com.fieldexpert.fbapi4j.dispatch.Dispatch;
package com.fieldexpert.fbapi4j; class SessionFactory { Session createSession(Configuration configuration) { return new MuxSession(configuration.buildDispatch()); }
// Path: src/com/fieldexpert/fbapi4j/dispatch/Dispatch.java // public interface Dispatch { // // Response invoke(String method, URL url); // // Response invoke(Request request); // // Response invoke(String method, URL url, Request request); // // URL getEndpoint(); // // URL getUrl(); // // Properties getP...
Session createSession(Dispatch dispatch) {
fieldexpert/fbapi4j
test/com/fieldexpert/fbapi4j/http/HttpTest.java
// Path: test/com/fieldexpert/fbapi4j/common/IOUtil.java // public static String string(File file) throws java.io.IOException { // return string(new FileInputStream(file)); // } // // Path: src/com/fieldexpert/fbapi4j/common/Attachment.java // public class Attachment { // // static { // registerMimeDetector(Exten...
import static com.fieldexpert.fbapi4j.common.IOUtil.string; import static java.util.Arrays.asList; import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertTrue; import java.io.BufferedReader; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.i...
package com.fieldexpert.fbapi4j.http; public class HttpTest { private static MockServer server; private static URL url; private Map<String, String> params; @Test public void get() throws IOException { InputStream is = Http.get(url, params); BufferedReader br = new BufferedReader(new InputStreamReader(i...
// Path: test/com/fieldexpert/fbapi4j/common/IOUtil.java // public static String string(File file) throws java.io.IOException { // return string(new FileInputStream(file)); // } // // Path: src/com/fieldexpert/fbapi4j/common/Attachment.java // public class Attachment { // // static { // registerMimeDetector(Exten...
List<Attachment> attachments = asList(new Attachment("foo.txt", "text/plain", "This is my test file."));
fieldexpert/fbapi4j
test/com/fieldexpert/fbapi4j/http/HttpTest.java
// Path: test/com/fieldexpert/fbapi4j/common/IOUtil.java // public static String string(File file) throws java.io.IOException { // return string(new FileInputStream(file)); // } // // Path: src/com/fieldexpert/fbapi4j/common/Attachment.java // public class Attachment { // // static { // registerMimeDetector(Exten...
import static com.fieldexpert.fbapi4j.common.IOUtil.string; import static java.util.Arrays.asList; import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertTrue; import java.io.BufferedReader; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.i...
package com.fieldexpert.fbapi4j.http; public class HttpTest { private static MockServer server; private static URL url; private Map<String, String> params; @Test public void get() throws IOException { InputStream is = Http.get(url, params); BufferedReader br = new BufferedReader(new InputStreamReader(i...
// Path: test/com/fieldexpert/fbapi4j/common/IOUtil.java // public static String string(File file) throws java.io.IOException { // return string(new FileInputStream(file)); // } // // Path: src/com/fieldexpert/fbapi4j/common/Attachment.java // public class Attachment { // // static { // registerMimeDetector(Exten...
Map<String, String> returnedParams = params(string(is));
fieldexpert/fbapi4j
src/com/fieldexpert/fbapi4j/Event.java
// Path: src/com/fieldexpert/fbapi4j/common/Attachment.java // public class Attachment { // // static { // registerMimeDetector(ExtensionMimeDetector.class.getName()); // registerMimeDetector(MagicMimeMimeDetector.class.getName()); // } // // public static String getType(File file) { // Collection<?> types =...
import java.util.ArrayList; import java.util.Collections; import java.util.Date; import java.util.List; import com.fieldexpert.fbapi4j.common.Attachment;
this.description = description; this.date = date; this.createdBy = createdBy; this.attachments = attachments; } public String getId() { return id; } public Case getBug() { return bug; } public String getVerb() { return verb; } public String getDescription() { return description; } public ...
// Path: src/com/fieldexpert/fbapi4j/common/Attachment.java // public class Attachment { // // static { // registerMimeDetector(ExtensionMimeDetector.class.getName()); // registerMimeDetector(MagicMimeMimeDetector.class.getName()); // } // // public static String getType(File file) { // Collection<?> types =...
public List<? extends Attachment> getAttachments() {
fieldexpert/fbapi4j
test/com/fieldexpert/fbapi4j/http/server/ParameterParser.java
// Path: test/com/fieldexpert/fbapi4j/common/IOUtil.java // public static String string(File file) throws java.io.IOException { // return string(new FileInputStream(file)); // }
import static com.fieldexpert.fbapi4j.common.IOUtil.string; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.net.URI; import java.net.URLDecoder; import java.util.HashMap; import java.util.Map; import com.sun.net.httpserver.Headers; import com.sun.net.httpserver.HttpExchange;
package com.fieldexpert.fbapi4j.http.server; class ParameterParser { Map<String, String> parse(HttpExchange exchange) throws UnsupportedEncodingException, IOException { if ("get".equalsIgnoreCase(exchange.getRequestMethod())) { URI requestedUri = exchange.getRequestURI(); return parseQuery(requestedUri.ge...
// Path: test/com/fieldexpert/fbapi4j/common/IOUtil.java // public static String string(File file) throws java.io.IOException { // return string(new FileInputStream(file)); // } // Path: test/com/fieldexpert/fbapi4j/http/server/ParameterParser.java import static com.fieldexpert.fbapi4j.common.IOUtil.string; import j...
return parseQuery(string(exchange.getRequestBody()));
fieldexpert/fbapi4j
src/com/fieldexpert/fbapi4j/http/Http.java
// Path: src/com/fieldexpert/fbapi4j/common/Attachment.java // public class Attachment { // // static { // registerMimeDetector(ExtensionMimeDetector.class.getName()); // registerMimeDetector(MagicMimeMimeDetector.class.getName()); // } // // public static String getType(File file) { // Collection<?> types =...
import java.io.InputStream; import java.net.URL; import java.util.List; import java.util.Map; import com.fieldexpert.fbapi4j.common.Attachment;
package com.fieldexpert.fbapi4j.http; public class Http { public static final String GET = "GET"; public static final String POST = "POST"; public static InputStream get(URL url, Map<String, String> parameters) { return req(GET, url, parameters); } public static InputStream post(URL url, Map<String, String>...
// Path: src/com/fieldexpert/fbapi4j/common/Attachment.java // public class Attachment { // // static { // registerMimeDetector(ExtensionMimeDetector.class.getName()); // registerMimeDetector(MagicMimeMimeDetector.class.getName()); // } // // public static String getType(File file) { // Collection<?> types =...
public static InputStream post(URL url, Map<String, String> parameters, List<Attachment> attachments) {
fieldexpert/fbapi4j
test/com/fieldexpert/fbapi4j/SessionTest.java
// Path: src/com/fieldexpert/fbapi4j/Configuration.java // public final class Configuration { // // private static final String ENDPOINT = "endpoint"; // private static final String EMAIL = "email"; // private static final String PASSWORD = "password"; // private static final String PATH = "path"; // // private ...
import org.junit.Test; import com.fieldexpert.fbapi4j.Configuration; import com.fieldexpert.fbapi4j.Session;
package com.fieldexpert.fbapi4j; public class SessionTest { @Test public void neverConnects() {
// Path: src/com/fieldexpert/fbapi4j/Configuration.java // public final class Configuration { // // private static final String ENDPOINT = "endpoint"; // private static final String EMAIL = "email"; // private static final String PASSWORD = "password"; // private static final String PATH = "path"; // // private ...
Configuration config = new Configuration().configure();
fieldexpert/fbapi4j
test/com/fieldexpert/fbapi4j/SessionTest.java
// Path: src/com/fieldexpert/fbapi4j/Configuration.java // public final class Configuration { // // private static final String ENDPOINT = "endpoint"; // private static final String EMAIL = "email"; // private static final String PASSWORD = "password"; // private static final String PATH = "path"; // // private ...
import org.junit.Test; import com.fieldexpert.fbapi4j.Configuration; import com.fieldexpert.fbapi4j.Session;
package com.fieldexpert.fbapi4j; public class SessionTest { @Test public void neverConnects() { Configuration config = new Configuration().configure();
// Path: src/com/fieldexpert/fbapi4j/Configuration.java // public final class Configuration { // // private static final String ENDPOINT = "endpoint"; // private static final String EMAIL = "email"; // private static final String PASSWORD = "password"; // private static final String PATH = "path"; // // private ...
Session session = config.buildSession();
fieldexpert/fbapi4j
src/com/fieldexpert/fbapi4j/DefaultCaseBuilder.java
// Path: src/com/fieldexpert/fbapi4j/common/Attachment.java // public class Attachment { // // static { // registerMimeDetector(ExtensionMimeDetector.class.getName()); // registerMimeDetector(MagicMimeMimeDetector.class.getName()); // } // // public static String getType(File file) { // Collection<?> types =...
import java.io.PrintWriter; import java.io.StringWriter; import com.fieldexpert.fbapi4j.common.Attachment;
package com.fieldexpert.fbapi4j; public class DefaultCaseBuilder { private String project; private String area; public DefaultCaseBuilder(String project, String area) { this.project = project; this.area = area; } public Case build(Throwable t, boolean attachStackTrace) { StackTraceElement firstCause = ...
// Path: src/com/fieldexpert/fbapi4j/common/Attachment.java // public class Attachment { // // static { // registerMimeDetector(ExtensionMimeDetector.class.getName()); // registerMimeDetector(MagicMimeMimeDetector.class.getName()); // } // // public static String getType(File file) { // Collection<?> types =...
Attachment attachment = new Attachment(exceptionName + ".txt", "text/plain", stackTraceWriter.toString());
Project-Nyx/Nyx
src/main/java/org/projectnyx/network/ext/SharedServerSocket.java
// Path: src/main/java/org/projectnyx/network/ext/udp/SharedUdpServerSocket.java // public class SharedUdpServerSocket extends SharedServerSocket { // public final static String TYPE = "UDP"; // @Getter private final UdpBufferThread thread; // // private Task task; // private Map<InetSocketAddress, Udp...
import java.net.InetAddress; import java.net.InetSocketAddress; import lombok.Getter; import lombok.Value; import org.projectnyx.network.ext.udp.SharedUdpServerSocket;
/* * Nyx - Server software for Minecraft: PE and more * Copyright © boredphoton 2016 * * 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...
// Path: src/main/java/org/projectnyx/network/ext/udp/SharedUdpServerSocket.java // public class SharedUdpServerSocket extends SharedServerSocket { // public final static String TYPE = "UDP"; // @Getter private final UdpBufferThread thread; // // private Task task; // private Map<InetSocketAddress, Udp...
case SharedUdpServerSocket.TYPE:
Project-Nyx/Nyx
src/main/java/org/projectnyx/config/ConfigParser.java
// Path: src/main/java/org/projectnyx/properties/NyxConfig.java // public class NyxConfig extends ConfigElement { // /** // * The servers to launch // */ // public Servers servers; // }
import java.io.*; import lombok.Getter; import lombok.Setter; import lombok.SneakyThrows; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; import org.xmlpull.v1.XmlPullParserFactory; import org.projectnyx.properties.NyxConfig; import static org.xmlpull.v1.XmlPullParser.*;
/* * Nyx - Server software for Minecraft: PE and more * Copyright © boredphoton 2016 * * 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...
// Path: src/main/java/org/projectnyx/properties/NyxConfig.java // public class NyxConfig extends ConfigElement { // /** // * The servers to launch // */ // public Servers servers; // } // Path: src/main/java/org/projectnyx/config/ConfigParser.java import java.io.*; import lombok.Getter; import lomb...
@Getter @Setter private String packageContext = NyxConfig.class.getPackage().getName();
Project-Nyx/Nyx
src/main/java/org/projectnyx/network/mcpe/raknet/RawDataPacket.java
// Path: src/main/java/org/projectnyx/network/mcpe/ReceivedPacket.java // public abstract class ReceivedPacket extends ByteBufferReader implements Cloneable { // public void parse(ByteBuffer buffer) { // this.buffer = buffer; // buffer.order(ByteOrder.BIG_ENDIAN); // // decode(); // } /...
import java.nio.ByteBuffer; import org.projectnyx.network.mcpe.ReceivedPacket;
/* * Nyx - Server software for Minecraft: PE and more * Copyright © boredphoton 2016 * * 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...
// Path: src/main/java/org/projectnyx/network/mcpe/ReceivedPacket.java // public abstract class ReceivedPacket extends ByteBufferReader implements Cloneable { // public void parse(ByteBuffer buffer) { // this.buffer = buffer; // buffer.order(ByteOrder.BIG_ENDIAN); // // decode(); // } /...
public static RawDataPacket read(ReceivedPacket packet) {
Project-Nyx/Nyx
src/main/java/org/projectnyx/network/Protocol.java
// Path: src/main/java/org/projectnyx/network/ext/SessionHandler.java // @RequiredArgsConstructor // public abstract class SessionHandler { // @Getter private final InetSocketAddress address; // @Getter private final SharedServerSocket socket; // // public abstract void onReceive(PacketWithAddress pk); // ...
import org.projectnyx.network.ext.SessionHandler;
/* * Nyx - Server software for Minecraft: PE and more * Copyright © boredphoton 2016 * * 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...
// Path: src/main/java/org/projectnyx/network/ext/SessionHandler.java // @RequiredArgsConstructor // public abstract class SessionHandler { // @Getter private final InetSocketAddress address; // @Getter private final SharedServerSocket socket; // // public abstract void onReceive(PacketWithAddress pk); // ...
public abstract Client acceptSession(SessionHandler session);
Project-Nyx/Nyx
src/main/java/org/projectnyx/network/xml/Packet.java
// Path: src/main/java/org/projectnyx/token/request/Request.java // public class Request { // } // // Path: src/main/java/org/projectnyx/token/response/Response.java // public class Response { // }
import java.util.List; import org.projectnyx.config.DefaultPackage; import org.projectnyx.token.request.Request; import org.projectnyx.token.response.Response;
/* * Nyx - Server software for Minecraft: PE and more * Copyright © boredphoton 2016 * * 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...
// Path: src/main/java/org/projectnyx/token/request/Request.java // public class Request { // } // // Path: src/main/java/org/projectnyx/token/response/Response.java // public class Response { // } // Path: src/main/java/org/projectnyx/network/xml/Packet.java import java.util.List; import org.projectnyx.config.Defau...
@DefaultPackage("org.projectnyx.token.request") public List<Class<? extends Request>> tokenRequests;
Project-Nyx/Nyx
src/main/java/org/projectnyx/network/xml/Packet.java
// Path: src/main/java/org/projectnyx/token/request/Request.java // public class Request { // } // // Path: src/main/java/org/projectnyx/token/response/Response.java // public class Response { // }
import java.util.List; import org.projectnyx.config.DefaultPackage; import org.projectnyx.token.request.Request; import org.projectnyx.token.response.Response;
/* * Nyx - Server software for Minecraft: PE and more * Copyright © boredphoton 2016 * * 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...
// Path: src/main/java/org/projectnyx/token/request/Request.java // public class Request { // } // // Path: src/main/java/org/projectnyx/token/response/Response.java // public class Response { // } // Path: src/main/java/org/projectnyx/network/xml/Packet.java import java.util.List; import org.projectnyx.config.Defau...
@DefaultPackage("org.projectnyx.token.response") public List<Class<? extends Response>> tokenResponses;
Project-Nyx/Nyx
src/main/java/org/projectnyx/network/Client.java
// Path: src/main/java/org/projectnyx/network/ext/SessionHandler.java // @RequiredArgsConstructor // public abstract class SessionHandler { // @Getter private final InetSocketAddress address; // @Getter private final SharedServerSocket socket; // // public abstract void onReceive(PacketWithAddress pk); // ...
import java.net.InetSocketAddress; import java.nio.ByteBuffer; import lombok.Getter; import org.projectnyx.network.ext.SessionHandler; import org.projectnyx.network.mcpe.PingStats; import org.projectnyx.player.Player;
/* * Nyx - Server software for Minecraft: PE and more * Copyright © boredphoton 2016 * * 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...
// Path: src/main/java/org/projectnyx/network/ext/SessionHandler.java // @RequiredArgsConstructor // public abstract class SessionHandler { // @Getter private final InetSocketAddress address; // @Getter private final SharedServerSocket socket; // // public abstract void onReceive(PacketWithAddress pk); // ...
@Getter private PingStats pingStats;
Project-Nyx/Nyx
src/main/java/org/projectnyx/network/Client.java
// Path: src/main/java/org/projectnyx/network/ext/SessionHandler.java // @RequiredArgsConstructor // public abstract class SessionHandler { // @Getter private final InetSocketAddress address; // @Getter private final SharedServerSocket socket; // // public abstract void onReceive(PacketWithAddress pk); // ...
import java.net.InetSocketAddress; import java.nio.ByteBuffer; import lombok.Getter; import org.projectnyx.network.ext.SessionHandler; import org.projectnyx.network.mcpe.PingStats; import org.projectnyx.player.Player;
/* * Nyx - Server software for Minecraft: PE and more * Copyright © boredphoton 2016 * * 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...
// Path: src/main/java/org/projectnyx/network/ext/SessionHandler.java // @RequiredArgsConstructor // public abstract class SessionHandler { // @Getter private final InetSocketAddress address; // @Getter private final SharedServerSocket socket; // // public abstract void onReceive(PacketWithAddress pk); // ...
public abstract SessionHandler getSessionHandler();
Project-Nyx/Nyx
src/main/java/org/projectnyx/network/mcpe/raknet/raknet/ReceivedDataPacketGroup.java
// Path: src/main/java/org/projectnyx/network/mcpe/ReceivedPacket.java // public abstract class ReceivedPacket extends ByteBufferReader implements Cloneable { // public void parse(ByteBuffer buffer) { // this.buffer = buffer; // buffer.order(ByteOrder.BIG_ENDIAN); // // decode(); // } /...
import java.util.ArrayList; import java.util.List; import lombok.RequiredArgsConstructor; import org.projectnyx.network.mcpe.ReceivedPacket; import org.projectnyx.network.mcpe.raknet.RawDataPacket;
/* * Nyx - Server software for Minecraft: PE and more * Copyright © boredphoton 2016 * * 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...
// Path: src/main/java/org/projectnyx/network/mcpe/ReceivedPacket.java // public abstract class ReceivedPacket extends ByteBufferReader implements Cloneable { // public void parse(ByteBuffer buffer) { // this.buffer = buffer; // buffer.order(ByteOrder.BIG_ENDIAN); // // decode(); // } /...
public List<RawDataPacket> packets = new ArrayList<>();
Project-Nyx/Nyx
src/main/java/org/projectnyx/network/ext/udp/UdpBufferThread.java
// Path: src/main/java/org/projectnyx/network/ext/PacketWithAddress.java // public class PacketWithAddress { // @Getter private final ByteBuffer buffer; // @Getter private final InetSocketAddress address; // // /** // * The buffer will be automatically flipped if the position is not at 0 // * // ...
import java.io.IOException; import java.net.DatagramSocket; import java.net.InetSocketAddress; import java.nio.ByteBuffer; import java.nio.channels.DatagramChannel; import java.util.LinkedList; import java.util.List; import lombok.RequiredArgsConstructor; import org.projectnyx.network.ext.PacketWithAddress;
/* * Nyx - Server software for Minecraft: PE and more * Copyright © boredphoton 2016 * * 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...
// Path: src/main/java/org/projectnyx/network/ext/PacketWithAddress.java // public class PacketWithAddress { // @Getter private final ByteBuffer buffer; // @Getter private final InetSocketAddress address; // // /** // * The buffer will be automatically flipped if the position is not at 0 // * // ...
private final List<PacketWithAddress> receive = new LinkedList<>();
Project-Nyx/Nyx
src/main/java/org/projectnyx/network/ext/SharedSocketPool.java
// Path: src/main/java/org/projectnyx/network/ext/SharedServerSocket.java // @Value // public static class Identifier { // String type; // InetAddress address; // int port; // // public SharedServerSocket create() { // switch(type) { // case SharedUdpServerSocket.TYPE: // ...
import java.util.HashMap; import java.util.Map; import lombok.Getter; import lombok.NonNull; import org.projectnyx.network.ext.SharedServerSocket.Identifier;
/* * Nyx - Server software for Minecraft: PE and more * Copyright © boredphoton 2016 * * 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...
// Path: src/main/java/org/projectnyx/network/ext/SharedServerSocket.java // @Value // public static class Identifier { // String type; // InetAddress address; // int port; // // public SharedServerSocket create() { // switch(type) { // case SharedUdpServerSocket.TYPE: // ...
private Map<Identifier, SharedServerSocket> sockets = new HashMap<>();
Project-Nyx/Nyx
src/main/java/org/projectnyx/command/CommandManager.java
// Path: src/main/java/org/projectnyx/command/impl/StopCommand.java // public class StopCommand extends Command { // public StopCommand() { // super("stop"); // } // // @Override // protected void run() { // Nyx.getInstance().shutdown(); // } // }
import java.util.HashMap; import java.util.Map; import lombok.Getter; import org.projectnyx.command.impl.StopCommand;
/* * Nyx - Server software for Minecraft: PE and more * Copyright © boredphoton 2016 * * 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...
// Path: src/main/java/org/projectnyx/command/impl/StopCommand.java // public class StopCommand extends Command { // public StopCommand() { // super("stop"); // } // // @Override // protected void run() { // Nyx.getInstance().shutdown(); // } // } // Path: src/main/java/org/projec...
registerCommand(new StopCommand());
Project-Nyx/Nyx
src/main/java/org/projectnyx/network/NetworkManager.java
// Path: src/main/java/org/projectnyx/module/ModuleManager.java // public abstract class ModuleManager<T> { // private final Class<T> myClass; // @Getter(lazy = true) private final String moduleTypeName = moduleType(); // @Getter private Map<String, T> modules = new HashMap<>(); // // protected abstrac...
import javax.validation.constraints.NotNull; import lombok.Getter; import lombok.Setter; import org.projectnyx.module.ModuleManager; import org.projectnyx.network.ext.SessionHandler; import org.projectnyx.network.ext.SharedSocketPool;
/* * Nyx - Server software for Minecraft: PE and more * Copyright © boredphoton 2016 * * 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...
// Path: src/main/java/org/projectnyx/module/ModuleManager.java // public abstract class ModuleManager<T> { // private final Class<T> myClass; // @Getter(lazy = true) private final String moduleTypeName = moduleType(); // @Getter private Map<String, T> modules = new HashMap<>(); // // protected abstrac...
private final SharedSocketPool sockets = new SharedSocketPool();
Project-Nyx/Nyx
src/main/java/org/projectnyx/network/NetworkManager.java
// Path: src/main/java/org/projectnyx/module/ModuleManager.java // public abstract class ModuleManager<T> { // private final Class<T> myClass; // @Getter(lazy = true) private final String moduleTypeName = moduleType(); // @Getter private Map<String, T> modules = new HashMap<>(); // // protected abstrac...
import javax.validation.constraints.NotNull; import lombok.Getter; import lombok.Setter; import org.projectnyx.module.ModuleManager; import org.projectnyx.network.ext.SessionHandler; import org.projectnyx.network.ext.SharedSocketPool;
/* * Nyx - Server software for Minecraft: PE and more * Copyright © boredphoton 2016 * * 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...
// Path: src/main/java/org/projectnyx/module/ModuleManager.java // public abstract class ModuleManager<T> { // private final Class<T> myClass; // @Getter(lazy = true) private final String moduleTypeName = moduleType(); // @Getter private Map<String, T> modules = new HashMap<>(); // // protected abstrac...
public Client adoptSession(SessionHandler session) {
Project-Nyx/Nyx
src/main/java/org/projectnyx/network/ext/SessionHandler.java
// Path: src/main/java/org/projectnyx/network/Protocol.java // public abstract class Protocol { // protected Protocol() { // init(); // } // // public abstract void init(); // // public abstract Client acceptSession(SessionHandler session); // // public abstract String getName(); // }
import java.net.InetSocketAddress; import java.nio.ByteBuffer; import lombok.Getter; import lombok.RequiredArgsConstructor; import org.projectnyx.network.Protocol;
/* * Nyx - Server software for Minecraft: PE and more * Copyright © boredphoton 2016 * * 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...
// Path: src/main/java/org/projectnyx/network/Protocol.java // public abstract class Protocol { // protected Protocol() { // init(); // } // // public abstract void init(); // // public abstract Client acceptSession(SessionHandler session); // // public abstract String getName(); // } /...
public abstract Protocol getProtocol();
rolandkrueger/user-microservice
service/src/test/java/info/rolandkrueger/userservice/service/UserDetailServiceImplTest.java
// Path: service/src/main/java/info/rolandkrueger/userservice/UserMicroserviceApplication.java // @SpringBootApplication // @PropertySource("userservice.properties") // public class UserMicroserviceApplication { // // public static void main(String[] args) { // SpringApplication.run( // new...
import info.rolandkrueger.userservice.UserMicroserviceApplication; import info.rolandkrueger.userservice.api.service.StaticEndpointProvider; import info.rolandkrueger.userservice.api.service.UserDetailServiceImpl; import info.rolandkrueger.userservice.testsupport.AbstractRestControllerTest; import org.junit.Before; imp...
package info.rolandkrueger.userservice.service; /** * @author Roland Krüger */ @RunWith(SpringJUnit4ClassRunner.class) @SpringApplicationConfiguration(classes = UserMicroserviceApplication.class) @WebIntegrationTest(randomPort = true)
// Path: service/src/main/java/info/rolandkrueger/userservice/UserMicroserviceApplication.java // @SpringBootApplication // @PropertySource("userservice.properties") // public class UserMicroserviceApplication { // // public static void main(String[] args) { // SpringApplication.run( // new...
public class UserDetailServiceImplTest extends AbstractRestControllerTest {
rolandkrueger/user-microservice
service/src/test/java/info/rolandkrueger/userservice/service/UserDetailServiceImplTest.java
// Path: service/src/main/java/info/rolandkrueger/userservice/UserMicroserviceApplication.java // @SpringBootApplication // @PropertySource("userservice.properties") // public class UserMicroserviceApplication { // // public static void main(String[] args) { // SpringApplication.run( // new...
import info.rolandkrueger.userservice.UserMicroserviceApplication; import info.rolandkrueger.userservice.api.service.StaticEndpointProvider; import info.rolandkrueger.userservice.api.service.UserDetailServiceImpl; import info.rolandkrueger.userservice.testsupport.AbstractRestControllerTest; import org.junit.Before; imp...
package info.rolandkrueger.userservice.service; /** * @author Roland Krüger */ @RunWith(SpringJUnit4ClassRunner.class) @SpringApplicationConfiguration(classes = UserMicroserviceApplication.class) @WebIntegrationTest(randomPort = true) public class UserDetailServiceImplTest extends AbstractRestControllerTest {
// Path: service/src/main/java/info/rolandkrueger/userservice/UserMicroserviceApplication.java // @SpringBootApplication // @PropertySource("userservice.properties") // public class UserMicroserviceApplication { // // public static void main(String[] args) { // SpringApplication.run( // new...
private UserDetailServiceImpl userDetailService;
rolandkrueger/user-microservice
service/src/test/java/info/rolandkrueger/userservice/service/UserDetailServiceImplTest.java
// Path: service/src/main/java/info/rolandkrueger/userservice/UserMicroserviceApplication.java // @SpringBootApplication // @PropertySource("userservice.properties") // public class UserMicroserviceApplication { // // public static void main(String[] args) { // SpringApplication.run( // new...
import info.rolandkrueger.userservice.UserMicroserviceApplication; import info.rolandkrueger.userservice.api.service.StaticEndpointProvider; import info.rolandkrueger.userservice.api.service.UserDetailServiceImpl; import info.rolandkrueger.userservice.testsupport.AbstractRestControllerTest; import org.junit.Before; imp...
package info.rolandkrueger.userservice.service; /** * @author Roland Krüger */ @RunWith(SpringJUnit4ClassRunner.class) @SpringApplicationConfiguration(classes = UserMicroserviceApplication.class) @WebIntegrationTest(randomPort = true) public class UserDetailServiceImplTest extends AbstractRestControllerTest { ...
// Path: service/src/main/java/info/rolandkrueger/userservice/UserMicroserviceApplication.java // @SpringBootApplication // @PropertySource("userservice.properties") // public class UserMicroserviceApplication { // // public static void main(String[] args) { // SpringApplication.run( // new...
private StaticEndpointProvider endpointProvider;
rolandkrueger/user-microservice
public-api/src/main/java/info/rolandkrueger/userservice/api/UserServiceAPI.java
// Path: public-api/src/main/java/info/rolandkrueger/userservice/api/resources/UserService.java // public class UserService extends EmptyResource { // // private Link authoritiesLink; // private Link usersLink; // private Link registrationsLink; // // public UserService(Link self) { // super(s...
import info.rolandkrueger.userservice.api.resources.UserService; import org.springframework.hateoas.Link;
package info.rolandkrueger.userservice.api; /** * Main class for the user service public API. Use this class to get a handle on the service's root resource * represented by class {@link UserService}. Using this handle, you can navigate through the whole service through * a fluent API. * * @author Roland Krüger ...
// Path: public-api/src/main/java/info/rolandkrueger/userservice/api/resources/UserService.java // public class UserService extends EmptyResource { // // private Link authoritiesLink; // private Link usersLink; // private Link registrationsLink; // // public UserService(Link self) { // super(s...
public static UserService init(String targetURI) {
rolandkrueger/user-microservice
public-api/src/main/java/info/rolandkrueger/userservice/api/_internal/AbstractPagedResource.java
// Path: public-api/src/main/java/info/rolandkrueger/userservice/api/_internal/model/AbstractBaseApiData.java // public abstract class AbstractBaseApiData<R extends AbstractResource> { // private Collection<Link> links; // // /** // * Creates a new resource object for this data type. The method uses the s...
import com.google.common.base.Joiner; import com.google.common.base.MoreObjects; import com.google.common.base.Preconditions; import info.rolandkrueger.userservice.api._internal.model.AbstractBaseApiData; import info.rolandkrueger.userservice.api.enums.SortDirection; import org.springframework.core.ParameterizedTypeRef...
package info.rolandkrueger.userservice.api._internal; /** * A REST collection resource that allows to page through the list of entities. This class adds methods to the general * {@link AbstractResource} interface supporting paging and sorting the collection resource's data. * <p/> * When you create a sub-class f...
// Path: public-api/src/main/java/info/rolandkrueger/userservice/api/_internal/model/AbstractBaseApiData.java // public abstract class AbstractBaseApiData<R extends AbstractResource> { // private Collection<Link> links; // // /** // * Creates a new resource object for this data type. The method uses the s...
public final R goToPageSorted(Integer page, Integer size, String sortByProperty, SortDirection direction) {