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 |
|---|---|---|---|---|---|---|
davidmoten/grumpy | grumpy-core/src/test/java/com/github/davidmoten/grumpy/core/PositionTest.java | // Path: grumpy-core/src/main/java/com/github/davidmoten/grumpy/core/Position.java
// public static double longitudeDiff(double a, double b) {
// a = to180(a);
// b = to180(b);
// return Math.abs(to180(a - b));
// }
//
// Path: grumpy-core/src/main/java/com/github/davidmoten/grumpy/core/Position.java
// pu... | import static com.github.davidmoten.grumpy.core.Position.longitudeDiff;
import static com.github.davidmoten.grumpy.core.Position.to180;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import java.util.ArrayList;
import java.util.List;
i... | Position p = new Position(-10, 110);
assertTrue(p.isOutside(squareRegion, MIN_DISTANCE_KM));
}
/**
* Test when a position is outside a given region consisting of several
* joining points. In this test the region is a roughly square region
* consisting of four segments or eight {@... | // Path: grumpy-core/src/main/java/com/github/davidmoten/grumpy/core/Position.java
// public static double longitudeDiff(double a, double b) {
// a = to180(a);
// b = to180(b);
// return Math.abs(to180(a - b));
// }
//
// Path: grumpy-core/src/main/java/com/github/davidmoten/grumpy/core/Position.java
// pu... | assertEquals(0, to180(0), PRECISION); |
davidmoten/grumpy | grumpy-core/src/test/java/com/github/davidmoten/grumpy/core/PositionTest.java | // Path: grumpy-core/src/main/java/com/github/davidmoten/grumpy/core/Position.java
// public static double longitudeDiff(double a, double b) {
// a = to180(a);
// b = to180(b);
// return Math.abs(to180(a - b));
// }
//
// Path: grumpy-core/src/main/java/com/github/davidmoten/grumpy/core/Position.java
// pu... | import static com.github.davidmoten.grumpy.core.Position.longitudeDiff;
import static com.github.davidmoten.grumpy.core.Position.to180;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import java.util.ArrayList;
import java.util.List;
i... | Position p = new Position(20.07030897931526, 24.999999999999996);
assertFalse(p.isOutside(squareRegion, MIN_DISTANCE_KM));
}
/**
* Test when a position is outside a given region consisting of several
* joining points. In this test the region is a roughly square region
* consistin... | // Path: grumpy-core/src/main/java/com/github/davidmoten/grumpy/core/Position.java
// public static double longitudeDiff(double a, double b) {
// a = to180(a);
// b = to180(b);
// return Math.abs(to180(a - b));
// }
//
// Path: grumpy-core/src/main/java/com/github/davidmoten/grumpy/core/Position.java
// pu... | assertEquals(10, longitudeDiff(15, 5), PRECISION); |
davidmoten/grumpy | grumpy-core/src/test/java/com/github/davidmoten/grumpy/core/PositionTest.java | // Path: grumpy-core/src/main/java/com/github/davidmoten/grumpy/core/Position.java
// public static double longitudeDiff(double a, double b) {
// a = to180(a);
// b = to180(b);
// return Math.abs(to180(a - b));
// }
//
// Path: grumpy-core/src/main/java/com/github/davidmoten/grumpy/core/Position.java
// pu... | import static com.github.davidmoten.grumpy.core.Position.longitudeDiff;
import static com.github.davidmoten.grumpy.core.Position.to180;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import java.util.ArrayList;
import java.util.List;
i... | Position a = Position.create(0, 20);
Position b = Position.create(0, 30);
System.out.println(a.getBearingDegrees(b));
Double halfwayLat = a.getLatitudeOnGreatCircle(b, 25);
assertEquals(0, halfwayLat, 0.1);
}
@Test
public void testGetLatitudeOnGreatCircleFromLaxToJfk... | // Path: grumpy-core/src/main/java/com/github/davidmoten/grumpy/core/Position.java
// public static double longitudeDiff(double a, double b) {
// a = to180(a);
// b = to180(b);
// return Math.abs(to180(a - b));
// }
//
// Path: grumpy-core/src/main/java/com/github/davidmoten/grumpy/core/Position.java
// pu... | LongitudePair candidates = a.getLongitudeOnGreatCircle(b, 36 + 23.65967428 / 60.0); |
davidmoten/grumpy | grumpy-ogc/src/main/java/com/github/davidmoten/util/servlet/RequestUtil.java | // Path: grumpy-ogc/src/main/java/com/github/davidmoten/grumpy/wms/MissingMandatoryParameterException.java
// public class MissingMandatoryParameterException extends Exception {
//
// private static final long serialVersionUID = -9206288232141856630L;
//
// public MissingMandatoryParameterException(String... | import java.util.Arrays;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.github.davidmoten.grumpy.wms.MissingMandatoryParameterException; | package com.github.davidmoten.util.servlet;
public class RequestUtil {
private static final String COMMA = ",";
public static List<String> getList(HttpServletRequest request, String parameter,
boolean mandatory) {
String[] items = new String[] {};
if (request.getParameter(param... | // Path: grumpy-ogc/src/main/java/com/github/davidmoten/grumpy/wms/MissingMandatoryParameterException.java
// public class MissingMandatoryParameterException extends Exception {
//
// private static final long serialVersionUID = -9206288232141856630L;
//
// public MissingMandatoryParameterException(String... | boolean mandatory) throws MissingMandatoryParameterException { |
juiser/juiser | spring/spring-security/src/main/java/org/juiser/spring/security/authentication/JwsToUserDetailsConverter.java | // Path: core/src/main/java/org/juiser/model/User.java
// public interface User {
//
// /**
// * Returns {@code true} if the user has been authenticated (proven their identity) or {@code false} if the user
// * is considered anonymous.
// *
// * @return {@code true} if the user has been authent... | import org.juiser.model.User;
import org.juiser.spring.security.core.userdetails.ForwardedUserDetails;
import io.jsonwebtoken.Claims;
import io.jsonwebtoken.lang.Assert;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
import java.util.Collecti... | /*
* Copyright 2017 Les Hazlewood and the respective Juiser contributors
*
* 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
*
* U... | // Path: core/src/main/java/org/juiser/model/User.java
// public interface User {
//
// /**
// * Returns {@code true} if the user has been authenticated (proven their identity) or {@code false} if the user
// * is considered anonymous.
// *
// * @return {@code true} if the user has been authent... | private final Function<Claims, User> claimsUserFactory; |
juiser/juiser | spring/spring-security/src/main/java/org/juiser/spring/security/authentication/JwsToUserDetailsConverter.java | // Path: core/src/main/java/org/juiser/model/User.java
// public interface User {
//
// /**
// * Returns {@code true} if the user has been authenticated (proven their identity) or {@code false} if the user
// * is considered anonymous.
// *
// * @return {@code true} if the user has been authent... | import org.juiser.model.User;
import org.juiser.spring.security.core.userdetails.ForwardedUserDetails;
import io.jsonwebtoken.Claims;
import io.jsonwebtoken.lang.Assert;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
import java.util.Collecti... | /*
* Copyright 2017 Les Hazlewood and the respective Juiser contributors
*
* 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
*
* U... | // Path: core/src/main/java/org/juiser/model/User.java
// public interface User {
//
// /**
// * Returns {@code true} if the user has been authenticated (proven their identity) or {@code false} if the user
// * is considered anonymous.
// *
// * @return {@code true} if the user has been authent... | return new ForwardedUserDetails(user, authorities); |
juiser/juiser | spring/spring-web/src/main/java/org/juiser/spring/web/SpringForwardedUserFilter.java | // Path: core/src/main/java/org/juiser/model/User.java
// public interface User {
//
// /**
// * Returns {@code true} if the user has been authenticated (proven their identity) or {@code false} if the user
// * is considered anonymous.
// *
// * @return {@code true} if the user has been authent... | import org.juiser.model.User;
import org.juiser.servlet.ForwardedUserFilter;
import org.springframework.web.filter.OncePerRequestFilter;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IO... | /*
* Copyright 2017 Les Hazlewood and the respective Juiser contributors
*
* 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
*
* U... | // Path: core/src/main/java/org/juiser/model/User.java
// public interface User {
//
// /**
// * Returns {@code true} if the user has been authenticated (proven their identity) or {@code false} if the user
// * is considered anonymous.
// *
// * @return {@code true} if the user has been authent... | Function<HttpServletRequest, User> userFactory, |
juiser/juiser | spring/spring-security/src/main/java/org/juiser/spring/security/web/authentication/HeaderAuthenticationFilter.java | // Path: spring/spring-security/src/main/java/org/juiser/spring/security/authentication/HeaderAuthenticationToken.java
// public class HeaderAuthenticationToken extends AbstractAuthenticationToken {
//
// private final String headerName;
//
// private final String headerValue;
//
// public HeaderAuthenti... | import org.juiser.spring.security.authentication.HeaderAuthenticationToken;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.authentication.InternalAuthenticationServiceException;
import org.springframe... |
/**
* Clears the {@link SecurityContextHolder} and returns {@code true}.
*/
protected boolean unsuccessfulAuthentication(HttpServletRequest request,
HttpServletResponse response,
FilterChain chain,
... | // Path: spring/spring-security/src/main/java/org/juiser/spring/security/authentication/HeaderAuthenticationToken.java
// public class HeaderAuthenticationToken extends AbstractAuthenticationToken {
//
// private final String headerName;
//
// private final String headerValue;
//
// public HeaderAuthenti... | HeaderAuthenticationToken token = new HeaderAuthenticationToken(name, value); |
juiser/juiser | core/src/main/java/org/juiser/jwt/config/ConfigJwkResolver.java | // Path: core/src/main/java/org/juiser/io/DefaultResource.java
// public class DefaultResource implements Resource {
//
// private final InputStream is;
// private final String name;
//
// public DefaultResource(InputStream is, String name) {
// Assert.notNull(is, "InputStream cannot be null.");
/... | import java.security.PublicKey;
import java.security.interfaces.ECKey;
import java.security.interfaces.RSAKey;
import java.util.function.Function;
import org.juiser.io.DefaultResource;
import org.juiser.io.Resource;
import org.juiser.io.ResourceLoader;
import org.juiser.jwt.AlgorithmFamily;
import io.jsonwebtoken.Signa... | /*
* Copyright 2017 Les Hazlewood and the respective Juiser contributors
*
* 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
*
* U... | // Path: core/src/main/java/org/juiser/io/DefaultResource.java
// public class DefaultResource implements Resource {
//
// private final InputStream is;
// private final String name;
//
// public DefaultResource(InputStream is, String name) {
// Assert.notNull(is, "InputStream cannot be null.");
/... | AlgorithmFamily algorithmFamily = null; |
juiser/juiser | core/src/main/java/org/juiser/jwt/config/ConfigJwkResolver.java | // Path: core/src/main/java/org/juiser/io/DefaultResource.java
// public class DefaultResource implements Resource {
//
// private final InputStream is;
// private final String name;
//
// public DefaultResource(InputStream is, String name) {
// Assert.notNull(is, "InputStream cannot be null.");
/... | import java.security.PublicKey;
import java.security.interfaces.ECKey;
import java.security.interfaces.RSAKey;
import java.util.function.Function;
import org.juiser.io.DefaultResource;
import org.juiser.io.Resource;
import org.juiser.io.ResourceLoader;
import org.juiser.jwt.AlgorithmFamily;
import io.jsonwebtoken.Signa... | /*
* Copyright 2017 Les Hazlewood and the respective Juiser contributors
*
* 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
*
* U... | // Path: core/src/main/java/org/juiser/io/DefaultResource.java
// public class DefaultResource implements Resource {
//
// private final InputStream is;
// private final String name;
//
// public DefaultResource(InputStream is, String name) {
// Assert.notNull(is, "InputStream cannot be null.");
/... | Resource keyResource = getResource(jwk); |
juiser/juiser | core/src/main/java/org/juiser/jwt/config/ConfigJwkResolver.java | // Path: core/src/main/java/org/juiser/io/DefaultResource.java
// public class DefaultResource implements Resource {
//
// private final InputStream is;
// private final String name;
//
// public DefaultResource(InputStream is, String name) {
// Assert.notNull(is, "InputStream cannot be null.");
/... | import java.security.PublicKey;
import java.security.interfaces.ECKey;
import java.security.interfaces.RSAKey;
import java.util.function.Function;
import org.juiser.io.DefaultResource;
import org.juiser.io.Resource;
import org.juiser.io.ResourceLoader;
import org.juiser.jwt.AlgorithmFamily;
import io.jsonwebtoken.Signa... |
if (keyResource != null && keyStringSpecified) {
String msg = "Both the juiser.header.jwt.key.value and " +
"juiser.header.jwt.key.resource properties may not be set simultaneously. " +
"Please choose one.";
throw new IllegalArgumentException(msg);
... | // Path: core/src/main/java/org/juiser/io/DefaultResource.java
// public class DefaultResource implements Resource {
//
// private final InputStream is;
// private final String name;
//
// public DefaultResource(InputStream is, String name) {
// Assert.notNull(is, "InputStream cannot be null.");
/... | keyResource = new DefaultResource(bais, "juiser.header.jwt.key.value"); |
juiser/juiser | spring/spring-core/src/main/java/org/juiser/spring/io/SpringResourceLoader.java | // Path: core/src/main/java/org/juiser/io/DefaultResource.java
// public class DefaultResource implements Resource {
//
// private final InputStream is;
// private final String name;
//
// public DefaultResource(InputStream is, String name) {
// Assert.notNull(is, "InputStream cannot be null.");
/... | import org.juiser.io.DefaultResource;
import org.juiser.io.Resource;
import org.juiser.io.ResourceLoader;
import java.io.IOException; | /*
* Copyright 2017 Les Hazlewood and the respective Juiser contributors
*
* 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
*
* U... | // Path: core/src/main/java/org/juiser/io/DefaultResource.java
// public class DefaultResource implements Resource {
//
// private final InputStream is;
// private final String name;
//
// public DefaultResource(InputStream is, String name) {
// Assert.notNull(is, "InputStream cannot be null.");
/... | public Resource getResource(String path) throws IOException { |
juiser/juiser | spring/spring-core/src/main/java/org/juiser/spring/io/SpringResourceLoader.java | // Path: core/src/main/java/org/juiser/io/DefaultResource.java
// public class DefaultResource implements Resource {
//
// private final InputStream is;
// private final String name;
//
// public DefaultResource(InputStream is, String name) {
// Assert.notNull(is, "InputStream cannot be null.");
/... | import org.juiser.io.DefaultResource;
import org.juiser.io.Resource;
import org.juiser.io.ResourceLoader;
import java.io.IOException; | /*
* Copyright 2017 Les Hazlewood and the respective Juiser contributors
*
* 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
*
* U... | // Path: core/src/main/java/org/juiser/io/DefaultResource.java
// public class DefaultResource implements Resource {
//
// private final InputStream is;
// private final String name;
//
// public DefaultResource(InputStream is, String name) {
// Assert.notNull(is, "InputStream cannot be null.");
/... | return new DefaultResource(resource.getInputStream(), resource.getDescription()); |
juiser/juiser | servlet/src/main/java/org/juiser/servlet/ForwardedUserFilter.java | // Path: core/src/main/java/org/juiser/model/User.java
// public interface User {
//
// /**
// * Returns {@code true} if the user has been authenticated (proven their identity) or {@code false} if the user
// * is considered anonymous.
// *
// * @return {@code true} if the user has been authent... | import java.util.LinkedHashSet;
import java.util.function.Function;
import io.jsonwebtoken.lang.Assert;
import io.jsonwebtoken.lang.Collections;
import io.jsonwebtoken.lang.Strings;
import org.juiser.model.User;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import jav... | /*
* Copyright 2017 Les Hazlewood and the respective Juiser contributors
*
* 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
*
* U... | // Path: core/src/main/java/org/juiser/model/User.java
// public interface User {
//
// /**
// * Returns {@code true} if the user has been authenticated (proven their identity) or {@code false} if the user
// * is considered anonymous.
// *
// * @return {@code true} if the user has been authent... | private final Function<HttpServletRequest, User> userFactory; |
juiser/juiser | spring/spring-security/src/main/java/org/juiser/spring/security/authentication/HeaderAuthenticationProvider.java | // Path: spring/spring-security/src/main/java/org/juiser/spring/security/core/ForwardedUserAuthentication.java
// public class ForwardedUserAuthentication implements Authentication {
//
// private final UserDetails details;
//
// public ForwardedUserAuthentication(UserDetails details) {
// Assert.notN... | import io.jsonwebtoken.JwtException;
import org.juiser.spring.security.core.ForwardedUserAuthentication;
import org.springframework.security.authentication.AuthenticationProvider;
import org.springframework.security.authentication.BadCredentialsException;
import org.springframework.security.authentication.InternalAuthe... | public boolean supports(Class<?> authentication) {
return HeaderAuthenticationToken.class.isAssignableFrom(authentication);
}
@Override
public Authentication authenticate(Authentication authentication) throws AuthenticationException {
HeaderAuthenticationToken token = (HeaderAuthentica... | // Path: spring/spring-security/src/main/java/org/juiser/spring/security/core/ForwardedUserAuthentication.java
// public class ForwardedUserAuthentication implements Authentication {
//
// private final UserDetails details;
//
// public ForwardedUserAuthentication(UserDetails details) {
// Assert.notN... | return new ForwardedUserAuthentication(details); |
mibo/janos | janos-core/src/test/java/org/apache/olingo/odata2/janos/processor/core/util/AnnotationHelperTest.java | // Path: janos-core/src/test/java/org/apache/olingo/odata2/janos/processor/core/model/Location.java
// @EdmComplexType(name = "c_Location", namespace = ModelSharedConstants.NAMESPACE_1)
// public class Location {
// @EdmProperty
// private String country;
// @EdmProperty
// private City city;
//
// public Lo... | import junit.framework.Assert;
import org.apache.olingo.odata2.api.annotation.edm.*;
import org.apache.olingo.odata2.api.edm.FullQualifiedName;
import org.apache.olingo.odata2.api.edm.provider.*;
import org.apache.olingo.odata2.api.exception.ODataException;
import org.apache.olingo.odata2.janos.processor.core.model.Loc... |
@Test
public void getFieldTypeForPropertyNullInstance() throws Exception {
Object result = annotationHelper.getFieldTypeForProperty(null, "");
Assert.assertNull(result);
}
@Test
public void getValueForPropertyNullInstance() throws Exception {
Object result = annotationHelper.getValueForProperty(... | // Path: janos-core/src/test/java/org/apache/olingo/odata2/janos/processor/core/model/Location.java
// @EdmComplexType(name = "c_Location", namespace = ModelSharedConstants.NAMESPACE_1)
// public class Location {
// @EdmProperty
// private String country;
// @EdmProperty
// private City city;
//
// public Lo... | FullQualifiedName fqn = annotationHelper.extractComplexTypeFqn(Location.class); |
mibo/janos | janos-core/src/test/java/org/apache/olingo/odata2/janos/processor/core/data/store/AnnotationValueAccessTest.java | // Path: janos-core/src/main/java/org/apache/olingo/odata2/janos/processor/core/data/access/AnnotationValueAccess.java
// public class AnnotationValueAccess implements ValueAccess {
// private final AnnotationHelper annotationHelper = new AnnotationHelper();
//
// /**
// * Retrieves the value of an EDM property... | import junit.framework.Assert;
import org.apache.olingo.odata2.api.annotation.edm.EdmEntityType;
import org.apache.olingo.odata2.api.edm.EdmException;
import org.apache.olingo.odata2.api.edm.EdmMapping;
import org.apache.olingo.odata2.api.edm.EdmProperty;
import org.apache.olingo.odata2.api.exception.ODataException;
im... | /*
* Copyright 2013 The Apache Software Foundation.
*
* 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 applicabl... | // Path: janos-core/src/main/java/org/apache/olingo/odata2/janos/processor/core/data/access/AnnotationValueAccess.java
// public class AnnotationValueAccess implements ValueAccess {
// private final AnnotationHelper annotationHelper = new AnnotationHelper();
//
// /**
// * Retrieves the value of an EDM property... | AnnotationValueAccess ava = new AnnotationValueAccess(); |
mibo/janos | janos-core/src/main/java/org/apache/olingo/odata2/janos/processor/core/extension/ExtensionRegistry.java | // Path: janos-api/src/main/java/org/apache/olingo/odata2/janos/processor/api/extension/ExtensionContext.java
// public interface ExtensionContext {
// String PARA_URI_INFO = "~uriinfo";
// String PARA_ACCEPT_HEADER = "~acceptheader";
// String PARA_REQUEST_BODY = "~requestbody";
// String PARA_REQUEST_TYPE = "... | import org.apache.olingo.odata2.janos.processor.api.extension.Extension;
import org.apache.olingo.odata2.janos.processor.api.extension.ExtensionContext;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
im... | static class ExtensionHolder {
private final String entitySetName;
private final Extension.Method type;
private final Method method;
private final Object instance;
public ExtensionHolder(String entitySetName, Extension.Method type, Object instance, Method method) {
this.entitySetName = enti... | // Path: janos-api/src/main/java/org/apache/olingo/odata2/janos/processor/api/extension/ExtensionContext.java
// public interface ExtensionContext {
// String PARA_URI_INFO = "~uriinfo";
// String PARA_ACCEPT_HEADER = "~acceptheader";
// String PARA_REQUEST_BODY = "~requestbody";
// String PARA_REQUEST_TYPE = "... | ExtensionContext context = extProcessor.createContext(); |
mibo/janos | janos-ref/src/main/java/org/apache/olingo/odata2/janos/processor/ref/model/RefExtensions.java | // Path: janos-api/src/main/java/org/apache/olingo/odata2/janos/processor/api/extension/ExtensionContext.java
// public interface ExtensionContext {
// String PARA_URI_INFO = "~uriinfo";
// String PARA_ACCEPT_HEADER = "~acceptheader";
// String PARA_REQUEST_BODY = "~requestbody";
// String PARA_REQUEST_TYPE = "... | import org.apache.olingo.odata2.api.processor.ODataResponse;
import org.apache.olingo.odata2.api.uri.UriInfo;
import org.apache.olingo.odata2.janos.processor.api.extension.Extension;
import org.apache.olingo.odata2.janos.processor.api.extension.Extension.Method;
import org.apache.olingo.odata2.janos.processor.api.exten... | package org.apache.olingo.odata2.janos.processor.ref.model;
/**
* Created by mibo on 21.02.16.
*/
public class RefExtensions {
private static final Logger LOG = LoggerFactory.getLogger(RefExtensions.class);
private static final String EXTENSION_TEST = "ExtensionTest";
@Extension(entitySetNames="Employees", ... | // Path: janos-api/src/main/java/org/apache/olingo/odata2/janos/processor/api/extension/ExtensionContext.java
// public interface ExtensionContext {
// String PARA_URI_INFO = "~uriinfo";
// String PARA_ACCEPT_HEADER = "~acceptheader";
// String PARA_REQUEST_BODY = "~requestbody";
// String PARA_REQUEST_TYPE = "... | public Object logReadAccess(ExtensionContext context) throws Exception { |
mibo/janos | janos-jpa-ref/src/main/java/org/apache/olingo/odata2/janos/processor/ref/jpa/model/RefExtensions.java | // Path: janos-api/src/main/java/org/apache/olingo/odata2/janos/processor/api/extension/ExtensionContext.java
// public interface ExtensionContext {
// String PARA_URI_INFO = "~uriinfo";
// String PARA_ACCEPT_HEADER = "~acceptheader";
// String PARA_REQUEST_BODY = "~requestbody";
// String PARA_REQUEST_TYPE = "... | import org.apache.olingo.odata2.api.processor.ODataResponse;
import org.apache.olingo.odata2.janos.processor.api.extension.Extension;
import org.apache.olingo.odata2.janos.processor.api.extension.Extension.Method;
import org.apache.olingo.odata2.janos.processor.api.extension.ExtensionContext;
import org.slf4j.Logger;
i... | package org.apache.olingo.odata2.janos.processor.ref.jpa.model;
/**
* Created by mibo on 21.02.16.
*/
public class RefExtensions {
private static final Logger LOG = LoggerFactory.getLogger(RefExtensions.class);
@Extension(entitySetNames="Employees", methods={Method.GET, Method.POST, Method.PUT}) | // Path: janos-api/src/main/java/org/apache/olingo/odata2/janos/processor/api/extension/ExtensionContext.java
// public interface ExtensionContext {
// String PARA_URI_INFO = "~uriinfo";
// String PARA_ACCEPT_HEADER = "~acceptheader";
// String PARA_REQUEST_BODY = "~requestbody";
// String PARA_REQUEST_TYPE = "... | public Object logAllAccess(ExtensionContext context) throws Exception { |
mibo/janos | janos-core/src/main/java/org/apache/olingo/odata2/janos/processor/core/extension/ExtensionProcessor.java | // Path: janos-api/src/main/java/org/apache/olingo/odata2/janos/processor/api/extension/ExtensionContext.java
// public interface ExtensionContext {
// String PARA_URI_INFO = "~uriinfo";
// String PARA_ACCEPT_HEADER = "~acceptheader";
// String PARA_REQUEST_BODY = "~requestbody";
// String PARA_REQUEST_TYPE = "... | import org.apache.olingo.odata2.api.edm.EdmException;
import org.apache.olingo.odata2.api.processor.ODataContext;
import org.apache.olingo.odata2.api.processor.ODataResponse;
import org.apache.olingo.odata2.api.processor.feature.ODataProcessorFeature;
import org.apache.olingo.odata2.api.uri.UriInfo;
import org.apache.o... | return ext.process(this);
}
return handler.process();
}
private Extension.Method mapMethod(String httpMethod) {
switch (httpMethod) {
case "GET": return Extension.Method.GET;
case "POST": return Extension.Method.POST;
case "PUT": return Extension.Method.PUT;
case "DELETE":... | // Path: janos-api/src/main/java/org/apache/olingo/odata2/janos/processor/api/extension/ExtensionContext.java
// public interface ExtensionContext {
// String PARA_URI_INFO = "~uriinfo";
// String PARA_ACCEPT_HEADER = "~acceptheader";
// String PARA_REQUEST_BODY = "~requestbody";
// String PARA_REQUEST_TYPE = "... | public ExtensionContext createContext() { |
colormine/colormine | demo/src/org/colormine/servlet/ServletOutput.java | // Path: colormine/src/main/org/colormine/image/profile/Profile.java
// public interface Profile<K> {
// /*
// * Tracks an item
// */
// void put(K key);
//
// /*
// * Tracks an item
// */
// void put(K key, int count);
//
// /*
// * Returns the number of times an item has been recorded
// */
// int... | import java.awt.Color;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import javax.servlet.http.HttpServletResponse;
import org.colormine.image.profile.Profile;
import org.json.JSONException;
import org.json... | package org.colormine.servlet;
public class ServletOutput {
static void write(HttpServletResponse response, double data, String key) throws IOException {
write(response, createJsonData(data, key));
}
static void write(HttpServletResponse response, String data, String key) throws IOException {
write(respons... | // Path: colormine/src/main/org/colormine/image/profile/Profile.java
// public interface Profile<K> {
// /*
// * Tracks an item
// */
// void put(K key);
//
// /*
// * Tracks an item
// */
// void put(K key, int count);
//
// /*
// * Returns the number of times an item has been recorded
// */
// int... | static void write(HttpServletResponse response, Profile<Color> profile) throws IOException { |
colormine/colormine | colormine/src/test/org/colormine/image/profile/ColorProfileTest.java | // Path: colormine/src/main/org/colormine/image/Image.java
// public interface Image {
// /**
// * Gets image width
// *
// * @return image width
// */
// int getWidth();
//
// /**
// * Gets image height
// *
// * @return image height
// */
// int getHeight();
//
// /**
// * Get Rgbs value of... | import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import java.awt.Color;
import org.colormine.image.Image;
import org.testng.AssertJUnit;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test; | package org.colormine.image.profile;
@Test
public class ColorProfileTest {
| // Path: colormine/src/main/org/colormine/image/Image.java
// public interface Image {
// /**
// * Gets image width
// *
// * @return image width
// */
// int getWidth();
//
// /**
// * Gets image height
// *
// * @return image height
// */
// int getHeight();
//
// /**
// * Get Rgbs value of... | private Image _image; |
colormine/colormine | colormine/src/main/org/colormine/image/profile/filter/OutlierFilter.java | // Path: colormine/src/main/org/colormine/image/profile/ColorProfile.java
// public class ColorProfile implements Profile<Color> {
//
// private Map<Color, Integer> _colors = new HashMap<Color, Integer>();
// private int _total = 0;
//
// public ColorProfile() {
// }
//
// public ColorProfile(Image image) {
// ... | import java.awt.Color;
import org.colormine.image.profile.ColorProfile;
import org.colormine.image.profile.Profile; | package org.colormine.image.profile.filter;
/**
* Removes colors that make up less than a given percentage of the image This is
* best done after using something like the MapFilter to 'condense' the palette
*/
public final class OutlierFilter implements Filter<Profile<Color>> {
private final int _percentage;
... | // Path: colormine/src/main/org/colormine/image/profile/ColorProfile.java
// public class ColorProfile implements Profile<Color> {
//
// private Map<Color, Integer> _colors = new HashMap<Color, Integer>();
// private int _total = 0;
//
// public ColorProfile() {
// }
//
// public ColorProfile(Image image) {
// ... | Profile<Color> result = new ColorProfile(); |
colormine/colormine | colormine/src/test/org/colormine/colorspace/LabComparerTest.java | // Path: colormine/src/main/org/colormine/colorspace/Lab.java
// public class Lab extends ColorTuple {
// public final double L;
// public final double A;
// public final double B;
//
// /**
// * Create Lab from values
// *
// * @param l
// * @param a
// * @param b
// */
// public Lab(double l, doubl... | import java.text.DecimalFormat;
import org.colormine.colorspace.Lab;
import org.testng.AssertJUnit;
import org.testng.annotations.Test; | package org.colormine.colorspace;
@Test
public class LabComparerTest {
public void noDistance() { | // Path: colormine/src/main/org/colormine/colorspace/Lab.java
// public class Lab extends ColorTuple {
// public final double L;
// public final double A;
// public final double B;
//
// /**
// * Create Lab from values
// *
// * @param l
// * @param a
// * @param b
// */
// public Lab(double l, doubl... | equals(0.0, new Lab(1, 0, 0), new Lab(1, 0, 0)); |
colormine/colormine | colormine/src/main/org/colormine/image/profile/ColorProfile.java | // Path: colormine/src/main/org/colormine/image/Image.java
// public interface Image {
// /**
// * Gets image width
// *
// * @return image width
// */
// int getWidth();
//
// /**
// * Gets image height
// *
// * @return image height
// */
// int getHeight();
//
// /**
// * Get Rgbs value of... | import java.awt.Color;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import org.colormine.image.Image; | package org.colormine.image.profile;
public class ColorProfile implements Profile<Color> {
private Map<Color, Integer> _colors = new HashMap<Color, Integer>();
private int _total = 0;
public ColorProfile() {
}
| // Path: colormine/src/main/org/colormine/image/Image.java
// public interface Image {
// /**
// * Gets image width
// *
// * @return image width
// */
// int getWidth();
//
// /**
// * Gets image height
// *
// * @return image height
// */
// int getHeight();
//
// /**
// * Get Rgbs value of... | public ColorProfile(Image image) { |
colormine/colormine | colormine/src/test/org/colormine/image/profile/filter/MapFilterTest.java | // Path: colormine/src/main/org/colormine/image/Image.java
// public interface Image {
// /**
// * Gets image width
// *
// * @return image width
// */
// int getWidth();
//
// /**
// * Gets image height
// *
// * @return image height
// */
// int getHeight();
//
// /**
// * Get Rgbs value of... | import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import java.awt.Color;
import java.util.HashMap;
import java.util.Map;
import org.colormine.image.Image;
import org.colormine.image.profile.ColorProfile;
import org.colormine.image.profile.Profile;
import org.testng.AssertJUnit;
import org.... | package org.colormine.image.profile.filter;
@Test
public class MapFilterTest {
| // Path: colormine/src/main/org/colormine/image/Image.java
// public interface Image {
// /**
// * Gets image width
// *
// * @return image width
// */
// int getWidth();
//
// /**
// * Gets image height
// *
// * @return image height
// */
// int getHeight();
//
// /**
// * Get Rgbs value of... | private Image _image; |
colormine/colormine | colormine/src/test/org/colormine/image/profile/filter/MapFilterTest.java | // Path: colormine/src/main/org/colormine/image/Image.java
// public interface Image {
// /**
// * Gets image width
// *
// * @return image width
// */
// int getWidth();
//
// /**
// * Gets image height
// *
// * @return image height
// */
// int getHeight();
//
// /**
// * Get Rgbs value of... | import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import java.awt.Color;
import java.util.HashMap;
import java.util.Map;
import org.colormine.image.Image;
import org.colormine.image.profile.ColorProfile;
import org.colormine.image.profile.Profile;
import org.testng.AssertJUnit;
import org.... | package org.colormine.image.profile.filter;
@Test
public class MapFilterTest {
private Image _image;
@BeforeTest
public void setup() {
_image = mock(Image.class);
when(_image.getHeight()).thenReturn(1);
when(_image.getWidth()).thenReturn(1);
when(_image.getRGB(0, 0)).thenReturn(0xFF0000);
}
@Test
... | // Path: colormine/src/main/org/colormine/image/Image.java
// public interface Image {
// /**
// * Gets image width
// *
// * @return image width
// */
// int getWidth();
//
// /**
// * Gets image height
// *
// * @return image height
// */
// int getHeight();
//
// /**
// * Get Rgbs value of... | Profile<Color> map = new ColorProfile(colors); |
colormine/colormine | colormine/src/test/org/colormine/image/profile/filter/MapFilterTest.java | // Path: colormine/src/main/org/colormine/image/Image.java
// public interface Image {
// /**
// * Gets image width
// *
// * @return image width
// */
// int getWidth();
//
// /**
// * Gets image height
// *
// * @return image height
// */
// int getHeight();
//
// /**
// * Get Rgbs value of... | import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import java.awt.Color;
import java.util.HashMap;
import java.util.Map;
import org.colormine.image.Image;
import org.colormine.image.profile.ColorProfile;
import org.colormine.image.profile.Profile;
import org.testng.AssertJUnit;
import org.... | package org.colormine.image.profile.filter;
@Test
public class MapFilterTest {
private Image _image;
@BeforeTest
public void setup() {
_image = mock(Image.class);
when(_image.getHeight()).thenReturn(1);
when(_image.getWidth()).thenReturn(1);
when(_image.getRGB(0, 0)).thenReturn(0xFF0000);
}
@Test
... | // Path: colormine/src/main/org/colormine/image/Image.java
// public interface Image {
// /**
// * Gets image width
// *
// * @return image width
// */
// int getWidth();
//
// /**
// * Gets image height
// *
// * @return image height
// */
// int getHeight();
//
// /**
// * Get Rgbs value of... | Profile<Color> map = new ColorProfile(colors); |
iipc/webarchive-commons | src/main/java/org/archive/util/StreamCopy.java | // Path: src/main/java/org/archive/util/io/PushBackOneByteInputStream.java
// public interface PushBackOneByteInputStream {
// public void pushback() throws IOException;
// public int read() throws IOException;
// }
| import java.io.IOException;
import java.io.OutputStream;
import java.io.InputStream;
import org.archive.util.io.PushBackOneByteInputStream;
| total += amtRead;
}
}
return total;
}
public static long readToEOF(InputStream i) throws IOException {
return readToEOF(i,DEFAULT_READ_SIZE);
}
public static long readToEOF(InputStream i, int bufferSize) throws IOException {
long numBytes = 0;
byte buffer[] = new byte[bufferSiz... | // Path: src/main/java/org/archive/util/io/PushBackOneByteInputStream.java
// public interface PushBackOneByteInputStream {
// public void pushback() throws IOException;
// public int read() throws IOException;
// }
// Path: src/main/java/org/archive/util/StreamCopy.java
import java.io.IOException;
import java.io.... | public static long skipChars(PushBackOneByteInputStream i, int [] skips) throws IOException {
|
dflick-pivotal/sentimentr-release | src/sentimentr-service-broker/src/main/java/io/pivotal/fe/sentimentr/broker/config/BrokerConfig.java | // Path: src/spring-cloud-cloudfoundry-service-broker/src/main/java/org/springframework/cloud/servicebroker/model/BrokerApiVersion.java
// @Getter
// @ToString
// @EqualsAndHashCode
// public class BrokerApiVersion {
//
// public final static String DEFAULT_API_VERSION_HEADER = "X-Broker-Api-Version";
// public fina... | import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.cloud.servicebroker.model.BrokerApiVersion;
import org.springframework.context.annotation.Bean; | package io.pivotal.fe.sentimentr.broker.config;
@Configuration
@ComponentScan(basePackages = "io.pivotal.fe.sentimentr.broker")
public class BrokerConfig {
@Bean | // Path: src/spring-cloud-cloudfoundry-service-broker/src/main/java/org/springframework/cloud/servicebroker/model/BrokerApiVersion.java
// @Getter
// @ToString
// @EqualsAndHashCode
// public class BrokerApiVersion {
//
// public final static String DEFAULT_API_VERSION_HEADER = "X-Broker-Api-Version";
// public fina... | public BrokerApiVersion brokerApiVersion() { |
dflick-pivotal/sentimentr-release | src/spring-cloud-cloudfoundry-service-broker/src/main/java/org/springframework/cloud/servicebroker/service/CatalogService.java | // Path: src/spring-cloud-cloudfoundry-service-broker/src/main/java/org/springframework/cloud/servicebroker/model/Catalog.java
// @Getter
// @ToString
// @EqualsAndHashCode
// @JsonAutoDetect(getterVisibility = JsonAutoDetect.Visibility.NONE)
// @JsonIgnoreProperties(ignoreUnknown = true)
// public class Catalog {
//
... | import org.springframework.cloud.servicebroker.model.Catalog;
import org.springframework.cloud.servicebroker.model.ServiceDefinition; | package org.springframework.cloud.servicebroker.service;
/**
* This interface is implemented by service brokers to process requests to retrieve the service catalog.
*
* @author sgreenberg@pivotal.io
*/
public interface CatalogService {
/**
* Return the catalog of services provided by the service broker.
*
... | // Path: src/spring-cloud-cloudfoundry-service-broker/src/main/java/org/springframework/cloud/servicebroker/model/Catalog.java
// @Getter
// @ToString
// @EqualsAndHashCode
// @JsonAutoDetect(getterVisibility = JsonAutoDetect.Visibility.NONE)
// @JsonIgnoreProperties(ignoreUnknown = true)
// public class Catalog {
//
... | ServiceDefinition getServiceDefinition(String serviceId); |
dflick-pivotal/sentimentr-release | sentimentr-client/sentimentr-connector/src/main/java/io/pivotal/fe/sentimentr/client/facade/SentimentrFacade.java | // Path: sentimentr-client/sentimentr-connector/src/main/java/io/pivotal/fe/sentimentr/client/domain/Sentiment.java
// @JsonIgnoreProperties(ignoreUnknown = true)
//
// public class Sentiment {
//
// private String sentiment;
// private String id;
//
// public String getSentiment() {
// return sentime... | import io.pivotal.fe.sentimentr.client.domain.Sentiment;
import org.springframework.web.client.RestTemplate; | package io.pivotal.fe.sentimentr.client.facade;
public class SentimentrFacade {
private String sentimentrUri;
public SentimentrFacade()
{
}
public SentimentrFacade(String sentimentrUri)
{
this.sentimentrUri = sentimentrUri;
}
| // Path: sentimentr-client/sentimentr-connector/src/main/java/io/pivotal/fe/sentimentr/client/domain/Sentiment.java
// @JsonIgnoreProperties(ignoreUnknown = true)
//
// public class Sentiment {
//
// private String sentiment;
// private String id;
//
// public String getSentiment() {
// return sentime... | public Sentiment getSentiment(String text) |
dflick-pivotal/sentimentr-release | sentimentr-client/sentimentr-ui/src/main/java/io/pivotal/fe/sentimentr/client/controller/InfoController.java | // Path: sentimentr-client/sentimentr-ui/src/main/java/io/pivotal/fe/sentimentr/client/domain/ApplicationInfo.java
// public class ApplicationInfo {
// private String[] profiles;
// private String[] services;
// private String ip;
// private int port;
//
// public ApplicationInfo(String[] profiles... | import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.Cloud;
import org.springframework.cloud.service.ServiceInfo;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
i... | package io.pivotal.fe.sentimentr.client.controller;
@Controller
public class InfoController {
@Autowired(required = false)
private Cloud cloud;
private Environment springEnvironment;
@Autowired
public InfoController(Environment springEnvironment) {
this.springEnvironment = springEnvi... | // Path: sentimentr-client/sentimentr-ui/src/main/java/io/pivotal/fe/sentimentr/client/domain/ApplicationInfo.java
// public class ApplicationInfo {
// private String[] profiles;
// private String[] services;
// private String ip;
// private int port;
//
// public ApplicationInfo(String[] profiles... | public @ResponseBody ApplicationInfo info(HttpServletRequest request) { |
dflick-pivotal/sentimentr-release | src/spring-cloud-cloudfoundry-service-broker/src/test/java/org/springframework/cloud/servicebroker/interceptor/BrokerApiVersionInterceptorTest.java | // Path: src/spring-cloud-cloudfoundry-service-broker/src/main/java/org/springframework/cloud/servicebroker/exception/ServiceBrokerApiVersionException.java
// public class ServiceBrokerApiVersionException extends RuntimeException {
//
// private static final long serialVersionUID = -6792404679608443775L;
//
// publ... | import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.atLeastOnce;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServl... | package org.springframework.cloud.servicebroker.interceptor;
public class BrokerApiVersionInterceptorTest {
@Mock
private HttpServletRequest request;
@Mock
private HttpServletResponse response;
@Mock | // Path: src/spring-cloud-cloudfoundry-service-broker/src/main/java/org/springframework/cloud/servicebroker/exception/ServiceBrokerApiVersionException.java
// public class ServiceBrokerApiVersionException extends RuntimeException {
//
// private static final long serialVersionUID = -6792404679608443775L;
//
// publ... | private BrokerApiVersion brokerApiVersion; |
dflick-pivotal/sentimentr-release | src/spring-cloud-cloudfoundry-service-broker/src/test/java/org/springframework/cloud/servicebroker/interceptor/BrokerApiVersionInterceptorTest.java | // Path: src/spring-cloud-cloudfoundry-service-broker/src/main/java/org/springframework/cloud/servicebroker/exception/ServiceBrokerApiVersionException.java
// public class ServiceBrokerApiVersionException extends RuntimeException {
//
// private static final long serialVersionUID = -6792404679608443775L;
//
// publ... | import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.atLeastOnce;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServl... | package org.springframework.cloud.servicebroker.interceptor;
public class BrokerApiVersionInterceptorTest {
@Mock
private HttpServletRequest request;
@Mock
private HttpServletResponse response;
@Mock
private BrokerApiVersion brokerApiVersion;
@Before
public void setup() {
MockitoAnnotations.initMo... | // Path: src/spring-cloud-cloudfoundry-service-broker/src/main/java/org/springframework/cloud/servicebroker/exception/ServiceBrokerApiVersionException.java
// public class ServiceBrokerApiVersionException extends RuntimeException {
//
// private static final long serialVersionUID = -6792404679608443775L;
//
// publ... | public void noBrokerApiVersionConfigured() throws IOException, ServletException, ServiceBrokerApiVersionException { |
dflick-pivotal/sentimentr-release | src/spring-cloud-cloudfoundry-service-broker/src/test/java/org/springframework/cloud/servicebroker/service/impl/BeanCatalogServiceTest.java | // Path: src/spring-cloud-cloudfoundry-service-broker/src/main/java/org/springframework/cloud/servicebroker/model/Catalog.java
// @Getter
// @ToString
// @EqualsAndHashCode
// @JsonAutoDetect(getterVisibility = JsonAutoDetect.Visibility.NONE)
// @JsonIgnoreProperties(ignoreUnknown = true)
// public class Catalog {
//
... | import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import java.util.Collections;
import java.util.List;
import org.springframework.cloud.servicebroker.model.Catalog;
import org.springframework.cloud.servicebroker.model.ServiceDefinition;
import org.springframework.cloud.servicebroke... | package org.springframework.cloud.servicebroker.service.impl;
public class BeanCatalogServiceTest {
private BeanCatalogService service;
| // Path: src/spring-cloud-cloudfoundry-service-broker/src/main/java/org/springframework/cloud/servicebroker/model/Catalog.java
// @Getter
// @ToString
// @EqualsAndHashCode
// @JsonAutoDetect(getterVisibility = JsonAutoDetect.Visibility.NONE)
// @JsonIgnoreProperties(ignoreUnknown = true)
// public class Catalog {
//
... | private Catalog catalog; |
dflick-pivotal/sentimentr-release | src/spring-cloud-cloudfoundry-service-broker/src/test/java/org/springframework/cloud/servicebroker/service/impl/BeanCatalogServiceTest.java | // Path: src/spring-cloud-cloudfoundry-service-broker/src/main/java/org/springframework/cloud/servicebroker/model/Catalog.java
// @Getter
// @ToString
// @EqualsAndHashCode
// @JsonAutoDetect(getterVisibility = JsonAutoDetect.Visibility.NONE)
// @JsonIgnoreProperties(ignoreUnknown = true)
// public class Catalog {
//
... | import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import java.util.Collections;
import java.util.List;
import org.springframework.cloud.servicebroker.model.Catalog;
import org.springframework.cloud.servicebroker.model.ServiceDefinition;
import org.springframework.cloud.servicebroke... | package org.springframework.cloud.servicebroker.service.impl;
public class BeanCatalogServiceTest {
private BeanCatalogService service;
private Catalog catalog; | // Path: src/spring-cloud-cloudfoundry-service-broker/src/main/java/org/springframework/cloud/servicebroker/model/Catalog.java
// @Getter
// @ToString
// @EqualsAndHashCode
// @JsonAutoDetect(getterVisibility = JsonAutoDetect.Visibility.NONE)
// @JsonIgnoreProperties(ignoreUnknown = true)
// public class Catalog {
//
... | private ServiceDefinition serviceDefinition; |
dflick-pivotal/sentimentr-release | sentimentr-client/sentimentr-ui/src/main/java/io/pivotal/fe/sentimentr/client/config/CloudConfiguration.java | // Path: sentimentr-client/sentimentr-connector/src/main/java/io/pivotal/fe/sentimentr/client/facade/SentimentrFacade.java
// public class SentimentrFacade {
//
// private String sentimentrUri;
//
// public SentimentrFacade()
// {
// }
// public SentimentrFacade(String sentimentrUri)
// {
// this.sentimentrU... | import io.pivotal.fe.sentimentr.client.facade.SentimentrFacade;
import org.springframework.cloud.config.java.AbstractCloudConfig;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile; | package io.pivotal.fe.sentimentr.client.config;
@Configuration
@Profile({"cloud","local"})
public class CloudConfiguration extends AbstractCloudConfig {
@Bean | // Path: sentimentr-client/sentimentr-connector/src/main/java/io/pivotal/fe/sentimentr/client/facade/SentimentrFacade.java
// public class SentimentrFacade {
//
// private String sentimentrUri;
//
// public SentimentrFacade()
// {
// }
// public SentimentrFacade(String sentimentrUri)
// {
// this.sentimentrU... | public SentimentrFacade sentimentrFacade() { |
dflick-pivotal/sentimentr-release | sentimentr-client/sentimentr-ui/src/main/java/io/pivotal/fe/sentimentr/client/controller/SentimentrClientController.java | // Path: sentimentr-client/sentimentr-connector/src/main/java/io/pivotal/fe/sentimentr/client/domain/Sentiment.java
// @JsonIgnoreProperties(ignoreUnknown = true)
//
// public class Sentiment {
//
// private String sentiment;
// private String id;
//
// public String getSentiment() {
// return sentime... | import io.pivotal.fe.sentimentr.client.domain.Sentiment;
import io.pivotal.fe.sentimentr.client.facade.SentimentrFacade;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.spri... | package io.pivotal.fe.sentimentr.client.controller;
@RestController
public class SentimentrClientController {
| // Path: sentimentr-client/sentimentr-connector/src/main/java/io/pivotal/fe/sentimentr/client/domain/Sentiment.java
// @JsonIgnoreProperties(ignoreUnknown = true)
//
// public class Sentiment {
//
// private String sentiment;
// private String id;
//
// public String getSentiment() {
// return sentime... | private SentimentrFacade sentimentrFacade; |
dflick-pivotal/sentimentr-release | sentimentr-client/sentimentr-ui/src/main/java/io/pivotal/fe/sentimentr/client/controller/SentimentrClientController.java | // Path: sentimentr-client/sentimentr-connector/src/main/java/io/pivotal/fe/sentimentr/client/domain/Sentiment.java
// @JsonIgnoreProperties(ignoreUnknown = true)
//
// public class Sentiment {
//
// private String sentiment;
// private String id;
//
// public String getSentiment() {
// return sentime... | import io.pivotal.fe.sentimentr.client.domain.Sentiment;
import io.pivotal.fe.sentimentr.client.facade.SentimentrFacade;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.spri... | package io.pivotal.fe.sentimentr.client.controller;
@RestController
public class SentimentrClientController {
private SentimentrFacade sentimentrFacade;
@Autowired
public SentimentrClientController(SentimentrFacade sentimentrFacade) {
this.sentimentrFacade = sentimentrFacade;
}
@RequestM... | // Path: sentimentr-client/sentimentr-connector/src/main/java/io/pivotal/fe/sentimentr/client/domain/Sentiment.java
// @JsonIgnoreProperties(ignoreUnknown = true)
//
// public class Sentiment {
//
// private String sentiment;
// private String id;
//
// public String getSentiment() {
// return sentime... | public Sentiment getSentiment(@PathVariable String text) { |
dflick-pivotal/sentimentr-release | sentimentr-client/sentimentr-ui/src/main/java/io/pivotal/fe/sentimentr/client/config/DefaultConfiguration.java | // Path: sentimentr-client/sentimentr-connector/src/main/java/io/pivotal/fe/sentimentr/client/facade/SentimentrFacade.java
// public class SentimentrFacade {
//
// private String sentimentrUri;
//
// public SentimentrFacade()
// {
// }
// public SentimentrFacade(String sentimentrUri)
// {
// this.sentimentrU... | import io.pivotal.fe.sentimentr.client.facade.SentimentrFacade;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile; | package io.pivotal.fe.sentimentr.client.config;
@Configuration
@Profile("default")
public class DefaultConfiguration {
@Bean | // Path: sentimentr-client/sentimentr-connector/src/main/java/io/pivotal/fe/sentimentr/client/facade/SentimentrFacade.java
// public class SentimentrFacade {
//
// private String sentimentrUri;
//
// public SentimentrFacade()
// {
// }
// public SentimentrFacade(String sentimentrUri)
// {
// this.sentimentrU... | public SentimentrFacade sentimentrFacade() { |
dflick-pivotal/sentimentr-release | src/spring-cloud-cloudfoundry-service-broker/src/main/java/org/springframework/cloud/servicebroker/config/BrokerApiVersionConfig.java | // Path: src/spring-cloud-cloudfoundry-service-broker/src/main/java/org/springframework/cloud/servicebroker/interceptor/BrokerApiVersionInterceptor.java
// public class BrokerApiVersionInterceptor extends HandlerInterceptorAdapter {
//
// private final BrokerApiVersion version;
//
// public BrokerApiVersionIntercep... | import org.springframework.cloud.servicebroker.interceptor.BrokerApiVersionInterceptor;
import org.springframework.cloud.servicebroker.model.BrokerApiVersion;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servle... | package org.springframework.cloud.servicebroker.config;
@Configuration
@EnableWebMvc
public class BrokerApiVersionConfig extends WebMvcConfigurerAdapter {
@Autowired | // Path: src/spring-cloud-cloudfoundry-service-broker/src/main/java/org/springframework/cloud/servicebroker/interceptor/BrokerApiVersionInterceptor.java
// public class BrokerApiVersionInterceptor extends HandlerInterceptorAdapter {
//
// private final BrokerApiVersion version;
//
// public BrokerApiVersionIntercep... | private BrokerApiVersion brokerApiVersion; |
dflick-pivotal/sentimentr-release | src/spring-cloud-cloudfoundry-service-broker/src/main/java/org/springframework/cloud/servicebroker/config/BrokerApiVersionConfig.java | // Path: src/spring-cloud-cloudfoundry-service-broker/src/main/java/org/springframework/cloud/servicebroker/interceptor/BrokerApiVersionInterceptor.java
// public class BrokerApiVersionInterceptor extends HandlerInterceptorAdapter {
//
// private final BrokerApiVersion version;
//
// public BrokerApiVersionIntercep... | import org.springframework.cloud.servicebroker.interceptor.BrokerApiVersionInterceptor;
import org.springframework.cloud.servicebroker.model.BrokerApiVersion;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servle... | package org.springframework.cloud.servicebroker.config;
@Configuration
@EnableWebMvc
public class BrokerApiVersionConfig extends WebMvcConfigurerAdapter {
@Autowired
private BrokerApiVersion brokerApiVersion;
@Override
public void addInterceptors(InterceptorRegistry registry) { | // Path: src/spring-cloud-cloudfoundry-service-broker/src/main/java/org/springframework/cloud/servicebroker/interceptor/BrokerApiVersionInterceptor.java
// public class BrokerApiVersionInterceptor extends HandlerInterceptorAdapter {
//
// private final BrokerApiVersion version;
//
// public BrokerApiVersionIntercep... | registry.addInterceptor(new BrokerApiVersionInterceptor(brokerApiVersion)).addPathPatterns("/v2/**"); |
dflick-pivotal/sentimentr-release | src/spring-cloud-cloudfoundry-service-broker/src/main/java/org/springframework/cloud/servicebroker/config/ServiceBrokerAutoConfiguration.java | // Path: src/spring-cloud-cloudfoundry-service-broker/src/main/java/org/springframework/cloud/servicebroker/model/BrokerApiVersion.java
// @Getter
// @ToString
// @EqualsAndHashCode
// public class BrokerApiVersion {
//
// public final static String DEFAULT_API_VERSION_HEADER = "X-Broker-Api-Version";
// public fina... | import org.springframework.cloud.servicebroker.model.BrokerApiVersion;
import org.springframework.cloud.servicebroker.model.Catalog;
import org.springframework.cloud.servicebroker.service.BeanCatalogService;
import org.springframework.cloud.servicebroker.service.CatalogService;
import org.springframework.boot.autoconfi... | package org.springframework.cloud.servicebroker.config;
@Configuration
@ComponentScan(basePackages = {"org.springframework.cloud.servicebroker"})
@ConditionalOnWebApplication
@AutoConfigureAfter(WebMvcAutoConfiguration.class)
public class ServiceBrokerAutoConfiguration {
@Bean | // Path: src/spring-cloud-cloudfoundry-service-broker/src/main/java/org/springframework/cloud/servicebroker/model/BrokerApiVersion.java
// @Getter
// @ToString
// @EqualsAndHashCode
// public class BrokerApiVersion {
//
// public final static String DEFAULT_API_VERSION_HEADER = "X-Broker-Api-Version";
// public fina... | @ConditionalOnMissingBean(BrokerApiVersion.class) |
dflick-pivotal/sentimentr-release | src/spring-cloud-cloudfoundry-service-broker/src/main/java/org/springframework/cloud/servicebroker/config/ServiceBrokerAutoConfiguration.java | // Path: src/spring-cloud-cloudfoundry-service-broker/src/main/java/org/springframework/cloud/servicebroker/model/BrokerApiVersion.java
// @Getter
// @ToString
// @EqualsAndHashCode
// public class BrokerApiVersion {
//
// public final static String DEFAULT_API_VERSION_HEADER = "X-Broker-Api-Version";
// public fina... | import org.springframework.cloud.servicebroker.model.BrokerApiVersion;
import org.springframework.cloud.servicebroker.model.Catalog;
import org.springframework.cloud.servicebroker.service.BeanCatalogService;
import org.springframework.cloud.servicebroker.service.CatalogService;
import org.springframework.boot.autoconfi... | package org.springframework.cloud.servicebroker.config;
@Configuration
@ComponentScan(basePackages = {"org.springframework.cloud.servicebroker"})
@ConditionalOnWebApplication
@AutoConfigureAfter(WebMvcAutoConfiguration.class)
public class ServiceBrokerAutoConfiguration {
@Bean
@ConditionalOnMissingBean(BrokerApiV... | // Path: src/spring-cloud-cloudfoundry-service-broker/src/main/java/org/springframework/cloud/servicebroker/model/BrokerApiVersion.java
// @Getter
// @ToString
// @EqualsAndHashCode
// public class BrokerApiVersion {
//
// public final static String DEFAULT_API_VERSION_HEADER = "X-Broker-Api-Version";
// public fina... | return new BrokerApiVersion(API_VERSION_CURRENT); |
dflick-pivotal/sentimentr-release | src/spring-cloud-cloudfoundry-service-broker/src/main/java/org/springframework/cloud/servicebroker/config/ServiceBrokerAutoConfiguration.java | // Path: src/spring-cloud-cloudfoundry-service-broker/src/main/java/org/springframework/cloud/servicebroker/model/BrokerApiVersion.java
// @Getter
// @ToString
// @EqualsAndHashCode
// public class BrokerApiVersion {
//
// public final static String DEFAULT_API_VERSION_HEADER = "X-Broker-Api-Version";
// public fina... | import org.springframework.cloud.servicebroker.model.BrokerApiVersion;
import org.springframework.cloud.servicebroker.model.Catalog;
import org.springframework.cloud.servicebroker.service.BeanCatalogService;
import org.springframework.cloud.servicebroker.service.CatalogService;
import org.springframework.boot.autoconfi... | package org.springframework.cloud.servicebroker.config;
@Configuration
@ComponentScan(basePackages = {"org.springframework.cloud.servicebroker"})
@ConditionalOnWebApplication
@AutoConfigureAfter(WebMvcAutoConfiguration.class)
public class ServiceBrokerAutoConfiguration {
@Bean
@ConditionalOnMissingBean(BrokerApiV... | // Path: src/spring-cloud-cloudfoundry-service-broker/src/main/java/org/springframework/cloud/servicebroker/model/BrokerApiVersion.java
// @Getter
// @ToString
// @EqualsAndHashCode
// public class BrokerApiVersion {
//
// public final static String DEFAULT_API_VERSION_HEADER = "X-Broker-Api-Version";
// public fina... | @ConditionalOnMissingBean(CatalogService.class) |
dflick-pivotal/sentimentr-release | src/spring-cloud-cloudfoundry-service-broker/src/main/java/org/springframework/cloud/servicebroker/config/ServiceBrokerAutoConfiguration.java | // Path: src/spring-cloud-cloudfoundry-service-broker/src/main/java/org/springframework/cloud/servicebroker/model/BrokerApiVersion.java
// @Getter
// @ToString
// @EqualsAndHashCode
// public class BrokerApiVersion {
//
// public final static String DEFAULT_API_VERSION_HEADER = "X-Broker-Api-Version";
// public fina... | import org.springframework.cloud.servicebroker.model.BrokerApiVersion;
import org.springframework.cloud.servicebroker.model.Catalog;
import org.springframework.cloud.servicebroker.service.BeanCatalogService;
import org.springframework.cloud.servicebroker.service.CatalogService;
import org.springframework.boot.autoconfi... | package org.springframework.cloud.servicebroker.config;
@Configuration
@ComponentScan(basePackages = {"org.springframework.cloud.servicebroker"})
@ConditionalOnWebApplication
@AutoConfigureAfter(WebMvcAutoConfiguration.class)
public class ServiceBrokerAutoConfiguration {
@Bean
@ConditionalOnMissingBean(BrokerApiV... | // Path: src/spring-cloud-cloudfoundry-service-broker/src/main/java/org/springframework/cloud/servicebroker/model/BrokerApiVersion.java
// @Getter
// @ToString
// @EqualsAndHashCode
// public class BrokerApiVersion {
//
// public final static String DEFAULT_API_VERSION_HEADER = "X-Broker-Api-Version";
// public fina... | public CatalogService beanCatalogService(Catalog catalog) { |
dflick-pivotal/sentimentr-release | src/spring-cloud-cloudfoundry-service-broker/src/main/java/org/springframework/cloud/servicebroker/config/ServiceBrokerAutoConfiguration.java | // Path: src/spring-cloud-cloudfoundry-service-broker/src/main/java/org/springframework/cloud/servicebroker/model/BrokerApiVersion.java
// @Getter
// @ToString
// @EqualsAndHashCode
// public class BrokerApiVersion {
//
// public final static String DEFAULT_API_VERSION_HEADER = "X-Broker-Api-Version";
// public fina... | import org.springframework.cloud.servicebroker.model.BrokerApiVersion;
import org.springframework.cloud.servicebroker.model.Catalog;
import org.springframework.cloud.servicebroker.service.BeanCatalogService;
import org.springframework.cloud.servicebroker.service.CatalogService;
import org.springframework.boot.autoconfi... | package org.springframework.cloud.servicebroker.config;
@Configuration
@ComponentScan(basePackages = {"org.springframework.cloud.servicebroker"})
@ConditionalOnWebApplication
@AutoConfigureAfter(WebMvcAutoConfiguration.class)
public class ServiceBrokerAutoConfiguration {
@Bean
@ConditionalOnMissingBean(BrokerApiV... | // Path: src/spring-cloud-cloudfoundry-service-broker/src/main/java/org/springframework/cloud/servicebroker/model/BrokerApiVersion.java
// @Getter
// @ToString
// @EqualsAndHashCode
// public class BrokerApiVersion {
//
// public final static String DEFAULT_API_VERSION_HEADER = "X-Broker-Api-Version";
// public fina... | return new BeanCatalogService(catalog); |
dflick-pivotal/sentimentr-release | sentimentr-client/sentimentr-connector/src/main/java/io/pivotal/fe/sentimentr/client/cloud/connector/SentimentrConnectionCreator.java | // Path: sentimentr-client/sentimentr-connector/src/main/java/io/pivotal/fe/sentimentr/client/cloud/SentimentrServiceInfo.java
// public class SentimentrServiceInfo extends UriBasedServiceInfo {
// public SentimentrServiceInfo(String id, String url) {
// super(id, url);
// }
// }
//
// Path: sentimentr... | import org.springframework.cloud.service.AbstractServiceConnectorCreator;
import org.springframework.cloud.service.ServiceConnectorConfig;
import io.pivotal.fe.sentimentr.client.cloud.SentimentrServiceInfo;
import io.pivotal.fe.sentimentr.client.facade.SentimentrFacade;
import io.pivotal.fe.sentimentr.client.facade.Sen... | package io.pivotal.fe.sentimentr.client.cloud.connector;
public class SentimentrConnectionCreator extends AbstractServiceConnectorCreator<SentimentrFacade, SentimentrServiceInfo> {
@Override
public SentimentrFacade create(SentimentrServiceInfo serviceInfo, ServiceConnectorConfig serviceConnectorConfig) { | // Path: sentimentr-client/sentimentr-connector/src/main/java/io/pivotal/fe/sentimentr/client/cloud/SentimentrServiceInfo.java
// public class SentimentrServiceInfo extends UriBasedServiceInfo {
// public SentimentrServiceInfo(String id, String url) {
// super(id, url);
// }
// }
//
// Path: sentimentr... | return new SentimentrFacadeFactory().create(serviceInfo.getUri()); |
dflick-pivotal/sentimentr-release | src/spring-cloud-cloudfoundry-service-broker/src/test/java/org/springframework/cloud/servicebroker/model/fixture/ServiceFixture.java | // Path: src/spring-cloud-cloudfoundry-service-broker/src/main/java/org/springframework/cloud/servicebroker/model/ServiceDefinition.java
// @Getter
// @ToString
// @EqualsAndHashCode
// @JsonAutoDetect(getterVisibility = JsonAutoDetect.Visibility.NONE)
// @JsonIgnoreProperties(ignoreUnknown = true)
// public class Serv... | import java.util.Arrays;
import org.springframework.cloud.servicebroker.model.ServiceDefinition;
import org.springframework.cloud.servicebroker.model.ServiceDefinitionRequires; | package org.springframework.cloud.servicebroker.model.fixture;
public class ServiceFixture {
public static ServiceDefinition getSimpleService() {
return new ServiceDefinition(
"service-one-id",
"Service One",
"Description for Service One",
true,
PlanFixture.getAllPlans());
}
public stat... | // Path: src/spring-cloud-cloudfoundry-service-broker/src/main/java/org/springframework/cloud/servicebroker/model/ServiceDefinition.java
// @Getter
// @ToString
// @EqualsAndHashCode
// @JsonAutoDetect(getterVisibility = JsonAutoDetect.Visibility.NONE)
// @JsonIgnoreProperties(ignoreUnknown = true)
// public class Serv... | ServiceDefinitionRequires.SERVICE_REQUIRES_SYSLOG_DRAIN.toString(), |
dflick-pivotal/sentimentr-release | src/spring-cloud-cloudfoundry-service-broker/src/test/java/org/springframework/cloud/servicebroker/interceptor/BrokerApiVersionInterceptorIntegrationTest.java | // Path: src/spring-cloud-cloudfoundry-service-broker/src/main/java/org/springframework/cloud/servicebroker/controller/CatalogController.java
// @RestController
// @Slf4j
// public class CatalogController extends BaseController {
// @Autowired
// public CatalogController(CatalogService service) {
// super(service);... | import static org.hamcrest.Matchers.containsString;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
imp... | package org.springframework.cloud.servicebroker.interceptor;
@RunWith(MockitoJUnitRunner.class)
public class BrokerApiVersionInterceptorIntegrationTest {
private final static String CATALOG_PATH = "/v2/catalog";
private MockMvc mockMvc;
@InjectMocks | // Path: src/spring-cloud-cloudfoundry-service-broker/src/main/java/org/springframework/cloud/servicebroker/controller/CatalogController.java
// @RestController
// @Slf4j
// public class CatalogController extends BaseController {
// @Autowired
// public CatalogController(CatalogService service) {
// super(service);... | private CatalogController controller; |
dflick-pivotal/sentimentr-release | src/spring-cloud-cloudfoundry-service-broker/src/test/java/org/springframework/cloud/servicebroker/interceptor/BrokerApiVersionInterceptorIntegrationTest.java | // Path: src/spring-cloud-cloudfoundry-service-broker/src/main/java/org/springframework/cloud/servicebroker/controller/CatalogController.java
// @RestController
// @Slf4j
// public class CatalogController extends BaseController {
// @Autowired
// public CatalogController(CatalogService service) {
// super(service);... | import static org.hamcrest.Matchers.containsString;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
imp... | package org.springframework.cloud.servicebroker.interceptor;
@RunWith(MockitoJUnitRunner.class)
public class BrokerApiVersionInterceptorIntegrationTest {
private final static String CATALOG_PATH = "/v2/catalog";
private MockMvc mockMvc;
@InjectMocks
private CatalogController controller;
@Mock | // Path: src/spring-cloud-cloudfoundry-service-broker/src/main/java/org/springframework/cloud/servicebroker/controller/CatalogController.java
// @RestController
// @Slf4j
// public class CatalogController extends BaseController {
// @Autowired
// public CatalogController(CatalogService service) {
// super(service);... | private CatalogService catalogService; |
dflick-pivotal/sentimentr-release | src/spring-cloud-cloudfoundry-service-broker/src/test/java/org/springframework/cloud/servicebroker/interceptor/BrokerApiVersionInterceptorIntegrationTest.java | // Path: src/spring-cloud-cloudfoundry-service-broker/src/main/java/org/springframework/cloud/servicebroker/controller/CatalogController.java
// @RestController
// @Slf4j
// public class CatalogController extends BaseController {
// @Autowired
// public CatalogController(CatalogService service) {
// super(service);... | import static org.hamcrest.Matchers.containsString;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
imp... | package org.springframework.cloud.servicebroker.interceptor;
@RunWith(MockitoJUnitRunner.class)
public class BrokerApiVersionInterceptorIntegrationTest {
private final static String CATALOG_PATH = "/v2/catalog";
private MockMvc mockMvc;
@InjectMocks
private CatalogController controller;
@Mock
private Catal... | // Path: src/spring-cloud-cloudfoundry-service-broker/src/main/java/org/springframework/cloud/servicebroker/controller/CatalogController.java
// @RestController
// @Slf4j
// public class CatalogController extends BaseController {
// @Autowired
// public CatalogController(CatalogService service) {
// super(service);... | .addInterceptors(new BrokerApiVersionInterceptor(new BrokerApiVersion("header", "expected-version"))) |
dflick-pivotal/sentimentr-release | src/spring-cloud-cloudfoundry-service-broker/src/main/java/org/springframework/cloud/servicebroker/interceptor/BrokerApiVersionInterceptor.java | // Path: src/spring-cloud-cloudfoundry-service-broker/src/main/java/org/springframework/cloud/servicebroker/exception/ServiceBrokerApiVersionException.java
// public class ServiceBrokerApiVersionException extends RuntimeException {
//
// private static final long serialVersionUID = -6792404679608443775L;
//
// publ... | import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.cloud.servicebroker.exception.ServiceBrokerApiVersionException;
import org.springframework.cloud.servicebroker.model.BrokerApiVersion;
import org.springframework.web.servlet.handler.HandlerInterceptor... | package org.springframework.cloud.servicebroker.interceptor;
public class BrokerApiVersionInterceptor extends HandlerInterceptorAdapter {
private final BrokerApiVersion version;
public BrokerApiVersionInterceptor() {
this(null);
}
public BrokerApiVersionInterceptor(BrokerApiVersion version) {
this.version... | // Path: src/spring-cloud-cloudfoundry-service-broker/src/main/java/org/springframework/cloud/servicebroker/exception/ServiceBrokerApiVersionException.java
// public class ServiceBrokerApiVersionException extends RuntimeException {
//
// private static final long serialVersionUID = -6792404679608443775L;
//
// publ... | Object handler) throws ServiceBrokerApiVersionException { |
dflick-pivotal/sentimentr-release | src/spring-cloud-cloudfoundry-service-broker/src/test/java/org/springframework/cloud/servicebroker/controller/ControllerIntegrationTest.java | // Path: src/spring-cloud-cloudfoundry-service-broker/src/test/java/org/springframework/cloud/servicebroker/model/fixture/ServiceFixture.java
// public class ServiceFixture {
//
// public static ServiceDefinition getSimpleService() {
// return new ServiceDefinition(
// "service-one-id",
// "Service One",
... | import org.springframework.cloud.servicebroker.model.fixture.ServiceFixture;
import org.springframework.cloud.servicebroker.service.CatalogService;
import org.mockito.Mock;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.when; | package org.springframework.cloud.servicebroker.controller;
public abstract class ControllerIntegrationTest {
@Mock | // Path: src/spring-cloud-cloudfoundry-service-broker/src/test/java/org/springframework/cloud/servicebroker/model/fixture/ServiceFixture.java
// public class ServiceFixture {
//
// public static ServiceDefinition getSimpleService() {
// return new ServiceDefinition(
// "service-one-id",
// "Service One",
... | protected CatalogService catalogService; |
dflick-pivotal/sentimentr-release | src/spring-cloud-cloudfoundry-service-broker/src/test/java/org/springframework/cloud/servicebroker/controller/ControllerIntegrationTest.java | // Path: src/spring-cloud-cloudfoundry-service-broker/src/test/java/org/springframework/cloud/servicebroker/model/fixture/ServiceFixture.java
// public class ServiceFixture {
//
// public static ServiceDefinition getSimpleService() {
// return new ServiceDefinition(
// "service-one-id",
// "Service One",
... | import org.springframework.cloud.servicebroker.model.fixture.ServiceFixture;
import org.springframework.cloud.servicebroker.service.CatalogService;
import org.mockito.Mock;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.when; | package org.springframework.cloud.servicebroker.controller;
public abstract class ControllerIntegrationTest {
@Mock
protected CatalogService catalogService;
protected void setupCatalogService(String serviceDefinitionId) {
when(catalogService.getServiceDefinition(eq(serviceDefinitionId))) | // Path: src/spring-cloud-cloudfoundry-service-broker/src/test/java/org/springframework/cloud/servicebroker/model/fixture/ServiceFixture.java
// public class ServiceFixture {
//
// public static ServiceDefinition getSimpleService() {
// return new ServiceDefinition(
// "service-one-id",
// "Service One",
... | .thenReturn(ServiceFixture.getSimpleService()); |
dflick-pivotal/sentimentr-release | src/spring-cloud-cloudfoundry-service-broker/src/main/java/org/springframework/cloud/servicebroker/service/BeanCatalogService.java | // Path: src/spring-cloud-cloudfoundry-service-broker/src/main/java/org/springframework/cloud/servicebroker/model/Catalog.java
// @Getter
// @ToString
// @EqualsAndHashCode
// @JsonAutoDetect(getterVisibility = JsonAutoDetect.Visibility.NONE)
// @JsonIgnoreProperties(ignoreUnknown = true)
// public class Catalog {
//
... | import java.util.HashMap;
import java.util.Map;
import org.springframework.cloud.servicebroker.model.Catalog;
import org.springframework.cloud.servicebroker.model.ServiceDefinition;
import org.springframework.beans.factory.annotation.Autowired; | package org.springframework.cloud.servicebroker.service;
/**
* An implementation of the CatalogService that allows the Catalog to be specified as a Spring Bean.
*
* @author sgreenberg@pivotal.io
*/
public class BeanCatalogService implements CatalogService {
private Catalog catalog; | // Path: src/spring-cloud-cloudfoundry-service-broker/src/main/java/org/springframework/cloud/servicebroker/model/Catalog.java
// @Getter
// @ToString
// @EqualsAndHashCode
// @JsonAutoDetect(getterVisibility = JsonAutoDetect.Visibility.NONE)
// @JsonIgnoreProperties(ignoreUnknown = true)
// public class Catalog {
//
... | private Map<String,ServiceDefinition> serviceDefs = new HashMap<String,ServiceDefinition>(); |
dflick-pivotal/sentimentr-release | src/sentimentr-service/src/main/java/io/pivotal/fe/sentiment/SentimentAnayticsServiceApplication.java | // Path: src/sentimentr-service/src/main/java/io/pivotal/fe/sentiment/engine/NLP.java
// public class NLP {
// static StanfordCoreNLP pipeline;
//
// public static void init() {
// pipeline = new StanfordCoreNLP("nlp.properties");
// }
//
// public static int findSentiment(String text) {
//... | import io.pivotal.fe.sentiment.engine.NLP;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import javax.servlet.http.HttpServletRequest;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.anno... | package io.pivotal.fe.sentiment;
@SpringBootApplication
@RestController
public class SentimentAnayticsServiceApplication {
@RequestMapping("/env")
public Map<String,Object> env(HttpServletRequest request) {
Map<String,Object> model = new HashMap<String,Object>();
model.put("ip", request.getLocalAddr()... | // Path: src/sentimentr-service/src/main/java/io/pivotal/fe/sentiment/engine/NLP.java
// public class NLP {
// static StanfordCoreNLP pipeline;
//
// public static void init() {
// pipeline = new StanfordCoreNLP("nlp.properties");
// }
//
// public static int findSentiment(String text) {
//... | int sentiment = NLP.findSentiment(text); |
dflick-pivotal/sentimentr-release | src/spring-cloud-cloudfoundry-service-broker/src/test/java/org/springframework/cloud/servicebroker/model/fixture/CatalogFixture.java | // Path: src/spring-cloud-cloudfoundry-service-broker/src/main/java/org/springframework/cloud/servicebroker/model/Catalog.java
// @Getter
// @ToString
// @EqualsAndHashCode
// @JsonAutoDetect(getterVisibility = JsonAutoDetect.Visibility.NONE)
// @JsonIgnoreProperties(ignoreUnknown = true)
// public class Catalog {
//
... | import org.springframework.cloud.servicebroker.model.Catalog;
import org.springframework.cloud.servicebroker.model.ServiceDefinition;
import java.util.Collections;
import java.util.List; | package org.springframework.cloud.servicebroker.model.fixture;
public class CatalogFixture {
public static Catalog getCatalog() { | // Path: src/spring-cloud-cloudfoundry-service-broker/src/main/java/org/springframework/cloud/servicebroker/model/Catalog.java
// @Getter
// @ToString
// @EqualsAndHashCode
// @JsonAutoDetect(getterVisibility = JsonAutoDetect.Visibility.NONE)
// @JsonIgnoreProperties(ignoreUnknown = true)
// public class Catalog {
//
... | List<ServiceDefinition> services = Collections.singletonList(ServiceFixture.getSimpleService()); |
dflick-pivotal/sentimentr-release | src/spring-cloud-cloudfoundry-service-broker/src/main/java/org/springframework/cloud/servicebroker/controller/CatalogController.java | // Path: src/spring-cloud-cloudfoundry-service-broker/src/main/java/org/springframework/cloud/servicebroker/model/Catalog.java
// @Getter
// @ToString
// @EqualsAndHashCode
// @JsonAutoDetect(getterVisibility = JsonAutoDetect.Visibility.NONE)
// @JsonIgnoreProperties(ignoreUnknown = true)
// public class Catalog {
//
... | import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.servicebroker.model.Catalog;
import org.springframework.cloud.servicebroker.service.CatalogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.... | package org.springframework.cloud.servicebroker.controller;
/**
* See: http://docs.cloudfoundry.org/services/api.html
*
* @author sgreenberg@pivotal.io
* @author Scott Frederick
*/
@RestController
@Slf4j
public class CatalogController extends BaseController {
@Autowired | // Path: src/spring-cloud-cloudfoundry-service-broker/src/main/java/org/springframework/cloud/servicebroker/model/Catalog.java
// @Getter
// @ToString
// @EqualsAndHashCode
// @JsonAutoDetect(getterVisibility = JsonAutoDetect.Visibility.NONE)
// @JsonIgnoreProperties(ignoreUnknown = true)
// public class Catalog {
//
... | public CatalogController(CatalogService service) { |
dflick-pivotal/sentimentr-release | src/spring-cloud-cloudfoundry-service-broker/src/main/java/org/springframework/cloud/servicebroker/controller/CatalogController.java | // Path: src/spring-cloud-cloudfoundry-service-broker/src/main/java/org/springframework/cloud/servicebroker/model/Catalog.java
// @Getter
// @ToString
// @EqualsAndHashCode
// @JsonAutoDetect(getterVisibility = JsonAutoDetect.Visibility.NONE)
// @JsonIgnoreProperties(ignoreUnknown = true)
// public class Catalog {
//
... | import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.servicebroker.model.Catalog;
import org.springframework.cloud.servicebroker.service.CatalogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.... | package org.springframework.cloud.servicebroker.controller;
/**
* See: http://docs.cloudfoundry.org/services/api.html
*
* @author sgreenberg@pivotal.io
* @author Scott Frederick
*/
@RestController
@Slf4j
public class CatalogController extends BaseController {
@Autowired
public CatalogController(CatalogService ... | // Path: src/spring-cloud-cloudfoundry-service-broker/src/main/java/org/springframework/cloud/servicebroker/model/Catalog.java
// @Getter
// @ToString
// @EqualsAndHashCode
// @JsonAutoDetect(getterVisibility = JsonAutoDetect.Visibility.NONE)
// @JsonIgnoreProperties(ignoreUnknown = true)
// public class Catalog {
//
... | public Catalog getCatalog() { |
guardianproject/gnupg-for-android | src/info/guardianproject/gpg/KeyserverLoader.java | // Path: src/org/openintents/openpgp/keyserver/KeyServer.java
// static public class InsufficientQuery extends Exception {
// private static final long serialVersionUID = 2703768928624654514L;
// }
//
// Path: src/org/openintents/openpgp/keyserver/KeyServer.java
// static public class KeyInfo implements Serializab... | import java.text.Collator;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import org.openintents.openpgp.keyserver.HkpKeyServer;
import org.openintents.openpgp.keyserver.KeyServer.InsufficientQuery;
import org.openintents.openpgp.keyserver.KeyServer.KeyInfo... |
@Override
public int compare(KeyInfo object1, KeyInfo object2) {
return sCollator.compare(object1.userIds.get(0), object2.userIds.get(0));
}
};
public KeyserverLoader(Context context) {
super(context);
mContext = context;
}
@Override
public void... | // Path: src/org/openintents/openpgp/keyserver/KeyServer.java
// static public class InsufficientQuery extends Exception {
// private static final long serialVersionUID = 2703768928624654514L;
// }
//
// Path: src/org/openintents/openpgp/keyserver/KeyServer.java
// static public class KeyInfo implements Serializab... | } catch (QueryException e) { |
guardianproject/gnupg-for-android | src/info/guardianproject/gpg/KeyserverLoader.java | // Path: src/org/openintents/openpgp/keyserver/KeyServer.java
// static public class InsufficientQuery extends Exception {
// private static final long serialVersionUID = 2703768928624654514L;
// }
//
// Path: src/org/openintents/openpgp/keyserver/KeyServer.java
// static public class KeyInfo implements Serializab... | import java.text.Collator;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import org.openintents.openpgp.keyserver.HkpKeyServer;
import org.openintents.openpgp.keyserver.KeyServer.InsufficientQuery;
import org.openintents.openpgp.keyserver.KeyServer.KeyInfo... | return sCollator.compare(object1.userIds.get(0), object2.userIds.get(0));
}
};
public KeyserverLoader(Context context) {
super(context);
mContext = context;
}
@Override
public void onStartLoading() {
mSearchString = MainActivity.mCurrentSearchString;
... | // Path: src/org/openintents/openpgp/keyserver/KeyServer.java
// static public class InsufficientQuery extends Exception {
// private static final long serialVersionUID = 2703768928624654514L;
// }
//
// Path: src/org/openintents/openpgp/keyserver/KeyServer.java
// static public class KeyInfo implements Serializab... | } catch (TooManyResponses e) { |
guardianproject/gnupg-for-android | src/info/guardianproject/gpg/KeyserverLoader.java | // Path: src/org/openintents/openpgp/keyserver/KeyServer.java
// static public class InsufficientQuery extends Exception {
// private static final long serialVersionUID = 2703768928624654514L;
// }
//
// Path: src/org/openintents/openpgp/keyserver/KeyServer.java
// static public class KeyInfo implements Serializab... | import java.text.Collator;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import org.openintents.openpgp.keyserver.HkpKeyServer;
import org.openintents.openpgp.keyserver.KeyServer.InsufficientQuery;
import org.openintents.openpgp.keyserver.KeyServer.KeyInfo... |
public KeyserverLoader(Context context) {
super(context);
mContext = context;
}
@Override
public void onStartLoading() {
mSearchString = MainActivity.mCurrentSearchString;
}
@Override
public KeyserverResult<List<KeyInfo>> loadInBackground() {
KeyserverResul... | // Path: src/org/openintents/openpgp/keyserver/KeyServer.java
// static public class InsufficientQuery extends Exception {
// private static final long serialVersionUID = 2703768928624654514L;
// }
//
// Path: src/org/openintents/openpgp/keyserver/KeyServer.java
// static public class KeyInfo implements Serializab... | } catch (InsufficientQuery e) { |
guardianproject/gnupg-for-android | tests/src/info/guardianproject/gpg/test/RawGpgContactTests.java | // Path: src/info/guardianproject/gpg/sync/RawGpgContact.java
// public class RawGpgContact {
//
// public final String name;
// public final String email;
// public final String comment;
// public final String keyID;
// public final String fingerprint;
// public final int flags;
// public ... | import info.guardianproject.gpg.NativeHelper;
import info.guardianproject.gpg.sync.RawGpgContact;
import info.guardianproject.gpg.sync.RawGpgContact.KeyFlags;
import android.test.AndroidTestCase;
import android.util.Log; |
package info.guardianproject.gpg.test;
public class RawGpgContactTests extends AndroidTestCase {
public static final String TAG = "RawGpgContactTests";
protected void setUp() throws Exception {
Log.i(TAG, "setUp");
super.setUp();
NativeHelper.setup(getContext());
}
protected... | // Path: src/info/guardianproject/gpg/sync/RawGpgContact.java
// public class RawGpgContact {
//
// public final String name;
// public final String email;
// public final String comment;
// public final String keyID;
// public final String fingerprint;
// public final int flags;
// public ... | RawGpgContact first, second; |
guardianproject/gnupg-for-android | tests/src/info/guardianproject/gpg/test/RawGpgContactTests.java | // Path: src/info/guardianproject/gpg/sync/RawGpgContact.java
// public class RawGpgContact {
//
// public final String name;
// public final String email;
// public final String comment;
// public final String keyID;
// public final String fingerprint;
// public final int flags;
// public ... | import info.guardianproject.gpg.NativeHelper;
import info.guardianproject.gpg.sync.RawGpgContact;
import info.guardianproject.gpg.sync.RawGpgContact.KeyFlags;
import android.test.AndroidTestCase;
import android.util.Log; |
package info.guardianproject.gpg.test;
public class RawGpgContactTests extends AndroidTestCase {
public static final String TAG = "RawGpgContactTests";
protected void setUp() throws Exception {
Log.i(TAG, "setUp");
super.setUp();
NativeHelper.setup(getContext());
}
protected... | // Path: src/info/guardianproject/gpg/sync/RawGpgContact.java
// public class RawGpgContact {
//
// public final String name;
// public final String email;
// public final String comment;
// public final String keyID;
// public final String fingerprint;
// public final int flags;
// public ... | int flags = (first.canEncrypt ? 1 << KeyFlags.canEncrypt : 0) |
guardianproject/gnupg-for-android | src/info/guardianproject/gpg/KeyListContactsAdapter.java | // Path: src/info/guardianproject/gpg/sync/RawGpgContact.java
// public class RawGpgContact {
//
// public final String name;
// public final String email;
// public final String comment;
// public final String keyID;
// public final String fingerprint;
// public final int flags;
// public ... | import android.widget.Filter;
import android.widget.Filterable;
import android.widget.ListView;
import android.widget.TextView;
import info.guardianproject.gpg.GpgApplication.Action;
import info.guardianproject.gpg.sync.GpgContactManager;
import info.guardianproject.gpg.sync.RawGpgContact;
import java.math.BigInteger;
... | /*
* Copyright (C) 2010 Thialfihar <thi@thialfihar.org>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | // Path: src/info/guardianproject/gpg/sync/RawGpgContact.java
// public class RawGpgContact {
//
// public final String name;
// public final String email;
// public final String comment;
// public final String keyID;
// public final String fingerprint;
// public final int flags;
// public ... | private RawGpgContact[] mContacts; |
guardianproject/gnupg-for-android | src/info/guardianproject/gpg/apg_compat/DecryptActivity.java | // Path: src/info/guardianproject/gpg/GnuPG.java
// public class GnuPG {
// public static GnuPGContext context = null;
//
// private static Pattern PGP_MESSAGE = null;
// private static Pattern PGP_PRIVATE_KEY_BLOCK = null;
// private static Pattern PGP_PUBLIC_KEY_BLOCK = null;
// private static Pa... | import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.widget.Toast;
import com.freiheit.gnupg.GnuPGData;
import info.guardianproject.gpg.GnuPG;
import info.guardianproject.gpg.R;
import java.io.BufferedOutputStream;
import java.io.ByteArrayOutputSt... |
package info.guardianproject.gpg.apg_compat;
public class DecryptActivity extends Activity {
public static final String TAG = "DecryptActivity";
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Intent intent = getIntent();
Strin... | // Path: src/info/guardianproject/gpg/GnuPG.java
// public class GnuPG {
// public static GnuPGContext context = null;
//
// private static Pattern PGP_MESSAGE = null;
// private static Pattern PGP_PRIVATE_KEY_BLOCK = null;
// private static Pattern PGP_PUBLIC_KEY_BLOCK = null;
// private static Pa... | GnuPG.context.setArmor(asciiArmor); |
guardianproject/gnupg-for-android | src/info/guardianproject/gpg/CreateKeyActivity.java | // Path: src/com/freiheit/gnupg/GnuPGGenkeyResult.java
// public class GnuPGGenkeyResult {
//
// private String _fpr;
// private boolean _primary;
// private boolean _sub;
//
// protected GnuPGGenkeyResult() {
// }
//
// /**
// * This is the fingerprint of the key that was created. If bo... | import android.accounts.Account;
import android.accounts.AccountManager;
import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.SharedPreferences;
import android.database.Cursor;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Envi... | Toast.makeText(this, getString(R.string.error_gen_key_failed), Toast.LENGTH_LONG)
.show();
finish();
}
public class CreateKeyTask extends AsyncTask<String, String, Integer> {
private ProgressDialog dialog;
private Context context;
public CreateKe... | // Path: src/com/freiheit/gnupg/GnuPGGenkeyResult.java
// public class GnuPGGenkeyResult {
//
// private String _fpr;
// private boolean _primary;
// private boolean _sub;
//
// protected GnuPGGenkeyResult() {
// }
//
// /**
// * This is the fingerprint of the key that was created. If bo... | GnuPGGenkeyResult result = GnuPG.context.getGenkeyResult(); |
guardianproject/gnupg-for-android | src/info/guardianproject/gpg/KeyListKeyserverAdapter.java | // Path: src/org/openintents/openpgp/keyserver/KeyServer.java
// static public class KeyInfo implements Serializable, Parcelable {
// private static final long serialVersionUID = -7797972113284992662L;
// public ArrayList<String> userIds;
// public boolean isRevoked;
// public Date creationDate;
// ... | import java.util.List;
import org.openintents.openpgp.keyserver.KeyServer.KeyInfo;
import android.content.Context;
import android.text.format.DateFormat;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import androi... | /*
* Copyright (C) 2010 Thialfihar <thi@thialfihar.org>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | // Path: src/org/openintents/openpgp/keyserver/KeyServer.java
// static public class KeyInfo implements Serializable, Parcelable {
// private static final long serialVersionUID = -7797972113284992662L;
// public ArrayList<String> userIds;
// public boolean isRevoked;
// public Date creationDate;
// ... | private KeyInfo[] mKeyArray; |
caprica/bootlace | src/main/java/uk/co/caprica/bootlace/controller/profile/ProfileController.java | // Path: src/main/java/uk/co/caprica/bootlace/data/mongo/profile/ProfileRepository.java
// public interface ProfileRepository extends MongoRepository<Profile, String> {
//
// }
//
// Path: src/main/java/uk/co/caprica/bootlace/domain/profile/Profile.java
// @Document
// public class Profile extends AbstractAuditableEn... | import org.springframework.web.bind.annotation.RestController;
import uk.co.caprica.bootlace.data.mongo.profile.ProfileRepository;
import uk.co.caprica.bootlace.domain.profile.Profile;
import uk.co.caprica.bootlace.security.domain.UserWithId;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springfra... | /*
* This file is part of Bootlace.
*
* Copyright (C) 2015
* Caprica Software Limited (capricasoftware.co.uk)
*
* 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.a... | // Path: src/main/java/uk/co/caprica/bootlace/data/mongo/profile/ProfileRepository.java
// public interface ProfileRepository extends MongoRepository<Profile, String> {
//
// }
//
// Path: src/main/java/uk/co/caprica/bootlace/domain/profile/Profile.java
// @Document
// public class Profile extends AbstractAuditableEn... | private ProfileRepository profileRepository; |
caprica/bootlace | src/main/java/uk/co/caprica/bootlace/controller/profile/ProfileController.java | // Path: src/main/java/uk/co/caprica/bootlace/data/mongo/profile/ProfileRepository.java
// public interface ProfileRepository extends MongoRepository<Profile, String> {
//
// }
//
// Path: src/main/java/uk/co/caprica/bootlace/domain/profile/Profile.java
// @Document
// public class Profile extends AbstractAuditableEn... | import org.springframework.web.bind.annotation.RestController;
import uk.co.caprica.bootlace.data.mongo.profile.ProfileRepository;
import uk.co.caprica.bootlace.domain.profile.Profile;
import uk.co.caprica.bootlace.security.domain.UserWithId;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springfra... | /*
* This file is part of Bootlace.
*
* Copyright (C) 2015
* Caprica Software Limited (capricasoftware.co.uk)
*
* 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.a... | // Path: src/main/java/uk/co/caprica/bootlace/data/mongo/profile/ProfileRepository.java
// public interface ProfileRepository extends MongoRepository<Profile, String> {
//
// }
//
// Path: src/main/java/uk/co/caprica/bootlace/domain/profile/Profile.java
// @Document
// public class Profile extends AbstractAuditableEn... | public Profile getProfile(@AuthenticationPrincipal UserWithId user) { |
caprica/bootlace | src/main/java/uk/co/caprica/bootlace/controller/profile/ProfileController.java | // Path: src/main/java/uk/co/caprica/bootlace/data/mongo/profile/ProfileRepository.java
// public interface ProfileRepository extends MongoRepository<Profile, String> {
//
// }
//
// Path: src/main/java/uk/co/caprica/bootlace/domain/profile/Profile.java
// @Document
// public class Profile extends AbstractAuditableEn... | import org.springframework.web.bind.annotation.RestController;
import uk.co.caprica.bootlace.data.mongo.profile.ProfileRepository;
import uk.co.caprica.bootlace.domain.profile.Profile;
import uk.co.caprica.bootlace.security.domain.UserWithId;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springfra... | /*
* This file is part of Bootlace.
*
* Copyright (C) 2015
* Caprica Software Limited (capricasoftware.co.uk)
*
* 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.a... | // Path: src/main/java/uk/co/caprica/bootlace/data/mongo/profile/ProfileRepository.java
// public interface ProfileRepository extends MongoRepository<Profile, String> {
//
// }
//
// Path: src/main/java/uk/co/caprica/bootlace/domain/profile/Profile.java
// @Document
// public class Profile extends AbstractAuditableEn... | public Profile getProfile(@AuthenticationPrincipal UserWithId user) { |
caprica/bootlace | src/main/java/uk/co/caprica/bootlace/startup/ApplicationStartup.java | // Path: src/main/java/uk/co/caprica/bootlace/data/mongo/account/AccountRepository.java
// public interface AccountRepository extends MongoRepository<Account, String> {
//
// /**
// * Find an account for a given username.
// *
// * @param username username to search for
// * @return account; or... | import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Component;
import uk.co.caprica.bootlace.data.mongo.account.AccountRepository;
import uk.co.caprica.bootlace.domain.account.Account;
import java.util.ArrayList;
import java.util.List;
import org.slf4j.Logger;
impo... | /*
* This file is part of Bootlace.
*
* Copyright (C) 2015
* Caprica Software Limited (capricasoftware.co.uk)
*
* 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.a... | // Path: src/main/java/uk/co/caprica/bootlace/data/mongo/account/AccountRepository.java
// public interface AccountRepository extends MongoRepository<Account, String> {
//
// /**
// * Find an account for a given username.
// *
// * @param username username to search for
// * @return account; or... | private AccountRepository accountRepository; |
caprica/bootlace | src/main/java/uk/co/caprica/bootlace/startup/ApplicationStartup.java | // Path: src/main/java/uk/co/caprica/bootlace/data/mongo/account/AccountRepository.java
// public interface AccountRepository extends MongoRepository<Account, String> {
//
// /**
// * Find an account for a given username.
// *
// * @param username username to search for
// * @return account; or... | import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Component;
import uk.co.caprica.bootlace.data.mongo.account.AccountRepository;
import uk.co.caprica.bootlace.domain.account.Account;
import java.util.ArrayList;
import java.util.List;
import org.slf4j.Logger;
impo... | */
private void createDatabase() {
logger.debug("createDatabase()");
try {
mongoOperations.createCollection("account");
mongoOperations.indexOps("account")
.ensureIndex(new TextIndexDefinitionBuilder()
.named("username")
... | // Path: src/main/java/uk/co/caprica/bootlace/data/mongo/account/AccountRepository.java
// public interface AccountRepository extends MongoRepository<Account, String> {
//
// /**
// * Find an account for a given username.
// *
// * @param username username to search for
// * @return account; or... | Account markAdminAccount = new Account(); |
caprica/bootlace | src/main/java/uk/co/caprica/bootlace/controller/account/AccountController.java | // Path: src/main/java/uk/co/caprica/bootlace/controller/ResourceNotFoundException.java
// @ResponseStatus(value=HttpStatus.NOT_FOUND)
// public class ResourceNotFoundException extends RuntimeException {
//
// }
//
// Path: src/main/java/uk/co/caprica/bootlace/data/mongo/account/AccountRepository.java
// public inter... | import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import uk.co.caprica.bootlace.controller.ResourceNotFoundException;
import uk.co.caprica.bootlace.data.mongo.account.AccountRepository;
import uk.co.caprica.bootlace.domain.account.Account;
import... | /*
* This file is part of Bootlace.
*
* Copyright (C) 2015
* Caprica Software Limited (capricasoftware.co.uk)
*
* 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.a... | // Path: src/main/java/uk/co/caprica/bootlace/controller/ResourceNotFoundException.java
// @ResponseStatus(value=HttpStatus.NOT_FOUND)
// public class ResourceNotFoundException extends RuntimeException {
//
// }
//
// Path: src/main/java/uk/co/caprica/bootlace/data/mongo/account/AccountRepository.java
// public inter... | private AccountRepository accountRepository; |
caprica/bootlace | src/main/java/uk/co/caprica/bootlace/controller/account/AccountController.java | // Path: src/main/java/uk/co/caprica/bootlace/controller/ResourceNotFoundException.java
// @ResponseStatus(value=HttpStatus.NOT_FOUND)
// public class ResourceNotFoundException extends RuntimeException {
//
// }
//
// Path: src/main/java/uk/co/caprica/bootlace/data/mongo/account/AccountRepository.java
// public inter... | import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import uk.co.caprica.bootlace.controller.ResourceNotFoundException;
import uk.co.caprica.bootlace.data.mongo.account.AccountRepository;
import uk.co.caprica.bootlace.domain.account.Account;
import... | /*
* This file is part of Bootlace.
*
* Copyright (C) 2015
* Caprica Software Limited (capricasoftware.co.uk)
*
* 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.a... | // Path: src/main/java/uk/co/caprica/bootlace/controller/ResourceNotFoundException.java
// @ResponseStatus(value=HttpStatus.NOT_FOUND)
// public class ResourceNotFoundException extends RuntimeException {
//
// }
//
// Path: src/main/java/uk/co/caprica/bootlace/data/mongo/account/AccountRepository.java
// public inter... | public List<Account> getAllAccounts() { |
caprica/bootlace | src/main/java/uk/co/caprica/bootlace/controller/account/AccountController.java | // Path: src/main/java/uk/co/caprica/bootlace/controller/ResourceNotFoundException.java
// @ResponseStatus(value=HttpStatus.NOT_FOUND)
// public class ResourceNotFoundException extends RuntimeException {
//
// }
//
// Path: src/main/java/uk/co/caprica/bootlace/data/mongo/account/AccountRepository.java
// public inter... | import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import uk.co.caprica.bootlace.controller.ResourceNotFoundException;
import uk.co.caprica.bootlace.data.mongo.account.AccountRepository;
import uk.co.caprica.bootlace.domain.account.Account;
import... | /*
* This file is part of Bootlace.
*
* Copyright (C) 2015
* Caprica Software Limited (capricasoftware.co.uk)
*
* 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.a... | // Path: src/main/java/uk/co/caprica/bootlace/controller/ResourceNotFoundException.java
// @ResponseStatus(value=HttpStatus.NOT_FOUND)
// public class ResourceNotFoundException extends RuntimeException {
//
// }
//
// Path: src/main/java/uk/co/caprica/bootlace/data/mongo/account/AccountRepository.java
// public inter... | throw new ResourceNotFoundException(); |
NiceSystems/hrider | src/main/java/hrider/converters/TypeConverter.java | // Path: src/main/java/hrider/io/Log.java
// public class Log {
//
// //region Variables
// private Logger logger;
// //endregion
//
// //region Constructor
// private Log(Class<?> clazz) {
// logger = Logger.getLogger(clazz);
// }
// //endregion
//
// //region Public Methods
... | import hrider.io.Log;
import java.awt.*;
import java.io.Serializable;
import java.util.Map;
import java.util.regex.Pattern; | package hrider.converters;
/**
* Copyright (C) 2012 NICE Systems ltd.
* <p/>
* 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
* <p/>
* http://www.apache.org/licenses/LICENSE-2.0
* <p/... | // Path: src/main/java/hrider/io/Log.java
// public class Log {
//
// //region Variables
// private Logger logger;
// //endregion
//
// //region Constructor
// private Log(Class<?> clazz) {
// logger = Logger.getLogger(clazz);
// }
// //endregion
//
// //region Public Methods
... | protected static final Log logger = Log.getLogger(TypeConverter.class); |
NiceSystems/hrider | src/main/java/hrider/config/GlobalConfig.java | // Path: src/main/java/hrider/io/PathHelper.java
// public class PathHelper {
//
// //region Constants
// public final static String FILE_SEPARATOR = System.getProperty("file.separator");
// public final static String LINE_SEPARATOR = System.getProperty("line.separator");
//
// private final static Lo... | import hrider.io.PathHelper; | * @return A size of the batch.
*/
public int getBatchSizeForWrite() {
return get(Integer.class, KEY_BATCH_WRITE_SIZE, DEFAULT_BATCH_WRITE_SIZE);
}
/**
* Gets an amount of time to wait for hbase connection during check.
*
* @return An amount of time to wait.
*/
publ... | // Path: src/main/java/hrider/io/PathHelper.java
// public class PathHelper {
//
// //region Constants
// public final static String FILE_SEPARATOR = System.getProperty("file.separator");
// public final static String LINE_SEPARATOR = System.getProperty("line.separator");
//
// private final static Lo... | return PathHelper.append(PathHelper.getCurrentFolder(), get(String.class, KEY_CONVERTERS_CLASSES_FOLDER, DEFAULT_CONVERTERS_CLASSES_FOLDER)); |
NiceSystems/hrider | src/main/java/hrider/ui/controls/format/FormatEditor.java | // Path: src/main/java/hrider/converters/TypeConverter.java
// @SuppressWarnings("CallToSimpleGetterFromWithinClass")
// public abstract class TypeConverter implements Comparable<TypeConverter>, Serializable {
//
// //region Constants
// protected static final Log logger = Log.getLogger(TypeConve... | import hrider.converters.TypeConverter;
import javax.swing.*;
import javax.swing.border.EmptyBorder;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; | */
public String getText() {
return textPane.getText();
}
/**
* Sets the new text into the editor.
*
* @param text The new text to set.
*/
public void setText(String text) {
textField.setText(text);
textPane.setText(text);
}
/**
* Sets the ... | // Path: src/main/java/hrider/converters/TypeConverter.java
// @SuppressWarnings("CallToSimpleGetterFromWithinClass")
// public abstract class TypeConverter implements Comparable<TypeConverter>, Serializable {
//
// //region Constants
// protected static final Log logger = Log.getLogger(TypeConve... | public void setTypeConverter(TypeConverter typeConverter) { |
NiceSystems/hrider | src/main/java/hrider/data/ColumnQualifier.java | // Path: src/main/java/hrider/converters/TypeConverter.java
// @SuppressWarnings("CallToSimpleGetterFromWithinClass")
// public abstract class TypeConverter implements Comparable<TypeConverter>, Serializable {
//
// //region Constants
// protected static final Log logger = Log.getLogger(TypeConve... | import hrider.converters.TypeConverter;
import hrider.io.Log;
import java.io.Serializable;
import java.util.Arrays; | package hrider.data;
/**
* Copyright (C) 2012 NICE Systems ltd.
* <p/>
* 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
* <p/>
* http://www.apache.org/licenses/LICENSE-2.0
* <p/>
* U... | // Path: src/main/java/hrider/converters/TypeConverter.java
// @SuppressWarnings("CallToSimpleGetterFromWithinClass")
// public abstract class TypeConverter implements Comparable<TypeConverter>, Serializable {
//
// //region Constants
// protected static final Log logger = Log.getLogger(TypeConve... | private static final Log logger = Log.getLogger(ColumnQualifier.class); |
NiceSystems/hrider | src/main/java/hrider/data/DataCell.java | // Path: src/main/java/hrider/converters/TypeConverter.java
// @SuppressWarnings("CallToSimpleGetterFromWithinClass")
// public abstract class TypeConverter implements Comparable<TypeConverter>, Serializable {
//
// //region Constants
// protected static final Log logger = Log.getLogger(TypeConve... | import hrider.converters.TypeConverter;
import java.io.Serializable; | * @param type The type to check.
* @return True if the value can be converted to the specified type or False otherwise.
*/
public boolean isOfType(ColumnType type) {
return this.convertibleValue.isOfType(type);
}
/**
* Gets cell's type.
*
* @return The cell's type.
... | // Path: src/main/java/hrider/converters/TypeConverter.java
// @SuppressWarnings("CallToSimpleGetterFromWithinClass")
// public abstract class TypeConverter implements Comparable<TypeConverter>, Serializable {
//
// //region Constants
// protected static final Log logger = Log.getLogger(TypeConve... | public void setColumnNameConverter(TypeConverter converter) { |
NiceSystems/hrider | src/main/java/hrider/converters/DateAsLongConverter.java | // Path: src/main/java/hrider/format/DateUtils.java
// public class DateUtils {
//
// private static final Log logger = Log.getLogger(DateUtils.class);
// private static final DateFormat df;
//
// static {
// df = new SimpleDateFormat(GlobalConfig.instance().getDateFormat(), Locale.ENGLISH);
// ... | import hrider.format.DateUtils;
import org.apache.hadoop.hbase.util.Bytes;
import java.util.Date; | package hrider.converters;
/**
* Copyright (C) 2012 NICE Systems ltd.
* <p/>
* 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
* <p/>
* http://www.apache.org/licenses/LICENSE-2.0
* <p/... | // Path: src/main/java/hrider/format/DateUtils.java
// public class DateUtils {
//
// private static final Log logger = Log.getLogger(DateUtils.class);
// private static final DateFormat df;
//
// static {
// df = new SimpleDateFormat(GlobalConfig.instance().getDateFormat(), Locale.ENGLISH);
// ... | return DateUtils.format(new Date(Bytes.toLong(value))); |
NiceSystems/hrider | src/main/java/hrider/config/ConnectionDetails.java | // Path: src/main/java/hrider/actions/Action.java
// public abstract class Action<R> {
//
// /**
// * Executes the action.
// *
// * @throws Exception Any error.
// */
// public abstract R run() throws Exception;
//
// /**
// * The method is called when the error occurred.
// ... | import hrider.actions.Action;
import hrider.actions.RunnableAction;
import hrider.hbase.ConnectionManager;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseConfiguration;
import java.io.IOException;
import java.io.Serializable; | package hrider.config;
/**
* Copyright (C) 2012 NICE Systems ltd.
* <p/>
* 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
* <p/>
* http://www.apache.org/licenses/LICENSE-2.0
* <p/>
*... | // Path: src/main/java/hrider/actions/Action.java
// public abstract class Action<R> {
//
// /**
// * Executes the action.
// *
// * @throws Exception Any error.
// */
// public abstract R run() throws Exception;
//
// /**
// * The method is called when the error occurred.
// ... | Boolean result = RunnableAction.runAndWait( |
NiceSystems/hrider | src/main/java/hrider/config/ConnectionDetails.java | // Path: src/main/java/hrider/actions/Action.java
// public abstract class Action<R> {
//
// /**
// * Executes the action.
// *
// * @throws Exception Any error.
// */
// public abstract R run() throws Exception;
//
// /**
// * The method is called when the error occurred.
// ... | import hrider.actions.Action;
import hrider.actions.RunnableAction;
import hrider.hbase.ConnectionManager;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseConfiguration;
import java.io.IOException;
import java.io.Serializable; | package hrider.config;
/**
* Copyright (C) 2012 NICE Systems ltd.
* <p/>
* 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
* <p/>
* http://www.apache.org/licenses/LICENSE-2.0
* <p/>
*... | // Path: src/main/java/hrider/actions/Action.java
// public abstract class Action<R> {
//
// /**
// * Executes the action.
// *
// * @throws Exception Any error.
// */
// public abstract R run() throws Exception;
//
// /**
// * The method is called when the error occurred.
// ... | this.zookeeper.getHost(), new Action<Boolean>() { |
NiceSystems/hrider | src/main/java/hrider/config/ConnectionDetails.java | // Path: src/main/java/hrider/actions/Action.java
// public abstract class Action<R> {
//
// /**
// * Executes the action.
// *
// * @throws Exception Any error.
// */
// public abstract R run() throws Exception;
//
// /**
// * The method is called when the error occurred.
// ... | import hrider.actions.Action;
import hrider.actions.RunnableAction;
import hrider.hbase.ConnectionManager;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseConfiguration;
import java.io.IOException;
import java.io.Serializable; | package hrider.config;
/**
* Copyright (C) 2012 NICE Systems ltd.
* <p/>
* 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
* <p/>
* http://www.apache.org/licenses/LICENSE-2.0
* <p/>
*... | // Path: src/main/java/hrider/actions/Action.java
// public abstract class Action<R> {
//
// /**
// * Executes the action.
// *
// * @throws Exception Any error.
// */
// public abstract R run() throws Exception;
//
// /**
// * The method is called when the error occurred.
// ... | ConnectionManager.create(ConnectionDetails.this); |
NiceSystems/hrider | src/main/java/hrider/data/DataRow.java | // Path: src/main/java/hrider/converters/TypeConverter.java
// @SuppressWarnings("CallToSimpleGetterFromWithinClass")
// public abstract class TypeConverter implements Comparable<TypeConverter>, Serializable {
//
// //region Constants
// protected static final Log logger = Log.getLogger(TypeConve... | import hrider.converters.TypeConverter;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map; | *
* @param columnType The type to check.
* @return True if the value can be converted to the specified type or False otherwise.
*/
public boolean isCellOfType(String columnName, ColumnType columnType) {
DataCell cell = getCell(columnName);
if (cell != null) {
return c... | // Path: src/main/java/hrider/converters/TypeConverter.java
// @SuppressWarnings("CallToSimpleGetterFromWithinClass")
// public abstract class TypeConverter implements Comparable<TypeConverter>, Serializable {
//
// //region Constants
// protected static final Log logger = Log.getLogger(TypeConve... | public void updateColumnNameConverter(TypeConverter converter) { |
Copyleaks/Java-Plagiarism-Checker | src/copyleaks/sdk/api/exceptions/SecurityTokenException.java | // Path: src/copyleaks/sdk/api/models/LoginToken.java
// public class LoginToken implements Serializable
// {
// /**
// * For Serializable implementation.
// */
// private static final long serialVersionUID = 1L;
//
// public LoginToken(String token, Date issued, Date expire)
// {
// setTemporarySe... | import java.security.AccessControlException;
import copyleaks.sdk.api.models.LoginToken;
| /********************************************************************************
The MIT License(MIT)
Copyright(c) 2016 Copyleaks LTD (https://copyleaks.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), ... | // Path: src/copyleaks/sdk/api/models/LoginToken.java
// public class LoginToken implements Serializable
// {
// /**
// * For Serializable implementation.
// */
// private static final long serialVersionUID = 1L;
//
// public LoginToken(String token, Date issued, Date expire)
// {
// setTemporarySe... | public SecurityTokenException(LoginToken token)
|
Copyleaks/Java-Plagiarism-Checker | src/copyleaks/sdk/api/helpers/HttpURLConnection/HttpURLConnectionHelper.java | // Path: src/copyleaks/sdk/api/Settings.java
// public class Settings
// {
// public static final String Encoding = "UTF-8";
//
// public static final int NetworkReadTimeout = 30000;
// public static final int NetworkConnectTimeout = 15000;
//
// public static final String ServiceEntryPoint = "https://... | import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.Map;
import java.util.Scanner;
import copyleaks.sdk.api.Settings;
| /********************************************************************************
The MIT License(MIT)
Copyright(c) 2016 Copyleaks LTD (https://copyleaks.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), ... | // Path: src/copyleaks/sdk/api/Settings.java
// public class Settings
// {
// public static final String Encoding = "UTF-8";
//
// public static final int NetworkReadTimeout = 30000;
// public static final int NetworkConnectTimeout = 15000;
//
// public static final String ServiceEntryPoint = "https://... | result.append(URLEncoder.encode(entry.getKey(), Settings.Encoding));
|
Copyleaks/Java-Plagiarism-Checker | src/copyleaks/sdk/api/models/LoginToken.java | // Path: src/copyleaks/sdk/api/exceptions/SecurityTokenException.java
// public class SecurityTokenException
// extends AccessControlException
// {
// private static final long serialVersionUID = 1L;
// public SecurityTokenException()
// {
// super("Security token is missing!");
// this.setToken(null);
... | import java.io.Serializable;
import java.util.Date;
import com.google.gson.annotations.SerializedName;
import copyleaks.sdk.api.exceptions.SecurityTokenException;
| }
@SerializedName("userName")
private String UserName;
public String getUserName()
{
return UserName;
}
@SerializedName("token_type")
private String TokenType;
public String getTokenType()
{
return TokenType;
}
void setUsername(String tokenType)
{
this.TokenType = tokenType;
... | // Path: src/copyleaks/sdk/api/exceptions/SecurityTokenException.java
// public class SecurityTokenException
// extends AccessControlException
// {
// private static final long serialVersionUID = 1L;
// public SecurityTokenException()
// {
// super("Security token is missing!");
// this.setToken(null);
... | throws SecurityTokenException
|
Copyleaks/Java-Plagiarism-Checker | src/copyleaks/sdk/api/exceptions/CommandFailedException.java | // Path: src/copyleaks/sdk/api/helpers/HttpURLConnection/HttpURLConnectionHelper.java
// public final class HttpURLConnectionHelper
// {
// public static String getQuery(Map<String, String> dic) throws UnsupportedEncodingException
// {
// StringBuilder result = new StringBuilder();
// boolean first = true;
... | import com.google.gson.GsonBuilder;
import com.google.gson.JsonSyntaxException;
import copyleaks.sdk.api.helpers.HttpURLConnection.HttpURLConnectionHelper;
import copyleaks.sdk.api.models.responses.BadResponse;
import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import jav... | return CopyleaksErrorCode;
}
private void setCopyleaksErrorCode(short errorCode)
{
CopyleaksErrorCode = errorCode;
}
public CommandFailedException(HttpURLConnection conn)
{
super(GetMessage(conn));
try
{
this.setHttpErrorCode(conn.getResponseCode());
}
catch (IOException e)
... | // Path: src/copyleaks/sdk/api/helpers/HttpURLConnection/HttpURLConnectionHelper.java
// public final class HttpURLConnectionHelper
// {
// public static String getQuery(Map<String, String> dic) throws UnsupportedEncodingException
// {
// StringBuilder result = new StringBuilder();
// boolean first = true;
... | errorResponse = HttpURLConnectionHelper.convertStreamToString(inputStream);
|
Copyleaks/Java-Plagiarism-Checker | src/copyleaks/sdk/api/exceptions/CommandFailedException.java | // Path: src/copyleaks/sdk/api/helpers/HttpURLConnection/HttpURLConnectionHelper.java
// public final class HttpURLConnectionHelper
// {
// public static String getQuery(Map<String, String> dic) throws UnsupportedEncodingException
// {
// StringBuilder result = new StringBuilder();
// boolean first = true;
... | import com.google.gson.GsonBuilder;
import com.google.gson.JsonSyntaxException;
import copyleaks.sdk.api.helpers.HttpURLConnection.HttpURLConnectionHelper;
import copyleaks.sdk.api.models.responses.BadResponse;
import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import jav... |
public CommandFailedException(HttpURLConnection conn)
{
super(GetMessage(conn));
try
{
this.setHttpErrorCode(conn.getResponseCode());
}
catch (IOException e)
{
this.setHttpErrorCode(UNDEFINED_HTTP_ERROR_CODE);
}
this.setCopyleaksErrorCode(GetCopyleaksErrorCode(conn));
}
pr... | // Path: src/copyleaks/sdk/api/helpers/HttpURLConnection/HttpURLConnectionHelper.java
// public final class HttpURLConnectionHelper
// {
// public static String getQuery(Map<String, String> dic) throws UnsupportedEncodingException
// {
// StringBuilder result = new StringBuilder();
// boolean first = true;
... | BadResponse model = null;
|
starqiu/RDMP1 | src/main/java/ustc/sse/service/impl/UserServiceImpl.java | // Path: src/main/java/ustc/sse/model/User.java
// public class User {
// /** 用户名
// @Size(min=3,max=20,message="user.length.required")
// @Pattern(regexp="^{[a-zA-Z0-9]+_?}+[a-zA-Z0-9]+$",message="user.ptn.required")*/
// private String userName ;
// /** 密码
// @Size(min=6,max=20,message="pwd.length.required")
//... | import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import ustc.sse.dao.UserDao;
import ustc.sse.model.User;
import ustc.sse.service.UserService; | /*
* ============================================================
* The SSE USTC Software License
*
* UserServiceImpl.java
* 2014-4-4
*
* Copyright (c) 2006 China Payment and Remittance Service Co.,Ltd
* All rights reserved.
* ============================================================
*/
package u... | // Path: src/main/java/ustc/sse/model/User.java
// public class User {
// /** 用户名
// @Size(min=3,max=20,message="user.length.required")
// @Pattern(regexp="^{[a-zA-Z0-9]+_?}+[a-zA-Z0-9]+$",message="user.ptn.required")*/
// private String userName ;
// /** 密码
// @Size(min=6,max=20,message="pwd.length.required")
//... | public List<User> selectAllUsers() { |
starqiu/RDMP1 | src/main/java/ustc/sse/service/UserService.java | // Path: src/main/java/ustc/sse/model/User.java
// public class User {
// /** 用户名
// @Size(min=3,max=20,message="user.length.required")
// @Pattern(regexp="^{[a-zA-Z0-9]+_?}+[a-zA-Z0-9]+$",message="user.ptn.required")*/
// private String userName ;
// /** 密码
// @Size(min=6,max=20,message="pwd.length.required")
//... | import ustc.sse.model.User;
import java.util.List;
import org.springframework.stereotype.Service; | /*
* ============================================================
* The SSE USTC Software License
*
* UserService.java
* 2014-4-4
*
* Copyright (c) 2006 China Payment and Remittance Service Co.,Ltd
* All rights reserved.
* ============================================================
*/
package ustc.... | // Path: src/main/java/ustc/sse/model/User.java
// public class User {
// /** 用户名
// @Size(min=3,max=20,message="user.length.required")
// @Pattern(regexp="^{[a-zA-Z0-9]+_?}+[a-zA-Z0-9]+$",message="user.ptn.required")*/
// private String userName ;
// /** 密码
// @Size(min=6,max=20,message="pwd.length.required")
//... | List<User> selectAllUsers(); |
starqiu/RDMP1 | ETL/source/java source/service/sqlldr.java | // Path: ETL/source/java source/common/Logger.java
// public class Logger
// {
// private org.apache.log4j.Logger log4jLogger = null;
// // private gcsFactory iGcsFactory;
// // private gcs iGcs;
//
// public static Logger getLogger(String configPath, String arg)
// {
// Logger logger = new Logger();
// LoadCo... | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import com.dbs.sg.DTE12.common.AESManager;
import com.dbs.sg.DTE12.common.LoadConfigXml;
import com.dbs.sg.DTE12.common.Logger;
| package com.dbs.sg.DTE12.service;
public class sqlldr {
/**
* @param args
*/
public static void main(String[] args) {
if (args.length < 2) {
System.out.println("1");
System.exit(1);
}
String configPath = args[0];
boolean skipFlag=true;
LoadConfigXml configXml = LoadConfigXml.ge... | // Path: ETL/source/java source/common/Logger.java
// public class Logger
// {
// private org.apache.log4j.Logger log4jLogger = null;
// // private gcsFactory iGcsFactory;
// // private gcs iGcs;
//
// public static Logger getLogger(String configPath, String arg)
// {
// Logger logger = new Logger();
// LoadCo... | Logger logger = Logger.getLogger(configPath, sqlldr.class);
|
starqiu/RDMP1 | ETL/source/java source/service/sqlplus.java | // Path: ETL/source/java source/common/Logger.java
// public class Logger
// {
// private org.apache.log4j.Logger log4jLogger = null;
// // private gcsFactory iGcsFactory;
// // private gcs iGcs;
//
// public static Logger getLogger(String configPath, String arg)
// {
// Logger logger = new Logger();
// LoadCo... | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import com.dbs.sg.DTE12.common.AESManager;
import com.dbs.sg.DTE12.common.LoadConfigXml;
import com.dbs.sg.DTE12.common.Logger; | package com.dbs.sg.DTE12.service;
public class sqlplus {
/**
* @param args
*/
public static void main(String[] args) {
if (args.length < 1) {
System.out.println("1");
System.exit(1);
}
boolean bPrintOutput = false;
String[] newargs;
List tmp = Arrays.asList(args);
List lstArgs = new ArrayList... | // Path: ETL/source/java source/common/Logger.java
// public class Logger
// {
// private org.apache.log4j.Logger log4jLogger = null;
// // private gcsFactory iGcsFactory;
// // private gcs iGcs;
//
// public static Logger getLogger(String configPath, String arg)
// {
// Logger logger = new Logger();
// LoadCo... | Logger logger = Logger.getLogger(configPath, sqlplus.class); |
starqiu/RDMP1 | src/main/java/ustc/sse/controller/LoginController.java | // Path: src/main/java/ustc/sse/model/User.java
// public class User {
// /** 用户名
// @Size(min=3,max=20,message="user.length.required")
// @Pattern(regexp="^{[a-zA-Z0-9]+_?}+[a-zA-Z0-9]+$",message="user.ptn.required")*/
// private String userName ;
// /** 密码
// @Size(min=6,max=20,message="pwd.length.required")
//... | import java.util.Date;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind... | /*
* ============================================================
* The SSE USTC Software License
*
* Login.java
* 2014-3-3
*
* Copyright (c) 2006 China Payment and Remittance Service Co.,Ltd
* All rights reserved.
* ============================================================
*/
package ustc.sse.co... | // Path: src/main/java/ustc/sse/model/User.java
// public class User {
// /** 用户名
// @Size(min=3,max=20,message="user.length.required")
// @Pattern(regexp="^{[a-zA-Z0-9]+_?}+[a-zA-Z0-9]+$",message="user.ptn.required")*/
// private String userName ;
// /** 密码
// @Size(min=6,max=20,message="pwd.length.required")
//... | private UserService userService; |
starqiu/RDMP1 | src/main/java/ustc/sse/controller/LoginController.java | // Path: src/main/java/ustc/sse/model/User.java
// public class User {
// /** 用户名
// @Size(min=3,max=20,message="user.length.required")
// @Pattern(regexp="^{[a-zA-Z0-9]+_?}+[a-zA-Z0-9]+$",message="user.ptn.required")*/
// private String userName ;
// /** 密码
// @Size(min=6,max=20,message="pwd.length.required")
//... | import java.util.Date;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind... | * 跳转到关于我们界面
* @param request
* @param response
* @return
*/
@RequestMapping("about")
public String about(HttpServletRequest request,HttpServletResponse response){
return "about";
}
/**
* 跳转到联系我们界面
* @param request
* @param response
* @return
*/
@RequestMapping("contact")
public String contac... | // Path: src/main/java/ustc/sse/model/User.java
// public class User {
// /** 用户名
// @Size(min=3,max=20,message="user.length.required")
// @Pattern(regexp="^{[a-zA-Z0-9]+_?}+[a-zA-Z0-9]+$",message="user.ptn.required")*/
// private String userName ;
// /** 密码
// @Size(min=6,max=20,message="pwd.length.required")
//... | User param = new User(); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.