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 |
|---|---|---|---|---|---|---|
fuinorg/ddd-4-java | src/test/java/org/fuin/ddd4j/test/PersonId.java | // Path: src/main/java/org/fuin/ddd4j/ddd/EntityId.java
// public interface EntityId extends TechnicalId {
//
// /**
// * Returns the type represented by this identifier.
// *
// * @return Type of entity.
// */
// public EntityType getType();
//
// /**
// * Returns the ... | import org.fuin.objects4j.common.Immutable;
import jakarta.validation.constraints.NotNull;
import org.fuin.ddd4j.ddd.EntityId;
import org.fuin.ddd4j.ddd.EntityType;
import org.fuin.ddd4j.ddd.StringBasedEntityType;
import org.fuin.objects4j.common.Contract;
import org.fuin.objects4j.vo.AbstractIntegerValueObject;
| /**
* Copyright (C) 2015 Michael Schnell. All rights reserved.
* http://www.fuin.org/
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 3 of the License, or (a... | // Path: src/main/java/org/fuin/ddd4j/ddd/EntityId.java
// public interface EntityId extends TechnicalId {
//
// /**
// * Returns the type represented by this identifier.
// *
// * @return Type of entity.
// */
// public EntityType getType();
//
// /**
// * Returns the ... | public static final EntityType ENTITY_TYPE = new StringBasedEntityType("Person");
|
fuinorg/ddd-4-java | src/test/java/org/fuin/ddd4j/test/PersonId.java | // Path: src/main/java/org/fuin/ddd4j/ddd/EntityId.java
// public interface EntityId extends TechnicalId {
//
// /**
// * Returns the type represented by this identifier.
// *
// * @return Type of entity.
// */
// public EntityType getType();
//
// /**
// * Returns the ... | import org.fuin.objects4j.common.Immutable;
import jakarta.validation.constraints.NotNull;
import org.fuin.ddd4j.ddd.EntityId;
import org.fuin.ddd4j.ddd.EntityType;
import org.fuin.ddd4j.ddd.StringBasedEntityType;
import org.fuin.objects4j.common.Contract;
import org.fuin.objects4j.vo.AbstractIntegerValueObject;
| /**
* Copyright (C) 2015 Michael Schnell. All rights reserved.
* http://www.fuin.org/
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 3 of the License, or (a... | // Path: src/main/java/org/fuin/ddd4j/ddd/EntityId.java
// public interface EntityId extends TechnicalId {
//
// /**
// * Returns the type represented by this identifier.
// *
// * @return Type of entity.
// */
// public EntityType getType();
//
// /**
// * Returns the ... | public static final EntityType ENTITY_TYPE = new StringBasedEntityType("Person");
|
fuinorg/ddd-4-java | src/main/java/org/fuin/ddd4j/ddd/AggregateNotFoundException.java | // Path: src/main/java/org/fuin/ddd4j/ddd/Ddd4JUtils.java
// public static final String SHORT_ID_PREFIX = "DDD4J";
| import org.fuin.objects4j.common.MarshalInformation;
import org.fuin.objects4j.common.ToExceptionCapable;
import org.fuin.objects4j.vo.ValueObject;
import static org.fuin.ddd4j.ddd.Ddd4JUtils.SHORT_ID_PREFIX;
import java.io.Serializable;
import jakarta.json.bind.annotation.JsonbProperty;
import jakarta.validation... | /**
* Copyright (C) 2015 Michael Schnell. All rights reserved.
* http://www.fuin.org/
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 3 of the License, or (a... | // Path: src/main/java/org/fuin/ddd4j/ddd/Ddd4JUtils.java
// public static final String SHORT_ID_PREFIX = "DDD4J";
// Path: src/main/java/org/fuin/ddd4j/ddd/AggregateNotFoundException.java
import org.fuin.objects4j.common.MarshalInformation;
import org.fuin.objects4j.common.ToExceptionCapable;
import org.fuin.objec... | public static final String SHORT_ID = SHORT_ID_PREFIX + "-AGGREGATE_NOT_FOUND";
|
fuinorg/ddd-4-java | src/test/java/org/fuin/ddd4j/ddd/EntityIdPathTest.java | // Path: src/test/java/org/fuin/ddd4j/test/AId.java
// public class AId implements ImplRootId {
//
// private static final long serialVersionUID = 1L;
//
// public static final EntityType TYPE = new StringBasedEntityType("A");
//
// private final long id;
//
// public AId(final long id) {
/... | import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.fail;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.fuin.ddd4j.test.AId;
import org.fuin.ddd4j.test.BId;
import org.fuin.ddd4j.test.CId;
import org.fuin.objects4j.common.ConstraintViolatio... | /**
* Copyright (C) 2015 Michael Schnell. All rights reserved.
* http://www.fuin.org/
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 3 of the License, or (at your... | // Path: src/test/java/org/fuin/ddd4j/test/AId.java
// public class AId implements ImplRootId {
//
// private static final long serialVersionUID = 1L;
//
// public static final EntityType TYPE = new StringBasedEntityType("A");
//
// private final long id;
//
// public AId(final long id) {
/... | final AId aid = new AId(1L); |
fuinorg/ddd-4-java | src/test/java/org/fuin/ddd4j/ddd/EntityIdPathTest.java | // Path: src/test/java/org/fuin/ddd4j/test/AId.java
// public class AId implements ImplRootId {
//
// private static final long serialVersionUID = 1L;
//
// public static final EntityType TYPE = new StringBasedEntityType("A");
//
// private final long id;
//
// public AId(final long id) {
/... | import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.fail;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.fuin.ddd4j.test.AId;
import org.fuin.ddd4j.test.BId;
import org.fuin.ddd4j.test.CId;
import org.fuin.objects4j.common.ConstraintViolatio... | public void testConstructorListEmpty() {
try {
new EntityIdPath(new ArrayList<EntityId>());
fail();
} catch (ConstraintViolationException ex) {
assertThat(ex.getMessage()).isEqualTo("Identifier list cannot be empty");
}
}
@Test
public void t... | // Path: src/test/java/org/fuin/ddd4j/test/AId.java
// public class AId implements ImplRootId {
//
// private static final long serialVersionUID = 1L;
//
// public static final EntityType TYPE = new StringBasedEntityType("A");
//
// private final long id;
//
// public AId(final long id) {
/... | final BId bid = new BId(2L); |
fuinorg/ddd-4-java | src/test/java/org/fuin/ddd4j/ddd/EntityIdPathTest.java | // Path: src/test/java/org/fuin/ddd4j/test/AId.java
// public class AId implements ImplRootId {
//
// private static final long serialVersionUID = 1L;
//
// public static final EntityType TYPE = new StringBasedEntityType("A");
//
// private final long id;
//
// public AId(final long id) {
/... | import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.fail;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.fuin.ddd4j.test.AId;
import org.fuin.ddd4j.test.BId;
import org.fuin.ddd4j.test.CId;
import org.fuin.objects4j.common.ConstraintViolatio... |
try {
new EntityIdPath(new ArrayList<EntityId>());
fail();
} catch (ConstraintViolationException ex) {
assertThat(ex.getMessage()).isEqualTo("Identifier list cannot be empty");
}
}
@Test
public void testConstructorListNullValues() {
try... | // Path: src/test/java/org/fuin/ddd4j/test/AId.java
// public class AId implements ImplRootId {
//
// private static final long serialVersionUID = 1L;
//
// public static final EntityType TYPE = new StringBasedEntityType("A");
//
// private final long id;
//
// public AId(final long id) {
/... | final CId cid = new CId(3L); |
flaxsearch/harahachibu | harahachibu/src/test/java/uk/co/flax/harahachibu/servlets/DiskSpaceFilterTest.java | // Path: harahachibu/src/main/java/uk/co/flax/harahachibu/config/ProxyConfiguration.java
// public class ProxyConfiguration {
//
// private int errorStatus = 503;
//
// @NotNull
// private String destinationServer;
//
// private List<String> checkUrls = new ArrayList<>();
//
// public int getErrorStatus() {
//... | import org.junit.Before;
import org.junit.Test;
import uk.co.flax.harahachibu.config.ProxyConfiguration;
import uk.co.flax.harahachibu.services.DiskSpaceChecker;
import uk.co.flax.harahachibu.services.DiskSpaceCheckerException;
import javax.servlet.FilterChain;
import javax.servlet.RequestDispatcher;
import javax.servl... | /**
* Copyright (c) 2016 Lemur Consulting 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/>
* Unless required by ap... | // Path: harahachibu/src/main/java/uk/co/flax/harahachibu/config/ProxyConfiguration.java
// public class ProxyConfiguration {
//
// private int errorStatus = 503;
//
// @NotNull
// private String destinationServer;
//
// private List<String> checkUrls = new ArrayList<>();
//
// public int getErrorStatus() {
//... | private final ProxyConfiguration proxyConfig = mock(ProxyConfiguration.class); |
flaxsearch/harahachibu | harahachibu/src/test/java/uk/co/flax/harahachibu/servlets/DiskSpaceFilterTest.java | // Path: harahachibu/src/main/java/uk/co/flax/harahachibu/config/ProxyConfiguration.java
// public class ProxyConfiguration {
//
// private int errorStatus = 503;
//
// @NotNull
// private String destinationServer;
//
// private List<String> checkUrls = new ArrayList<>();
//
// public int getErrorStatus() {
//... | import org.junit.Before;
import org.junit.Test;
import uk.co.flax.harahachibu.config.ProxyConfiguration;
import uk.co.flax.harahachibu.services.DiskSpaceChecker;
import uk.co.flax.harahachibu.services.DiskSpaceCheckerException;
import javax.servlet.FilterChain;
import javax.servlet.RequestDispatcher;
import javax.servl... | verify(req, atLeastOnce()).getRequestURI();
verify(chain).doFilter(req, response);
}
@Test
public void proxyWithoutCheckingState() throws Exception {
final String requestUri = "/solr/select";
final String requestQuery = "q=test";
final String proxiedUri = DiskSpaceProxyServlet.PROXY_PATH_PREFIX + "/solr/s... | // Path: harahachibu/src/main/java/uk/co/flax/harahachibu/config/ProxyConfiguration.java
// public class ProxyConfiguration {
//
// private int errorStatus = 503;
//
// @NotNull
// private String destinationServer;
//
// private List<String> checkUrls = new ArrayList<>();
//
// public int getErrorStatus() {
//... | when(checker.isSpaceAvailable()).thenThrow(new DiskSpaceCheckerException("Error")); |
flaxsearch/harahachibu | harahachibu/src/test/java/uk/co/flax/harahachibu/health/ClusterDiskSpaceManagerHealthCheckTest.java | // Path: harahachibu/src/main/java/uk/co/flax/harahachibu/services/ClusterDiskSpaceManager.java
// public class ClusterDiskSpaceManager {
//
// private final Set<String> servers;
// private final Map<String, DiskSpace> diskSpaceMap = new ConcurrentHashMap<>();
//
// /**
// * Construct the ClusterDiskSpaceManager... | import com.codahale.metrics.health.HealthCheck;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import uk.co.flax.harahachibu.services.ClusterDiskSpaceManager;
import uk.co.flax.harahachibu.services.data.DiskSpace;
import java.util.*;
import static org.assertj.core.api.Assertions.assertThat;
imp... | /**
* Copyright (c) 2016 Lemur Consulting 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/>
* Unless required by ap... | // Path: harahachibu/src/main/java/uk/co/flax/harahachibu/services/ClusterDiskSpaceManager.java
// public class ClusterDiskSpaceManager {
//
// private final Set<String> servers;
// private final Map<String, DiskSpace> diskSpaceMap = new ConcurrentHashMap<>();
//
// /**
// * Construct the ClusterDiskSpaceManager... | private final Map<String, DiskSpace> diskSpaceMap = new HashMap<>(); |
flaxsearch/harahachibu | harahachibu/src/test/java/uk/co/flax/harahachibu/resources/SetSpaceResourceTest.java | // Path: harahachibu/src/main/java/uk/co/flax/harahachibu/api/SetSpaceResponse.java
// public class SetSpaceResponse {
//
// public enum ResponseCode {
// OK, ERROR
// };
//
// @JsonProperty("status")
// private final ResponseCode responseCode;
// @JsonProperty("message")
// private final String message;
//
... | import org.junit.Before;
import org.junit.Test;
import uk.co.flax.harahachibu.api.SetSpaceResponse;
import uk.co.flax.harahachibu.services.ClusterDiskSpaceManager;
import uk.co.flax.harahachibu.services.DiskSpaceCheckerException;
import uk.co.flax.harahachibu.services.data.DiskSpace;
import static org.assertj.core.api.... | /**
* Copyright (c) 2016 Lemur Consulting 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/>
* Unless required by ap... | // Path: harahachibu/src/main/java/uk/co/flax/harahachibu/api/SetSpaceResponse.java
// public class SetSpaceResponse {
//
// public enum ResponseCode {
// OK, ERROR
// };
//
// @JsonProperty("status")
// private final ResponseCode responseCode;
// @JsonProperty("message")
// private final String message;
//
... | doThrow(new DiskSpaceCheckerException("Error")).when(manager).setDiskSpace(eq(server), isA(DiskSpace.class)); |
flaxsearch/harahachibu | harahachibu/src/test/java/uk/co/flax/harahachibu/resources/SetSpaceResourceTest.java | // Path: harahachibu/src/main/java/uk/co/flax/harahachibu/api/SetSpaceResponse.java
// public class SetSpaceResponse {
//
// public enum ResponseCode {
// OK, ERROR
// };
//
// @JsonProperty("status")
// private final ResponseCode responseCode;
// @JsonProperty("message")
// private final String message;
//
... | import org.junit.Before;
import org.junit.Test;
import uk.co.flax.harahachibu.api.SetSpaceResponse;
import uk.co.flax.harahachibu.services.ClusterDiskSpaceManager;
import uk.co.flax.harahachibu.services.DiskSpaceCheckerException;
import uk.co.flax.harahachibu.services.data.DiskSpace;
import static org.assertj.core.api.... | /**
* Copyright (c) 2016 Lemur Consulting 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/>
* Unless required by ap... | // Path: harahachibu/src/main/java/uk/co/flax/harahachibu/api/SetSpaceResponse.java
// public class SetSpaceResponse {
//
// public enum ResponseCode {
// OK, ERROR
// };
//
// @JsonProperty("status")
// private final ResponseCode responseCode;
// @JsonProperty("message")
// private final String message;
//
... | doThrow(new DiskSpaceCheckerException("Error")).when(manager).setDiskSpace(eq(server), isA(DiskSpace.class)); |
flaxsearch/harahachibu | harahachibu/src/test/java/uk/co/flax/harahachibu/resources/SetSpaceResourceTest.java | // Path: harahachibu/src/main/java/uk/co/flax/harahachibu/api/SetSpaceResponse.java
// public class SetSpaceResponse {
//
// public enum ResponseCode {
// OK, ERROR
// };
//
// @JsonProperty("status")
// private final ResponseCode responseCode;
// @JsonProperty("message")
// private final String message;
//
... | import org.junit.Before;
import org.junit.Test;
import uk.co.flax.harahachibu.api.SetSpaceResponse;
import uk.co.flax.harahachibu.services.ClusterDiskSpaceManager;
import uk.co.flax.harahachibu.services.DiskSpaceCheckerException;
import uk.co.flax.harahachibu.services.data.DiskSpace;
import static org.assertj.core.api.... | /**
* Copyright (c) 2016 Lemur Consulting 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/>
* Unless required by ap... | // Path: harahachibu/src/main/java/uk/co/flax/harahachibu/api/SetSpaceResponse.java
// public class SetSpaceResponse {
//
// public enum ResponseCode {
// OK, ERROR
// };
//
// @JsonProperty("status")
// private final ResponseCode responseCode;
// @JsonProperty("message")
// private final String message;
//
... | SetSpaceResponse response = resource.handlePost(server, 128L, 1024L); |
flaxsearch/harahachibu | harahachibu/src/test/java/uk/co/flax/harahachibu/health/DiskSpaceCheckerHealthCheckTest.java | // Path: harahachibu/src/main/java/uk/co/flax/harahachibu/services/DiskSpaceChecker.java
// public interface DiskSpaceChecker {
//
// /**
// * Check whether space is available on the disk or cluster of
// * disks.
// * @return {@code true} if space is available, {@code false} if not
// * (including if server ... | import com.codahale.metrics.health.HealthCheck;
import com.codahale.metrics.health.HealthCheck.Result;
import org.junit.Before;
import org.junit.Test;
import uk.co.flax.harahachibu.services.DiskSpaceChecker;
import uk.co.flax.harahachibu.services.DiskSpaceCheckerException;
import static org.assertj.core.api.Assertions.... | /**
* Copyright (c) 2016 Lemur Consulting 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/>
* Unless required by ap... | // Path: harahachibu/src/main/java/uk/co/flax/harahachibu/services/DiskSpaceChecker.java
// public interface DiskSpaceChecker {
//
// /**
// * Check whether space is available on the disk or cluster of
// * disks.
// * @return {@code true} if space is available, {@code false} if not
// * (including if server ... | when(checker.isSpaceAvailable()).thenThrow(new DiskSpaceCheckerException("Error")); |
flaxsearch/harahachibu | harahachibu/src/main/java/uk/co/flax/harahachibu/health/ElasticsearchClientHealthCheck.java | // Path: harahachibu/src/main/java/uk/co/flax/harahachibu/services/DiskSpaceCheckerException.java
// public class DiskSpaceCheckerException extends Exception {
//
// public DiskSpaceCheckerException() {
// super();
// }
//
// public DiskSpaceCheckerException(String message) {
// super(message);
// }
//
// p... | import com.codahale.metrics.health.HealthCheck;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import uk.co.flax.harahachibu.services.DiskSpaceCheckerException;
import uk.co.flax.harahachibu.services.data.ElasticsearchClusterStats;
import uk.co.flax.harahachibu.services.impl.ElasticsearchClient; | /**
* Copyright (c) 2016 Lemur Consulting 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/>
* Unless required by ap... | // Path: harahachibu/src/main/java/uk/co/flax/harahachibu/services/DiskSpaceCheckerException.java
// public class DiskSpaceCheckerException extends Exception {
//
// public DiskSpaceCheckerException() {
// super();
// }
//
// public DiskSpaceCheckerException(String message) {
// super(message);
// }
//
// p... | private final ElasticsearchClient client; |
flaxsearch/harahachibu | harahachibu/src/test/java/uk/co/flax/harahachibu/services/ClusterDiskSpaceManagerTest.java | // Path: harahachibu/src/main/java/uk/co/flax/harahachibu/services/data/DiskSpace.java
// public class DiskSpace {
//
// private final long freeSpace;
// private final long maxSpace;
// private final Date creationDate = new Date();
//
// public DiskSpace(long freeSpace, long maxSpace) {
// this.freeSpace = free... | import org.junit.Test;
import uk.co.flax.harahachibu.services.data.DiskSpace;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import static org.assertj.core.api.Assertions.assertThat; | /**
* Copyright (c) 2016 Lemur Consulting 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/>
* Unless required by ap... | // Path: harahachibu/src/main/java/uk/co/flax/harahachibu/services/data/DiskSpace.java
// public class DiskSpace {
//
// private final long freeSpace;
// private final long maxSpace;
// private final Date creationDate = new Date();
//
// public DiskSpace(long freeSpace, long maxSpace) {
// this.freeSpace = free... | manager.setDiskSpace("blah", new DiskSpace(0, 0)); |
flaxsearch/harahachibu | harahachibu/src/main/java/uk/co/flax/harahachibu/services/ClusterDiskSpaceManager.java | // Path: harahachibu/src/main/java/uk/co/flax/harahachibu/services/data/DiskSpace.java
// public class DiskSpace {
//
// private final long freeSpace;
// private final long maxSpace;
// private final Date creationDate = new Date();
//
// public DiskSpace(long freeSpace, long maxSpace) {
// this.freeSpace = free... | import uk.co.flax.harahachibu.services.data.DiskSpace;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap; | /**
* Copyright (c) 2016 Lemur Consulting 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/>
* Unless required by ap... | // Path: harahachibu/src/main/java/uk/co/flax/harahachibu/services/data/DiskSpace.java
// public class DiskSpace {
//
// private final long freeSpace;
// private final long maxSpace;
// private final Date creationDate = new Date();
//
// public DiskSpace(long freeSpace, long maxSpace) {
// this.freeSpace = free... | private final Map<String, DiskSpace> diskSpaceMap = new ConcurrentHashMap<>(); |
flaxsearch/harahachibu | harahachibu/src/test/java/uk/co/flax/harahachibu/services/impl/ElasticsearchClientTest.java | // Path: harahachibu/src/main/java/uk/co/flax/harahachibu/services/data/ElasticsearchClusterStats.java
// @JsonIgnoreProperties(ignoreUnknown = true)
// public class ElasticsearchClusterStats {
//
// @JsonProperty("timestamp")
// private final long timestamp;
//
// @JsonProperty("cluster_name")
// private final S... | import com.codahale.metrics.MetricRegistry;
import io.dropwizard.client.JerseyClientBuilder;
import io.dropwizard.lifecycle.setup.LifecycleEnvironment;
import io.dropwizard.setup.Environment;
import org.apache.commons.io.FileUtils;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org... | esClient.getClusterStats();
}
@Test(expected = uk.co.flax.harahachibu.services.DiskSpaceCheckerException.class)
public void throwsExceptionWhenServerNotRunning() throws Exception {
mockServer.stop();
esClient.getClusterStats();
}
@Test(expected = uk.co.flax.harahachibu.services.DiskSpaceCheckerException.cl... | // Path: harahachibu/src/main/java/uk/co/flax/harahachibu/services/data/ElasticsearchClusterStats.java
// @JsonIgnoreProperties(ignoreUnknown = true)
// public class ElasticsearchClusterStats {
//
// @JsonProperty("timestamp")
// private final long timestamp;
//
// @JsonProperty("cluster_name")
// private final S... | ElasticsearchClusterStats clusterStats = esClient.getClusterStats(); |
flaxsearch/harahachibu | harahachibu/src/main/java/uk/co/flax/harahachibu/servlets/DiskSpaceFilter.java | // Path: harahachibu/src/main/java/uk/co/flax/harahachibu/config/ProxyConfiguration.java
// public class ProxyConfiguration {
//
// private int errorStatus = 503;
//
// @NotNull
// private String destinationServer;
//
// private List<String> checkUrls = new ArrayList<>();
//
// public int getErrorStatus() {
//... | import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import uk.co.flax.harahachibu.config.ProxyConfiguration;
import uk.co.flax.harahachibu.services.DiskSpaceChecker;
import uk.co.flax.harahachibu.services.DiskSpaceCheckerException;
import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import javax.... | /**
* Copyright (c) 2016 Lemur Consulting 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/>
* Unless required by ap... | // Path: harahachibu/src/main/java/uk/co/flax/harahachibu/config/ProxyConfiguration.java
// public class ProxyConfiguration {
//
// private int errorStatus = 503;
//
// @NotNull
// private String destinationServer;
//
// private List<String> checkUrls = new ArrayList<>();
//
// public int getErrorStatus() {
//... | private final DiskSpaceChecker spaceChecker; |
flaxsearch/harahachibu | harahachibu/src/main/java/uk/co/flax/harahachibu/servlets/DiskSpaceFilter.java | // Path: harahachibu/src/main/java/uk/co/flax/harahachibu/config/ProxyConfiguration.java
// public class ProxyConfiguration {
//
// private int errorStatus = 503;
//
// @NotNull
// private String destinationServer;
//
// private List<String> checkUrls = new ArrayList<>();
//
// public int getErrorStatus() {
//... | import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import uk.co.flax.harahachibu.config.ProxyConfiguration;
import uk.co.flax.harahachibu.services.DiskSpaceChecker;
import uk.co.flax.harahachibu.services.DiskSpaceCheckerException;
import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import javax.... | /**
* Copyright (c) 2016 Lemur Consulting 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/>
* Unless required by ap... | // Path: harahachibu/src/main/java/uk/co/flax/harahachibu/config/ProxyConfiguration.java
// public class ProxyConfiguration {
//
// private int errorStatus = 503;
//
// @NotNull
// private String destinationServer;
//
// private List<String> checkUrls = new ArrayList<>();
//
// public int getErrorStatus() {
//... | private final ProxyConfiguration proxyConfiguration; |
flaxsearch/harahachibu | harahachibu/src/main/java/uk/co/flax/harahachibu/servlets/DiskSpaceFilter.java | // Path: harahachibu/src/main/java/uk/co/flax/harahachibu/config/ProxyConfiguration.java
// public class ProxyConfiguration {
//
// private int errorStatus = 503;
//
// @NotNull
// private String destinationServer;
//
// private List<String> checkUrls = new ArrayList<>();
//
// public int getErrorStatus() {
//... | import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import uk.co.flax.harahachibu.config.ProxyConfiguration;
import uk.co.flax.harahachibu.services.DiskSpaceChecker;
import uk.co.flax.harahachibu.services.DiskSpaceCheckerException;
import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import javax.... | /**
* Copyright (c) 2016 Lemur Consulting 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/>
* Unless required by ap... | // Path: harahachibu/src/main/java/uk/co/flax/harahachibu/config/ProxyConfiguration.java
// public class ProxyConfiguration {
//
// private int errorStatus = 503;
//
// @NotNull
// private String destinationServer;
//
// private List<String> checkUrls = new ArrayList<>();
//
// public int getErrorStatus() {
//... | } catch (DiskSpaceCheckerException e) { |
flaxsearch/harahachibu | harahachibu/src/main/java/uk/co/flax/harahachibu/health/ClusterDiskSpaceManagerHealthCheck.java | // Path: harahachibu/src/main/java/uk/co/flax/harahachibu/services/ClusterDiskSpaceManager.java
// public class ClusterDiskSpaceManager {
//
// private final Set<String> servers;
// private final Map<String, DiskSpace> diskSpaceMap = new ConcurrentHashMap<>();
//
// /**
// * Construct the ClusterDiskSpaceManager... | import com.codahale.metrics.health.HealthCheck;
import uk.co.flax.harahachibu.services.ClusterDiskSpaceManager;
import uk.co.flax.harahachibu.services.data.DiskSpace;
import java.util.Date;
import java.util.Set; | /**
* Copyright (c) 2016 Lemur Consulting 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/>
* Unless required by ap... | // Path: harahachibu/src/main/java/uk/co/flax/harahachibu/services/ClusterDiskSpaceManager.java
// public class ClusterDiskSpaceManager {
//
// private final Set<String> servers;
// private final Map<String, DiskSpace> diskSpaceMap = new ConcurrentHashMap<>();
//
// /**
// * Construct the ClusterDiskSpaceManager... | private final ClusterDiskSpaceManager manager; |
flaxsearch/harahachibu | harahachibu/src/main/java/uk/co/flax/harahachibu/health/ClusterDiskSpaceManagerHealthCheck.java | // Path: harahachibu/src/main/java/uk/co/flax/harahachibu/services/ClusterDiskSpaceManager.java
// public class ClusterDiskSpaceManager {
//
// private final Set<String> servers;
// private final Map<String, DiskSpace> diskSpaceMap = new ConcurrentHashMap<>();
//
// /**
// * Construct the ClusterDiskSpaceManager... | import com.codahale.metrics.health.HealthCheck;
import uk.co.flax.harahachibu.services.ClusterDiskSpaceManager;
import uk.co.flax.harahachibu.services.data.DiskSpace;
import java.util.Date;
import java.util.Set; | /**
* Copyright (c) 2016 Lemur Consulting 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/>
* Unless required by ap... | // Path: harahachibu/src/main/java/uk/co/flax/harahachibu/services/ClusterDiskSpaceManager.java
// public class ClusterDiskSpaceManager {
//
// private final Set<String> servers;
// private final Map<String, DiskSpace> diskSpaceMap = new ConcurrentHashMap<>();
//
// /**
// * Construct the ClusterDiskSpaceManager... | DiskSpace disk = manager.getDiskSpace().get(server); |
flaxsearch/harahachibu | harahachibu/src/main/java/uk/co/flax/harahachibu/health/DiskSpaceCheckerHealthCheck.java | // Path: harahachibu/src/main/java/uk/co/flax/harahachibu/services/DiskSpaceChecker.java
// public interface DiskSpaceChecker {
//
// /**
// * Check whether space is available on the disk or cluster of
// * disks.
// * @return {@code true} if space is available, {@code false} if not
// * (including if server ... | import com.codahale.metrics.health.HealthCheck;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import uk.co.flax.harahachibu.services.DiskSpaceChecker;
import uk.co.flax.harahachibu.services.DiskSpaceCheckerException; | /**
* Copyright (c) 2016 Lemur Consulting 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/>
* Unless required by ap... | // Path: harahachibu/src/main/java/uk/co/flax/harahachibu/services/DiskSpaceChecker.java
// public interface DiskSpaceChecker {
//
// /**
// * Check whether space is available on the disk or cluster of
// * disks.
// * @return {@code true} if space is available, {@code false} if not
// * (including if server ... | private final DiskSpaceChecker checker; |
flaxsearch/harahachibu | harahachibu/src/main/java/uk/co/flax/harahachibu/health/DiskSpaceCheckerHealthCheck.java | // Path: harahachibu/src/main/java/uk/co/flax/harahachibu/services/DiskSpaceChecker.java
// public interface DiskSpaceChecker {
//
// /**
// * Check whether space is available on the disk or cluster of
// * disks.
// * @return {@code true} if space is available, {@code false} if not
// * (including if server ... | import com.codahale.metrics.health.HealthCheck;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import uk.co.flax.harahachibu.services.DiskSpaceChecker;
import uk.co.flax.harahachibu.services.DiskSpaceCheckerException; | /**
* Copyright (c) 2016 Lemur Consulting 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/>
* Unless required by ap... | // Path: harahachibu/src/main/java/uk/co/flax/harahachibu/services/DiskSpaceChecker.java
// public interface DiskSpaceChecker {
//
// /**
// * Check whether space is available on the disk or cluster of
// * disks.
// * @return {@code true} if space is available, {@code false} if not
// * (including if server ... | } catch (DiskSpaceCheckerException e) { |
flaxsearch/harahachibu | harahachibu/src/main/java/uk/co/flax/harahachibu/services/DiskSpaceThreshold.java | // Path: harahachibu/src/main/java/uk/co/flax/harahachibu/services/data/DiskSpace.java
// public class DiskSpace {
//
// private final long freeSpace;
// private final long maxSpace;
// private final Date creationDate = new Date();
//
// public DiskSpace(long freeSpace, long maxSpace) {
// this.freeSpace = free... | import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import uk.co.flax.harahachibu.services.data.DiskSpace;
import java.util.regex.Matcher;
import java.util.regex.Pattern; | // FALL THROUGH
case "M":
value = value * KILOBYTE;
// FALL THROUGH
case "K":
value = value * KILOBYTE;
t = new DiskSpaceThreshold(value, false);
break;
default:
throw new DiskSpaceCheckerException("Unexpected unit value: " + unit);
}
}
return t;
}
public long g... | // Path: harahachibu/src/main/java/uk/co/flax/harahachibu/services/data/DiskSpace.java
// public class DiskSpace {
//
// private final long freeSpace;
// private final long maxSpace;
// private final Date creationDate = new Date();
//
// public DiskSpace(long freeSpace, long maxSpace) {
// this.freeSpace = free... | public boolean withinThreshold(DiskSpace diskSpace) { |
flaxsearch/harahachibu | harahachibu/src/main/java/uk/co/flax/harahachibu/services/impl/ElasticsearchClient.java | // Path: harahachibu/src/main/java/uk/co/flax/harahachibu/services/DiskSpaceCheckerException.java
// public class DiskSpaceCheckerException extends Exception {
//
// public DiskSpaceCheckerException() {
// super();
// }
//
// public DiskSpaceCheckerException(String message) {
// super(message);
// }
//
// p... | import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import uk.co.flax.harahachibu.services.DiskSpaceCheckerException;
import uk.co.flax.harahachibu.services.data.ElasticsearchClusterStats;
import javax.ws.rs.client.Client;
import javax.ws.rs.core.MediaType;
import java.io.IOException; | /**
* Copyright (c) 2016 Lemur Consulting 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/>
* Unless required by ap... | // Path: harahachibu/src/main/java/uk/co/flax/harahachibu/services/DiskSpaceCheckerException.java
// public class DiskSpaceCheckerException extends Exception {
//
// public DiskSpaceCheckerException() {
// super();
// }
//
// public DiskSpaceCheckerException(String message) {
// super(message);
// }
//
// p... | private ElasticsearchClusterStats latestStats; |
flaxsearch/harahachibu | harahachibu/src/main/java/uk/co/flax/harahachibu/services/impl/ElasticsearchClient.java | // Path: harahachibu/src/main/java/uk/co/flax/harahachibu/services/DiskSpaceCheckerException.java
// public class DiskSpaceCheckerException extends Exception {
//
// public DiskSpaceCheckerException() {
// super();
// }
//
// public DiskSpaceCheckerException(String message) {
// super(message);
// }
//
// p... | import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import uk.co.flax.harahachibu.services.DiskSpaceCheckerException;
import uk.co.flax.harahachibu.services.data.ElasticsearchClusterStats;
import javax.ws.rs.client.Client;
import javax.ws.rs.core.MediaType;
import java.io.IOException; | /**
* Copyright (c) 2016 Lemur Consulting 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/>
* Unless required by ap... | // Path: harahachibu/src/main/java/uk/co/flax/harahachibu/services/DiskSpaceCheckerException.java
// public class DiskSpaceCheckerException extends Exception {
//
// public DiskSpaceCheckerException() {
// super();
// }
//
// public DiskSpaceCheckerException(String message) {
// super(message);
// }
//
// p... | public ElasticsearchClusterStats getClusterStats() throws DiskSpaceCheckerException { |
flaxsearch/harahachibu | harahachibu/src/main/java/uk/co/flax/harahachibu/HaraHachiBuConfiguration.java | // Path: harahachibu/src/main/java/uk/co/flax/harahachibu/config/DiskSpaceConfiguration.java
// public class DiskSpaceConfiguration {
//
// public static final String ELASTICSEARCH_CHECKER = "elasticsearch";
// public static final String SOLR_LOCAL_CHECKER = "solr";
// public static final String CLUSTER_CHECKER = "... | import io.dropwizard.Configuration;
import io.dropwizard.client.JerseyClientConfiguration;
import uk.co.flax.harahachibu.config.DiskSpaceConfiguration;
import uk.co.flax.harahachibu.config.ProxyConfiguration;
import javax.validation.Valid;
import javax.validation.constraints.NotNull; | /**
* Copyright (c) 2016 Lemur Consulting 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/>
* Unless required by ap... | // Path: harahachibu/src/main/java/uk/co/flax/harahachibu/config/DiskSpaceConfiguration.java
// public class DiskSpaceConfiguration {
//
// public static final String ELASTICSEARCH_CHECKER = "elasticsearch";
// public static final String SOLR_LOCAL_CHECKER = "solr";
// public static final String CLUSTER_CHECKER = "... | private ProxyConfiguration proxy; |
flaxsearch/harahachibu | harahachibu/src/main/java/uk/co/flax/harahachibu/HaraHachiBuConfiguration.java | // Path: harahachibu/src/main/java/uk/co/flax/harahachibu/config/DiskSpaceConfiguration.java
// public class DiskSpaceConfiguration {
//
// public static final String ELASTICSEARCH_CHECKER = "elasticsearch";
// public static final String SOLR_LOCAL_CHECKER = "solr";
// public static final String CLUSTER_CHECKER = "... | import io.dropwizard.Configuration;
import io.dropwizard.client.JerseyClientConfiguration;
import uk.co.flax.harahachibu.config.DiskSpaceConfiguration;
import uk.co.flax.harahachibu.config.ProxyConfiguration;
import javax.validation.Valid;
import javax.validation.constraints.NotNull; | /**
* Copyright (c) 2016 Lemur Consulting 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/>
* Unless required by ap... | // Path: harahachibu/src/main/java/uk/co/flax/harahachibu/config/DiskSpaceConfiguration.java
// public class DiskSpaceConfiguration {
//
// public static final String ELASTICSEARCH_CHECKER = "elasticsearch";
// public static final String SOLR_LOCAL_CHECKER = "solr";
// public static final String CLUSTER_CHECKER = "... | private DiskSpaceConfiguration diskSpace; |
flaxsearch/harahachibu | harahachibu/src/test/java/uk/co/flax/harahachibu/services/impl/SolrDiskSpaceCheckerTest.java | // Path: harahachibu/src/main/java/uk/co/flax/harahachibu/services/DiskSpaceThreshold.java
// public class DiskSpaceThreshold {
//
// private static final Logger LOGGER = LoggerFactory.getLogger(DiskSpaceThreshold.class);
//
// private static final Pattern THRESHOLD_PATTERN = Pattern.compile("^(\\d+)\\s*([KMG%])?$"... | import org.junit.Before;
import org.junit.Test;
import uk.co.flax.harahachibu.services.DiskSpaceThreshold;
import java.io.IOException;
import java.nio.file.FileStore;
import java.util.HashMap;
import java.util.Map;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import ... | /**
* Copyright (c) 2016 Lemur Consulting 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/>
* Unless required by ap... | // Path: harahachibu/src/main/java/uk/co/flax/harahachibu/services/DiskSpaceThreshold.java
// public class DiskSpaceThreshold {
//
// private static final Logger LOGGER = LoggerFactory.getLogger(DiskSpaceThreshold.class);
//
// private static final Pattern THRESHOLD_PATTERN = Pattern.compile("^(\\d+)\\s*([KMG%])?$"... | private DiskSpaceThreshold threshold = mock(DiskSpaceThreshold.class); |
flaxsearch/harahachibu | harahachibu/src/main/java/uk/co/flax/harahachibu/resources/SetSpaceResource.java | // Path: harahachibu/src/main/java/uk/co/flax/harahachibu/api/SetSpaceResponse.java
// public class SetSpaceResponse {
//
// public enum ResponseCode {
// OK, ERROR
// };
//
// @JsonProperty("status")
// private final ResponseCode responseCode;
// @JsonProperty("message")
// private final String message;
//
... | import uk.co.flax.harahachibu.api.SetSpaceResponse;
import uk.co.flax.harahachibu.services.ClusterDiskSpaceManager;
import uk.co.flax.harahachibu.services.DiskSpaceCheckerException;
import uk.co.flax.harahachibu.services.data.DiskSpace;
import javax.ws.rs.*;
import javax.ws.rs.core.MediaType; | /**
* Copyright (c) 2016 Lemur Consulting 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/>
* Unless required by ap... | // Path: harahachibu/src/main/java/uk/co/flax/harahachibu/api/SetSpaceResponse.java
// public class SetSpaceResponse {
//
// public enum ResponseCode {
// OK, ERROR
// };
//
// @JsonProperty("status")
// private final ResponseCode responseCode;
// @JsonProperty("message")
// private final String message;
//
... | private final ClusterDiskSpaceManager clusterManager; |
flaxsearch/harahachibu | harahachibu/src/main/java/uk/co/flax/harahachibu/resources/SetSpaceResource.java | // Path: harahachibu/src/main/java/uk/co/flax/harahachibu/api/SetSpaceResponse.java
// public class SetSpaceResponse {
//
// public enum ResponseCode {
// OK, ERROR
// };
//
// @JsonProperty("status")
// private final ResponseCode responseCode;
// @JsonProperty("message")
// private final String message;
//
... | import uk.co.flax.harahachibu.api.SetSpaceResponse;
import uk.co.flax.harahachibu.services.ClusterDiskSpaceManager;
import uk.co.flax.harahachibu.services.DiskSpaceCheckerException;
import uk.co.flax.harahachibu.services.data.DiskSpace;
import javax.ws.rs.*;
import javax.ws.rs.core.MediaType; | /**
* Copyright (c) 2016 Lemur Consulting 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/>
* Unless required by ap... | // Path: harahachibu/src/main/java/uk/co/flax/harahachibu/api/SetSpaceResponse.java
// public class SetSpaceResponse {
//
// public enum ResponseCode {
// OK, ERROR
// };
//
// @JsonProperty("status")
// private final ResponseCode responseCode;
// @JsonProperty("message")
// private final String message;
//
... | public SetSpaceResponse handlePost(@PathParam("host") String server, |
flaxsearch/harahachibu | harahachibu/src/main/java/uk/co/flax/harahachibu/resources/SetSpaceResource.java | // Path: harahachibu/src/main/java/uk/co/flax/harahachibu/api/SetSpaceResponse.java
// public class SetSpaceResponse {
//
// public enum ResponseCode {
// OK, ERROR
// };
//
// @JsonProperty("status")
// private final ResponseCode responseCode;
// @JsonProperty("message")
// private final String message;
//
... | import uk.co.flax.harahachibu.api.SetSpaceResponse;
import uk.co.flax.harahachibu.services.ClusterDiskSpaceManager;
import uk.co.flax.harahachibu.services.DiskSpaceCheckerException;
import uk.co.flax.harahachibu.services.data.DiskSpace;
import javax.ws.rs.*;
import javax.ws.rs.core.MediaType; | /**
* Copyright (c) 2016 Lemur Consulting 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/>
* Unless required by ap... | // Path: harahachibu/src/main/java/uk/co/flax/harahachibu/api/SetSpaceResponse.java
// public class SetSpaceResponse {
//
// public enum ResponseCode {
// OK, ERROR
// };
//
// @JsonProperty("status")
// private final ResponseCode responseCode;
// @JsonProperty("message")
// private final String message;
//
... | clusterManager.setDiskSpace(server, new DiskSpace(freeSpace, maxSpace)); |
flaxsearch/harahachibu | harahachibu/src/main/java/uk/co/flax/harahachibu/resources/SetSpaceResource.java | // Path: harahachibu/src/main/java/uk/co/flax/harahachibu/api/SetSpaceResponse.java
// public class SetSpaceResponse {
//
// public enum ResponseCode {
// OK, ERROR
// };
//
// @JsonProperty("status")
// private final ResponseCode responseCode;
// @JsonProperty("message")
// private final String message;
//
... | import uk.co.flax.harahachibu.api.SetSpaceResponse;
import uk.co.flax.harahachibu.services.ClusterDiskSpaceManager;
import uk.co.flax.harahachibu.services.DiskSpaceCheckerException;
import uk.co.flax.harahachibu.services.data.DiskSpace;
import javax.ws.rs.*;
import javax.ws.rs.core.MediaType; | /**
* Copyright (c) 2016 Lemur Consulting 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/>
* Unless required by ap... | // Path: harahachibu/src/main/java/uk/co/flax/harahachibu/api/SetSpaceResponse.java
// public class SetSpaceResponse {
//
// public enum ResponseCode {
// OK, ERROR
// };
//
// @JsonProperty("status")
// private final ResponseCode responseCode;
// @JsonProperty("message")
// private final String message;
//
... | } catch (DiskSpaceCheckerException e) { |
flaxsearch/harahachibu | harahachibu/src/test/java/uk/co/flax/harahachibu/HaraHachiBuApplicationTest.java | // Path: harahachibu/src/main/java/uk/co/flax/harahachibu/config/DiskSpaceConfiguration.java
// public class DiskSpaceConfiguration {
//
// public static final String ELASTICSEARCH_CHECKER = "elasticsearch";
// public static final String SOLR_LOCAL_CHECKER = "solr";
// public static final String CLUSTER_CHECKER = "... | import static org.mockito.Matchers.eq;
import static org.mockito.Matchers.isA;
import static org.mockito.Mockito.*;
import com.codahale.metrics.MetricRegistry;
import com.codahale.metrics.health.HealthCheckRegistry;
import io.dropwizard.jersey.setup.JerseyEnvironment;
import io.dropwizard.jetty.setup.ServletEnvironment... | /**
* Copyright (c) 2016 Lemur Consulting 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/>
* Unless required by ap... | // Path: harahachibu/src/main/java/uk/co/flax/harahachibu/config/DiskSpaceConfiguration.java
// public class DiskSpaceConfiguration {
//
// public static final String ELASTICSEARCH_CHECKER = "elasticsearch";
// public static final String SOLR_LOCAL_CHECKER = "solr";
// public static final String CLUSTER_CHECKER = "... | private final ProxyConfiguration proxyConfiguration = new ProxyConfiguration(); |
flaxsearch/harahachibu | harahachibu/src/test/java/uk/co/flax/harahachibu/HaraHachiBuApplicationTest.java | // Path: harahachibu/src/main/java/uk/co/flax/harahachibu/config/DiskSpaceConfiguration.java
// public class DiskSpaceConfiguration {
//
// public static final String ELASTICSEARCH_CHECKER = "elasticsearch";
// public static final String SOLR_LOCAL_CHECKER = "solr";
// public static final String CLUSTER_CHECKER = "... | import static org.mockito.Matchers.eq;
import static org.mockito.Matchers.isA;
import static org.mockito.Mockito.*;
import com.codahale.metrics.MetricRegistry;
import com.codahale.metrics.health.HealthCheckRegistry;
import io.dropwizard.jersey.setup.JerseyEnvironment;
import io.dropwizard.jetty.setup.ServletEnvironment... | /**
* Copyright (c) 2016 Lemur Consulting 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/>
* Unless required by ap... | // Path: harahachibu/src/main/java/uk/co/flax/harahachibu/config/DiskSpaceConfiguration.java
// public class DiskSpaceConfiguration {
//
// public static final String ELASTICSEARCH_CHECKER = "elasticsearch";
// public static final String SOLR_LOCAL_CHECKER = "solr";
// public static final String CLUSTER_CHECKER = "... | private final DiskSpaceConfiguration diskSpaceConfiguration = new DiskSpaceConfiguration(); |
MicBrain/Topographic-Maps | trip/Road.java | // Path: trip/Main.java
// static void error(String format, Object... args) {
// throw new IllegalArgumentException(String.format(format, args));
// }
| import static trip.Main.error; | package trip;
/** Represents a road between two Locations.
* @author P. N. Hilfinger
*/
class Road {
/** A Road whose name is NAME, going in DIRECTION, and of given
* LENGTH. */
Road(String name, Direction direction, double length) {
if (length < 0) { | // Path: trip/Main.java
// static void error(String format, Object... args) {
// throw new IllegalArgumentException(String.format(format, args));
// }
// Path: trip/Road.java
import static trip.Main.error;
package trip;
/** Represents a road between two Locations.
* @author P. N. Hilfinger
*/
class Road {
... | error("Road %s given negative length.", length); |
MicBrain/Topographic-Maps | make/Maker.java | // Path: graph/DepthFirstTraversal.java
// public class DepthFirstTraversal extends Traversal {
//
// /** A depth-first Traversal of G, using FRINGE as the fringe. */
// protected DepthFirstTraversal(Graph G) {
// super(G, Collections.asLifoQueue(new ArrayDeque<Integer>()));
// }
//
// @Overri... | import graph.DepthFirstTraversal;
import java.io.FileReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.NoSuchElementException;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.Set;... | package make;
/** Represents a makefile.
* @author P. N. Hilfinger
*/
class Maker {
/** Describes Makefile lines that are ignored. */
static final Pattern IGNORED = Pattern.compile("\\s*(#.*)?");
/** Describes a rule header in a makefile: TARGET: DEPENDENCIES. */
static final Pattern HEADER =... | // Path: graph/DepthFirstTraversal.java
// public class DepthFirstTraversal extends Traversal {
//
// /** A depth-first Traversal of G, using FRINGE as the fringe. */
// protected DepthFirstTraversal(Graph G) {
// super(G, Collections.asLifoQueue(new ArrayDeque<Integer>()));
// }
//
// @Overri... | error("Illegal Target: '%s'", dest); |
MicBrain/Topographic-Maps | make/Maker.java | // Path: graph/DepthFirstTraversal.java
// public class DepthFirstTraversal extends Traversal {
//
// /** A depth-first Traversal of G, using FRINGE as the fringe. */
// protected DepthFirstTraversal(Graph G) {
// super(G, Collections.asLifoQueue(new ArrayDeque<Integer>()));
// }
//
// @Overri... | import graph.DepthFirstTraversal;
import java.io.FileReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.NoSuchElementException;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.Set;... |
/** Return my dependence graph. */
final Depends getGraph() {
return _depends;
}
/** Return the initial age of TARGET, if it exists, or null if it
* does not. */
final Integer getInitialAge(String target) {
return _ages.get(target);
}
/** Returns the current time (to... | // Path: graph/DepthFirstTraversal.java
// public class DepthFirstTraversal extends Traversal {
//
// /** A depth-first Traversal of G, using FRINGE as the fringe. */
// protected DepthFirstTraversal(Graph G) {
// super(G, Collections.asLifoQueue(new ArrayDeque<Integer>()));
// }
//
// @Overri... | class MakeTraversal extends DepthFirstTraversal { |
MicBrain/Topographic-Maps | make/Rule.java | // Path: graph/Iteration.java
// public abstract class Iteration<Type>
// implements Iterator<Type>, Iterable<Type> {
//
// @Override
// public Iterator<Type> iterator() {
// return this;
// }
//
// @Override
// public void remove() {
// throw new UnsupportedOperationException(... | import java.util.ArrayList;
import java.util.List;
import graph.Iteration;
import static make.Main.error; | package make;
/** Represents the rules concerning a single target in a makefile.
* @author P. N. Hilfinger
*/
class Rule {
/** A new Rule for TARGET. Adds corresponding vertex to MAKER's dependence
* graph. */
Rule(Maker maker, String target) {
_maker = maker;
_depends = _maker.getG... | // Path: graph/Iteration.java
// public abstract class Iteration<Type>
// implements Iterator<Type>, Iterable<Type> {
//
// @Override
// public Iterator<Type> iterator() {
// return this;
// }
//
// @Override
// public void remove() {
// throw new UnsupportedOperationException(... | error("Input and commands are not empty."); |
MicBrain/Topographic-Maps | make/Rule.java | // Path: graph/Iteration.java
// public abstract class Iteration<Type>
// implements Iterator<Type>, Iterable<Type> {
//
// @Override
// public Iterator<Type> iterator() {
// return this;
// }
//
// @Override
// public void remove() {
// throw new UnsupportedOperationException(... | import java.util.ArrayList;
import java.util.List;
import graph.Iteration;
import static make.Main.error; | package make;
/** Represents the rules concerning a single target in a makefile.
* @author P. N. Hilfinger
*/
class Rule {
/** A new Rule for TARGET. Adds corresponding vertex to MAKER's dependence
* graph. */
Rule(Maker maker, String target) {
_maker = maker;
_depends = _maker.getG... | // Path: graph/Iteration.java
// public abstract class Iteration<Type>
// implements Iterator<Type>, Iterable<Type> {
//
// @Override
// public Iterator<Type> iterator() {
// return this;
// }
//
// @Override
// public void remove() {
// throw new UnsupportedOperationException(... | Iteration<Integer> par = _depends.successors(getVertex()); |
MicBrain/Topographic-Maps | trip/Direction.java | // Path: trip/Main.java
// static void error(String format, Object... args) {
// throw new IllegalArgumentException(String.format(format, args));
// }
| import static trip.Main.error; | package trip;
/** Represents the direction of a road segment.
* @author P. N. Hilfinger
*/
enum Direction {
/** Directions: NS (from north to south), SN (from south to
* north), WE (from west to east), EW (from east to west). */
NS("south"), SN("north"), WE("east"), EW("west");
/** A new Directi... | // Path: trip/Main.java
// static void error(String format, Object... args) {
// throw new IllegalArgumentException(String.format(format, args));
// }
// Path: trip/Direction.java
import static trip.Main.error;
package trip;
/** Represents the direction of a road segment.
* @author P. N. Hilfinger
*/
enum D... | error("improper direction name: %s", name); |
dgradecak/alfresco-mvc | alfresco-mvc-rest/src/main/java/com/gradecak/alfresco/mvc/rest/config/DefaultAlfrescoMvcServletContextConfiguration.java | // Path: alfresco-mvc-rest/src/main/java/com/gradecak/alfresco/mvc/rest/AlfrescoApiResponseInterceptor.java
// @ControllerAdvice
// public class AlfrescoApiResponseInterceptor implements ResponseBodyAdvice<Object> {
//
// private final ResourceWebScriptHelper webscriptHelper;
// private final boolean globalAlfrescoR... | import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.List;
import java.util.TimeZone;
import org.alfresco.rest.framework.jacksonextensions.RestJsonModule;
import org.alfresco.rest.framework.webscripts.ResourceWebScriptHelper;
import org.springframework.beans.factory.annotation.Autowired;
imp... | /**
* Copyright gradecak.com
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writin... | // Path: alfresco-mvc-rest/src/main/java/com/gradecak/alfresco/mvc/rest/AlfrescoApiResponseInterceptor.java
// @ControllerAdvice
// public class AlfrescoApiResponseInterceptor implements ResponseBodyAdvice<Object> {
//
// private final ResourceWebScriptHelper webscriptHelper;
// private final boolean globalAlfrescoR... | public AlfrescoApiResponseInterceptor alfrescoResponseInterceptor(ResourceWebScriptHelper webscriptHelper) { |
dgradecak/alfresco-mvc | alfresco-mvc-aop/src/test/java/com/gradecak/alfresco/mvc/aop/RunAsTest.java | // Path: alfresco-mvc-aop/src/test/java/com/gradecak/alfresco/mvc/service/RunAsService.java
// @Service
// public class RunAsService {
//
// @Autowired
// private ServiceRegistry serviceRegistry;
//
// @AlfrescoRunAs("user")
// public String getNamePropertyAsUser(final NodeRef nodeRef) {
// Assert.isTrue("user"... | import static org.mockito.Mockito.when;
import org.alfresco.repo.security.authentication.AuthenticationUtil;
import org.alfresco.service.ServiceRegistry;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.cmr.repository.StoreRef;
impor... | /**
* Copyright gradecak.com
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writin... | // Path: alfresco-mvc-aop/src/test/java/com/gradecak/alfresco/mvc/service/RunAsService.java
// @Service
// public class RunAsService {
//
// @Autowired
// private ServiceRegistry serviceRegistry;
//
// @AlfrescoRunAs("user")
// public String getNamePropertyAsUser(final NodeRef nodeRef) {
// Assert.isTrue("user"... | private RunAsService service; |
dgradecak/alfresco-mvc | alfresco-mvc-aop/src/main/java/com/gradecak/alfresco/mvc/annotation/EnableAlfrescoMvcAop.java | // Path: alfresco-mvc-aop/src/main/java/com/gradecak/alfresco/mvc/aop/AlfrescoProxyRegistrar.java
// public class AlfrescoProxyRegistrar implements ImportBeanDefinitionRegistrar {
//
// public static final String PACKAGE_PROXY_CREATOR_BEAN_NAME = "com.gradecak.alfresco.mvc.aop.alfrescoMvcPackageAutoProxyCreator";
// ... | import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.springframework.context.annotation.AdviceMode;
import org.springframe... | /**
* Copyright gradecak.com
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writin... | // Path: alfresco-mvc-aop/src/main/java/com/gradecak/alfresco/mvc/aop/AlfrescoProxyRegistrar.java
// public class AlfrescoProxyRegistrar implements ImportBeanDefinitionRegistrar {
//
// public static final String PACKAGE_PROXY_CREATOR_BEAN_NAME = "com.gradecak.alfresco.mvc.aop.alfrescoMvcPackageAutoProxyCreator";
// ... | @Import(AlfrescoProxyRegistrar.class) |
dgradecak/alfresco-mvc | alfresco-mvc-rest/src/test/java/com/gradecak/alfresco/mvc/config/AlfrescoMvcRestServletContext.java | // Path: alfresco-mvc-rest/src/test/java/com/gradecak/alfresco/mvc/controller/TestController.java
// @Controller
// @RequestMapping("/test")
// public class TestController {
//
// @RequestMapping(value = "/get", method = { RequestMethod.GET })
// public ResponseEntity<?> get(@RequestParam String id) {
// return Re... | import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import com.gradecak.alfresco.mvc.controller.TestController;
import com.gradecak.alfresco.mvc.rest.annotation.EnableWebAlfre... | package com.gradecak.alfresco.mvc.config;
@Configuration
@EnableWebAlfrescoMvc | // Path: alfresco-mvc-rest/src/test/java/com/gradecak/alfresco/mvc/controller/TestController.java
// @Controller
// @RequestMapping("/test")
// public class TestController {
//
// @RequestMapping(value = "/get", method = { RequestMethod.GET })
// public ResponseEntity<?> get(@RequestParam String id) {
// return Re... | @ComponentScan(basePackageClasses = { TestController.class }) |
dgradecak/alfresco-mvc | alfresco-mvc-aop/src/test/java/com/gradecak/alfresco/mvc/aop/TransactionalTest.java | // Path: alfresco-mvc-aop/src/test/java/com/gradecak/alfresco/mvc/service/TransactionalService.java
// @Service
// public class TransactionalService {
//
// @Autowired
// private ServiceRegistry serviceRegistry;
//
// @AlfrescoTransaction
// public String transactionWriteWithoutPropagation() {
// return (String... | import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import javax.transaction.SystemException;
import org.alfresco.repo.transaction.RetryingTransactionHelper;
import org.alfresco.repo.transaction.... | /**
* Copyright gradecak.com
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writin... | // Path: alfresco-mvc-aop/src/test/java/com/gradecak/alfresco/mvc/service/TransactionalService.java
// @Service
// public class TransactionalService {
//
// @Autowired
// private ServiceRegistry serviceRegistry;
//
// @AlfrescoTransaction
// public String transactionWriteWithoutPropagation() {
// return (String... | private TransactionalService service; |
dgradecak/alfresco-mvc | alfresco-mvc-aop/src/test/java/com/gradecak/alfresco/mvc/service/AuthenticationService.java | // Path: alfresco-mvc-aop/src/main/java/com/gradecak/alfresco/mvc/annotation/AuthenticationType.java
// public enum AuthenticationType {
//
// NONE,
//
// GUEST,
//
// USER,
//
// ADMIN
//
// }
| import org.alfresco.model.ContentModel;
import org.alfresco.service.ServiceRegistry;
import org.alfresco.service.cmr.repository.NodeRef;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.gradecak.alfresco.mvc.annotation.AlfrescoAuthentication;
impor... | /**
* Copyright gradecak.com
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writin... | // Path: alfresco-mvc-aop/src/main/java/com/gradecak/alfresco/mvc/annotation/AuthenticationType.java
// public enum AuthenticationType {
//
// NONE,
//
// GUEST,
//
// USER,
//
// ADMIN
//
// }
// Path: alfresco-mvc-aop/src/test/java/com/gradecak/alfresco/mvc/service/AuthenticationService.java
import org.alf... | @AlfrescoAuthentication(AuthenticationType.USER) |
dgradecak/alfresco-mvc | alfresco-mvc-rest/src/main/java/com/gradecak/alfresco/mvc/rest/annotation/AlfrescoDispatcherWebscript.java | // Path: alfresco-mvc-rest/src/main/java/com/gradecak/alfresco/mvc/rest/config/AlfrescoRestRegistrar.java
// public class AlfrescoRestRegistrar implements ImportBeanDefinitionRegistrar {
//
// private AnnotationAttributes attributes;
//
// public void registerBeanDefinitions(AnnotationMetadata annotationMetadata, B... | import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.springframework.context.annot... | /**
* Copyright gradecak.com
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writin... | // Path: alfresco-mvc-rest/src/main/java/com/gradecak/alfresco/mvc/rest/config/AlfrescoRestRegistrar.java
// public class AlfrescoRestRegistrar implements ImportBeanDefinitionRegistrar {
//
// private AnnotationAttributes attributes;
//
// public void registerBeanDefinitions(AnnotationMetadata annotationMetadata, B... | @Import(AlfrescoRestRegistrar.class) |
dgradecak/alfresco-mvc | alfresco-mvc-rest/src/main/java/com/gradecak/alfresco/mvc/rest/annotation/AlfrescoDispatcherWebscript.java | // Path: alfresco-mvc-rest/src/main/java/com/gradecak/alfresco/mvc/rest/config/AlfrescoRestRegistrar.java
// public class AlfrescoRestRegistrar implements ImportBeanDefinitionRegistrar {
//
// private AnnotationAttributes attributes;
//
// public void registerBeanDefinitions(AnnotationMetadata annotationMetadata, B... | import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.springframework.context.annot... | /**
* Copyright gradecak.com
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writin... | // Path: alfresco-mvc-rest/src/main/java/com/gradecak/alfresco/mvc/rest/config/AlfrescoRestRegistrar.java
// public class AlfrescoRestRegistrar implements ImportBeanDefinitionRegistrar {
//
// private AnnotationAttributes attributes;
//
// public void registerBeanDefinitions(AnnotationMetadata annotationMetadata, B... | ServletConfigOptions[] servletConfigOptions() default {}; |
dgradecak/alfresco-mvc | alfresco-mvc-rest/src/main/java/com/gradecak/alfresco/mvc/rest/annotation/EnableWebAlfrescoMvc.java | // Path: alfresco-mvc-rest/src/main/java/com/gradecak/alfresco/mvc/rest/config/DefaultAlfrescoMvcServletContextConfiguration.java
// @Configuration
// public class DefaultAlfrescoMvcServletContextConfiguration implements WebMvcConfigurer {
//
// private final RestJsonModule alfrescoRestJsonModule;
//
// @Autowired
... | import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.springframework.context.annotation.Import;
import org.springframework... | /**
* Copyright gradecak.com
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writin... | // Path: alfresco-mvc-rest/src/main/java/com/gradecak/alfresco/mvc/rest/config/DefaultAlfrescoMvcServletContextConfiguration.java
// @Configuration
// public class DefaultAlfrescoMvcServletContextConfiguration implements WebMvcConfigurer {
//
// private final RestJsonModule alfrescoRestJsonModule;
//
// @Autowired
... | @Import(DefaultAlfrescoMvcServletContextConfiguration.class) |
dgradecak/alfresco-mvc | alfresco-mvc-rest/src/test/java/com/gradecak/alfresco/mvc/inheritservletconfig/AlfrescoMvcCustomServletConfigModuleConfiguration.java | // Path: alfresco-mvc-rest/src/main/java/com/gradecak/alfresco/mvc/webscript/DispatcherWebscript.java
// public static enum ServletConfigOptions {
// DISABLED_PARENT_HANDLER_MAPPINGS, DISABLED_PARENT_HANDLER_ADAPTERS, DISABLED_PARENT_VIEW_RESOLVERS,
// DISABLED_PARENT_HANDLER_EXCEPTION_RESOLVERS
// }
| import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResource;
import org.springframework.web.servlet.config.annotation.PathMatchConfigurer;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import com.gradecak.alfresco.mvc.rest.annota... | /**
* Copyright gradecak.com
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writin... | // Path: alfresco-mvc-rest/src/main/java/com/gradecak/alfresco/mvc/webscript/DispatcherWebscript.java
// public static enum ServletConfigOptions {
// DISABLED_PARENT_HANDLER_MAPPINGS, DISABLED_PARENT_HANDLER_ADAPTERS, DISABLED_PARENT_VIEW_RESOLVERS,
// DISABLED_PARENT_HANDLER_EXCEPTION_RESOLVERS
// }
// Path: alfre... | @EnableAlfrescoMvcRest(@AlfrescoDispatcherWebscript(servletContext = AlfrescoMvcServletContext.class, servletConfigOptions = ServletConfigOptions.DISABLED_PARENT_HANDLER_MAPPINGS)) |
dgradecak/alfresco-mvc | alfresco-mvc-rest/src/test/java/com/gradecak/alfresco/mvc/webscript/DispatcherWebscriptMockitoTest.java | // Path: alfresco-mvc-rest/src/test/java/com/gradecak/alfresco/mvc/webscript/mock/MockWebscriptBuilder.java
// public class MockWebscriptBuilder {
//
// static public MockWebscript singleWebscript(final AbstractWebScript webScript) throws IOException {
// return new MockWebscript(webScript);
// }
// }
| import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.TestInstance;
import org.junit.jupiter.api.TestInstance.Lifecycle;
import org.mockito.MockitoAnnotations;
import org.mockito.Spy;
import org.springframework.context.event.ContextRefreshedEvent;
import org.sprin... | /**
* Copyright gradecak.com
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writin... | // Path: alfresco-mvc-rest/src/test/java/com/gradecak/alfresco/mvc/webscript/mock/MockWebscriptBuilder.java
// public class MockWebscriptBuilder {
//
// static public MockWebscript singleWebscript(final AbstractWebScript webScript) throws IOException {
// return new MockWebscript(webScript);
// }
// }
// Path: a... | mockWebscript = MockWebscriptBuilder.singleWebscript(webScript); |
dgradecak/alfresco-mvc | alfresco-mvc-rest/src/test/java/com/gradecak/alfresco/mvc/webscript/DispatcherWebscriptSpringAnnotationRepeatableTest.java | // Path: alfresco-mvc-rest/src/test/java/com/gradecak/alfresco/mvc/webscript/mock/MockWebscriptBuilder.java
// public class MockWebscriptBuilder {
//
// static public MockWebscript singleWebscript(final AbstractWebScript webScript) throws IOException {
// return new MockWebscript(webScript);
// }
// }
| import com.gradecak.alfresco.mvc.webscript.mock.MockWebscriptBuilder;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInstance;
import org.junit.jupiter.api.TestInstance.Lifecycl... | /**
* Copyright gradecak.com
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writin... | // Path: alfresco-mvc-rest/src/test/java/com/gradecak/alfresco/mvc/webscript/mock/MockWebscriptBuilder.java
// public class MockWebscriptBuilder {
//
// static public MockWebscript singleWebscript(final AbstractWebScript webScript) throws IOException {
// return new MockWebscript(webScript);
// }
// }
// Path: a... | mockWebscript = MockWebscriptBuilder.singleWebscript(webScript); |
dgradecak/alfresco-mvc | alfresco-mvc-rest/src/test/java/com/gradecak/alfresco/mvc/webscript/DispatcherWebscriptSpringAnnotationSingleTest.java | // Path: alfresco-mvc-rest/src/test/java/com/gradecak/alfresco/mvc/webscript/mock/MockWebscriptBuilder.java
// public class MockWebscriptBuilder {
//
// static public MockWebscript singleWebscript(final AbstractWebScript webScript) throws IOException {
// return new MockWebscript(webScript);
// }
// }
| import com.gradecak.alfresco.mvc.webscript.mock.MockWebscriptBuilder;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInstance;
import org.junit.jupiter.api.TestInstance.Lifecycl... | /**
* Copyright gradecak.com
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writin... | // Path: alfresco-mvc-rest/src/test/java/com/gradecak/alfresco/mvc/webscript/mock/MockWebscriptBuilder.java
// public class MockWebscriptBuilder {
//
// static public MockWebscript singleWebscript(final AbstractWebScript webScript) throws IOException {
// return new MockWebscript(webScript);
// }
// }
// Path: a... | mockWebscript = MockWebscriptBuilder.singleWebscript(webScript); |
dgradecak/alfresco-mvc | alfresco-mvc-rest/src/main/java/com/gradecak/alfresco/mvc/rest/AlfrescoApiResponseInterceptor.java | // Path: alfresco-mvc-rest/src/main/java/com/gradecak/alfresco/mvc/webscript/DispatcherWebscript.java
// public class WebscriptRequestWrapper extends HttpServletRequestWrapper {
//
// private WebScriptServletRequest origReq;
//
// public WebscriptRequestWrapper(WebScriptServletRequest request) {
// super(request.... | import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice;
import com.gradecak.alfresco.mvc.rest.annotation.AlfrescoRestResponse;
import com.gradecak.alfresco.mvc.webscript.DispatcherWebscript.WebscriptRequestWrapper;
import javax.se... | this.webscriptHelper = webscriptHelper;
this.globalAlfrescoResponse = globalAlfrescoResponse;
}
@Override
public Object beforeBodyWrite(Object body, MethodParameter returnType, MediaType selectedContentType,
Class<? extends HttpMessageConverter<?>> selectedConverterType, ServerHttpRequest request,
ServerH... | // Path: alfresco-mvc-rest/src/main/java/com/gradecak/alfresco/mvc/webscript/DispatcherWebscript.java
// public class WebscriptRequestWrapper extends HttpServletRequestWrapper {
//
// private WebScriptServletRequest origReq;
//
// public WebscriptRequestWrapper(WebScriptServletRequest request) {
// super(request.... | if (!(r instanceof WebscriptRequestWrapper)) { |
dgradecak/alfresco-mvc | alfresco-mvc-rest/src/test/java/com/gradecak/alfresco/mvc/webscript/DispatcherWebscriptSpringXmlTest.java | // Path: alfresco-mvc-rest/src/test/java/com/gradecak/alfresco/mvc/webscript/mock/MockWebscriptBuilder.java
// public class MockWebscriptBuilder {
//
// static public MockWebscript singleWebscript(final AbstractWebScript webScript) throws IOException {
// return new MockWebscript(webScript);
// }
// }
| import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.TestInstance;
import org.junit.jupiter.api.TestInstance.Lifecycle;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.MockitoAnnotations;
import org.mockito.Spy;
import org.springframework.be... | /**
* Copyright gradecak.com
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writin... | // Path: alfresco-mvc-rest/src/test/java/com/gradecak/alfresco/mvc/webscript/mock/MockWebscriptBuilder.java
// public class MockWebscriptBuilder {
//
// static public MockWebscript singleWebscript(final AbstractWebScript webScript) throws IOException {
// return new MockWebscript(webScript);
// }
// }
// Path: a... | mockWebscript = MockWebscriptBuilder.singleWebscript(webScript); |
dgradecak/alfresco-mvc | alfresco-mvc-rest/src/test/java/com/gradecak/alfresco/mvc/webscript/DispatcherWebscriptSpringAnnotationEnableTest.java | // Path: alfresco-mvc-rest/src/test/java/com/gradecak/alfresco/mvc/webscript/mock/MockWebscriptBuilder.java
// public class MockWebscriptBuilder {
//
// static public MockWebscript singleWebscript(final AbstractWebScript webScript) throws IOException {
// return new MockWebscript(webScript);
// }
// }
| import com.gradecak.alfresco.mvc.webscript.mock.MockWebscriptBuilder;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInstance;
import org.junit.jupiter.api.TestInstance.Lifecycl... | /**
* Copyright gradecak.com
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writin... | // Path: alfresco-mvc-rest/src/test/java/com/gradecak/alfresco/mvc/webscript/mock/MockWebscriptBuilder.java
// public class MockWebscriptBuilder {
//
// static public MockWebscript singleWebscript(final AbstractWebScript webScript) throws IOException {
// return new MockWebscript(webScript);
// }
// }
// Path: a... | mockWebscript = MockWebscriptBuilder.singleWebscript(webScript); |
dgradecak/alfresco-mvc | alfresco-mvc-aop/src/main/java/com/gradecak/alfresco/mvc/aop/AuthenticationAdvice.java | // Path: alfresco-mvc-aop/src/main/java/com/gradecak/alfresco/mvc/annotation/AuthenticationType.java
// public enum AuthenticationType {
//
// NONE,
//
// GUEST,
//
// USER,
//
// ADMIN
//
// }
| import com.gradecak.alfresco.mvc.annotation.AlfrescoAuthentication;
import com.gradecak.alfresco.mvc.annotation.AuthenticationType;
import java.lang.annotation.Annotation;
import java.lang.reflect.AnnotatedElement;
import java.lang.reflect.Method;
import org.alfresco.repo.security.authentication.AuthenticationException... | /**
* Copyright gradecak.com
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writin... | // Path: alfresco-mvc-aop/src/main/java/com/gradecak/alfresco/mvc/annotation/AuthenticationType.java
// public enum AuthenticationType {
//
// NONE,
//
// GUEST,
//
// USER,
//
// ADMIN
//
// }
// Path: alfresco-mvc-aop/src/main/java/com/gradecak/alfresco/mvc/aop/AuthenticationAdvice.java
import com.gradecak... | AuthenticationType authenticationType = alfrescoAuthentication.value(); |
dgradecak/alfresco-mvc | alfresco-mvc-aop/src/test/java/com/gradecak/alfresco/mvc/aop/AuthenticationTest.java | // Path: alfresco-mvc-aop/src/test/java/com/gradecak/alfresco/mvc/service/AuthenticationService.java
// @Service
// public class AuthenticationService {
//
// @Autowired
// private ServiceRegistry serviceRegistry;
//
// @AlfrescoAuthentication
// public String getNamePropertyAsDefault(final NodeRef nodeRef) {
// ... | import static org.mockito.Mockito.when;
import org.alfresco.repo.security.authentication.AuthenticationException;
import org.alfresco.repo.security.authentication.AuthenticationUtil;
import org.alfresco.service.ServiceRegistry;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.reposito... | /**
* Copyright gradecak.com
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writin... | // Path: alfresco-mvc-aop/src/test/java/com/gradecak/alfresco/mvc/service/AuthenticationService.java
// @Service
// public class AuthenticationService {
//
// @Autowired
// private ServiceRegistry serviceRegistry;
//
// @AlfrescoAuthentication
// public String getNamePropertyAsDefault(final NodeRef nodeRef) {
// ... | private AuthenticationService service; |
firepick1/FireBOM | src/main/java/org/firepick/firebom/bom/HtmlRowVisitor.java | // Path: src/main/java/org/firepick/relation/IRow.java
// public interface IRow {
// IRelation getRelation();
// Object item(int index);
// }
//
// Path: src/main/java/org/firepick/relation/IRowVisitor.java
// public interface IRowVisitor {
// void visit(IRow row);
// }
| import org.firepick.relation.IRow;
import org.firepick.relation.IRowVisitor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory; | package org.firepick.firebom.bom;
/*
HtmlRowVisitor.java
Copyright (C) 2013 Karl Lew <karl@firepick.org>. All rights reserved.
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
ht... | // Path: src/main/java/org/firepick/relation/IRow.java
// public interface IRow {
// IRelation getRelation();
// Object item(int index);
// }
//
// Path: src/main/java/org/firepick/relation/IRowVisitor.java
// public interface IRowVisitor {
// void visit(IRow row);
// }
// Path: src/main/java/org/firepic... | public void visit(IRow row) { |
firepick1/FireBOM | src/test/java/org/firepick/firebom/MainTest.java | // Path: src/main/java/org/firepick/firebom/bom/BOMFactory.java
// public class BOMFactory implements Runnable {
// private static Logger logger = LoggerFactory.getLogger(BOMFactory.class);
// private final ConcurrentLinkedQueue<BOM> bomQueue = new ConcurrentLinkedQueue<BOM>();
// private OutputType outputT... | import org.firepick.firebom.bom.BOMFactory;
import org.junit.Test;
import java.io.*;
import static org.junit.Assert.assertEquals; | package org.firepick.firebom;
/*
MainTest.java
Copyright (C) 2013 Karl Lew <karl@firepick.org>. All rights reserved.
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/org/firepick/firebom/bom/BOMFactory.java
// public class BOMFactory implements Runnable {
// private static Logger logger = LoggerFactory.getLogger(BOMFactory.class);
// private final ConcurrentLinkedQueue<BOM> bomQueue = new ConcurrentLinkedQueue<BOM>();
// private OutputType outputT... | BOMFactory bomFactory = new BOMFactory(); |
firepick1/FireBOM | src/test/java/org/firepick/firebom/RefreshableTimerTest.java | // Path: src/main/java/org/firepick/firebom/exception/ProxyResolutionException.java
// public class ProxyResolutionException extends RuntimeException {
// public ProxyResolutionException(Exception e) {
// super(e);
// }
//
// public ProxyResolutionException(String message) {
// super(messag... | import org.firepick.firebom.exception.ProxyResolutionException;
import org.junit.Test;
import static org.junit.Assert.assertEquals; | assertEquals(0, timer.getSamplesSinceRefresh());
assertEquals(10, timer.getRefreshInterval());
assertEquals(10, timer.getSampleInterval());
// Sampling affects refresh/sampling intervals and, therefore, freshness
Thread.sleep(50);
timer.sample();
assertEquals(1, ... | // Path: src/main/java/org/firepick/firebom/exception/ProxyResolutionException.java
// public class ProxyResolutionException extends RuntimeException {
// public ProxyResolutionException(Exception e) {
// super(e);
// }
//
// public ProxyResolutionException(String message) {
// super(messag... | throw new ProxyResolutionException("test"); |
firepick1/FireBOM | src/test/java/org/firepick/firebom/RefreshableProxyTester.java | // Path: src/main/java/org/firepick/firebom/exception/ProxyResolutionException.java
// public class ProxyResolutionException extends RuntimeException {
// public ProxyResolutionException(Exception e) {
// super(e);
// }
//
// public ProxyResolutionException(String message) {
// super(messag... | import org.firepick.firebom.exception.ProxyResolutionException;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail; | }
catch (Exception e) {
fail(e.getMessage());
}
assert (proxy.isFresh());
assert (proxy.isResolved());
// Sampling has no effect on freshness
proxy.sample();
assert (proxy.isFresh());
assert (proxy.isResolved());
testProxyAge(p... | // Path: src/main/java/org/firepick/firebom/exception/ProxyResolutionException.java
// public class ProxyResolutionException extends RuntimeException {
// public ProxyResolutionException(Exception e) {
// super(e);
// }
//
// public ProxyResolutionException(String message) {
// super(messag... | assert (e instanceof ProxyResolutionException); |
firepick1/FireBOM | src/main/java/org/firepick/firebom/part/PartFactory.java | // Path: src/main/java/org/firepick/firebom/exception/ProxyResolutionException.java
// public class ProxyResolutionException extends RuntimeException {
// public ProxyResolutionException(Exception e) {
// super(e);
// }
//
// public ProxyResolutionException(String message) {
// super(messag... | import net.sf.ehcache.CacheManager;
import net.sf.ehcache.Ehcache;
import net.sf.ehcache.Element;
import org.firepick.firebom.exception.ProxyResolutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.net.URL;
import java.util.*;
import java.util.concurrent.Conc... | } else if ("www.sparkfun.com".equalsIgnoreCase(host)) {
part = new SparkfunPart(this, url, urlResolver);
} else if ("www.adafruit.com".equalsIgnoreCase(host)) {
part = new AdafruitPart(this, url, urlResolver);
} else if ("www.digikey.com".equalsIgnoreCase(host)) {
part = new DigiKeyPart(th... | // Path: src/main/java/org/firepick/firebom/exception/ProxyResolutionException.java
// public class ProxyResolutionException extends RuntimeException {
// public ProxyResolutionException(Exception e) {
// super(e);
// }
//
// public ProxyResolutionException(String message) {
// super(messag... | throw new ProxyResolutionException("Uncaught exception", e); |
firepick1/FireBOM | src/main/java/org/firepick/firebom/part/CachedUrlResolver.java | // Path: src/main/java/org/firepick/firebom/exception/ProxyResolutionException.java
// public class ProxyResolutionException extends RuntimeException {
// public ProxyResolutionException(Exception e) {
// super(e);
// }
//
// public ProxyResolutionException(String message) {
// super(messag... | import java.util.Locale;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import static java.util.Locale.US;
import net.sf.ehcache.CacheManager;
import net.sf.ehcache.Ehcache;
import net.sf.ehcache.Element;
import org.firepick.firebom.exception.ProxyResolutionException;
import org.slf4j.Logger;
import or... | isr = new InputStreamReader(connection.getInputStream());
int responseCode = connection.getResponseCode();
if (!isCached) {
logger.info("get({}) => {}", url, responseCode);
}
switch (responseCode) {
case HttpURLConne... | // Path: src/main/java/org/firepick/firebom/exception/ProxyResolutionException.java
// public class ProxyResolutionException extends RuntimeException {
// public ProxyResolutionException(Exception e) {
// super(e);
// }
//
// public ProxyResolutionException(String message) {
// super(messag... | throw new ProxyResolutionException(url.toString(), e); |
firepick1/FireBOM | src/main/java/org/firepick/firebom/part/AmazonPart.java | // Path: src/main/java/org/firepick/firebom/exception/ProxyResolutionException.java
// public class ProxyResolutionException extends RuntimeException {
// public ProxyResolutionException(Exception e) {
// super(e);
// }
//
// public ProxyResolutionException(String message) {
// super(messag... | import org.firepick.firebom.exception.ProxyResolutionException;
import java.io.IOException;
import java.net.URL;
import java.util.regex.Pattern; | setTitleCategory(phrase);
}
}
}
String price = PartFactory.getInstance().scrapeText(content, startPrice, endPrice);
if (price != null) {
setPackageCost(Double.parseDouble(price));
}
String unitCostStr = PartFactory.getInstance().scrapeText(content, startUnitCost, endUni... | // Path: src/main/java/org/firepick/firebom/exception/ProxyResolutionException.java
// public class ProxyResolutionException extends RuntimeException {
// public ProxyResolutionException(Exception e) {
// super(e);
// }
//
// public ProxyResolutionException(String message) {
// super(messag... | throw new ProxyResolutionException("Could not parse www.amazon.com url: " + getUrl()); |
firepick1/FireBOM | src/main/java/org/firepick/firebom/part/Part.java | // Path: src/main/java/org/firepick/firebom/IPartComparable.java
// public interface IPartComparable extends Comparable<IPartComparable> {
// Part getPart();
// }
//
// Path: src/main/java/org/firepick/firebom/IRefreshableProxy.java
// public interface IRefreshableProxy {
//
// /**
// * Synchronize proxy... | import java.util.List;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import java.util.regex.Pattern;
import org.firepick.firebom.IPartComparable;
import org.firepick.firebom.IRefreshableProxy;
import org.firepick.firebom.RefreshableTimer;
import org.firepick.firebom.exception.... | setRefreshException(proxyResolutionException);
}
}
// The refresh exception may be temporary, so the proxy is treated as "fresh and resolved with error"
isResolved = true;
sourceList = null;
sourcePartUsage = null;
requiredParts.clear();
refreshableTimer.refresh();
return... | // Path: src/main/java/org/firepick/firebom/IPartComparable.java
// public interface IPartComparable extends Comparable<IPartComparable> {
// Part getPart();
// }
//
// Path: src/main/java/org/firepick/firebom/IRefreshableProxy.java
// public interface IRefreshableProxy {
//
// /**
// * Synchronize proxy... | rootPart.setRefreshException(new CyclicReferenceException("Cyclic part reference detected: " + url)); |
firepick1/FireBOM | src/main/java/org/firepick/firebom/part/HtmlPart.java | // Path: src/main/java/org/firepick/firebom/exception/ProxyResolutionException.java
// public class ProxyResolutionException extends RuntimeException {
// public ProxyResolutionException(Exception e) {
// super(e);
// }
//
// public ProxyResolutionException(String message) {
// super(messag... | import org.firepick.firebom.exception.ProxyResolutionException;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Pattern; | package org.firepick.firebom.part;
/*
HtmlPart.java
Copyright (C) 2013 Karl Lew <karl@firepick.org>. All rights reserved.
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://... | // Path: src/main/java/org/firepick/firebom/exception/ProxyResolutionException.java
// public class ProxyResolutionException extends RuntimeException {
// public ProxyResolutionException(Exception e) {
// super(e);
// }
//
// public ProxyResolutionException(String message) {
// super(messag... | throw new ProxyResolutionException("Html page has no @Sources tag"); |
firepick1/FireBOM | src/main/java/org/firepick/firebom/part/McMasterCarrPart.java | // Path: src/main/java/org/firepick/firebom/exception/ProxyResolutionException.java
// public class ProxyResolutionException extends RuntimeException {
// public ProxyResolutionException(Exception e) {
// super(e);
// }
//
// public ProxyResolutionException(String message) {
// super(messag... | import org.firepick.firebom.exception.ProxyResolutionException;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.List;
import java.util.Map;
import java.util.regex.Pattern; | private static Pattern endTitle = Pattern.compile("\",");
private static Pattern startPrice = Pattern.compile("\"PrceTxt\":\"");
private static Pattern endPrice = Pattern.compile("\"");
private static Pattern startPackageUnits = Pattern.compile("\"SellStdPkgQty\":");
private static Pattern endPackageUnits = P... | // Path: src/main/java/org/firepick/firebom/exception/ProxyResolutionException.java
// public class ProxyResolutionException extends RuntimeException {
// public ProxyResolutionException(Exception e) {
// super(e);
// }
//
// public ProxyResolutionException(String message) {
// super(messag... | throw new ProxyResolutionException(url.toString(), e); |
firepick1/FireBOM | src/main/java/org/firepick/firebom/bom/BOMRowIterator.java | // Path: src/main/java/org/firepick/firebom/IPartComparable.java
// public interface IPartComparable extends Comparable<IPartComparable> {
// Part getPart();
// }
//
// Path: src/main/java/org/firepick/firebom/part/VendorComparator.java
// public class VendorComparator implements Comparator<IPartComparable> {
// ... | import org.firepick.firebom.IPartComparable;
import org.firepick.firebom.part.VendorComparator;
import org.firepick.relation.IRow;
import java.util.Iterator;
import java.util.TreeSet; | package org.firepick.firebom.bom;
/*
BOMRowIterator.java
Copyright (C) 2013 Karl Lew <karl@firepick.org>. All rights reserved.
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
ht... | // Path: src/main/java/org/firepick/firebom/IPartComparable.java
// public interface IPartComparable extends Comparable<IPartComparable> {
// Part getPart();
// }
//
// Path: src/main/java/org/firepick/firebom/part/VendorComparator.java
// public class VendorComparator implements Comparator<IPartComparable> {
// ... | public BOMRowIterator(Iterator<IPartComparable> iterator) { |
firepick1/FireBOM | src/main/java/org/firepick/firebom/bom/BOMRowIterator.java | // Path: src/main/java/org/firepick/firebom/IPartComparable.java
// public interface IPartComparable extends Comparable<IPartComparable> {
// Part getPart();
// }
//
// Path: src/main/java/org/firepick/firebom/part/VendorComparator.java
// public class VendorComparator implements Comparator<IPartComparable> {
// ... | import org.firepick.firebom.IPartComparable;
import org.firepick.firebom.part.VendorComparator;
import org.firepick.relation.IRow;
import java.util.Iterator;
import java.util.TreeSet; | package org.firepick.firebom.bom;
/*
BOMRowIterator.java
Copyright (C) 2013 Karl Lew <karl@firepick.org>. All rights reserved.
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
ht... | // Path: src/main/java/org/firepick/firebom/IPartComparable.java
// public interface IPartComparable extends Comparable<IPartComparable> {
// Part getPart();
// }
//
// Path: src/main/java/org/firepick/firebom/part/VendorComparator.java
// public class VendorComparator implements Comparator<IPartComparable> {
// ... | TreeSet<BOMRow> treeSet = new TreeSet(new VendorComparator()); |
firepick1/FireBOM | src/main/java/org/firepick/firebom/bom/BOMMarkdownPrinter.java | // Path: src/main/java/org/firepick/relation/IRelation.java
// public interface IRelation extends Iterable<IRow> {
// List<IColumnDescription> describeColumns();
// long getRowCount();
// }
//
// Path: src/main/java/org/firepick/relation/IRow.java
// public interface IRow {
// IRelation getRelation();
// ... | import org.firepick.relation.IRelation;
import org.firepick.relation.IRow;
import org.firepick.relation.IRowVisitor;
import org.firepick.relation.RelationPrinter;
import java.io.PrintStream;
import java.text.DecimalFormat;
import java.text.NumberFormat; | package org.firepick.firebom.bom;
/*
BOMMarkdownPrinter.java
Copyright (C) 2013 Karl Lew <karl@firepick.org>. All rights reserved.
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
... | // Path: src/main/java/org/firepick/relation/IRelation.java
// public interface IRelation extends Iterable<IRow> {
// List<IColumnDescription> describeColumns();
// long getRowCount();
// }
//
// Path: src/main/java/org/firepick/relation/IRow.java
// public interface IRow {
// IRelation getRelation();
// ... | public RelationPrinter print(IRelation relation, PrintStream printStream, IRowVisitor rowVisitor) { |
firepick1/FireBOM | src/main/java/org/firepick/firebom/bom/BOMMarkdownPrinter.java | // Path: src/main/java/org/firepick/relation/IRelation.java
// public interface IRelation extends Iterable<IRow> {
// List<IColumnDescription> describeColumns();
// long getRowCount();
// }
//
// Path: src/main/java/org/firepick/relation/IRow.java
// public interface IRow {
// IRelation getRelation();
// ... | import org.firepick.relation.IRelation;
import org.firepick.relation.IRow;
import org.firepick.relation.IRowVisitor;
import org.firepick.relation.RelationPrinter;
import java.io.PrintStream;
import java.text.DecimalFormat;
import java.text.NumberFormat; | package org.firepick.firebom.bom;
/*
BOMMarkdownPrinter.java
Copyright (C) 2013 Karl Lew <karl@firepick.org>. All rights reserved.
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
... | // Path: src/main/java/org/firepick/relation/IRelation.java
// public interface IRelation extends Iterable<IRow> {
// List<IColumnDescription> describeColumns();
// long getRowCount();
// }
//
// Path: src/main/java/org/firepick/relation/IRow.java
// public interface IRow {
// IRelation getRelation();
// ... | public RelationPrinter print(IRelation relation, PrintStream printStream, IRowVisitor rowVisitor) { |
xushaomin/apple-deploy | src/main/java/com/appleframework/deploy/dao/TaskMapper.java | // Path: src/main/java/com/appleframework/deploy/entity/Task.java
// public class Task implements Serializable {
//
// private Integer id;
//
// private Integer projectId;
//
// private String projectName;
//
// private String hosts;
//
// private String title;
//
// priva... | import org.springframework.stereotype.Repository;
import com.appleframework.deploy.entity.Task;
| package com.appleframework.deploy.dao;
@Repository
public interface TaskMapper {
int deleteByPrimaryKey(Integer id);
| // Path: src/main/java/com/appleframework/deploy/entity/Task.java
// public class Task implements Serializable {
//
// private Integer id;
//
// private Integer projectId;
//
// private String projectName;
//
// private String hosts;
//
// private String title;
//
// priva... | int insert(Task record);
|
xushaomin/apple-deploy | src/main/java/com/appleframework/deploy/service/impl/RecordServiceImpl.java | // Path: src/main/java/com/appleframework/deploy/dao/RecordMapper.java
// @Repository
// public interface RecordMapper {
// int deleteByPrimaryKey(Long id);
//
// int insert(RecordWithBLOBs record);
//
// int insertSelective(RecordWithBLOBs record);
//
// RecordWithBLOBs selectByPrimaryKey(Lo... | import java.util.Date;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.appleframework.deploy.dao.RecordMapper;
import com.appleframework.deploy.entity.RecordWithBLOBs;
import com.appleframework.deploy.service.RecordService;
import com.appleframework.exception.AppleExcep... | package com.appleframework.deploy.service.impl;
@Service("recordService")
public class RecordServiceImpl implements RecordService {
@Resource
| // Path: src/main/java/com/appleframework/deploy/dao/RecordMapper.java
// @Repository
// public interface RecordMapper {
// int deleteByPrimaryKey(Long id);
//
// int insert(RecordWithBLOBs record);
//
// int insertSelective(RecordWithBLOBs record);
//
// RecordWithBLOBs selectByPrimaryKey(Lo... | private RecordMapper recordMapper;
|
xushaomin/apple-deploy | src/main/java/com/appleframework/deploy/service/impl/RecordServiceImpl.java | // Path: src/main/java/com/appleframework/deploy/dao/RecordMapper.java
// @Repository
// public interface RecordMapper {
// int deleteByPrimaryKey(Long id);
//
// int insert(RecordWithBLOBs record);
//
// int insertSelective(RecordWithBLOBs record);
//
// RecordWithBLOBs selectByPrimaryKey(Lo... | import java.util.Date;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.appleframework.deploy.dao.RecordMapper;
import com.appleframework.deploy.entity.RecordWithBLOBs;
import com.appleframework.deploy.service.RecordService;
import com.appleframework.exception.AppleExcep... | package com.appleframework.deploy.service.impl;
@Service("recordService")
public class RecordServiceImpl implements RecordService {
@Resource
private RecordMapper recordMapper;
@Override
| // Path: src/main/java/com/appleframework/deploy/dao/RecordMapper.java
// @Repository
// public interface RecordMapper {
// int deleteByPrimaryKey(Long id);
//
// int insert(RecordWithBLOBs record);
//
// int insertSelective(RecordWithBLOBs record);
//
// RecordWithBLOBs selectByPrimaryKey(Lo... | public Long save(RecordWithBLOBs record) throws AppleException {
|
xushaomin/apple-deploy | src/main/java/com/appleframework/deploy/task/DeployTask.java | // Path: src/main/java/com/appleframework/deploy/entity/ProjectWithBLOBs.java
// public class ProjectWithBLOBs extends Project implements Serializable {
//
// private String hosts;
//
// private String preDeploy;
//
// private String postDeploy;
//
// private String afterDeploy;
//
// ... | import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import javax.annotation.Resource;
import org.springframework.stereotype.Component;
import com.appleframework.deploy.entity.ProjectWithBLOBs;
import com.appleframework.deploy.service.ProjectService;
import com.jcraft.jsch... | package com.appleframework.deploy.task;
@Component
public class DeployTask {
@Resource
| // Path: src/main/java/com/appleframework/deploy/entity/ProjectWithBLOBs.java
// public class ProjectWithBLOBs extends Project implements Serializable {
//
// private String hosts;
//
// private String preDeploy;
//
// private String postDeploy;
//
// private String afterDeploy;
//
// ... | private ProjectService projectService;
|
xushaomin/apple-deploy | src/main/java/com/appleframework/deploy/task/DeployTask.java | // Path: src/main/java/com/appleframework/deploy/entity/ProjectWithBLOBs.java
// public class ProjectWithBLOBs extends Project implements Serializable {
//
// private String hosts;
//
// private String preDeploy;
//
// private String postDeploy;
//
// private String afterDeploy;
//
// ... | import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import javax.annotation.Resource;
import org.springframework.stereotype.Component;
import com.appleframework.deploy.entity.ProjectWithBLOBs;
import com.appleframework.deploy.service.ProjectService;
import com.jcraft.jsch... | package com.appleframework.deploy.task;
@Component
public class DeployTask {
@Resource
private ProjectService projectService;
//@Scheduled(cron = "0/30 * * * * ?")
public void deploy() {
| // Path: src/main/java/com/appleframework/deploy/entity/ProjectWithBLOBs.java
// public class ProjectWithBLOBs extends Project implements Serializable {
//
// private String hosts;
//
// private String preDeploy;
//
// private String postDeploy;
//
// private String afterDeploy;
//
// ... | ProjectWithBLOBs project = projectService.get(1);
|
xushaomin/apple-deploy | src/main/java/com/appleframework/deploy/dao/extend/TaskExtendMapper.java | // Path: src/main/java/com/appleframework/deploy/entity/Project.java
// public class Project implements Serializable {
//
// private Integer id;
//
// private String name;
//
// private Integer type;
//
// private Integer env;
//
// private Integer plus;
//
// private ... | import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import com.appleframework.deploy.entity.Project;
import com.appleframework.deploy.model.TaskSo;
import com.appleframework.model.page.Pagination;
| package com.appleframework.deploy.dao.extend;
@Repository
public interface TaskExtendMapper {
| // Path: src/main/java/com/appleframework/deploy/entity/Project.java
// public class Project implements Serializable {
//
// private Integer id;
//
// private String name;
//
// private Integer type;
//
// private Integer env;
//
// private Integer plus;
//
// private ... | List<Project> selectByPage(@Param("page") Pagination page, @Param("so") TaskSo so);
|
xushaomin/apple-deploy | src/main/java/com/appleframework/deploy/dao/extend/TaskExtendMapper.java | // Path: src/main/java/com/appleframework/deploy/entity/Project.java
// public class Project implements Serializable {
//
// private Integer id;
//
// private String name;
//
// private Integer type;
//
// private Integer env;
//
// private Integer plus;
//
// private ... | import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import com.appleframework.deploy.entity.Project;
import com.appleframework.deploy.model.TaskSo;
import com.appleframework.model.page.Pagination;
| package com.appleframework.deploy.dao.extend;
@Repository
public interface TaskExtendMapper {
| // Path: src/main/java/com/appleframework/deploy/entity/Project.java
// public class Project implements Serializable {
//
// private Integer id;
//
// private String name;
//
// private Integer type;
//
// private Integer env;
//
// private Integer plus;
//
// private ... | List<Project> selectByPage(@Param("page") Pagination page, @Param("so") TaskSo so);
|
xushaomin/apple-deploy | src/main/java/com/appleframework/deploy/dao/extend/ProjectExtendMapper.java | // Path: src/main/java/com/appleframework/deploy/entity/Project.java
// public class Project implements Serializable {
//
// private Integer id;
//
// private String name;
//
// private Integer type;
//
// private Integer env;
//
// private Integer plus;
//
// private ... | import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import com.appleframework.deploy.entity.Project;
import com.appleframework.deploy.model.ProjectSo;
import com.appleframework.model.page.Pagination;
| package com.appleframework.deploy.dao.extend;
@Repository
public interface ProjectExtendMapper {
| // Path: src/main/java/com/appleframework/deploy/entity/Project.java
// public class Project implements Serializable {
//
// private Integer id;
//
// private String name;
//
// private Integer type;
//
// private Integer env;
//
// private Integer plus;
//
// private ... | List<Project> selectByPage(@Param("page") Pagination page, @Param("so") ProjectSo so);
|
xushaomin/apple-deploy | src/main/java/com/appleframework/deploy/dao/extend/ProjectExtendMapper.java | // Path: src/main/java/com/appleframework/deploy/entity/Project.java
// public class Project implements Serializable {
//
// private Integer id;
//
// private String name;
//
// private Integer type;
//
// private Integer env;
//
// private Integer plus;
//
// private ... | import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import com.appleframework.deploy.entity.Project;
import com.appleframework.deploy.model.ProjectSo;
import com.appleframework.model.page.Pagination;
| package com.appleframework.deploy.dao.extend;
@Repository
public interface ProjectExtendMapper {
| // Path: src/main/java/com/appleframework/deploy/entity/Project.java
// public class Project implements Serializable {
//
// private Integer id;
//
// private String name;
//
// private Integer type;
//
// private Integer env;
//
// private Integer plus;
//
// private ... | List<Project> selectByPage(@Param("page") Pagination page, @Param("so") ProjectSo so);
|
xushaomin/apple-deploy | src/main/java/com/appleframework/deploy/service/TaskService.java | // Path: src/main/java/com/appleframework/deploy/entity/Task.java
// public class Task implements Serializable {
//
// private Integer id;
//
// private Integer projectId;
//
// private String projectName;
//
// private String hosts;
//
// private String title;
//
// priva... | import com.appleframework.deploy.entity.Task;
import com.appleframework.deploy.model.TaskSo;
import com.appleframework.exception.AppleException;
import com.appleframework.model.page.Pagination; | package com.appleframework.deploy.service;
public interface TaskService {
public Integer save(Task record) throws AppleException;
public Integer update(Task record) throws AppleException;
public Integer delete(Integer id) throws AppleException;
public Task get(Integer id);
| // Path: src/main/java/com/appleframework/deploy/entity/Task.java
// public class Task implements Serializable {
//
// private Integer id;
//
// private Integer projectId;
//
// private String projectName;
//
// private String hosts;
//
// private String title;
//
// priva... | public Pagination findPage(Pagination page, TaskSo so); |
xushaomin/apple-deploy | src/main/java/com/appleframework/deploy/dao/RecordMapper.java | // Path: src/main/java/com/appleframework/deploy/entity/Record.java
// public class Record implements Serializable {
// private Long id;
//
// private Integer taskId;
//
// private Integer status;
//
// private Integer action;
//
// private Integer duration;
//
// private Date cr... | import org.springframework.stereotype.Repository;
import com.appleframework.deploy.entity.Record;
import com.appleframework.deploy.entity.RecordWithBLOBs;
| package com.appleframework.deploy.dao;
@Repository
public interface RecordMapper {
int deleteByPrimaryKey(Long id);
| // Path: src/main/java/com/appleframework/deploy/entity/Record.java
// public class Record implements Serializable {
// private Long id;
//
// private Integer taskId;
//
// private Integer status;
//
// private Integer action;
//
// private Integer duration;
//
// private Date cr... | int insert(RecordWithBLOBs record);
|
xushaomin/apple-deploy | src/main/java/com/appleframework/deploy/dao/RecordMapper.java | // Path: src/main/java/com/appleframework/deploy/entity/Record.java
// public class Record implements Serializable {
// private Long id;
//
// private Integer taskId;
//
// private Integer status;
//
// private Integer action;
//
// private Integer duration;
//
// private Date cr... | import org.springframework.stereotype.Repository;
import com.appleframework.deploy.entity.Record;
import com.appleframework.deploy.entity.RecordWithBLOBs;
| package com.appleframework.deploy.dao;
@Repository
public interface RecordMapper {
int deleteByPrimaryKey(Long id);
int insert(RecordWithBLOBs record);
int insertSelective(RecordWithBLOBs record);
RecordWithBLOBs selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(Recor... | // Path: src/main/java/com/appleframework/deploy/entity/Record.java
// public class Record implements Serializable {
// private Long id;
//
// private Integer taskId;
//
// private Integer status;
//
// private Integer action;
//
// private Integer duration;
//
// private Date cr... | int updateByPrimaryKey(Record record);
|
Mpmart08/MusicPlayer | src/app/musicplayer/model/Artist.java | // Path: src/app/musicplayer/util/Resources.java
// public final class Resources {
//
// public static final String FXML = "/app/musicplayer/view/";
// public static final String IMG = "/app/musicplayer/util/img/";
// public static final String CSS = "/app/musicplayer/util/css/";
// public static Strin... | import java.awt.Color;
import java.awt.image.BufferedImage;
import java.io.File;
import java.net.URL;
import java.net.URLEncoder;
import java.util.ArrayList;
import javax.imageio.ImageIO;
import javax.xml.stream.XMLInputFactory;
import javax.xml.stream.XMLStreamReader;
import app.musicplayer.util.Resources;
import java... | package app.musicplayer.model;
/**
* Model class for an Artist
*
*/
public final class Artist implements Comparable<Artist> {
private String title;
private ArrayList<Album> albums;
private Image artistImage;
private SimpleObjectProperty<Image> artistImageProperty;
/**
* Constructor for... | // Path: src/app/musicplayer/util/Resources.java
// public final class Resources {
//
// public static final String FXML = "/app/musicplayer/view/";
// public static final String IMG = "/app/musicplayer/util/img/";
// public static final String CSS = "/app/musicplayer/util/css/";
// public static Strin... | File file = new File(Resources.JAR + "/img/" + this.title + ".jpg"); |
Mpmart08/MusicPlayer | src/app/musicplayer/model/Song.java | // Path: src/app/musicplayer/util/Resources.java
// public final class Resources {
//
// public static final String FXML = "/app/musicplayer/view/";
// public static final String IMG = "/app/musicplayer/util/img/";
// public static final String CSS = "/app/musicplayer/util/css/";
// public static Strin... | import java.io.File;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.time.Duration;
import java.time.LocalDateTime;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Transformer;
import javax.xm... | public boolean getPlaying() {
return this.playing.get();
}
public void setPlaying(boolean playing) {
this.playing.set(playing);
}
public BooleanProperty selectedProperty() {
return this.selected;
}
public boolean getSelected() {
return this.selected.get();
... | // Path: src/app/musicplayer/util/Resources.java
// public final class Resources {
//
// public static final String FXML = "/app/musicplayer/view/";
// public static final String IMG = "/app/musicplayer/util/img/";
// public static final String CSS = "/app/musicplayer/util/css/";
// public static Strin... | Document doc = docBuilder.parse(Resources.JAR + "library.xml"); |
Mpmart08/MusicPlayer | src/app/musicplayer/model/Album.java | // Path: src/app/musicplayer/util/Resources.java
// public final class Resources {
//
// public static final String FXML = "/app/musicplayer/view/";
// public static final String IMG = "/app/musicplayer/util/img/";
// public static final String CSS = "/app/musicplayer/util/css/";
// public static Strin... | import java.awt.Color;
import java.awt.image.BufferedImage;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.net.URL;
import java.net.URLEncoder;
import java.util.ArrayList;
import javax.imageio.ImageIO;
import javax.xml.stream.XMLInputFactory;
import javax.xml.stream.XMLStreamReader;
import org.ja... | * @return album title
*/
public String getTitle() {
return this.title;
}
public String getArtist() {
return this.artist;
}
public ArrayList<Song> getSongs() {
return new ArrayList<>(this.songs);
}
public ObjectProperty<Image> artworkProperty() {
r... | // Path: src/app/musicplayer/util/Resources.java
// public final class Resources {
//
// public static final String FXML = "/app/musicplayer/view/";
// public static final String IMG = "/app/musicplayer/util/img/";
// public static final String CSS = "/app/musicplayer/util/css/";
// public static Strin... | this.artwork = new Image(Resources.IMG + "albumsIcon.png"); |
Mpmart08/MusicPlayer | src/app/musicplayer/model/Playlist.java | // Path: src/app/musicplayer/util/Resources.java
// public final class Resources {
//
// public static final String FXML = "/app/musicplayer/view/";
// public static final String IMG = "/app/musicplayer/util/img/";
// public static final String CSS = "/app/musicplayer/util/css/";
// public static Strin... | import java.io.File;
import java.util.ArrayList;
import java.util.Iterator;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.... | this.id = id;
this.title = title;
this.songs = null;
this.placeholder = placeholder;
}
public int getId() {
return this.id;
}
public String getTitle() {
return this.title;
}
public String getPlaceholder() {
return this.placeholder;
}... | // Path: src/app/musicplayer/util/Resources.java
// public final class Resources {
//
// public static final String FXML = "/app/musicplayer/view/";
// public static final String IMG = "/app/musicplayer/util/img/";
// public static final String CSS = "/app/musicplayer/util/css/";
// public static Strin... | Document doc = docBuilder.parse(Resources.JAR + "library.xml"); |
Turbo87/flight-club | core/src/main/java/org/flightclub/CameraMan.java | // Path: core/src/main/java/org/flightclub/compat/Color.java
// public class Color {
// private final java.awt.Color c;
//
//
// /**
// * The color white. In the default sRGB space.
// */
// public final static Color WHITE = new Color(255, 255, 255);
//
// /**
// * The color light gra... | import org.flightclub.compat.Color;
| /**
This code is covered by the GNU General Public License
detailed at http://www.gnu.org/copyleft/gpl.html
Flight Club docs located at http://www.danb.dircon.co.uk/hg/hg.htm
Dan Burton , Nov 2001
*/
package org.flightclub;
/*
todo - seperate into two classes
- generic 3d framework camera func... | // Path: core/src/main/java/org/flightclub/compat/Color.java
// public class Color {
// private final java.awt.Color c;
//
//
// /**
// * The color white. In the default sRGB space.
// */
// public final static Color WHITE = new Color(255, 255, 255);
//
// /**
// * The color light gra... | private static final Color BACKGROUND = new Color(BACKGROUND_R, BACKGROUND_G, BACKGROUND_B);
|
Turbo87/flight-club | core/src/main/java/org/flightclub/XCGame.java | // Path: core/src/main/java/org/flightclub/compat/Color.java
// public class Color {
// private final java.awt.Color c;
//
//
// /**
// * The color white. In the default sRGB space.
// */
// public final static Color WHITE = new Color(255, 255, 255);
//
// /**
// * The color light gra... | import org.flightclub.compat.Color;
import org.flightclub.compat.Font;
import org.flightclub.compat.Graphics;
import java.awt.event.KeyEvent;
import java.util.Vector;
| cameraMan.move(CameraMan.CAMERA_MOVEMENT_DELTA, 0);
return;
case KeyEvent.VK_M:
cameraMan.move(0, CameraMan.CAMERA_MOVEMENT_DELTA);
return;
case KeyEvent.VK_N:
cameraMan.move(0, -CameraMan.CAMERA_MOVEMENT_DELTA... | // Path: core/src/main/java/org/flightclub/compat/Color.java
// public class Color {
// private final java.awt.Color c;
//
//
// /**
// * The color white. In the default sRGB space.
// */
// public final static Color WHITE = new Color(255, 255, 255);
//
// /**
// * The color light gra... | public void draw(Graphics g, int width, int height) {
|
Turbo87/flight-club | core/src/main/java/org/flightclub/XCGame.java | // Path: core/src/main/java/org/flightclub/compat/Color.java
// public class Color {
// private final java.awt.Color c;
//
//
// /**
// * The color white. In the default sRGB space.
// */
// public final static Color WHITE = new Color(255, 255, 255);
//
// /**
// * The color light gra... | import org.flightclub.compat.Color;
import org.flightclub.compat.Font;
import org.flightclub.compat.Graphics;
import java.awt.event.KeyEvent;
import java.util.Vector;
| return;
case KeyEvent.VK_3:
cameraMan.setMode(CameraMan.Mode.PLAN);
return;
case KeyEvent.VK_4:
cameraMan.setMode(CameraMan.Mode.TILE);
return;
default:
}
}
@Override
pu... | // Path: core/src/main/java/org/flightclub/compat/Color.java
// public class Color {
// private final java.awt.Color c;
//
//
// /**
// * The color white. In the default sRGB space.
// */
// public final static Color WHITE = new Color(255, 255, 255);
//
// /**
// * The color light gra... | Font font = new Font("SansSerif", Font.PLAIN, 10);
|
Turbo87/flight-club | core/src/main/java/org/flightclub/XCGame.java | // Path: core/src/main/java/org/flightclub/compat/Color.java
// public class Color {
// private final java.awt.Color c;
//
//
// /**
// * The color white. In the default sRGB space.
// */
// public final static Color WHITE = new Color(255, 255, 255);
//
// /**
// * The color light gra... | import org.flightclub.compat.Color;
import org.flightclub.compat.Font;
import org.flightclub.compat.Graphics;
import java.awt.event.KeyEvent;
import java.util.Vector;
| cameraMan.setMode(CameraMan.Mode.PLAN);
return;
case KeyEvent.VK_4:
cameraMan.setMode(CameraMan.Mode.TILE);
return;
default:
}
}
@Override
public void keyReleased(KeyEvent e) {
}
public v... | // Path: core/src/main/java/org/flightclub/compat/Color.java
// public class Color {
// private final java.awt.Color c;
//
//
// /**
// * The color white. In the default sRGB space.
// */
// public final static Color WHITE = new Color(255, 255, 255);
//
// /**
// * The color light gra... | g.setColor(Color.LIGHT_GRAY);
|
Turbo87/flight-club | core/src/main/java/org/flightclub/Object3dWithShadow.java | // Path: core/src/main/java/org/flightclub/compat/Color.java
// public class Color {
// private final java.awt.Color c;
//
//
// /**
// * The color white. In the default sRGB space.
// */
// public final static Color WHITE = new Color(255, 255, 255);
//
// /**
// * The color light gra... | import org.flightclub.compat.Color;
import org.flightclub.compat.Graphics;
import java.util.Vector;
| /**
This code is covered by the GNU General Public License
detailed at http://www.gnu.org/copyleft/gpl.html
Flight Club docs located at http://www.danb.dircon.co.uk/hg/hg.htm
Dan Burton , Nov 2001
*/
package org.flightclub;
/**
* Three new methods added to object3d...
*
* 1. addWireWithShado... | // Path: core/src/main/java/org/flightclub/compat/Color.java
// public class Color {
// private final java.awt.Color c;
//
//
// /**
// * The color white. In the default sRGB space.
// */
// public final static Color WHITE = new Color(255, 255, 255);
//
// /**
// * The color light gra... | public int addWireWithShadow(Vector<Vector3d> wirePoints, Color c, boolean isSolid, boolean hasNormal) {
|
Turbo87/flight-club | core/src/main/java/org/flightclub/Object3dWithShadow.java | // Path: core/src/main/java/org/flightclub/compat/Color.java
// public class Color {
// private final java.awt.Color c;
//
//
// /**
// * The color white. In the default sRGB space.
// */
// public final static Color WHITE = new Color(255, 255, 255);
//
// /**
// * The color light gra... | import org.flightclub.compat.Color;
import org.flightclub.compat.Graphics;
import java.util.Vector;
| private void initShadow() {
for (int i = 0; i < MAX_SHADOWS; i++) {
shadowCasters[i] = -1;
}
}
public void updateShadow() {
/*
keep shadow under object.
the owner/creator of this object should
call this method each time they move the
object
*/
... | // Path: core/src/main/java/org/flightclub/compat/Color.java
// public class Color {
// private final java.awt.Color c;
//
//
// /**
// * The color white. In the default sRGB space.
// */
// public final static Color WHITE = new Color(255, 255, 255);
//
// /**
// * The color light gra... | public void drawShadow(Graphics g) {
|
Turbo87/flight-club | core/src/main/java/org/flightclub/PolyLine.java | // Path: core/src/main/java/org/flightclub/compat/Color.java
// public class Color {
// private final java.awt.Color c;
//
//
// /**
// * The color white. In the default sRGB space.
// */
// public final static Color WHITE = new Color(255, 255, 255);
//
// /**
// * The color light gra... | import org.flightclub.compat.Color;
import org.flightclub.compat.Graphics; | /**
This code is covered by the GNU General Public License
detailed at http://www.gnu.org/copyleft/gpl.html
Flight Club docs located at http://www.danb.dircon.co.uk/hg/hg.htm
Dan Burton , Nov 2001
*/
package org.flightclub;
public class PolyLine {
final int numPoints;
final int[] points;
int nextIn... | // Path: core/src/main/java/org/flightclub/compat/Color.java
// public class Color {
// private final java.awt.Color c;
//
//
// /**
// * The color white. In the default sRGB space.
// */
// public final static Color WHITE = new Color(255, 255, 255);
//
// /**
// * The color light gra... | Color c; |
Turbo87/flight-club | core/src/main/java/org/flightclub/PolyLine.java | // Path: core/src/main/java/org/flightclub/compat/Color.java
// public class Color {
// private final java.awt.Color c;
//
//
// /**
// * The color white. In the default sRGB space.
// */
// public final static Color WHITE = new Color(255, 255, 255);
//
// /**
// * The color light gra... | import org.flightclub.compat.Color;
import org.flightclub.compat.Graphics; |
void setNormal() {
if (numPoints < 3)
return;
Vector3d[] ps = new Vector3d[3];
for (int i = 0; i < 3; i++)
ps[i] = object3d.points.elementAt(points[i]);
Vector3d e1 = ps[0].minus(ps[1]);
Vector3d e2 = ps[2].minus(ps[1]);
normal = new Vector... | // Path: core/src/main/java/org/flightclub/compat/Color.java
// public class Color {
// private final java.awt.Color c;
//
//
// /**
// * The color white. In the default sRGB space.
// */
// public final static Color WHITE = new Color(255, 255, 255);
//
// /**
// * The color light gra... | public void draw(Graphics g) { |
Turbo87/flight-club | core/src/main/java/org/flightclub/Cloud.java | // Path: core/src/main/java/org/flightclub/compat/Color.java
// public class Color {
// private final java.awt.Color c;
//
//
// /**
// * The color white. In the default sRGB space.
// */
// public final static Color WHITE = new Color(255, 255, 255);
//
// /**
// * The color light gra... | import org.flightclub.compat.Color;
import java.util.Vector;
| /**
This code is covered by the GNU General Public License
detailed at http://www.gnu.org/copyleft/gpl.html
Flight Club docs located at http://www.danb.dircon.co.uk/hg/hg.htm
Dan Burton , Nov 2001
*/
package org.flightclub;
public class Cloud implements CameraSubject, Clock.Observer {
final X... | // Path: core/src/main/java/org/flightclub/compat/Color.java
// public class Color {
// private final java.awt.Color c;
//
//
// /**
// * The color white. In the default sRGB space.
// */
// public final static Color WHITE = new Color(255, 255, 255);
//
// /**
// * The color light gra... | final Color color;
|
Turbo87/flight-club | core/src/main/java/org/flightclub/Tail.java | // Path: core/src/main/java/org/flightclub/compat/Color.java
// public class Color {
// private final java.awt.Color c;
//
//
// /**
// * The color white. In the default sRGB space.
// */
// public final static Color WHITE = new Color(255, 255, 255);
//
// /**
// * The color light gra... | import org.flightclub.compat.Color;
import java.util.Vector;
| /**
This code is covered by the GNU General Public License
detailed at http://www.gnu.org/copyleft/gpl.html
Flight Club docs located at http://www.danb.dircon.co.uk/hg/hg.htm
Dan Burton , Nov 2001
*/
package org.flightclub;
/**
* a tail of length n may be attached to a flying dot
*/
public cl... | // Path: core/src/main/java/org/flightclub/compat/Color.java
// public class Color {
// private final java.awt.Color c;
//
//
// /**
// * The color white. In the default sRGB space.
// */
// public final static Color WHITE = new Color(255, 255, 255);
//
// /**
// * The color light gra... | final Color color;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.