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 |
|---|---|---|---|---|---|---|
alexgamas/treinamento-spring-boot | treinamento_5/src/main/java/br/com/gamas/treinamento/repository/UsuarioRepository.java | // Path: treinamento_5/src/main/java/br/com/gamas/treinamento/model/Usuario.java
// @Entity
// @Table(name = "usuario")
// public class Usuario implements UserDetails{
//
// private static final long serialVersionUID = 3317339439073208844L;
//
// @Id
// @GeneratedValue(strategy = GenerationType.IDENTITY)
// ... | import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.TypedQuery;
import org.springframework.stereotype.Repository;
import org.springframework.util.CollectionUtils;
import br.com.gamas.treinamento.model.Usuario; | package br.com.gamas.treinamento.repository;
@Repository
public class UsuarioRepository {
@PersistenceContext
private EntityManager em;
| // Path: treinamento_5/src/main/java/br/com/gamas/treinamento/model/Usuario.java
// @Entity
// @Table(name = "usuario")
// public class Usuario implements UserDetails{
//
// private static final long serialVersionUID = 3317339439073208844L;
//
// @Id
// @GeneratedValue(strategy = GenerationType.IDENTITY)
// ... | public Usuario loadUserByUsername(String username) { |
jboz/plantuml-builder | src/main/java/ch/ifocusit/plantuml/classdiagram/model/attribute/Attribute.java | // Path: src/main/java/ch/ifocusit/plantuml/classdiagram/model/Link.java
// public class Link {
// private String url;
// private String label;
//
// public String getUrl() {
// return url;
// }
//
// public void setUrl(String url) {
// this.url = url;
// }
//
// public St... | import ch.ifocusit.plantuml.classdiagram.model.Link;
import java.util.Optional; | /*-
* Plantuml builder
*
* Copyright (C) 2017 Focus IT
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you unde... | // Path: src/main/java/ch/ifocusit/plantuml/classdiagram/model/Link.java
// public class Link {
// private String url;
// private String label;
//
// public String getUrl() {
// return url;
// }
//
// public void setUrl(String url) {
// this.url = url;
// }
//
// public St... | default public Optional<Link> getLink() { |
jboz/plantuml-builder | src/main/java/ch/ifocusit/plantuml/classdiagram/model/method/Method.java | // Path: src/main/java/ch/ifocusit/plantuml/classdiagram/model/Link.java
// public class Link {
// private String url;
// private String label;
//
// public String getUrl() {
// return url;
// }
//
// public void setUrl(String url) {
// this.url = url;
// }
//
// public St... | import ch.ifocusit.plantuml.classdiagram.model.Link;
import ch.ifocusit.plantuml.classdiagram.model.attribute.MethodAttribute;
import java.util.Optional; | /*-
* Plantuml builder
*
* Copyright (C) 2017 Focus IT
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you unde... | // Path: src/main/java/ch/ifocusit/plantuml/classdiagram/model/Link.java
// public class Link {
// private String url;
// private String label;
//
// public String getUrl() {
// return url;
// }
//
// public void setUrl(String url) {
// this.url = url;
// }
//
// public St... | public Optional<MethodAttribute[]> getParameters(); |
jboz/plantuml-builder | src/main/java/ch/ifocusit/plantuml/classdiagram/model/method/Method.java | // Path: src/main/java/ch/ifocusit/plantuml/classdiagram/model/Link.java
// public class Link {
// private String url;
// private String label;
//
// public String getUrl() {
// return url;
// }
//
// public void setUrl(String url) {
// this.url = url;
// }
//
// public St... | import ch.ifocusit.plantuml.classdiagram.model.Link;
import ch.ifocusit.plantuml.classdiagram.model.attribute.MethodAttribute;
import java.util.Optional; | /*-
* Plantuml builder
*
* Copyright (C) 2017 Focus IT
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you unde... | // Path: src/main/java/ch/ifocusit/plantuml/classdiagram/model/Link.java
// public class Link {
// private String url;
// private String label;
//
// public String getUrl() {
// return url;
// }
//
// public void setUrl(String url) {
// this.url = url;
// }
//
// public St... | default public Optional<Link> getLink() { |
jboz/plantuml-builder | src/main/java/ch/ifocusit/plantuml/classdiagram/model/clazz/Clazz.java | // Path: src/main/java/ch/ifocusit/plantuml/classdiagram/model/Link.java
// public class Link {
// private String url;
// private String label;
//
// public String getUrl() {
// return url;
// }
//
// public void setUrl(String url) {
// this.url = url;
// }
//
// public St... | import ch.ifocusit.plantuml.classdiagram.model.Link;
import ch.ifocusit.plantuml.classdiagram.model.method.Method;
import ch.ifocusit.plantuml.classdiagram.model.attribute.Attribute;
import org.apache.commons.lang3.Validate;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional; | /*-
* Plantuml builder
*
* Copyright (C) 2017 Focus IT
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you unde... | // Path: src/main/java/ch/ifocusit/plantuml/classdiagram/model/Link.java
// public class Link {
// private String url;
// private String label;
//
// public String getUrl() {
// return url;
// }
//
// public void setUrl(String url) {
// this.url = url;
// }
//
// public St... | default public Optional<Link> getLink() { |
jboz/plantuml-builder | src/main/java/ch/ifocusit/plantuml/classdiagram/model/clazz/Clazz.java | // Path: src/main/java/ch/ifocusit/plantuml/classdiagram/model/Link.java
// public class Link {
// private String url;
// private String label;
//
// public String getUrl() {
// return url;
// }
//
// public void setUrl(String url) {
// this.url = url;
// }
//
// public St... | import ch.ifocusit.plantuml.classdiagram.model.Link;
import ch.ifocusit.plantuml.classdiagram.model.method.Method;
import ch.ifocusit.plantuml.classdiagram.model.attribute.Attribute;
import org.apache.commons.lang3.Validate;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional; | /*-
* Plantuml builder
*
* Copyright (C) 2017 Focus IT
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you unde... | // Path: src/main/java/ch/ifocusit/plantuml/classdiagram/model/Link.java
// public class Link {
// private String url;
// private String label;
//
// public String getUrl() {
// return url;
// }
//
// public void setUrl(String url) {
// this.url = url;
// }
//
// public St... | public List<? extends Attribute> getAttributes(); |
jboz/plantuml-builder | src/main/java/ch/ifocusit/plantuml/classdiagram/model/clazz/Clazz.java | // Path: src/main/java/ch/ifocusit/plantuml/classdiagram/model/Link.java
// public class Link {
// private String url;
// private String label;
//
// public String getUrl() {
// return url;
// }
//
// public void setUrl(String url) {
// this.url = url;
// }
//
// public St... | import ch.ifocusit.plantuml.classdiagram.model.Link;
import ch.ifocusit.plantuml.classdiagram.model.method.Method;
import ch.ifocusit.plantuml.classdiagram.model.attribute.Attribute;
import org.apache.commons.lang3.Validate;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional; | /*-
* Plantuml builder
*
* Copyright (C) 2017 Focus IT
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you unde... | // Path: src/main/java/ch/ifocusit/plantuml/classdiagram/model/Link.java
// public class Link {
// private String url;
// private String label;
//
// public String getUrl() {
// return url;
// }
//
// public void setUrl(String url) {
// this.url = url;
// }
//
// public St... | default public List<? extends Method> getMethods() { |
jboz/plantuml-builder | src/test/java/ch/ifocusit/plantuml/test/helper/domain/Driver.java | // Path: src/test/java/ch/ifocusit/plantuml/test/helper/domain/material/Car.java
// @Machine
// public class Car implements Vehicule {
//
// @Machine
// // must be ignored
// private Long ignored;
// @Machine
// private String brand;
// @Machine
// private String model;
//
// private S... | import ch.ifocusit.plantuml.test.helper.domain.material.Car;
import java.util.ArrayList;
import java.util.List; | /*-
* Plantuml builder
*
* Copyright (C) 2017 Focus IT
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you unde... | // Path: src/test/java/ch/ifocusit/plantuml/test/helper/domain/material/Car.java
// @Machine
// public class Car implements Vehicule {
//
// @Machine
// // must be ignored
// private Long ignored;
// @Machine
// private String brand;
// @Machine
// private String model;
//
// private S... | private List<Car> cars = new ArrayList<>(); |
jboz/plantuml-builder | src/test/java/ch/ifocusit/plantuml/PlantUmlBuilderTest.java | // Path: src/main/java/ch/ifocusit/plantuml/classdiagram/model/Association.java
// public enum AssociationType {
//
// LINK("-"),
// DIRECTION("-->"),
// BI_DIRECTION("<->"),
// INHERITANCE("<|--");
//
// private String symbol;
//
// AssociationType(String symbol) {
// this.symbol = s... | import ch.ifocusit.plantuml.classdiagram.model.Association.AssociationType;
import ch.ifocusit.plantuml.classdiagram.model.Cardinality;
import ch.ifocusit.plantuml.classdiagram.model.attribute.SimpleAttribute;
import ch.ifocusit.plantuml.classdiagram.model.clazz.Clazz;
import ch.ifocusit.plantuml.classdiagram.model.cla... | /*-
* Plantuml builder
*
* Copyright (C) 2017 Focus IT
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you unde... | // Path: src/main/java/ch/ifocusit/plantuml/classdiagram/model/Association.java
// public enum AssociationType {
//
// LINK("-"),
// DIRECTION("-->"),
// BI_DIRECTION("<->"),
// INHERITANCE("<|--");
//
// private String symbol;
//
// AssociationType(String symbol) {
// this.symbol = s... | final String diagram = new PlantUmlBuilder().addType(SimpleClazz.create("Vehicule", Clazz.Type.INTERFACE)).build(); |
jboz/plantuml-builder | src/test/java/ch/ifocusit/plantuml/PlantUmlBuilderTest.java | // Path: src/main/java/ch/ifocusit/plantuml/classdiagram/model/Association.java
// public enum AssociationType {
//
// LINK("-"),
// DIRECTION("-->"),
// BI_DIRECTION("<->"),
// INHERITANCE("<|--");
//
// private String symbol;
//
// AssociationType(String symbol) {
// this.symbol = s... | import ch.ifocusit.plantuml.classdiagram.model.Association.AssociationType;
import ch.ifocusit.plantuml.classdiagram.model.Cardinality;
import ch.ifocusit.plantuml.classdiagram.model.attribute.SimpleAttribute;
import ch.ifocusit.plantuml.classdiagram.model.clazz.Clazz;
import ch.ifocusit.plantuml.classdiagram.model.cla... | /*-
* Plantuml builder
*
* Copyright (C) 2017 Focus IT
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you unde... | // Path: src/main/java/ch/ifocusit/plantuml/classdiagram/model/Association.java
// public enum AssociationType {
//
// LINK("-"),
// DIRECTION("-->"),
// BI_DIRECTION("<->"),
// INHERITANCE("<|--");
//
// private String symbol;
//
// AssociationType(String symbol) {
// this.symbol = s... | final String diagram = new PlantUmlBuilder().addType(SimpleClazz.create("Vehicule", Clazz.Type.INTERFACE)).build(); |
jboz/plantuml-builder | src/test/java/ch/ifocusit/plantuml/PlantUmlBuilderTest.java | // Path: src/main/java/ch/ifocusit/plantuml/classdiagram/model/Association.java
// public enum AssociationType {
//
// LINK("-"),
// DIRECTION("-->"),
// BI_DIRECTION("<->"),
// INHERITANCE("<|--");
//
// private String symbol;
//
// AssociationType(String symbol) {
// this.symbol = s... | import ch.ifocusit.plantuml.classdiagram.model.Association.AssociationType;
import ch.ifocusit.plantuml.classdiagram.model.Cardinality;
import ch.ifocusit.plantuml.classdiagram.model.attribute.SimpleAttribute;
import ch.ifocusit.plantuml.classdiagram.model.clazz.Clazz;
import ch.ifocusit.plantuml.classdiagram.model.cla... | /*-
* Plantuml builder
*
* Copyright (C) 2017 Focus IT
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you unde... | // Path: src/main/java/ch/ifocusit/plantuml/classdiagram/model/Association.java
// public enum AssociationType {
//
// LINK("-"),
// DIRECTION("-->"),
// BI_DIRECTION("<->"),
// INHERITANCE("<|--");
//
// private String symbol;
//
// AssociationType(String symbol) {
// this.symbol = s... | new SimpleAttribute("brand", "String"), |
jboz/plantuml-builder | src/test/java/ch/ifocusit/plantuml/PlantUmlBuilderTest.java | // Path: src/main/java/ch/ifocusit/plantuml/classdiagram/model/Association.java
// public enum AssociationType {
//
// LINK("-"),
// DIRECTION("-->"),
// BI_DIRECTION("<->"),
// INHERITANCE("<|--");
//
// private String symbol;
//
// AssociationType(String symbol) {
// this.symbol = s... | import ch.ifocusit.plantuml.classdiagram.model.Association.AssociationType;
import ch.ifocusit.plantuml.classdiagram.model.Cardinality;
import ch.ifocusit.plantuml.classdiagram.model.attribute.SimpleAttribute;
import ch.ifocusit.plantuml.classdiagram.model.clazz.Clazz;
import ch.ifocusit.plantuml.classdiagram.model.cla... | .addType(SimpleClazz.create("Car", Clazz.Type.CLASS,
new SimpleAttribute("brand", "String"),
new SimpleAttribute("wheels", "Collection<Wheel>")))
.build();
assertThat(diagram).isEqualTo("class \"Car\" {" + CR +
" b... | // Path: src/main/java/ch/ifocusit/plantuml/classdiagram/model/Association.java
// public enum AssociationType {
//
// LINK("-"),
// DIRECTION("-->"),
// BI_DIRECTION("<->"),
// INHERITANCE("<|--");
//
// private String symbol;
//
// AssociationType(String symbol) {
// this.symbol = s... | .addAssociation("Vehicule", "Car", AssociationType.INHERITANCE) |
jboz/plantuml-builder | src/test/java/ch/ifocusit/plantuml/PlantUmlBuilderTest.java | // Path: src/main/java/ch/ifocusit/plantuml/classdiagram/model/Association.java
// public enum AssociationType {
//
// LINK("-"),
// DIRECTION("-->"),
// BI_DIRECTION("<->"),
// INHERITANCE("<|--");
//
// private String symbol;
//
// AssociationType(String symbol) {
// this.symbol = s... | import ch.ifocusit.plantuml.classdiagram.model.Association.AssociationType;
import ch.ifocusit.plantuml.classdiagram.model.Cardinality;
import ch.ifocusit.plantuml.classdiagram.model.attribute.SimpleAttribute;
import ch.ifocusit.plantuml.classdiagram.model.clazz.Clazz;
import ch.ifocusit.plantuml.classdiagram.model.cla... | new SimpleAttribute("wheels", "Collection<Wheel>")))
.build();
assertThat(diagram).isEqualTo("class \"Car\" {" + CR +
" brand : String" + CR +
" wheels : Collection<Wheel>" + CR +
"}" + CR + CR);
}
@Test
publ... | // Path: src/main/java/ch/ifocusit/plantuml/classdiagram/model/Association.java
// public enum AssociationType {
//
// LINK("-"),
// DIRECTION("-->"),
// BI_DIRECTION("<->"),
// INHERITANCE("<|--");
//
// private String symbol;
//
// AssociationType(String symbol) {
// this.symbol = s... | .addAssociation("Car", "Wheel", AssociationType.DIRECTION, "wheels", Cardinality.NONE, Cardinality.MANY) |
jboz/plantuml-builder | src/main/java/ch/ifocusit/plantuml/classdiagram/model/clazz/SimpleClazz.java | // Path: src/main/java/ch/ifocusit/plantuml/classdiagram/model/attribute/Attribute.java
// public interface Attribute {
//
// public Optional<String> getTypeName();
//
// public String getName();
//
// default public Optional<Link> getLink() {
// return Optional.empty();
// }
// }
| import ch.ifocusit.plantuml.classdiagram.model.attribute.Attribute;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Stream; | /*-
* Plantuml builder
*
* Copyright (C) 2017 Focus IT
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you unde... | // Path: src/main/java/ch/ifocusit/plantuml/classdiagram/model/attribute/Attribute.java
// public interface Attribute {
//
// public Optional<String> getTypeName();
//
// public String getName();
//
// default public Optional<Link> getLink() {
// return Optional.empty();
// }
// }
// Path: ... | private List<Attribute> attributes = new ArrayList<>(); |
jboz/plantuml-builder | src/test/java/ch/ifocusit/plantuml/test/helper/domain/material/Car.java | // Path: src/test/java/ch/ifocusit/plantuml/test/helper/domain/Devise.java
// public enum Devise {
// CHF, EUR, USD
// }
//
// Path: src/test/java/ch/ifocusit/plantuml/test/helper/domain/Driver.java
// public class Driver {
// private String name;
// private Long ignored;
// private List<Car> cars = ne... | import java.util.HashSet;
import java.util.Set;
import ch.ifocusit.plantuml.test.helper.domain.Devise;
import ch.ifocusit.plantuml.test.helper.domain.Driver;
import ch.ifocusit.plantuml.test.helper.domain.Price;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuild... | /*-
* Plantuml builder
*
* Copyright (C) 2017 Focus IT
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you unde... | // Path: src/test/java/ch/ifocusit/plantuml/test/helper/domain/Devise.java
// public enum Devise {
// CHF, EUR, USD
// }
//
// Path: src/test/java/ch/ifocusit/plantuml/test/helper/domain/Driver.java
// public class Driver {
// private String name;
// private Long ignored;
// private List<Car> cars = ne... | private Set<Driver> drivers = new HashSet<>(); |
jboz/plantuml-builder | src/test/java/ch/ifocusit/plantuml/test/helper/domain/material/Car.java | // Path: src/test/java/ch/ifocusit/plantuml/test/helper/domain/Devise.java
// public enum Devise {
// CHF, EUR, USD
// }
//
// Path: src/test/java/ch/ifocusit/plantuml/test/helper/domain/Driver.java
// public class Driver {
// private String name;
// private Long ignored;
// private List<Car> cars = ne... | import java.util.HashSet;
import java.util.Set;
import ch.ifocusit.plantuml.test.helper.domain.Devise;
import ch.ifocusit.plantuml.test.helper.domain.Driver;
import ch.ifocusit.plantuml.test.helper.domain.Price;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuild... | /*-
* Plantuml builder
*
* Copyright (C) 2017 Focus IT
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you unde... | // Path: src/test/java/ch/ifocusit/plantuml/test/helper/domain/Devise.java
// public enum Devise {
// CHF, EUR, USD
// }
//
// Path: src/test/java/ch/ifocusit/plantuml/test/helper/domain/Driver.java
// public class Driver {
// private String name;
// private Long ignored;
// private List<Car> cars = ne... | private Price price; |
jboz/plantuml-builder | src/test/java/ch/ifocusit/plantuml/test/helper/domain/material/Car.java | // Path: src/test/java/ch/ifocusit/plantuml/test/helper/domain/Devise.java
// public enum Devise {
// CHF, EUR, USD
// }
//
// Path: src/test/java/ch/ifocusit/plantuml/test/helper/domain/Driver.java
// public class Driver {
// private String name;
// private Long ignored;
// private List<Car> cars = ne... | import java.util.HashSet;
import java.util.Set;
import ch.ifocusit.plantuml.test.helper.domain.Devise;
import ch.ifocusit.plantuml.test.helper.domain.Driver;
import ch.ifocusit.plantuml.test.helper.domain.Price;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuild... | /*-
* Plantuml builder
*
* Copyright (C) 2017 Focus IT
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you unde... | // Path: src/test/java/ch/ifocusit/plantuml/test/helper/domain/Devise.java
// public enum Devise {
// CHF, EUR, USD
// }
//
// Path: src/test/java/ch/ifocusit/plantuml/test/helper/domain/Driver.java
// public class Driver {
// private String name;
// private Long ignored;
// private List<Car> cars = ne... | public Driver buyBy(Driver driver, BigDecimal amount, Devise devise) { |
ivanpribela/svetovid-lib | src/org/svetovid/util/JsonHelper.java | // Path: src/org/svetovid/SvetovidFormatException.java
// public class SvetovidFormatException extends SvetovidException {
//
// private static final long serialVersionUID = 1829394491209593218L;
//
// /**
// * Constructs a {@code SvetovidFormatException} with the specified message.
// *
// ... | import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.svetovid.SvetovidFormatException;
| Map<String, Object> map = (Map<String, Object>) object;
return map;
} catch (ClassCastException e) {
throw new SvetovidJsonException(JsonType.OBJECT,
object.getClass(), path);
}
}
/**
* Returns the raw object at the specified... | // Path: src/org/svetovid/SvetovidFormatException.java
// public class SvetovidFormatException extends SvetovidException {
//
// private static final long serialVersionUID = 1829394491209593218L;
//
// /**
// * Constructs a {@code SvetovidFormatException} with the specified message.
// *
// ... | throws SvetovidFormatException, SvetovidJsonException {
|
ivanpribela/svetovid-lib | src/org/svetovid/run/SvetovidJvmProcessBuilder.java | // Path: src/org/svetovid/io/SvetovidProcess.java
// public class SvetovidProcess {
//
// public final Process process;
// public final SvetovidWriter in;
// public final SvetovidReader out;
// public final SvetovidReader err;
//
// public SvetovidProcess(Process process) {
// this... | import java.io.File;
import java.io.IOException;
import java.lang.ProcessBuilder.Redirect;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.svetovid.io.SvetovidProcess;
import org.svetovid.util.CompoundList;
| /*
* Copyright 2015 Ivan Pribela
*
* 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 ... | // Path: src/org/svetovid/io/SvetovidProcess.java
// public class SvetovidProcess {
//
// public final Process process;
// public final SvetovidWriter in;
// public final SvetovidReader out;
// public final SvetovidReader err;
//
// public SvetovidProcess(Process process) {
// this... | private CompoundList<String> wholeCommand = new CompoundList<String>(executable, commandClasspath, commandExtDirs, commandEndorsedDirs, commandLibraryDirs, commandSystemProperties, new ArrayList<String>(), null);
|
ivanpribela/svetovid-lib | src/org/svetovid/run/SvetovidJvmProcessBuilder.java | // Path: src/org/svetovid/io/SvetovidProcess.java
// public class SvetovidProcess {
//
// public final Process process;
// public final SvetovidWriter in;
// public final SvetovidReader out;
// public final SvetovidReader err;
//
// public SvetovidProcess(Process process) {
// this... | import java.io.File;
import java.io.IOException;
import java.lang.ProcessBuilder.Redirect;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.svetovid.io.SvetovidProcess;
import org.svetovid.util.CompoundList;
| public SvetovidJvmProcessBuilder redirectInput(Path file) {
super.redirectInput(file);
return this;
}
@Override
public SvetovidJvmProcessBuilder redirectOutput(Path file) {
super.redirectOutput(file);
return this;
}
@Override
public SvetovidJvmPr... | // Path: src/org/svetovid/io/SvetovidProcess.java
// public class SvetovidProcess {
//
// public final Process process;
// public final SvetovidWriter in;
// public final SvetovidReader out;
// public final SvetovidReader err;
//
// public SvetovidProcess(Process process) {
// this... | public SvetovidProcess start() throws IOException {
|
ivanpribela/svetovid-lib | src/org/svetovid/io/SvetovidWriter.java | // Path: src/org/svetovid/SvetovidFormatException.java
// public class SvetovidFormatException extends SvetovidException {
//
// private static final long serialVersionUID = 1829394491209593218L;
//
// /**
// * Constructs a {@code SvetovidFormatException} with the specified message.
// *
// ... | import java.io.Closeable;
import org.svetovid.SvetovidFormatException; | * if an error occurred during the operation.
*/
public void println(Object[][] value) throws SvetovidIOException;
/**
* Prints a formatted string using the specified format string and
* arguments. For details see {@link java.util.Formatter}.
*
* @param format
* ... | // Path: src/org/svetovid/SvetovidFormatException.java
// public class SvetovidFormatException extends SvetovidException {
//
// private static final long serialVersionUID = 1829394491209593218L;
//
// /**
// * Constructs a {@code SvetovidFormatException} with the specified message.
// *
// ... | throws SvetovidFormatException, SvetovidIOException; |
ivanpribela/svetovid-lib | src/org/svetovid/run/SvetovidProcessBuilder.java | // Path: src/org/svetovid/io/SvetovidProcess.java
// public class SvetovidProcess {
//
// public final Process process;
// public final SvetovidWriter in;
// public final SvetovidReader out;
// public final SvetovidReader err;
//
// public SvetovidProcess(Process process) {
// this... | import java.io.IOException;
import java.lang.ProcessBuilder.Redirect;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.svetovid.io.SvetovidProcess;
| public SvetovidProcessBuilder redirectOutput(Path file) {
builder.redirectOutput(file.toFile());
return this;
}
public SvetovidProcessBuilder redirectError(Path file) {
builder.redirectError(file.toFile());
return this;
}
public SvetovidProcessBuilder inhe... | // Path: src/org/svetovid/io/SvetovidProcess.java
// public class SvetovidProcess {
//
// public final Process process;
// public final SvetovidWriter in;
// public final SvetovidReader out;
// public final SvetovidReader err;
//
// public SvetovidProcess(Process process) {
// this... | public SvetovidProcess start() throws IOException {
|
ivanpribela/svetovid-lib | src/org/svetovid/demo/Calculator.java | // Path: src/org/svetovid/run/Start.java
// public class Start {
//
// public static void main(String[] arguments) {
//
// // No class to run
// if (arguments.length == 0) {
// return;
// }
//
// // Find the class
// String className = arguments[0];
// ... | import org.svetovid.run.Start; | }
@SuppressWarnings("unused")
private double add(double a, double b) {
return a + b;
}
public double add(double a, double b, double c) {
return a + b + c;
}
public double minus(double a) {
return -a;
}
protected String add(double a, String b) {
ret... | // Path: src/org/svetovid/run/Start.java
// public class Start {
//
// public static void main(String[] arguments) {
//
// // No class to run
// if (arguments.length == 0) {
// return;
// }
//
// // Find the class
// String className = arguments[0];
// ... | Start.main(arguments); |
mozammel/mNet | src/main/java/org/jugbd/mnet/web/editor/GenderEditor.java | // Path: src/main/java/org/jugbd/mnet/domain/enums/Gender.java
// public enum Gender {
//
// MALE("Male"),
// FEMALE("Female"),
// OTHER("Other");
//
// private String label;
//
// Gender(String label) {
// this.label = label;
// }
//
// public String getLabel() {
// retu... | import org.jugbd.mnet.domain.enums.Gender;
import java.beans.PropertyEditorSupport; | package org.jugbd.mnet.web.editor;
/**
* @author ronygomes
*/
public class GenderEditor extends PropertyEditorSupport {
@Override
public void setAsText(String text) { | // Path: src/main/java/org/jugbd/mnet/domain/enums/Gender.java
// public enum Gender {
//
// MALE("Male"),
// FEMALE("Female"),
// OTHER("Other");
//
// private String label;
//
// Gender(String label) {
// this.label = label;
// }
//
// public String getLabel() {
// retu... | for (Gender gender : Gender.values()) { |
mozammel/mNet | src/main/java/org/jugbd/mnet/web/controller/PictureInformationController.java | // Path: src/main/java/org/jugbd/mnet/domain/enums/PictureInformationType.java
// public enum PictureInformationType {
//
// DAY_ONE("Day One"),
//
// PREOPERATIVE("Pre-operative"),
//
// PRE_OPERATION("Pre-operation"),
//
// POSTOPERATIVE("Post operative"),
//
// ON_DISCHARGE("On Discharge");
... | import org.jugbd.mnet.dao.AttachmentDao;
import org.jugbd.mnet.domain.Attachment;
import org.jugbd.mnet.domain.PictureInformation;
import org.jugbd.mnet.domain.enums.PictureInformationType;
import org.jugbd.mnet.service.PictureInformationService;
import org.jugbd.mnet.service.RegisterService;
import org.jugbd.mnet.util... | package org.jugbd.mnet.web.controller;
/**
* @author Bazlur Rahman Rokon
* @date 12/27/14.
*/
@Controller
@Secured({"ROLE_ADMIN", "ROLE_USER"})
public class PictureInformationController {
private Logger log = LoggerFactory.getLogger(PictureInformationController.class);
@Autowired
private RegisterServ... | // Path: src/main/java/org/jugbd/mnet/domain/enums/PictureInformationType.java
// public enum PictureInformationType {
//
// DAY_ONE("Day One"),
//
// PREOPERATIVE("Pre-operative"),
//
// PRE_OPERATION("Pre-operation"),
//
// POSTOPERATIVE("Post operative"),
//
// ON_DISCHARGE("On Discharge");
... | private PictureInformationService pictureInformationService; |
mozammel/mNet | src/main/java/org/jugbd/mnet/web/controller/PictureInformationController.java | // Path: src/main/java/org/jugbd/mnet/domain/enums/PictureInformationType.java
// public enum PictureInformationType {
//
// DAY_ONE("Day One"),
//
// PREOPERATIVE("Pre-operative"),
//
// PRE_OPERATION("Pre-operation"),
//
// POSTOPERATIVE("Post operative"),
//
// ON_DISCHARGE("On Discharge");
... | import org.jugbd.mnet.dao.AttachmentDao;
import org.jugbd.mnet.domain.Attachment;
import org.jugbd.mnet.domain.PictureInformation;
import org.jugbd.mnet.domain.enums.PictureInformationType;
import org.jugbd.mnet.service.PictureInformationService;
import org.jugbd.mnet.service.RegisterService;
import org.jugbd.mnet.util... | package org.jugbd.mnet.web.controller;
/**
* @author Bazlur Rahman Rokon
* @date 12/27/14.
*/
@Controller
@Secured({"ROLE_ADMIN", "ROLE_USER"})
public class PictureInformationController {
private Logger log = LoggerFactory.getLogger(PictureInformationController.class);
@Autowired
private RegisterServ... | // Path: src/main/java/org/jugbd/mnet/domain/enums/PictureInformationType.java
// public enum PictureInformationType {
//
// DAY_ONE("Day One"),
//
// PREOPERATIVE("Pre-operative"),
//
// PRE_OPERATION("Pre-operation"),
//
// POSTOPERATIVE("Post operative"),
//
// ON_DISCHARGE("On Discharge");
... | @RequestParam("pictureInformationType") PictureInformationType pictureInformationType, |
mozammel/mNet | src/main/java/org/jugbd/mnet/web/controller/PictureInformationController.java | // Path: src/main/java/org/jugbd/mnet/domain/enums/PictureInformationType.java
// public enum PictureInformationType {
//
// DAY_ONE("Day One"),
//
// PREOPERATIVE("Pre-operative"),
//
// PRE_OPERATION("Pre-operation"),
//
// POSTOPERATIVE("Post operative"),
//
// ON_DISCHARGE("On Discharge");
... | import org.jugbd.mnet.dao.AttachmentDao;
import org.jugbd.mnet.domain.Attachment;
import org.jugbd.mnet.domain.PictureInformation;
import org.jugbd.mnet.domain.enums.PictureInformationType;
import org.jugbd.mnet.service.PictureInformationService;
import org.jugbd.mnet.service.RegisterService;
import org.jugbd.mnet.util... | RedirectAttributes redirectAttributes
) throws IOException {
log.debug("uploadPhoto() pictureInformationType ={}", pictureInformationType);
String errorMsg = validate(file, Contestant.VALID_FILE_TYPE_LIST, Contestant.FILE_MAX_SIZE_BYTES, "Photo");
if (!errorMs... | // Path: src/main/java/org/jugbd/mnet/domain/enums/PictureInformationType.java
// public enum PictureInformationType {
//
// DAY_ONE("Day One"),
//
// PREOPERATIVE("Pre-operative"),
//
// PRE_OPERATION("Pre-operation"),
//
// POSTOPERATIVE("Post operative"),
//
// ON_DISCHARGE("On Discharge");
... | if (!FileUtils.isValidFile(file, validFileTypes)) { |
mozammel/mNet | src/main/java/org/jugbd/mnet/service/ComplicationManagementService.java | // Path: src/main/java/org/jugbd/mnet/domain/ComplicationManagement.java
// @Entity
// public class ComplicationManagement extends PersistentObject implements Auditable {
//
// @Id
// @GeneratedValue(strategy = GenerationType.AUTO)
// private Long id;
//
// @Version
// private Long version;
//
//... | import org.jugbd.mnet.domain.ComplicationManagement;
import org.springframework.stereotype.Component; | package org.jugbd.mnet.service;
/**
* @author Bazlur Rahman Rokon
* @date 12/26/14.
*/
@Component
public interface ComplicationManagementService {
| // Path: src/main/java/org/jugbd/mnet/domain/ComplicationManagement.java
// @Entity
// public class ComplicationManagement extends PersistentObject implements Auditable {
//
// @Id
// @GeneratedValue(strategy = GenerationType.AUTO)
// private Long id;
//
// @Version
// private Long version;
//
//... | ComplicationManagement save(ComplicationManagement complicationManagement); |
mozammel/mNet | src/main/java/org/jugbd/mnet/web/controller/DiagnosisController.java | // Path: src/main/java/org/jugbd/mnet/service/DiagnosisService.java
// @Component
// public interface DiagnosisService {
// Diagnosis save(Diagnosis diagnosis);
//
// Diagnosis findOne(Long id);
//
// Diagnosis save(Diagnosis diagnosis, RegistrationType registrationType);
// }
| import org.jugbd.mnet.domain.Diagnosis;
import org.jugbd.mnet.domain.enums.RegistrationType;
import org.jugbd.mnet.service.DiagnosisService;
import org.jugbd.mnet.service.RegisterService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.s... | package org.jugbd.mnet.web.controller;
/**
* @author Mushfekur Rahman (mushfek0001)
*/
@Controller
@Secured({"ROLE_ADMIN", "ROLE_USER"})
@RequestMapping("/diagnosis")
public class DiagnosisController {
private static final Logger log = LoggerFactory.getLogger(DiagnosisController.class);
public static fina... | // Path: src/main/java/org/jugbd/mnet/service/DiagnosisService.java
// @Component
// public interface DiagnosisService {
// Diagnosis save(Diagnosis diagnosis);
//
// Diagnosis findOne(Long id);
//
// Diagnosis save(Diagnosis diagnosis, RegistrationType registrationType);
// }
// Path: src/main/java/org... | private DiagnosisService diagnosisService; |
mozammel/mNet | src/main/java/org/jugbd/mnet/service/PictureInformationService.java | // Path: src/main/java/org/jugbd/mnet/domain/enums/PictureInformationType.java
// public enum PictureInformationType {
//
// DAY_ONE("Day One"),
//
// PREOPERATIVE("Pre-operative"),
//
// PRE_OPERATION("Pre-operation"),
//
// POSTOPERATIVE("Post operative"),
//
// ON_DISCHARGE("On Discharge");
... | import org.jugbd.mnet.domain.PictureInformation;
import org.jugbd.mnet.domain.enums.PictureInformationType;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
import org.springframework.web.multipart.MultipartFile; | package org.jugbd.mnet.service;
/**
* @author Bazlur Rahman Rokon
* @date 12/27/14.
*/
@Component
public interface PictureInformationService {
PictureInformation save(PictureInformation pictureInformation);
PictureInformation findOne(Long id);
| // Path: src/main/java/org/jugbd/mnet/domain/enums/PictureInformationType.java
// public enum PictureInformationType {
//
// DAY_ONE("Day One"),
//
// PREOPERATIVE("Pre-operative"),
//
// PRE_OPERATION("Pre-operation"),
//
// POSTOPERATIVE("Post operative"),
//
// ON_DISCHARGE("On Discharge");
... | void upload(Long registerId, MultipartFile file, PictureInformationType pictureInformationType, String fileName, String comment); |
kevinbayes/vest | src/test/java/me/bayes/vertx/vest/TestJaxrsToVertxPathConverter.java | // Path: src/main/java/me/bayes/vertx/vest/util/UriPathUtil.java
// public final class UriPathUtil {
//
// private UriPathUtil() { }
//
//
// /**
// * Retrieve the context from the provided {@link Application}'s {@link ApplicationPath}.
// *
// * @param application with a {@link ApplicationPath} annotatio... | import static org.junit.Assert.*;
import me.bayes.vertx.vest.util.UriPathUtil;
import org.junit.Test; | /**
* Copyright 2013 Bayes Technologies
*
* 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 ... | // Path: src/main/java/me/bayes/vertx/vest/util/UriPathUtil.java
// public final class UriPathUtil {
//
// private UriPathUtil() { }
//
//
// /**
// * Retrieve the context from the provided {@link Application}'s {@link ApplicationPath}.
// *
// * @param application with a {@link ApplicationPath} annotatio... | String result = UriPathUtil.convertPath(path); |
kevinbayes/vest | src/test/java/me/bayes/vertx/vest/deploy/VestVerticleTest.java | // Path: src/main/java/me/bayes/vertx/vest/deploy/VestVerticle.java
// public class VestVerticle extends AbstractVestVerticle {
//
// public VestApplication createApplication(final JsonObject config) throws Exception {
//
// final JsonArray vestPackagesToScan = config.getJsonArray("vestPackagesToScan");
// fin... | import static org.junit.Assert.*;
import javax.ws.rs.core.Application;
import io.vertx.core.json.JsonObject;
import me.bayes.vertx.vest.deploy.VestVerticle;
import me.bayes.vertx.vest.sample.PingEndpoint;
import org.junit.Before;
import org.junit.Test; | /**
* Copyright 2013 Bayes Technologies
*
* 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 ... | // Path: src/main/java/me/bayes/vertx/vest/deploy/VestVerticle.java
// public class VestVerticle extends AbstractVestVerticle {
//
// public VestApplication createApplication(final JsonObject config) throws Exception {
//
// final JsonArray vestPackagesToScan = config.getJsonArray("vestPackagesToScan");
// fin... | private VestVerticle vestVerticle; |
kevinbayes/vest | src/test/java/me/bayes/vertx/vest/deploy/VestVerticleTest.java | // Path: src/main/java/me/bayes/vertx/vest/deploy/VestVerticle.java
// public class VestVerticle extends AbstractVestVerticle {
//
// public VestApplication createApplication(final JsonObject config) throws Exception {
//
// final JsonArray vestPackagesToScan = config.getJsonArray("vestPackagesToScan");
// fin... | import static org.junit.Assert.*;
import javax.ws.rs.core.Application;
import io.vertx.core.json.JsonObject;
import me.bayes.vertx.vest.deploy.VestVerticle;
import me.bayes.vertx.vest.sample.PingEndpoint;
import org.junit.Before;
import org.junit.Test; | /**
* Copyright 2013 Bayes Technologies
*
* 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 ... | // Path: src/main/java/me/bayes/vertx/vest/deploy/VestVerticle.java
// public class VestVerticle extends AbstractVestVerticle {
//
// public VestApplication createApplication(final JsonObject config) throws Exception {
//
// final JsonArray vestPackagesToScan = config.getJsonArray("vestPackagesToScan");
// fin... | assertTrue(application.getClasses().contains(PingEndpoint.class)); |
jefalbino/jsmart-web | src/main/java/com/jsmartframework/web/tag/ValidateTagHandler.java | // Path: src/main/java/com/jsmartframework/web/tag/type/Look.java
// public enum Look {
//
// DEFAULT,
// PRIMARY,
// SUCCESS,
// INFO,
// WARNING,
// DANGER,
// MUTED,
// LINK,
// ERROR;
//
// public static boolean validate(String look) {
// try {
// Look.v... | import com.jsmartframework.web.exception.InvalidAttributeException;
import com.jsmartframework.web.manager.TagHandler;
import com.jsmartframework.web.tag.html.Tag;
import com.jsmartframework.web.tag.type.Look;
import java.io.IOException;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.JspTag; | /*
* JSmart Framework - Java Web Development Framework
* Copyright (c) 2015, Jeferson Albino da Silva, All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either... | // Path: src/main/java/com/jsmartframework/web/tag/type/Look.java
// public enum Look {
//
// DEFAULT,
// PRIMARY,
// SUCCESS,
// INFO,
// WARNING,
// DANGER,
// MUTED,
// LINK,
// ERROR;
//
// public static boolean validate(String look) {
// try {
// Look.v... | private String look = Look.ERROR.name().toLowerCase(); |
http-builder-ng/http-builder-ng | http-builder-ng-core/src/main/java/groovyx/net/http/optional/Jackson.java | // Path: http-builder-ng-core/src/main/java/groovyx/net/http/NativeHandlers.java
// public static boolean handleRawUpload(final ChainedHttpConfig config, final ToServer ts) {
// final ChainedHttpConfig.ChainedRequest request = config.getChainedRequest();
// final Object body = request.actualBody();
// final... | import com.fasterxml.jackson.databind.ObjectMapper;
import groovyx.net.http.*;
import java.io.IOException;
import java.io.StringWriter;
import static groovyx.net.http.NativeHandlers.Encoders.handleRawUpload; | /**
* Copyright (C) 2017 HttpBuilder-NG Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicab... | // Path: http-builder-ng-core/src/main/java/groovyx/net/http/NativeHandlers.java
// public static boolean handleRawUpload(final ChainedHttpConfig config, final ToServer ts) {
// final ChainedHttpConfig.ChainedRequest request = config.getChainedRequest();
// final Object body = request.actualBody();
// final... | if (handleRawUpload(config, ts)) { |
http-builder-ng/http-builder-ng | http-builder-ng-core/src/main/java/groovyx/net/http/UriBuilder.java | // Path: http-builder-ng-core/src/main/java/groovyx/net/http/Traverser.java
// public static <V> Predicate<V> notValue(final V v) { return (toTest) -> !v.equals(toTest); }
//
// Path: http-builder-ng-core/src/main/java/groovyx/net/http/Traverser.java
// public static <T,V> V traverse(final T target, final Function<T,T... | import static java.nio.charset.StandardCharsets.UTF_8;
import static java.util.Collections.singletonList;
import groovy.lang.GString;
import org.codehaus.groovy.runtime.GStringImpl;
import java.io.IOException;
import java.net.HttpCookie;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.*;
impor... | /**
* Copyright (C) 2017 HttpBuilder-NG Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicab... | // Path: http-builder-ng-core/src/main/java/groovyx/net/http/Traverser.java
// public static <V> Predicate<V> notValue(final V v) { return (toTest) -> !v.equals(toTest); }
//
// Path: http-builder-ng-core/src/main/java/groovyx/net/http/Traverser.java
// public static <T,V> V traverse(final T target, final Function<T,T... | final String scheme = traverse(this, UriBuilder::getParent, UriBuilder::getScheme, Traverser::notNull); |
http-builder-ng/http-builder-ng | http-builder-ng-core/src/main/java/groovyx/net/http/UriBuilder.java | // Path: http-builder-ng-core/src/main/java/groovyx/net/http/Traverser.java
// public static <V> Predicate<V> notValue(final V v) { return (toTest) -> !v.equals(toTest); }
//
// Path: http-builder-ng-core/src/main/java/groovyx/net/http/Traverser.java
// public static <T,V> V traverse(final T target, final Function<T,T... | import static java.nio.charset.StandardCharsets.UTF_8;
import static java.util.Collections.singletonList;
import groovy.lang.GString;
import org.codehaus.groovy.runtime.GStringImpl;
import java.io.IOException;
import java.net.HttpCookie;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.*;
impor... | /**
* Copyright (C) 2017 HttpBuilder-NG Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicab... | // Path: http-builder-ng-core/src/main/java/groovyx/net/http/Traverser.java
// public static <V> Predicate<V> notValue(final V v) { return (toTest) -> !v.equals(toTest); }
//
// Path: http-builder-ng-core/src/main/java/groovyx/net/http/Traverser.java
// public static <T,V> V traverse(final T target, final Function<T,T... | final Integer port = traverse(this, UriBuilder::getParent, UriBuilder::getPort, notValue(DEFAULT_PORT)); |
http-builder-ng/http-builder-ng | http-builder-ng-core/src/main/java/groovyx/net/http/util/IoUtils.java | // Path: http-builder-ng-core/src/main/java/groovyx/net/http/TransportingException.java
// public class TransportingException extends RuntimeException {
//
// public TransportingException(final String message, final Throwable cause) {
// super(message, cause);
// }
//
// public TransportingExcepti... | import groovyx.net.http.TransportingException;
import java.io.BufferedInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream; | public static String copyAsString(final BufferedInputStream inputStream) throws IOException, IllegalStateException {
if (inputStream == null) return null;
try {
inputStream.mark(Integer.MAX_VALUE);
return new String(streamToBytes(inputStream, false));
} finally {
... | // Path: http-builder-ng-core/src/main/java/groovyx/net/http/TransportingException.java
// public class TransportingException extends RuntimeException {
//
// public TransportingException(final String message, final Throwable cause) {
// super(message, cause);
// }
//
// public TransportingExcepti... | throw new TransportingException(e); |
http-builder-ng/http-builder-ng | http-builder-ng-core/src/main/java/groovyx/net/http/HttpConfig.java | // Path: http-builder-ng-core/src/main/java/groovyx/net/http/fn/ClosureBiFunction.java
// public class ClosureBiFunction<IN_0, IN_1, OUT> implements BiFunction<IN_0, IN_1, OUT> {
//
// private final Closure<OUT> closure;
//
// public ClosureBiFunction(final Closure<OUT> closure) {
// this.closure = cl... | import groovy.lang.Closure;
import groovyx.net.http.fn.ClosureBiFunction;
import groovyx.net.http.fn.ClosureFunction;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.nio.charset.Charset;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.Map;
import java.ut... | * Defines the configurable HTTP response properties.
*/
interface Response {
/**
* Configures the execution of the provided closure "when" the given status occurs in the response. The `closure` will be called with an instance
* of the response as a `FromServer` instance and the ... | // Path: http-builder-ng-core/src/main/java/groovyx/net/http/fn/ClosureBiFunction.java
// public class ClosureBiFunction<IN_0, IN_1, OUT> implements BiFunction<IN_0, IN_1, OUT> {
//
// private final Closure<OUT> closure;
//
// public ClosureBiFunction(final Closure<OUT> closure) {
// this.closure = cl... | when(status, new ClosureBiFunction<>(closure)); |
http-builder-ng/http-builder-ng | http-builder-ng-core/src/main/java/groovyx/net/http/HttpConfig.java | // Path: http-builder-ng-core/src/main/java/groovyx/net/http/fn/ClosureBiFunction.java
// public class ClosureBiFunction<IN_0, IN_1, OUT> implements BiFunction<IN_0, IN_1, OUT> {
//
// private final Closure<OUT> closure;
//
// public ClosureBiFunction(final Closure<OUT> closure) {
// this.closure = cl... | import groovy.lang.Closure;
import groovyx.net.http.fn.ClosureBiFunction;
import groovyx.net.http.fn.ClosureFunction;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.nio.charset.Charset;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.Map;
import java.ut... | * different from a failure condition because there is no response, no status code, no headers, etc. The `closure` will be called with
* the best guess as to what was the original exception. Some attempts will be made to unwrap exceptions that are of type
* {@link groovyx.net.http.Transporting... | // Path: http-builder-ng-core/src/main/java/groovyx/net/http/fn/ClosureBiFunction.java
// public class ClosureBiFunction<IN_0, IN_1, OUT> implements BiFunction<IN_0, IN_1, OUT> {
//
// private final Closure<OUT> closure;
//
// public ClosureBiFunction(final Closure<OUT> closure) {
// this.closure = cl... | exception(new ClosureFunction<>(closure)); |
http-builder-ng/http-builder-ng | http-builder-ng-okhttp/src/main/java/groovyx/net/http/OkHttpEncoders.java | // Path: http-builder-ng-core/src/main/java/groovyx/net/http/EmbeddedEncoder.java
// public static byte[] encode(final ChainedHttpConfig config, final String contentType, final Object content) {
// final InMemoryToServer toServer = new InMemoryToServer();
// BiConsumer<ChainedHttpConfig, ToServer> encoder = con... | import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import okio.Buffer;
import java.io.IOException;
import static groovyx.net.http.ContentTypes.MULTIPART_FORMDATA;
import static groovyx.net.http.ContentTypes.MULTIPART_MIXED;
import static groovyx.net.http.EmbeddedEncoder.encode;
import static okhttp3.MediaType.pa... | /**
* Copyright (C) 2017 HttpBuilder-NG Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicab... | // Path: http-builder-ng-core/src/main/java/groovyx/net/http/EmbeddedEncoder.java
// public static byte[] encode(final ChainedHttpConfig config, final String contentType, final Object content) {
// final InMemoryToServer toServer = new InMemoryToServer();
// BiConsumer<ChainedHttpConfig, ToServer> encoder = con... | create(parse(mpe.getContentType()), encode(config, mpe.getContentType(), mpe.getContent())) |
http-builder-ng/http-builder-ng | http-builder-ng-core/src/main/java/groovyx/net/http/MultipartContent.java | // Path: http-builder-ng-core/src/main/java/groovyx/net/http/util/Misc.java
// public static String randomString(final int size) {
// final StringBuilder buffer = new StringBuilder(size);
// for(int i = 0; i < size; ++i) {
// buffer.append(theChars[current().nextInt(theChars.length)]);
// }
//
// ... | import groovy.lang.Closure;
import groovy.lang.DelegatesTo;
import java.util.LinkedList;
import java.util.List;
import java.util.function.Consumer;
import static java.util.Collections.unmodifiableList;
import static groovyx.net.http.util.Misc.randomString; | /**
* Copyright (C) 2017 HttpBuilder-NG Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicab... | // Path: http-builder-ng-core/src/main/java/groovyx/net/http/util/Misc.java
// public static String randomString(final int size) {
// final StringBuilder buffer = new StringBuilder(size);
// for(int i = 0; i < size; ++i) {
// buffer.append(theChars[current().nextInt(theChars.length)]);
// }
//
// ... | private final String boundary = randomString(16); |
http-builder-ng/http-builder-ng | http-builder-ng-okhttp/src/main/java/groovyx/net/http/OkHttpBuilder.java | // Path: http-builder-ng-core/src/main/java/groovyx/net/http/util/IoUtils.java
// public class IoUtils {
//
// /**
// * Reads all bytes from the stream into a byte array.
// *
// * @param inputStream the {@link InputStream}
// * @return the array of bytes from the stream
// * @throws IOExc... | import com.burgstaller.okhttp.AuthenticationCacheInterceptor;
import com.burgstaller.okhttp.CachingAuthenticatorDecorator;
import com.burgstaller.okhttp.digest.CachingAuthenticator;
import com.burgstaller.okhttp.digest.DigestAuthenticator;
import groovy.lang.Closure;
import groovy.lang.DelegatesTo;
import groovyx.net.h... | for (Map.Entry<String, String> e : cookiesToAdd(clientConfig, cr).entrySet()) {
requestBuilder.addHeader(e.getKey(), e.getValue());
}
}
private static void applyAuth(final Request.Builder requestBuilder, final ChainedHttpConfig chainedConfig) {
final HttpConfig.Auth auth = c... | // Path: http-builder-ng-core/src/main/java/groovyx/net/http/util/IoUtils.java
// public class IoUtils {
//
// /**
// * Reads all bytes from the stream into a byte array.
// *
// * @param inputStream the {@link InputStream}
// * @return the array of bytes from the stream
// * @throws IOExc... | return HANDLER_FUNCTION.apply(chainedConfig, new OkHttpFromServer(chainedConfig.getChainedRequest().getUri().toURI(), response)); |
http-builder-ng/http-builder-ng | http-builder-ng-okhttp/src/main/java/groovyx/net/http/OkHttpBuilder.java | // Path: http-builder-ng-core/src/main/java/groovyx/net/http/util/IoUtils.java
// public class IoUtils {
//
// /**
// * Reads all bytes from the stream into a byte array.
// *
// * @param inputStream the {@link InputStream}
// * @return the array of bytes from the stream
// * @throws IOExc... | import com.burgstaller.okhttp.AuthenticationCacheInterceptor;
import com.burgstaller.okhttp.CachingAuthenticatorDecorator;
import com.burgstaller.okhttp.digest.CachingAuthenticator;
import com.burgstaller.okhttp.digest.DigestAuthenticator;
import groovy.lang.Closure;
import groovy.lang.DelegatesTo;
import groovyx.net.h... | }
}
private class OkHttpFromServer implements FromServer {
private final URI uri;
private final Response response;
private List<Header<?>> headers;
private boolean body;
private OkHttpFromServer(final URI uri, final Response response) {
this.uri = u... | // Path: http-builder-ng-core/src/main/java/groovyx/net/http/util/IoUtils.java
// public class IoUtils {
//
// /**
// * Reads all bytes from the stream into a byte array.
// *
// * @param inputStream the {@link InputStream}
// * @return the array of bytes from the stream
// * @throws IOExc... | ret.add(keyValue(name, value)); |
http-builder-ng/http-builder-ng | http-builder-ng-okhttp/src/main/java/groovyx/net/http/OkHttpBuilder.java | // Path: http-builder-ng-core/src/main/java/groovyx/net/http/util/IoUtils.java
// public class IoUtils {
//
// /**
// * Reads all bytes from the stream into a byte array.
// *
// * @param inputStream the {@link InputStream}
// * @return the array of bytes from the stream
// * @throws IOExc... | import com.burgstaller.okhttp.AuthenticationCacheInterceptor;
import com.burgstaller.okhttp.CachingAuthenticatorDecorator;
import com.burgstaller.okhttp.digest.CachingAuthenticator;
import com.burgstaller.okhttp.digest.DigestAuthenticator;
import groovy.lang.Closure;
import groovy.lang.DelegatesTo;
import groovyx.net.h... | }
@Override
public boolean getHasBody() {
return body;
}
@Override
public URI getUri() {
return uri;
}
@Override
public void finish() {
response.close();
}
}
private static class OkHttpToServe... | // Path: http-builder-ng-core/src/main/java/groovyx/net/http/util/IoUtils.java
// public class IoUtils {
//
// /**
// * Reads all bytes from the stream into a byte array.
// *
// * @param inputStream the {@link InputStream}
// * @return the array of bytes from the stream
// * @throws IOExc... | this.bytes = IoUtils.streamToBytes(inputStream); |
http-builder-ng/http-builder-ng | http-builder-ng-core/src/main/java/groovyx/net/http/ChainedHttpConfig.java | // Path: http-builder-ng-core/src/main/java/groovyx/net/http/Traverser.java
// public static <T,V> V traverse(final T target, final Function<T,T> next,
// final Function<T,V> getValue, final Predicate<V> testValue) {
// final V v = getValue.apply(target);
// if(testValue.test(v)) ... | import java.net.HttpCookie;
import java.nio.charset.Charset;
import java.util.AbstractMap;
import java.util.List;
import java.util.Map;
import java.util.function.BiConsumer;
import java.util.function.BiFunction;
import java.util.function.Function;
import java.util.function.Predicate;
import static groovyx.net.http.Trav... | /**
* Copyright (C) 2017 HttpBuilder-NG Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicab... | // Path: http-builder-ng-core/src/main/java/groovyx/net/http/Traverser.java
// public static <T,V> V traverse(final T target, final Function<T,T> next,
// final Function<T,V> getValue, final Predicate<V> testValue) {
// final V v = getValue.apply(target);
// if(testValue.test(v)) ... | return traverse(this, ChainedRequest::getParent, ChainedRequest::getCharset, Traverser::notNull); |
http-builder-ng/http-builder-ng | http-builder-ng-apache/src/main/java/groovyx/net/http/ApacheEncoders.java | // Path: http-builder-ng-core/src/main/java/groovyx/net/http/util/Misc.java
// public static String randomString(final int size) {
// final StringBuilder buffer = new StringBuilder(size);
// for(int i = 0; i < size; ++i) {
// buffer.append(theChars[current().nextInt(theChars.length)]);
// }
//
// ... | import org.apache.http.entity.ContentType;
import org.apache.http.entity.mime.MultipartEntityBuilder;
import java.io.IOException;
import static groovyx.net.http.ContentTypes.MULTIPART_FORMDATA;
import static groovyx.net.http.ContentTypes.MULTIPART_MIXED;
import static org.apache.http.entity.ContentType.parse;
import st... | /**
* Copyright (C) 2017 HttpBuilder-NG Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicab... | // Path: http-builder-ng-core/src/main/java/groovyx/net/http/util/Misc.java
// public static String randomString(final int size) {
// final StringBuilder buffer = new StringBuilder(size);
// for(int i = 0; i < size; ++i) {
// buffer.append(theChars[current().nextInt(theChars.length)]);
// }
//
// ... | final String boundary = randomString(10); |
http-builder-ng/http-builder-ng | http-builder-ng-core/src/main/java/groovyx/net/http/JavaHttpBuilder.java | // Path: http-builder-ng-core/src/main/java/groovyx/net/http/util/IoUtils.java
// public class IoUtils {
//
// /**
// * Reads all bytes from the stream into a byte array.
// *
// * @param inputStream the {@link InputStream}
// * @return the array of bytes from the stream
// * @throws IOExc... | import java.util.function.Consumer;
import java.util.zip.GZIPInputStream;
import java.util.zip.InflaterInputStream;
import static groovyx.net.http.HttpBuilder.ResponseHandlerFunction.HANDLER_FUNCTION;
import groovyx.net.http.util.IoUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.net.ssl.Hos... | requestConfig.findEncoder().accept(requestConfig, j2s);
}
if (log.isDebugEnabled()) {
log.debug("Request-URI({}): {}", connection.getRequestMethod(), theUri);
}
addHeaders();
connection.connect();
... | // Path: http-builder-ng-core/src/main/java/groovyx/net/http/util/IoUtils.java
// public class IoUtils {
//
// /**
// * Reads all bytes from the stream into a byte array.
// *
// * @param inputStream the {@link InputStream}
// * @return the array of bytes from the stream
// * @throws IOExc... | return HANDLER_FUNCTION.apply(requestConfig, fromServer); |
http-builder-ng/http-builder-ng | http-builder-ng-core/src/main/java/groovyx/net/http/JavaHttpBuilder.java | // Path: http-builder-ng-core/src/main/java/groovyx/net/http/util/IoUtils.java
// public class IoUtils {
//
// /**
// * Reads all bytes from the stream into a byte array.
// *
// * @param inputStream the {@link InputStream}
// * @return the array of bytes from the stream
// * @throws IOExc... | import java.util.function.Consumer;
import java.util.zip.GZIPInputStream;
import java.util.zip.InflaterInputStream;
import static groovyx.net.http.HttpBuilder.ResponseHandlerFunction.HANDLER_FUNCTION;
import groovyx.net.http.util.IoUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.net.ssl.Hos... | contentLog.debug("Request-Body({}): {}", requestConfig.getChainedRequest().actualContentType(), j2s.content());
}
j2s.transfer();
}
final JavaFromServer fromServer = new JavaFromServer(theUri);
if (conten... | // Path: http-builder-ng-core/src/main/java/groovyx/net/http/util/IoUtils.java
// public class IoUtils {
//
// /**
// * Reads all bytes from the stream into a byte array.
// *
// * @param inputStream the {@link InputStream}
// * @return the array of bytes from the stream
// * @throws IOExc... | IoUtils.transfer(inputStream, connection.getOutputStream(), true); |
http-builder-ng/http-builder-ng | http-builder-ng-core/src/main/java/groovyx/net/http/NativeHandlers.java | // Path: http-builder-ng-core/src/main/java/groovyx/net/http/util/IoUtils.java
// public class IoUtils {
//
// /**
// * Reads all bytes from the stream into a byte array.
// *
// * @param inputStream the {@link InputStream}
// * @return the array of bytes from the stream
// * @throws IOExc... | import groovy.json.JsonBuilder;
import groovy.json.JsonSlurper;
import groovy.lang.Closure;
import groovy.lang.GString;
import groovy.lang.Writable;
import groovy.util.XmlSlurper;
import groovy.util.slurpersupport.GPathResult;
import groovy.xml.StreamingMarkupBuilder;
import groovyx.net.http.util.IoUtils;
import org.ap... | * This CatalogResolver is static to avoid the overhead of re-parsing the catalog definition file every time. Unfortunately, there's no
* way to share a single Catalog instance between resolvers. The {@link Catalog} class is technically not thread-safe, but as long as you
* do not parse cata... | // Path: http-builder-ng-core/src/main/java/groovyx/net/http/util/IoUtils.java
// public class IoUtils {
//
// /**
// * Reads all bytes from the stream into a byte array.
// *
// * @param inputStream the {@link InputStream}
// * @return the array of bytes from the stream
// * @throws IOExc... | IoUtils.transfer(fromServer.getInputStream(), baos, true); |
http-builder-ng/http-builder-ng | http-builder-ng-core/src/main/java/groovyx/net/http/HttpObjectConfigImpl.java | // Path: http-builder-ng-core/src/main/java/groovyx/net/http/HttpConfigs.java
// public static ChainedHttpConfig threadSafe(final ChainedHttpConfig parent) {
// return new ThreadSafeHttpConfig(parent);
// }
//
// Path: http-builder-ng-core/src/main/java/groovyx/net/http/HttpConfigs.java
// public static ChainedHtt... | import static groovyx.net.http.util.Misc.isPropertySet;
import java.net.Proxy;
import java.net.UnknownHostException;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.SSLContext;
import java.io.File;
import java.util.EnumMap;
import java.util.concurrent.Executor;
import java.util.function.BiFunction;
import j... | /**
* Copyright (C) 2017 HttpBuilder-NG Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicab... | // Path: http-builder-ng-core/src/main/java/groovyx/net/http/HttpConfigs.java
// public static ChainedHttpConfig threadSafe(final ChainedHttpConfig parent) {
// return new ThreadSafeHttpConfig(parent);
// }
//
// Path: http-builder-ng-core/src/main/java/groovyx/net/http/HttpConfigs.java
// public static ChainedHtt... | if(isPropertySet("groovyx.net.http.ignore-ssl-issues")) { |
http-builder-ng/http-builder-ng | http-builder-ng-core/src/main/java/groovyx/net/http/HttpObjectConfigImpl.java | // Path: http-builder-ng-core/src/main/java/groovyx/net/http/HttpConfigs.java
// public static ChainedHttpConfig threadSafe(final ChainedHttpConfig parent) {
// return new ThreadSafeHttpConfig(parent);
// }
//
// Path: http-builder-ng-core/src/main/java/groovyx/net/http/HttpConfigs.java
// public static ChainedHtt... | import static groovyx.net.http.util.Misc.isPropertySet;
import java.net.Proxy;
import java.net.UnknownHostException;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.SSLContext;
import java.io.File;
import java.util.EnumMap;
import java.util.concurrent.Executor;
import java.util.function.BiFunction;
import j... | /**
* Copyright (C) 2017 HttpBuilder-NG Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicab... | // Path: http-builder-ng-core/src/main/java/groovyx/net/http/HttpConfigs.java
// public static ChainedHttpConfig threadSafe(final ChainedHttpConfig parent) {
// return new ThreadSafeHttpConfig(parent);
// }
//
// Path: http-builder-ng-core/src/main/java/groovyx/net/http/HttpConfigs.java
// public static ChainedHtt... | setSslContext(acceptingSslContext()); |
http-builder-ng/http-builder-ng | http-builder-ng-core/src/main/java/groovyx/net/http/HttpObjectConfigImpl.java | // Path: http-builder-ng-core/src/main/java/groovyx/net/http/HttpConfigs.java
// public static ChainedHttpConfig threadSafe(final ChainedHttpConfig parent) {
// return new ThreadSafeHttpConfig(parent);
// }
//
// Path: http-builder-ng-core/src/main/java/groovyx/net/http/HttpConfigs.java
// public static ChainedHtt... | import static groovyx.net.http.util.Misc.isPropertySet;
import java.net.Proxy;
import java.net.UnknownHostException;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.SSLContext;
import java.io.File;
import java.util.EnumMap;
import java.util.concurrent.Executor;
import java.util.function.BiFunction;
import j... | /**
* Copyright (C) 2017 HttpBuilder-NG Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicab... | // Path: http-builder-ng-core/src/main/java/groovyx/net/http/HttpConfigs.java
// public static ChainedHttpConfig threadSafe(final ChainedHttpConfig parent) {
// return new ThreadSafeHttpConfig(parent);
// }
//
// Path: http-builder-ng-core/src/main/java/groovyx/net/http/HttpConfigs.java
// public static ChainedHtt... | setHostnameVerifier(ANY_HOSTNAME); |
http-builder-ng/http-builder-ng | http-builder-ng-core/src/main/java/groovyx/net/http/EmbeddedEncoder.java | // Path: http-builder-ng-core/src/main/java/groovyx/net/http/util/IoUtils.java
// public class IoUtils {
//
// /**
// * Reads all bytes from the stream into a byte array.
// *
// * @param inputStream the {@link InputStream}
// * @return the array of bytes from the stream
// * @throws IOExc... | import groovyx.net.http.util.IoUtils;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.Map;
import java.util.function.BiConsumer; | /**
* Copyright (C) 2017 HttpBuilder-NG Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicab... | // Path: http-builder-ng-core/src/main/java/groovyx/net/http/util/IoUtils.java
// public class IoUtils {
//
// /**
// * Reads all bytes from the stream into a byte array.
// *
// * @param inputStream the {@link InputStream}
// * @return the array of bytes from the stream
// * @throws IOExc... | bytes = IoUtils.streamToBytes(inputStream); |
junjunguo/PocketMaps | PocketMaps/app/src/main/java/com/villoren/android/kalmanlocationmanager/lib/LooperThread.java | // Path: PocketMaps/app/src/main/java/com/junjunguo/pocketmaps/activities/Permission.java
// public class Permission extends AppCompatActivity
// implements ActivityCompat.OnRequestPermissionsResultCallback, OnClickListener
// {
// static String[] sPermission;
// static boolean isFirstForcedPermission;
// static... | import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.os.SystemClock;
import com.junjunguo.pocketmaps.activities.Permission;
import static com.villoren.android.kalmanlocationmanager.lib.KalmanLocationManager.KALMAN_PROVIDER;
import static com.villoren.android.kalmanlocationmanag... |
@Override
public void onProviderDisabled(String provider) {
final String finalProvider = provider;
mClientHandler.post(new Runnable() {
@Override
public void run() {
mClientLocationListener.onProviderDisabled(finalProvider)... | // Path: PocketMaps/app/src/main/java/com/junjunguo/pocketmaps/activities/Permission.java
// public class Permission extends AppCompatActivity
// implements ActivityCompat.OnRequestPermissionsResultCallback, OnClickListener
// {
// static String[] sPermission;
// static boolean isFirstForcedPermission;
// static... | final Location location = new Location(KALMAN_PROVIDER); |
junjunguo/PocketMaps | PocketMaps/app/src/main/java/com/junjunguo/pocketmaps/fragments/MyAddressAdapter.java | // Path: PocketMaps/app/src/main/java/com/junjunguo/pocketmaps/geocoding/AddressLoc.java
// public class AddressLoc
// {
// private static final char STRING_SEP = '|';
// private static final char STRING_SEP_ESC = '/';
//
// /** Adds the address to prop.
// * @param updateLocName The old name of address (=... | import android.location.Address;
import androidx.recyclerview.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.junjunguo.pocketmaps.R;
import com.junjungu... | package com.junjunguo.pocketmaps.fragments;
/**
* This file is part of PocketMaps
* <p/>
* Created by GuoJunjun <junjunguo.com> on July 03, 2015.
*/
public class MyAddressAdapter extends RecyclerView.Adapter<MyAddressAdapter.ViewHolder> {
private List<Address> addressList; | // Path: PocketMaps/app/src/main/java/com/junjunguo/pocketmaps/geocoding/AddressLoc.java
// public class AddressLoc
// {
// private static final char STRING_SEP = '|';
// private static final char STRING_SEP_ESC = '/';
//
// /** Adds the address to prop.
// * @param updateLocName The old name of address (=... | private OnClickAddressListener onClickAddressListener; |
junjunguo/PocketMaps | PocketMaps/app/src/main/java/com/junjunguo/pocketmaps/fragments/MyAddressAdapter.java | // Path: PocketMaps/app/src/main/java/com/junjunguo/pocketmaps/geocoding/AddressLoc.java
// public class AddressLoc
// {
// private static final char STRING_SEP = '|';
// private static final char STRING_SEP_ESC = '/';
//
// /** Adds the address to prop.
// * @param updateLocName The old name of address (=... | import android.location.Address;
import androidx.recyclerview.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.junjunguo.pocketmaps.R;
import com.junjungu... | ImageView addrDetailsButton;
public ViewHolder(View itemView, OnClickAddressListener onClickAddressListener, OnClickAddressListener onClickDetailsListener) {
super(itemView);
this.onClickAddressListener = onClickAddressListener;
this.onClickDetailsListener = onClickDe... | // Path: PocketMaps/app/src/main/java/com/junjunguo/pocketmaps/geocoding/AddressLoc.java
// public class AddressLoc
// {
// private static final char STRING_SEP = '|';
// private static final char STRING_SEP_ESC = '/';
//
// /** Adds the address to prop.
// * @param updateLocName The old name of address (=... | ArrayList<String> lines = AddressLoc.getLines(address); |
junjunguo/PocketMaps | PocketMaps/app/src/main/java/com/junjunguo/pocketmaps/model/SportCategory.java | // Path: PocketMaps/app/src/main/java/com/junjunguo/pocketmaps/util/Calorie.java
// public class Calorie {
// /*
// * sport category, which defines the MET value
// */
//
// /** Slow with bike 10mph or 16kmh **/
// public final static double BIKE_SLOW = 4.0;
// /** Normal with bike 13mph or... | import com.junjunguo.pocketmaps.util.Calorie; | package com.junjunguo.pocketmaps.model;
/**
* This file is part of PocketMaps
* <p>
* Created by GuoJunjun <junjunguo.com> on August 30, 2015.
*/
public class SportCategory {
private String text;
private Integer imageId; | // Path: PocketMaps/app/src/main/java/com/junjunguo/pocketmaps/util/Calorie.java
// public class Calorie {
// /*
// * sport category, which defines the MET value
// */
//
// /** Slow with bike 10mph or 16kmh **/
// public final static double BIKE_SLOW = 4.0;
// /** Normal with bike 13mph or... | private Calorie.Type sportMET; |
pjq/rpi | android/app/src/main/java/me/pjq/rpicar/widget/RadarView.java | // Path: android/app/src/main/java/me/pjq/rpicar/utils/Utils.java
// public class Utils {
// public static int[] Getrandomarray(int i, int i1) {
// int size = 11;
// int[] value = new int[size];
// for (int j = 0; j < size; j++) {
// value[j] = j;
// }
//
// retu... | import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.Shader;
import android.graphics.SweepGradient;
import android.support.annotation.IntDef;
import android.util.AttributeSet;
import android.... | // TODO Auto-generated method stub
setBackgroundColor(Color.TRANSPARENT);
//宽度=5,抗锯齿,描边效果的白色画笔
mPaintLine = new Paint();
mPaintLine.setStrokeWidth(5);
mPaintLine.setAntiAlias(true);
mPaintLine.setStyle(Paint.Style.STROKE);
mPaintLine.setColor(Color.WHITE)... | // Path: android/app/src/main/java/me/pjq/rpicar/utils/Utils.java
// public class Utils {
// public static int[] Getrandomarray(int i, int i1) {
// int size = 11;
// int[] value = new int[size];
// for (int j = 0; j < size; j++) {
// value[j] = j;
// }
//
// retu... | point_x = Utils.Getrandomarray(15, 300); |
pjq/rpi | spring-server/src/main/java/me/pjq/Constants.java | // Path: spring-server/src/main/java/me/pjq/Utils/Log.java
// public class Log {
// static String dateFormat = "yyyy-MM-dd hh:mm:ss";
// static SimpleDateFormat fm = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss.SSS");
// static boolean showLog = true;
//
// public static void log(String tag, String msg) {... | import me.pjq.Utils.Log;
import me.pjq.model.Config;
import java.io.*;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Properties; | package me.pjq;
public enum Constants {
INSTANCE;
private static final String TAG = "Constants";
// public static String deviceName = "RpiCarHome";
// public static String productKey = "tKB3pmbLvnA";
// public static String secret = "fT9ryVgfucZNs2g0VZkj8kzV3eNjY55E";
// public static String de... | // Path: spring-server/src/main/java/me/pjq/Utils/Log.java
// public class Log {
// static String dateFormat = "yyyy-MM-dd hh:mm:ss";
// static SimpleDateFormat fm = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss.SSS");
// static boolean showLog = true;
//
// public static void log(String tag, String msg) {... | private Config config; |
pjq/rpi | spring-server/src/main/java/me/pjq/Constants.java | // Path: spring-server/src/main/java/me/pjq/Utils/Log.java
// public class Log {
// static String dateFormat = "yyyy-MM-dd hh:mm:ss";
// static SimpleDateFormat fm = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss.SSS");
// static boolean showLog = true;
//
// public static void log(String tag, String msg) {... | import me.pjq.Utils.Log;
import me.pjq.model.Config;
import java.io.*;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Properties; | package me.pjq;
public enum Constants {
INSTANCE;
private static final String TAG = "Constants";
// public static String deviceName = "RpiCarHome";
// public static String productKey = "tKB3pmbLvnA";
// public static String secret = "fT9ryVgfucZNs2g0VZkj8kzV3eNjY55E";
// public static String de... | // Path: spring-server/src/main/java/me/pjq/Utils/Log.java
// public class Log {
// static String dateFormat = "yyyy-MM-dd hh:mm:ss";
// static SimpleDateFormat fm = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss.SSS");
// static boolean showLog = true;
//
// public static void log(String tag, String msg) {... | Log.log(TAG, strKey + "=" + strValue); |
pjq/rpi | android/app/src/main/java/me/pjq/rpicar/Constants.java | // Path: android/app/src/main/java/me/pjq/rpicar/utils/Log.java
// public class Log {
// static String dateFormat = "yyyy-MM-dd hh:mm:ss";
// static SimpleDateFormat fm = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss.SSS");
// static boolean showLog = true;
//
// public static void log(String tag, String m... | import java.io.*;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Properties;
import me.pjq.rpicar.utils.Log; | package me.pjq.rpicar;
public enum Constants {
INSTANCE;
private static final String TAG = "Constants";
public static String deviceName = "RpiCarHome";
public static String productKey = "tKB3pmbLvnA";
public static String secret = "fT9ryVgfucZNs2g0VZkj8kzV3eNjY55E";
// public static String de... | // Path: android/app/src/main/java/me/pjq/rpicar/utils/Log.java
// public class Log {
// static String dateFormat = "yyyy-MM-dd hh:mm:ss";
// static SimpleDateFormat fm = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss.SSS");
// static boolean showLog = true;
//
// public static void log(String tag, String m... | Log.log(TAG, "init: " + CONFIG_FILE); |
zxcpro/zing | zing-server/src/main/java/org/zxc/zing/server/remote/NettyServer.java | // Path: zing-common/src/main/java/org/zxc/zing/common/handler/NettyDecoder.java
// public class NettyDecoder extends ByteToMessageDecoder{
//
// private static final Logger log = LoggerFactory.getLogger(NettyDecoder.class);
//
// @Override
// protected void decode(ChannelHandlerContext ctx, ByteBuf in, L... | import io.netty.bootstrap.ServerBootstrap;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelFutureListener;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelOption;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.chann... | package org.zxc.zing.server.remote;
/**
* Created by xuanchen.zhao on 16-1-17.
*/
public class NettyServer {
private static final Logger log = LoggerFactory.getLogger(NettyServer.class);
private static volatile boolean started = false;
public static void start(int port) {
if (!started) {
... | // Path: zing-common/src/main/java/org/zxc/zing/common/handler/NettyDecoder.java
// public class NettyDecoder extends ByteToMessageDecoder{
//
// private static final Logger log = LoggerFactory.getLogger(NettyDecoder.class);
//
// @Override
// protected void decode(ChannelHandlerContext ctx, ByteBuf in, L... | ch.pipeline().addLast(new NettyDecoder(), new NettyEncoder(), new NettyServerHandler()); |
zxcpro/zing | zing-server/src/main/java/org/zxc/zing/server/remote/NettyServer.java | // Path: zing-common/src/main/java/org/zxc/zing/common/handler/NettyDecoder.java
// public class NettyDecoder extends ByteToMessageDecoder{
//
// private static final Logger log = LoggerFactory.getLogger(NettyDecoder.class);
//
// @Override
// protected void decode(ChannelHandlerContext ctx, ByteBuf in, L... | import io.netty.bootstrap.ServerBootstrap;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelFutureListener;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelOption;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.chann... | package org.zxc.zing.server.remote;
/**
* Created by xuanchen.zhao on 16-1-17.
*/
public class NettyServer {
private static final Logger log = LoggerFactory.getLogger(NettyServer.class);
private static volatile boolean started = false;
public static void start(int port) {
if (!started) {
... | // Path: zing-common/src/main/java/org/zxc/zing/common/handler/NettyDecoder.java
// public class NettyDecoder extends ByteToMessageDecoder{
//
// private static final Logger log = LoggerFactory.getLogger(NettyDecoder.class);
//
// @Override
// protected void decode(ChannelHandlerContext ctx, ByteBuf in, L... | ch.pipeline().addLast(new NettyDecoder(), new NettyEncoder(), new NettyServerHandler()); |
zxcpro/zing | zing-server/src/main/java/org/zxc/zing/server/remote/RemoteServiceBean.java | // Path: zing-server/src/main/java/org/zxc/zing/server/RemoteServiceServer.java
// public class RemoteServiceServer {
//
// private static final Logger log = LoggerFactory.getLogger(RemoteServiceServer.class);
//
// private static volatile boolean started = false;
//
// private static String ipAddress = ... | import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.zxc.zing.server.RemoteServiceServer; | package org.zxc.zing.server.remote;
/**
* Created by xuanchen.zhao on 15-12-16.
*/
public class RemoteServiceBean {
private static final Logger log = LoggerFactory.getLogger(RemoteServiceBean.class);
private String serviceName;
private Object serviceImpl;
public void init() { | // Path: zing-server/src/main/java/org/zxc/zing/server/RemoteServiceServer.java
// public class RemoteServiceServer {
//
// private static final Logger log = LoggerFactory.getLogger(RemoteServiceServer.class);
//
// private static volatile boolean started = false;
//
// private static String ipAddress = ... | RemoteServiceServer.addService(serviceName, serviceImpl); |
zxcpro/zing | zing-common/src/main/java/org/zxc/zing/common/registry/ProviderNodeEventListener.java | // Path: zing-common/src/main/java/org/zxc/zing/common/constant/Constants.java
// public class Constants {
// public final static int SERVER_DEFAULT_PORT = 4080;
//
// public final static String SERVER_IP_ADDRESS_CONFIG_KEY = "server.address.ip";
//
// public final static String SERVER_PORT_CONFIG_KEY = "... | import com.google.common.base.Strings;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.recipes.cache.TreeCacheEvent;
import org.apache.curator.framework.recipes.cache.TreeCacheListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.zxc.zing.common.constant... | package org.zxc.zing.common.registry;
/**
* Created by xuanchen.zhao on 16-1-17.
*/
public class ProviderNodeEventListener implements TreeCacheListener {
private static final Logger log = LoggerFactory.getLogger(ProviderNodeEventListener.class);
@Override
public void childEvent(CuratorFramework clien... | // Path: zing-common/src/main/java/org/zxc/zing/common/constant/Constants.java
// public class Constants {
// public final static int SERVER_DEFAULT_PORT = 4080;
//
// public final static String SERVER_IP_ADDRESS_CONFIG_KEY = "server.address.ip";
//
// public final static String SERVER_PORT_CONFIG_KEY = "... | String serviceName = ZookeeperPathUtils.getServiceNameFromProviderZkPath(event.getData().getPath()); |
zxcpro/zing | zing-common/src/main/java/org/zxc/zing/common/registry/ProviderNodeEventListener.java | // Path: zing-common/src/main/java/org/zxc/zing/common/constant/Constants.java
// public class Constants {
// public final static int SERVER_DEFAULT_PORT = 4080;
//
// public final static String SERVER_IP_ADDRESS_CONFIG_KEY = "server.address.ip";
//
// public final static String SERVER_PORT_CONFIG_KEY = "... | import com.google.common.base.Strings;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.recipes.cache.TreeCacheEvent;
import org.apache.curator.framework.recipes.cache.TreeCacheListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.zxc.zing.common.constant... | package org.zxc.zing.common.registry;
/**
* Created by xuanchen.zhao on 16-1-17.
*/
public class ProviderNodeEventListener implements TreeCacheListener {
private static final Logger log = LoggerFactory.getLogger(ProviderNodeEventListener.class);
@Override
public void childEvent(CuratorFramework clien... | // Path: zing-common/src/main/java/org/zxc/zing/common/constant/Constants.java
// public class Constants {
// public final static int SERVER_DEFAULT_PORT = 4080;
//
// public final static String SERVER_IP_ADDRESS_CONFIG_KEY = "server.address.ip";
//
// public final static String SERVER_PORT_CONFIG_KEY = "... | if (!nodePath.startsWith(Constants.SERVICE_ZK_PATH_PREFIX)) { |
zxcpro/zing | zing-server/src/main/java/org/zxc/zing/server/remote/NettyServerHandler.java | // Path: zing-common/src/main/java/org/zxc/zing/common/entity/RemoteRequest.java
// public class RemoteRequest implements Serializable{
//
// private String requestId;
// private String serviceName;
// private String methodName;
// private Class<?>[] parameterTypes;
// private Object[] arguments;
/... | import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelFutureListener;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.zxc.zing.common.entity.RemoteRequest;
import org.zxc.zing.common.e... | package org.zxc.zing.server.remote;
/**
* Created by xuanchen.zhao on 15-12-16.
*/
public class NettyServerHandler extends SimpleChannelInboundHandler<RemoteRequest> {
private static final Logger log = LoggerFactory.getLogger(NettyServerHandler.class);
@Override
protected void channelRead0(ChannelHa... | // Path: zing-common/src/main/java/org/zxc/zing/common/entity/RemoteRequest.java
// public class RemoteRequest implements Serializable{
//
// private String requestId;
// private String serviceName;
// private String methodName;
// private Class<?>[] parameterTypes;
// private Object[] arguments;
/... | Object actualServiceImpl = RemoteServiceServer.getActualServiceImpl(request.getServiceName()); |
zxcpro/zing | zing-server/src/main/java/org/zxc/zing/server/remote/NettyServerHandler.java | // Path: zing-common/src/main/java/org/zxc/zing/common/entity/RemoteRequest.java
// public class RemoteRequest implements Serializable{
//
// private String requestId;
// private String serviceName;
// private String methodName;
// private Class<?>[] parameterTypes;
// private Object[] arguments;
/... | import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelFutureListener;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.zxc.zing.common.entity.RemoteRequest;
import org.zxc.zing.common.e... | package org.zxc.zing.server.remote;
/**
* Created by xuanchen.zhao on 15-12-16.
*/
public class NettyServerHandler extends SimpleChannelInboundHandler<RemoteRequest> {
private static final Logger log = LoggerFactory.getLogger(NettyServerHandler.class);
@Override
protected void channelRead0(ChannelHa... | // Path: zing-common/src/main/java/org/zxc/zing/common/entity/RemoteRequest.java
// public class RemoteRequest implements Serializable{
//
// private String requestId;
// private String serviceName;
// private String methodName;
// private Class<?>[] parameterTypes;
// private Object[] arguments;
/... | RemoteResponse response = new RemoteResponse(); |
zxcpro/zing | zing-demo/src/main/java/org/zxc/zing/demo/impl/DemoServiceImpl.java | // Path: zing-demo/src/main/java/org/zxc/zing/demo/api/DemoService.java
// public interface DemoService {
// String echo(String input);
// MessageDTO loadObject(int messageId);
// }
//
// Path: zing-demo/src/main/java/org/zxc/zing/demo/api/MessageDTO.java
// public class MessageDTO implements Serializable{
// ... | import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.zxc.zing.demo.api.DemoService;
import org.zxc.zing.demo.api.MessageDTO; | package org.zxc.zing.demo.impl;
/**
* Created by xuanchen.zhao on 15-12-8.
*/
public class DemoServiceImpl implements DemoService {
private static final Logger log = LoggerFactory.getLogger(DemoServiceImpl.class);
@Override
public String echo(String input) {
return "echo:"+input;
}
@O... | // Path: zing-demo/src/main/java/org/zxc/zing/demo/api/DemoService.java
// public interface DemoService {
// String echo(String input);
// MessageDTO loadObject(int messageId);
// }
//
// Path: zing-demo/src/main/java/org/zxc/zing/demo/api/MessageDTO.java
// public class MessageDTO implements Serializable{
// ... | public MessageDTO loadObject(int messageId) { |
zxcpro/zing | zing-common/src/main/java/org/zxc/zing/common/util/ZookeeperPathUtils.java | // Path: zing-common/src/main/java/org/zxc/zing/common/constant/Constants.java
// public class Constants {
// public final static int SERVER_DEFAULT_PORT = 4080;
//
// public final static String SERVER_IP_ADDRESS_CONFIG_KEY = "server.address.ip";
//
// public final static String SERVER_PORT_CONFIG_KEY = "... | import com.google.common.base.Splitter;
import com.google.common.base.Strings;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import org.zxc.zing.common.constant.Constants;
import java.util.List; | package org.zxc.zing.common.util;
/**
* Created by xuanchen.zhao on 16-1-24.
*/
public class ZookeeperPathUtils {
private static final int PROVIDER_INFO_NODE_DEPTH = 4;
private static final int SERVICE_NAME_ZK_PATH_DEPTH = 3;
public static String formatProviderPath(String serviceName, String ip, int ... | // Path: zing-common/src/main/java/org/zxc/zing/common/constant/Constants.java
// public class Constants {
// public final static int SERVER_DEFAULT_PORT = 4080;
//
// public final static String SERVER_IP_ADDRESS_CONFIG_KEY = "server.address.ip";
//
// public final static String SERVER_PORT_CONFIG_KEY = "... | String serviceZkPath = String.format(Constants.SERVICE_ZK_PATH_FORMAT, serviceName); |
zxcpro/zing | zing-client/src/main/java/org/zxc/zing/client/provider/ServiceProviderManager.java | // Path: zing-common/src/main/java/org/zxc/zing/common/entity/ProviderInfo.java
// public class ProviderInfo {
// private String address;
// private int port;
//
// public ProviderInfo(String address, int port) {
// this.address = address;
// this.port = port;
// }
//
// public int... | import com.google.common.collect.Lists;
import org.apache.commons.collections.CollectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.zxc.zing.common.entity.ProviderInfo;
import org.zxc.zing.common.registry.ProviderStateListenerManager;
import org.zxc.zing.common.registry.RegistryManager;
i... | package org.zxc.zing.client.provider;
/**
* Created by xuanchen.zhao on 15-12-11.
*/
public class ServiceProviderManager {
private static final Logger log = LoggerFactory.getLogger(ServiceProviderManager.class);
| // Path: zing-common/src/main/java/org/zxc/zing/common/entity/ProviderInfo.java
// public class ProviderInfo {
// private String address;
// private int port;
//
// public ProviderInfo(String address, int port) {
// this.address = address;
// this.port = port;
// }
//
// public int... | private static Map<String, Set<ProviderInfo>> serviceServerMap = new ConcurrentHashMap<String, Set<ProviderInfo>>(); |
zxcpro/zing | zing-client/src/main/java/org/zxc/zing/client/provider/ServiceProviderManager.java | // Path: zing-common/src/main/java/org/zxc/zing/common/entity/ProviderInfo.java
// public class ProviderInfo {
// private String address;
// private int port;
//
// public ProviderInfo(String address, int port) {
// this.address = address;
// this.port = port;
// }
//
// public int... | import com.google.common.collect.Lists;
import org.apache.commons.collections.CollectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.zxc.zing.common.entity.ProviderInfo;
import org.zxc.zing.common.registry.ProviderStateListenerManager;
import org.zxc.zing.common.registry.RegistryManager;
i... | package org.zxc.zing.client.provider;
/**
* Created by xuanchen.zhao on 15-12-11.
*/
public class ServiceProviderManager {
private static final Logger log = LoggerFactory.getLogger(ServiceProviderManager.class);
private static Map<String, Set<ProviderInfo>> serviceServerMap = new ConcurrentHashMap<Strin... | // Path: zing-common/src/main/java/org/zxc/zing/common/entity/ProviderInfo.java
// public class ProviderInfo {
// private String address;
// private int port;
//
// public ProviderInfo(String address, int port) {
// this.address = address;
// this.port = port;
// }
//
// public int... | ProviderStateListenerManager.getInstance().registerProviderStateListener(new ClientProviderStateListener()); |
zxcpro/zing | zing-client/src/main/java/org/zxc/zing/client/provider/ServiceProviderManager.java | // Path: zing-common/src/main/java/org/zxc/zing/common/entity/ProviderInfo.java
// public class ProviderInfo {
// private String address;
// private int port;
//
// public ProviderInfo(String address, int port) {
// this.address = address;
// this.port = port;
// }
//
// public int... | import com.google.common.collect.Lists;
import org.apache.commons.collections.CollectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.zxc.zing.common.entity.ProviderInfo;
import org.zxc.zing.common.registry.ProviderStateListenerManager;
import org.zxc.zing.common.registry.RegistryManager;
i... | package org.zxc.zing.client.provider;
/**
* Created by xuanchen.zhao on 15-12-11.
*/
public class ServiceProviderManager {
private static final Logger log = LoggerFactory.getLogger(ServiceProviderManager.class);
private static Map<String, Set<ProviderInfo>> serviceServerMap = new ConcurrentHashMap<Strin... | // Path: zing-common/src/main/java/org/zxc/zing/common/entity/ProviderInfo.java
// public class ProviderInfo {
// private String address;
// private int port;
//
// public ProviderInfo(String address, int port) {
// this.address = address;
// this.port = port;
// }
//
// public int... | RegistryManager.start(); |
zxcpro/zing | zing-common/src/test/java/com/zxc/zing/common/registry/RegistryManagerTest.java | // Path: zing-common/src/main/java/org/zxc/zing/common/entity/ProviderInfo.java
// public class ProviderInfo {
// private String address;
// private int port;
//
// public ProviderInfo(String address, int port) {
// this.address = address;
// this.port = port;
// }
//
// public int... | import org.zxc.zing.common.entity.ProviderInfo;
import org.zxc.zing.common.registry.RegistryManager;
import java.util.List; | package com.zxc.zing.common.registry;
/**
* Created by xuanchen.zhao on 16-1-17.
*/
public class RegistryManagerTest {
public static void main(String[] args) throws Exception { | // Path: zing-common/src/main/java/org/zxc/zing/common/entity/ProviderInfo.java
// public class ProviderInfo {
// private String address;
// private int port;
//
// public ProviderInfo(String address, int port) {
// this.address = address;
// this.port = port;
// }
//
// public int... | RegistryManager.start(); |
zxcpro/zing | zing-common/src/test/java/com/zxc/zing/common/registry/RegistryManagerTest.java | // Path: zing-common/src/main/java/org/zxc/zing/common/entity/ProviderInfo.java
// public class ProviderInfo {
// private String address;
// private int port;
//
// public ProviderInfo(String address, int port) {
// this.address = address;
// this.port = port;
// }
//
// public int... | import org.zxc.zing.common.entity.ProviderInfo;
import org.zxc.zing.common.registry.RegistryManager;
import java.util.List; | package com.zxc.zing.common.registry;
/**
* Created by xuanchen.zhao on 16-1-17.
*/
public class RegistryManagerTest {
public static void main(String[] args) throws Exception {
RegistryManager.start();
RegistryManager.publishService("org.zxc.zing.demo.api.DemoService", "127.0.0.1", 4080); | // Path: zing-common/src/main/java/org/zxc/zing/common/entity/ProviderInfo.java
// public class ProviderInfo {
// private String address;
// private int port;
//
// public ProviderInfo(String address, int port) {
// this.address = address;
// this.port = port;
// }
//
// public int... | List<ProviderInfo> providerInfos = RegistryManager.loadServerListOfService("org.zxc.zing.demo.api.DemoService"); |
zxcpro/zing | zing-client/src/main/java/org/zxc/zing/client/proxy/ServiceProxyBeanFactory.java | // Path: zing-client/src/main/java/org/zxc/zing/client/provider/ServiceProviderManager.java
// public class ServiceProviderManager {
//
// private static final Logger log = LoggerFactory.getLogger(ServiceProviderManager.class);
//
// private static Map<String, Set<ProviderInfo>> serviceServerMap = new Concurr... | import com.google.common.reflect.Reflection;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.zxc.zing.client.provider.ServiceProviderManager; | package org.zxc.zing.client.proxy;
/**
* Created by xuanchen.zhao on 15-12-10.
*/
public class ServiceProxyBeanFactory {
private static final Logger log = LoggerFactory.getLogger(ServiceProxyBeanFactory.class);
public static Object getService(String serviceName) throws ClassNotFoundException {
Cl... | // Path: zing-client/src/main/java/org/zxc/zing/client/provider/ServiceProviderManager.java
// public class ServiceProviderManager {
//
// private static final Logger log = LoggerFactory.getLogger(ServiceProviderManager.class);
//
// private static Map<String, Set<ProviderInfo>> serviceServerMap = new Concurr... | ServiceProviderManager.initServerListOfService(serviceName); |
zxcpro/zing | zing-common/src/main/java/org/zxc/zing/common/handler/NettyEncoder.java | // Path: zing-common/src/main/java/org/zxc/zing/common/serialize/Serializer.java
// public class Serializer {
//
// private static final Logger log = LoggerFactory.getLogger(Serializer.class);
//
//
// public static byte[] serialize(Object obj) throws IOException {
// ByteArrayOutputStream bos = new ... | import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToByteEncoder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.zxc.zing.common.serialize.Serializer; | package org.zxc.zing.common.handler;
/**
* Created by xuanchen.zhao on 15-12-15.
*/
public class NettyEncoder extends MessageToByteEncoder {
private static final Logger log = LoggerFactory.getLogger(NettyEncoder.class);
@Override
protected void encode(ChannelHandlerContext ctx, Object msg, ByteBuf out... | // Path: zing-common/src/main/java/org/zxc/zing/common/serialize/Serializer.java
// public class Serializer {
//
// private static final Logger log = LoggerFactory.getLogger(Serializer.class);
//
//
// public static byte[] serialize(Object obj) throws IOException {
// ByteArrayOutputStream bos = new ... | byte[] bytes = Serializer.serialize(msg); |
zxcpro/zing | zing-demo/src/main/java/org/zxc/zing/demo/test/client/DemoClientTest.java | // Path: zing-demo/src/main/java/org/zxc/zing/demo/api/DemoService.java
// public interface DemoService {
// String echo(String input);
// MessageDTO loadObject(int messageId);
// }
//
// Path: zing-demo/src/main/java/org/zxc/zing/demo/api/MessageDTO.java
// public class MessageDTO implements Serializable{
// ... | import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.zxc.zing.demo.api.DemoService;
import org.zxc.zing.demo.api.MessageDTO;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors; | package org.zxc.zing.demo.test.client;
/**
* Created by xuanchen.zhao on 15-12-11.
*/
public class DemoClientTest {
private static DemoService demoService;
public static void main(String[] args) throws InterruptedException {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationCont... | // Path: zing-demo/src/main/java/org/zxc/zing/demo/api/DemoService.java
// public interface DemoService {
// String echo(String input);
// MessageDTO loadObject(int messageId);
// }
//
// Path: zing-demo/src/main/java/org/zxc/zing/demo/api/MessageDTO.java
// public class MessageDTO implements Serializable{
// ... | MessageDTO messageDTO = demoService.loadObject(1); |
zxcpro/zing | zing-common/src/main/java/org/zxc/zing/common/handler/NettyDecoder.java | // Path: zing-common/src/main/java/org/zxc/zing/common/serialize/Serializer.java
// public class Serializer {
//
// private static final Logger log = LoggerFactory.getLogger(Serializer.class);
//
//
// public static byte[] serialize(Object obj) throws IOException {
// ByteArrayOutputStream bos = new ... | import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.ByteToMessageDecoder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.zxc.zing.common.serialize.Serializer;
import java.util.List; | package org.zxc.zing.common.handler;
/**
* Created by xuanchen.zhao on 15-12-15.
*/
public class NettyDecoder extends ByteToMessageDecoder{
private static final Logger log = LoggerFactory.getLogger(NettyDecoder.class);
@Override
protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object... | // Path: zing-common/src/main/java/org/zxc/zing/common/serialize/Serializer.java
// public class Serializer {
//
// private static final Logger log = LoggerFactory.getLogger(Serializer.class);
//
//
// public static byte[] serialize(Object obj) throws IOException {
// ByteArrayOutputStream bos = new ... | Object deserialized = Serializer.deserialize(data); |
4FunApp/4Fun | client/FourFun/app/src/main/java/com/joker/fourfun/di/component/AppComponent.java | // Path: client/FourFun/app/src/main/java/com/joker/fourfun/FourFun.java
// public class FourFun extends Application {
// private static FourFun instance;
//
// public static FourFun getInstance() {
// return instance;
// }
//
// @Override
// public void onCreate() {
// super.onCre... | import com.joker.fourfun.FourFun;
import com.joker.fourfun.di.module.AppModule;
import com.joker.fourfun.utils.RetrofitUtil;
import javax.inject.Singleton;
import dagger.Component; | package com.joker.fourfun.di.component;
/**
* Created by joker on 2016/11/28.
*/
@Singleton
@Component(modules = AppModule.class)
public abstract class AppComponent {
private static AppComponent mComponent;
public static AppComponent getInstance() {
if (mComponent == null) {
synchroni... | // Path: client/FourFun/app/src/main/java/com/joker/fourfun/FourFun.java
// public class FourFun extends Application {
// private static FourFun instance;
//
// public static FourFun getInstance() {
// return instance;
// }
//
// @Override
// public void onCreate() {
// super.onCre... | mComponent = DaggerAppComponent.builder().appModule(new AppModule(FourFun.getInstance |
4FunApp/4Fun | client/FourFun/app/src/main/java/com/joker/fourfun/di/component/AppComponent.java | // Path: client/FourFun/app/src/main/java/com/joker/fourfun/FourFun.java
// public class FourFun extends Application {
// private static FourFun instance;
//
// public static FourFun getInstance() {
// return instance;
// }
//
// @Override
// public void onCreate() {
// super.onCre... | import com.joker.fourfun.FourFun;
import com.joker.fourfun.di.module.AppModule;
import com.joker.fourfun.utils.RetrofitUtil;
import javax.inject.Singleton;
import dagger.Component; | package com.joker.fourfun.di.component;
/**
* Created by joker on 2016/11/28.
*/
@Singleton
@Component(modules = AppModule.class)
public abstract class AppComponent {
private static AppComponent mComponent;
public static AppComponent getInstance() {
if (mComponent == null) {
synchroni... | // Path: client/FourFun/app/src/main/java/com/joker/fourfun/FourFun.java
// public class FourFun extends Application {
// private static FourFun instance;
//
// public static FourFun getInstance() {
// return instance;
// }
//
// @Override
// public void onCreate() {
// super.onCre... | public abstract RetrofitUtil retrofitUtil(); |
4FunApp/4Fun | client/FourFun/app/src/main/java/com/joker/fourfun/widget/DividerItemDecoration.java | // Path: client/FourFun/app/src/main/java/com/joker/fourfun/utils/SystemUtil.java
// public class SystemUtil {
// public static final String RUNNING_FONT = "running_font.ttf";
// private static Toast mToast;
//
// private SystemUtil() {
// }
//
// /**
// * 网络是否连接
// *
// * @return
/... | import android.graphics.Rect;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.RecyclerView.ItemDecoration;
import android.view.View;
import com.joker.fourfun.utils.SystemUtil; | package com.joker.fourfun.widget;
/**
* Created by joker on 2016/12/20.
*/
public class DividerItemDecoration extends ItemDecoration {
int mSpace;
/**
* @param space 传入的值,其单位视为dp
*/
public DividerItemDecoration(int space) { | // Path: client/FourFun/app/src/main/java/com/joker/fourfun/utils/SystemUtil.java
// public class SystemUtil {
// public static final String RUNNING_FONT = "running_font.ttf";
// private static Toast mToast;
//
// private SystemUtil() {
// }
//
// /**
// * 网络是否连接
// *
// * @return
/... | this.mSpace = SystemUtil.dp2px(space); |
4FunApp/4Fun | client/FourFun/app/src/main/java/com/joker/fourfun/utils/RxUtil.java | // Path: client/FourFun/app/src/main/java/com/joker/fourfun/model/LoginInfo.java
// public class LoginInfo {
// /**
// * error : false
// * result : [{"userName":"1","password":"1","sex":0,"code":1051}]
// */
// /**
// * userName : 1
// * password : 1
// * sex : 0
// * code : ... | import com.joker.fourfun.model.LoginInfo;
import com.joker.fourfun.net.LoginException;
import com.orhanobut.logger.Logger;
import org.reactivestreams.Publisher;
import java.util.List;
import java.util.concurrent.TimeUnit;
import io.reactivex.Flowable;
import io.reactivex.FlowableTransformer;
import io.reactivex.android... | package com.joker.fourfun.utils;
/**
* Created by joker on 2016/11/28.
*/
public class RxUtil {
/**
* rxjava 线程封装
*
* @param <T>
* @return
*/
public static <T> FlowableTransformer<T, T> rxSchedulerTransformer() {
return new FlowableTransformer<T, T>() {
@Over... | // Path: client/FourFun/app/src/main/java/com/joker/fourfun/model/LoginInfo.java
// public class LoginInfo {
// /**
// * error : false
// * result : [{"userName":"1","password":"1","sex":0,"code":1051}]
// */
// /**
// * userName : 1
// * password : 1
// * sex : 0
// * code : ... | public static FlowableTransformer<List<LoginInfo>, LoginInfo> rxStateCheck(final int code) { |
4FunApp/4Fun | client/FourFun/app/src/main/java/com/joker/fourfun/utils/RxUtil.java | // Path: client/FourFun/app/src/main/java/com/joker/fourfun/model/LoginInfo.java
// public class LoginInfo {
// /**
// * error : false
// * result : [{"userName":"1","password":"1","sex":0,"code":1051}]
// */
// /**
// * userName : 1
// * password : 1
// * sex : 0
// * code : ... | import com.joker.fourfun.model.LoginInfo;
import com.joker.fourfun.net.LoginException;
import com.orhanobut.logger.Logger;
import org.reactivestreams.Publisher;
import java.util.List;
import java.util.concurrent.TimeUnit;
import io.reactivex.Flowable;
import io.reactivex.FlowableTransformer;
import io.reactivex.android... | package com.joker.fourfun.utils;
/**
* Created by joker on 2016/11/28.
*/
public class RxUtil {
/**
* rxjava 线程封装
*
* @param <T>
* @return
*/
public static <T> FlowableTransformer<T, T> rxSchedulerTransformer() {
return new FlowableTransformer<T, T>() {
@Over... | // Path: client/FourFun/app/src/main/java/com/joker/fourfun/model/LoginInfo.java
// public class LoginInfo {
// /**
// * error : false
// * result : [{"userName":"1","password":"1","sex":0,"code":1051}]
// */
// /**
// * userName : 1
// * password : 1
// * sex : 0
// * code : ... | throw new LoginException(serverCode); |
4FunApp/4Fun | server/4FunServer/src/com/mollychin/utils/JDBCUtil.java | // Path: server/4FunServer/src/com/mollychin/utils/ConstantsUtil.java
// public final static String PASSWORD = "123456";
//
// Path: server/4FunServer/src/com/mollychin/utils/ConstantsUtil.java
// public final static String ROOT_URL = "jdbc:mysql://localhost:3306/"
// + DATABASE_NAME;
//
// Path: server/4FunServer/... | import static com.mollychin.utils.ConstantsUtil.PASSWORD;
import static com.mollychin.utils.ConstantsUtil.ROOT_URL;
import static com.mollychin.utils.ConstantsUtil.USER;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.ResultSetMeta... | package com.mollychin.utils;
public class JDBCUtil {
// 连接
public static Connection getConnection() throws Exception {
try {
Class.forName("com.mysql.jdbc.Driver").newInstance(); | // Path: server/4FunServer/src/com/mollychin/utils/ConstantsUtil.java
// public final static String PASSWORD = "123456";
//
// Path: server/4FunServer/src/com/mollychin/utils/ConstantsUtil.java
// public final static String ROOT_URL = "jdbc:mysql://localhost:3306/"
// + DATABASE_NAME;
//
// Path: server/4FunServer/... | return DriverManager.getConnection(ROOT_URL, USER, PASSWORD); |
4FunApp/4Fun | server/4FunServer/src/com/mollychin/utils/JDBCUtil.java | // Path: server/4FunServer/src/com/mollychin/utils/ConstantsUtil.java
// public final static String PASSWORD = "123456";
//
// Path: server/4FunServer/src/com/mollychin/utils/ConstantsUtil.java
// public final static String ROOT_URL = "jdbc:mysql://localhost:3306/"
// + DATABASE_NAME;
//
// Path: server/4FunServer/... | import static com.mollychin.utils.ConstantsUtil.PASSWORD;
import static com.mollychin.utils.ConstantsUtil.ROOT_URL;
import static com.mollychin.utils.ConstantsUtil.USER;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.ResultSetMeta... | package com.mollychin.utils;
public class JDBCUtil {
// 连接
public static Connection getConnection() throws Exception {
try {
Class.forName("com.mysql.jdbc.Driver").newInstance(); | // Path: server/4FunServer/src/com/mollychin/utils/ConstantsUtil.java
// public final static String PASSWORD = "123456";
//
// Path: server/4FunServer/src/com/mollychin/utils/ConstantsUtil.java
// public final static String ROOT_URL = "jdbc:mysql://localhost:3306/"
// + DATABASE_NAME;
//
// Path: server/4FunServer/... | return DriverManager.getConnection(ROOT_URL, USER, PASSWORD); |
4FunApp/4Fun | server/4FunServer/src/com/mollychin/utils/JDBCUtil.java | // Path: server/4FunServer/src/com/mollychin/utils/ConstantsUtil.java
// public final static String PASSWORD = "123456";
//
// Path: server/4FunServer/src/com/mollychin/utils/ConstantsUtil.java
// public final static String ROOT_URL = "jdbc:mysql://localhost:3306/"
// + DATABASE_NAME;
//
// Path: server/4FunServer/... | import static com.mollychin.utils.ConstantsUtil.PASSWORD;
import static com.mollychin.utils.ConstantsUtil.ROOT_URL;
import static com.mollychin.utils.ConstantsUtil.USER;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.ResultSetMeta... | package com.mollychin.utils;
public class JDBCUtil {
// 连接
public static Connection getConnection() throws Exception {
try {
Class.forName("com.mysql.jdbc.Driver").newInstance(); | // Path: server/4FunServer/src/com/mollychin/utils/ConstantsUtil.java
// public final static String PASSWORD = "123456";
//
// Path: server/4FunServer/src/com/mollychin/utils/ConstantsUtil.java
// public final static String ROOT_URL = "jdbc:mysql://localhost:3306/"
// + DATABASE_NAME;
//
// Path: server/4FunServer/... | return DriverManager.getConnection(ROOT_URL, USER, PASSWORD); |
4FunApp/4Fun | server/4FunServer/src/com/mollychin/utils/JDBCUtil.java | // Path: server/4FunServer/src/com/mollychin/utils/ConstantsUtil.java
// public final static String PASSWORD = "123456";
//
// Path: server/4FunServer/src/com/mollychin/utils/ConstantsUtil.java
// public final static String ROOT_URL = "jdbc:mysql://localhost:3306/"
// + DATABASE_NAME;
//
// Path: server/4FunServer/... | import static com.mollychin.utils.ConstantsUtil.PASSWORD;
import static com.mollychin.utils.ConstantsUtil.ROOT_URL;
import static com.mollychin.utils.ConstantsUtil.USER;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.ResultSetMeta... | JSONObject object = new JSONObject();
boolean error = true;
// json 数组
JSONArray array = new JSONArray();
// 获取列数
ResultSetMetaData metaData = rs.getMetaData();
int columnCount = metaData.getColumnCount();
// 遍历ResultSet中的每条数据
while (rs.next()) {
int row = rs.getRow() - 1;
ResultSet data = selec... | // Path: server/4FunServer/src/com/mollychin/utils/ConstantsUtil.java
// public final static String PASSWORD = "123456";
//
// Path: server/4FunServer/src/com/mollychin/utils/ConstantsUtil.java
// public final static String ROOT_URL = "jdbc:mysql://localhost:3306/"
// + DATABASE_NAME;
//
// Path: server/4FunServer/... | public static void addUser(User user) throws Exception { |
4FunApp/4Fun | client/FourFun/app/src/main/java/com/joker/fourfun/presenter/contract/MovieDetailContract.java | // Path: client/FourFun/app/src/main/java/com/joker/fourfun/base/BasePresenter.java
// public interface BasePresenter<T extends BaseView> {
// void attach(T mView);
//
// void detach();
// }
//
// Path: client/FourFun/app/src/main/java/com/joker/fourfun/base/BaseView.java
// public interface BaseView {
// ... | import com.joker.fourfun.base.BasePresenter;
import com.joker.fourfun.base.BaseView;
import com.joker.fourfun.model.Movie; | package com.joker.fourfun.presenter.contract;
/**
* Created by joker on 2017/1/3.
*/
public interface MovieDetailContract {
interface View extends BaseView {
void showContent(Movie movie);
}
| // Path: client/FourFun/app/src/main/java/com/joker/fourfun/base/BasePresenter.java
// public interface BasePresenter<T extends BaseView> {
// void attach(T mView);
//
// void detach();
// }
//
// Path: client/FourFun/app/src/main/java/com/joker/fourfun/base/BaseView.java
// public interface BaseView {
// ... | interface Presenter extends BasePresenter<View> { |
4FunApp/4Fun | client/FourFun/app/src/main/java/com/joker/fourfun/presenter/contract/PictureContract.java | // Path: client/FourFun/app/src/main/java/com/joker/fourfun/base/BasePresenter.java
// public interface BasePresenter<T extends BaseView> {
// void attach(T mView);
//
// void detach();
// }
//
// Path: client/FourFun/app/src/main/java/com/joker/fourfun/base/BaseView.java
// public interface BaseView {
// ... | import com.joker.fourfun.base.BasePresenter;
import com.joker.fourfun.base.BaseView; | package com.joker.fourfun.presenter.contract;
/**
* Created by joker on 2016/12/5.
*/
public interface PictureContract {
interface View extends BaseView {
}
| // Path: client/FourFun/app/src/main/java/com/joker/fourfun/base/BasePresenter.java
// public interface BasePresenter<T extends BaseView> {
// void attach(T mView);
//
// void detach();
// }
//
// Path: client/FourFun/app/src/main/java/com/joker/fourfun/base/BaseView.java
// public interface BaseView {
// ... | interface Presenter extends BasePresenter<View> { |
4FunApp/4Fun | client/FourFun/app/src/main/java/com/joker/fourfun/presenter/contract/MainContract.java | // Path: client/FourFun/app/src/main/java/com/joker/fourfun/base/BasePresenter.java
// public interface BasePresenter<T extends BaseView> {
// void attach(T mView);
//
// void detach();
// }
//
// Path: client/FourFun/app/src/main/java/com/joker/fourfun/base/BaseView.java
// public interface BaseView {
// ... | import com.joker.fourfun.base.BasePresenter;
import com.joker.fourfun.base.BaseView; | package com.joker.fourfun.presenter.contract;
/**
* Created by joker on 2016/11/30.
*/
public interface MainContract {
interface View extends BaseView {
}
| // Path: client/FourFun/app/src/main/java/com/joker/fourfun/base/BasePresenter.java
// public interface BasePresenter<T extends BaseView> {
// void attach(T mView);
//
// void detach();
// }
//
// Path: client/FourFun/app/src/main/java/com/joker/fourfun/base/BaseView.java
// public interface BaseView {
// ... | interface Presenter extends BasePresenter<View> { |
4FunApp/4Fun | client/FourFun/app/src/main/java/com/joker/fourfun/base/BaseMvpActivity.java | // Path: client/FourFun/app/src/main/java/com/joker/fourfun/di/component/ActivityComponent.java
// @PerActivity
// @Component(dependencies = AppComponent.class, modules = ActivityModule.class)
// public interface ActivityComponent {
// AppCompatActivity activity();
//
// void inject(SplashActivity activity);
/... | import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import com.joker.fourfun.di.component.ActivityComponent;
import com.joker.fourfun.di.component.AppComponent;
import com.joker.fourfun.di.component.DaggerActivityComponent;
import com.joker.fourfun.di.modul... | package com.joker.fourfun.base;
public abstract class BaseMvpActivity<V extends BaseView, T extends BaseMvpPresenter<V>> extends
AppCompatActivity {
@Inject
protected T mPresenter;
@Override
@SuppressWarnings("unchecked")
protected void onCreate(Bundle savedInstanceState) {
sup... | // Path: client/FourFun/app/src/main/java/com/joker/fourfun/di/component/ActivityComponent.java
// @PerActivity
// @Component(dependencies = AppComponent.class, modules = ActivityModule.class)
// public interface ActivityComponent {
// AppCompatActivity activity();
//
// void inject(SplashActivity activity);
/... | protected ActivityComponent getComponent() { |
4FunApp/4Fun | client/FourFun/app/src/main/java/com/joker/fourfun/base/BaseMvpActivity.java | // Path: client/FourFun/app/src/main/java/com/joker/fourfun/di/component/ActivityComponent.java
// @PerActivity
// @Component(dependencies = AppComponent.class, modules = ActivityModule.class)
// public interface ActivityComponent {
// AppCompatActivity activity();
//
// void inject(SplashActivity activity);
/... | import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import com.joker.fourfun.di.component.ActivityComponent;
import com.joker.fourfun.di.component.AppComponent;
import com.joker.fourfun.di.component.DaggerActivityComponent;
import com.joker.fourfun.di.modul... | package com.joker.fourfun.base;
public abstract class BaseMvpActivity<V extends BaseView, T extends BaseMvpPresenter<V>> extends
AppCompatActivity {
@Inject
protected T mPresenter;
@Override
@SuppressWarnings("unchecked")
protected void onCreate(Bundle savedInstanceState) {
sup... | // Path: client/FourFun/app/src/main/java/com/joker/fourfun/di/component/ActivityComponent.java
// @PerActivity
// @Component(dependencies = AppComponent.class, modules = ActivityModule.class)
// public interface ActivityComponent {
// AppCompatActivity activity();
//
// void inject(SplashActivity activity);
/... | return DaggerActivityComponent.builder().activityModule(getModule()).appComponent(AppComponent |
4FunApp/4Fun | client/FourFun/app/src/main/java/com/joker/fourfun/base/BaseMvpActivity.java | // Path: client/FourFun/app/src/main/java/com/joker/fourfun/di/component/ActivityComponent.java
// @PerActivity
// @Component(dependencies = AppComponent.class, modules = ActivityModule.class)
// public interface ActivityComponent {
// AppCompatActivity activity();
//
// void inject(SplashActivity activity);
/... | import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import com.joker.fourfun.di.component.ActivityComponent;
import com.joker.fourfun.di.component.AppComponent;
import com.joker.fourfun.di.component.DaggerActivityComponent;
import com.joker.fourfun.di.modul... | package com.joker.fourfun.base;
public abstract class BaseMvpActivity<V extends BaseView, T extends BaseMvpPresenter<V>> extends
AppCompatActivity {
@Inject
protected T mPresenter;
@Override
@SuppressWarnings("unchecked")
protected void onCreate(Bundle savedInstanceState) {
sup... | // Path: client/FourFun/app/src/main/java/com/joker/fourfun/di/component/ActivityComponent.java
// @PerActivity
// @Component(dependencies = AppComponent.class, modules = ActivityModule.class)
// public interface ActivityComponent {
// AppCompatActivity activity();
//
// void inject(SplashActivity activity);
/... | protected ActivityModule getModule() { |
4FunApp/4Fun | client/FourFun/app/src/main/java/com/joker/fourfun/presenter/contract/PictureDetailContract.java | // Path: client/FourFun/app/src/main/java/com/joker/fourfun/base/BasePresenter.java
// public interface BasePresenter<T extends BaseView> {
// void attach(T mView);
//
// void detach();
// }
//
// Path: client/FourFun/app/src/main/java/com/joker/fourfun/base/BaseView.java
// public interface BaseView {
// ... | import com.joker.fourfun.base.BasePresenter;
import com.joker.fourfun.base.BaseView;
import com.joker.fourfun.model.Picture; | package com.joker.fourfun.presenter.contract;
/**
* Created by joker on 2016/12/29.
*/
public interface PictureDetailContract {
interface View extends BaseView { | // Path: client/FourFun/app/src/main/java/com/joker/fourfun/base/BasePresenter.java
// public interface BasePresenter<T extends BaseView> {
// void attach(T mView);
//
// void detach();
// }
//
// Path: client/FourFun/app/src/main/java/com/joker/fourfun/base/BaseView.java
// public interface BaseView {
// ... | void showContent(Picture picture); |
4FunApp/4Fun | client/FourFun/app/src/main/java/com/joker/fourfun/presenter/contract/PictureDetailContract.java | // Path: client/FourFun/app/src/main/java/com/joker/fourfun/base/BasePresenter.java
// public interface BasePresenter<T extends BaseView> {
// void attach(T mView);
//
// void detach();
// }
//
// Path: client/FourFun/app/src/main/java/com/joker/fourfun/base/BaseView.java
// public interface BaseView {
// ... | import com.joker.fourfun.base.BasePresenter;
import com.joker.fourfun.base.BaseView;
import com.joker.fourfun.model.Picture; | package com.joker.fourfun.presenter.contract;
/**
* Created by joker on 2016/12/29.
*/
public interface PictureDetailContract {
interface View extends BaseView {
void showContent(Picture picture);
}
| // Path: client/FourFun/app/src/main/java/com/joker/fourfun/base/BasePresenter.java
// public interface BasePresenter<T extends BaseView> {
// void attach(T mView);
//
// void detach();
// }
//
// Path: client/FourFun/app/src/main/java/com/joker/fourfun/base/BaseView.java
// public interface BaseView {
// ... | interface Presenter extends BasePresenter<View> { |
4FunApp/4Fun | client/FourFun/app/src/main/java/com/joker/fourfun/presenter/contract/SplashContract.java | // Path: client/FourFun/app/src/main/java/com/joker/fourfun/base/BasePresenter.java
// public interface BasePresenter<T extends BaseView> {
// void attach(T mView);
//
// void detach();
// }
//
// Path: client/FourFun/app/src/main/java/com/joker/fourfun/base/BaseView.java
// public interface BaseView {
// ... | import com.joker.fourfun.base.BasePresenter;
import com.joker.fourfun.base.BaseView;
import com.joker.fourfun.model.Picture; | package com.joker.fourfun.presenter.contract;
/**
* Created by joker on 2016/11/27.
*/
public interface SplashContract {
interface View extends BaseView {
void showZhihuPic(String url);
void setMediaBackground(String url);
| // Path: client/FourFun/app/src/main/java/com/joker/fourfun/base/BasePresenter.java
// public interface BasePresenter<T extends BaseView> {
// void attach(T mView);
//
// void detach();
// }
//
// Path: client/FourFun/app/src/main/java/com/joker/fourfun/base/BaseView.java
// public interface BaseView {
// ... | void setPictureOne(Picture picture); |
4FunApp/4Fun | client/FourFun/app/src/main/java/com/joker/fourfun/presenter/contract/SplashContract.java | // Path: client/FourFun/app/src/main/java/com/joker/fourfun/base/BasePresenter.java
// public interface BasePresenter<T extends BaseView> {
// void attach(T mView);
//
// void detach();
// }
//
// Path: client/FourFun/app/src/main/java/com/joker/fourfun/base/BaseView.java
// public interface BaseView {
// ... | import com.joker.fourfun.base.BasePresenter;
import com.joker.fourfun.base.BaseView;
import com.joker.fourfun.model.Picture; | package com.joker.fourfun.presenter.contract;
/**
* Created by joker on 2016/11/27.
*/
public interface SplashContract {
interface View extends BaseView {
void showZhihuPic(String url);
void setMediaBackground(String url);
void setPictureOne(Picture picture);
}
| // Path: client/FourFun/app/src/main/java/com/joker/fourfun/base/BasePresenter.java
// public interface BasePresenter<T extends BaseView> {
// void attach(T mView);
//
// void detach();
// }
//
// Path: client/FourFun/app/src/main/java/com/joker/fourfun/base/BaseView.java
// public interface BaseView {
// ... | interface Presenter extends BasePresenter<View> { |
4FunApp/4Fun | client/FourFun/app/src/main/java/com/joker/fourfun/presenter/contract/LoginContract.java | // Path: client/FourFun/app/src/main/java/com/joker/fourfun/base/BasePresenter.java
// public interface BasePresenter<T extends BaseView> {
// void attach(T mView);
//
// void detach();
// }
//
// Path: client/FourFun/app/src/main/java/com/joker/fourfun/base/BaseView.java
// public interface BaseView {
// ... | import com.joker.fourfun.base.BasePresenter;
import com.joker.fourfun.base.BaseView; | package com.joker.fourfun.presenter.contract;
/**
* Created by joker on 2016/12/30.
*/
public interface LoginContract {
interface View extends BaseView {
void loginSuccess(String message);
void usernameEmpty();
void passwordEmpty();
}
| // Path: client/FourFun/app/src/main/java/com/joker/fourfun/base/BasePresenter.java
// public interface BasePresenter<T extends BaseView> {
// void attach(T mView);
//
// void detach();
// }
//
// Path: client/FourFun/app/src/main/java/com/joker/fourfun/base/BaseView.java
// public interface BaseView {
// ... | interface Presenter extends BasePresenter<View> { |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.