Permalink
Browse files

Merge remote-tracking branch 'origin' into new-html-docs

  • Loading branch information...
LadyCailin committed Sep 29, 2017
2 parents 63ee648 + b7607a5 commit f935722c57554598fcc612594433a19451fc215a
Showing with 7,230 additions and 5,058 deletions.
  1. +14 −2 src/main/java/com/laytonsmith/PureUtilities/Common/ArrayUtils.java
  2. +71 −1 src/main/java/com/laytonsmith/PureUtilities/Web/RequestSettings.java
  3. +192 −3 src/main/java/com/laytonsmith/PureUtilities/Web/WebUtility.java
  4. +101 −97 src/main/java/com/laytonsmith/abstraction/StaticLayer.java
  5. +29 −1 src/main/java/com/laytonsmith/core/Main.java
  6. +11 −14 src/main/java/com/laytonsmith/core/MethodScriptCompiler.java
  7. +194 −163 src/main/java/com/laytonsmith/core/MethodScriptFileLocations.java
  8. +12 −4 src/main/java/com/laytonsmith/core/events/drivers/CmdlineEvents.java
  9. +2,508 −2,512 src/main/java/com/laytonsmith/core/functions/ArrayHandling.java
  10. +2 −2 src/main/java/com/laytonsmith/core/functions/BasicLogic.java
  11. +2 −1 src/main/java/com/laytonsmith/core/functions/Cmdline.java
  12. +1 −1 src/main/java/com/laytonsmith/core/functions/DataHandling.java
  13. +2,277 −2,190 src/main/java/com/laytonsmith/core/functions/Math.java
  14. +24 −0 src/main/java/com/laytonsmith/core/functions/Web.java
  15. +1 −1 src/main/java/com/laytonsmith/persistence/io/WebConnection.java
  16. +140 −23 src/main/java/com/laytonsmith/tools/Interpreter.java
  17. +94 −0 src/main/resources/docs/Annotations
  18. +64 −0 src/main/resources/docs/BasicBuiltinTypes
  19. +162 −0 src/main/resources/docs/Cross_Casting
  20. +198 −0 src/main/resources/docs/DesignFAQ
  21. +177 −0 src/main/resources/docs/Developer_Guide
  22. +156 −0 src/main/resources/docs/Enums_and_Masks
  23. +110 −0 src/main/resources/docs/Structs
  24. +619 −0 src/main/resources/docs/WebTemplating
  25. +18 −0 src/main/resources/functionDocs/http_request
  26. +53 −43 src/test/java/com/laytonsmith/core/functions/MathTest.java
@@ -129,6 +129,7 @@
* @param finish The ending node (inclusive).
* @return
*/
@SuppressWarnings("unchecked")
public static <T> T [] slice(T[] array, int start, int finish){
int size = Math.abs(start - finish) + 1;
Object newArray = Array.newInstance(array.getClass().getComponentType(), size);
@@ -365,6 +366,7 @@
* @param array The "boxed" array
* @return The "unboxed" array
*/
@SuppressWarnings("UnnecessaryUnboxing")
public static char[] unbox(Character[] array){
if(array == null){
return null;
@@ -384,6 +386,7 @@
* @param array The "boxed" array
* @return The "unboxed" array
*/
@SuppressWarnings("UnnecessaryUnboxing")
public static byte[] unbox(Byte[] array){
if(array == null){
return null;
@@ -403,6 +406,7 @@
* @param array The "boxed" array
* @return The "unboxed" array
*/
@SuppressWarnings("UnnecessaryUnboxing")
public static short[] unbox(Short[] array){
if(array == null){
return null;
@@ -422,6 +426,7 @@
* @param array The "boxed" array
* @return The "unboxed" array
*/
@SuppressWarnings("UnnecessaryUnboxing")
public static int[] unbox(Integer[] array){
if(array == null){
return null;
@@ -441,6 +446,7 @@
* @param array The "boxed" array
* @return The "unboxed" array
*/
@SuppressWarnings("UnnecessaryUnboxing")
public static long[] unbox(Long[] array){
if(array == null){
return null;
@@ -460,6 +466,7 @@
* @param array The "boxed" array
* @return The "unboxed" array
*/
@SuppressWarnings("UnnecessaryUnboxing")
public static float[] unbox(Float[] array){
if(array == null){
return null;
@@ -479,6 +486,7 @@
* @param array The "boxed" array
* @return The "unboxed" array
*/
@SuppressWarnings("UnnecessaryUnboxing")
public static double[] unbox(Double[] array){
if(array == null){
return null;
@@ -498,6 +506,7 @@
* @param array The "boxed" array
* @return The "unboxed" array
*/
@SuppressWarnings("UnnecessaryUnboxing")
public static boolean[] unbox(Boolean[] array){
if(array == null){
return null;
@@ -677,10 +686,11 @@
* @param list
* @return
*/
public static <T> T[] asArray(Class<T> clazz, List<?> list){
@SuppressWarnings("unchecked")
public static <T> T[] asArray(Class<T> clazz, List<T> list){
T[] obj = (T[]) Array.newInstance(clazz, list.size());
for(int i = 0; i < list.size(); i++){
obj[i] = (T)list.get(i);
obj[i] = list.get(i);
}
return obj;
}
@@ -695,6 +705,7 @@
* @param toClass
* @return
*/
@SuppressWarnings("unchecked")
public static <T> T cast(Object array, Class<T> toArrayClass){
if(!array.getClass().isArray()){
throw new ClassCastException();
@@ -709,6 +720,7 @@
return (T)obj;
}
@SuppressWarnings("UnnecessaryUnboxing")
private static void doSet(Object array, int index, Object o){
Class<?> componentType = array.getClass().getComponentType();
if(componentType.isPrimitive()){
@@ -4,6 +4,7 @@
import java.net.Proxy;
import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.logging.Logger;
@@ -24,9 +25,12 @@
private Proxy proxy = null;
private byte[] rawParameter;
private File downloadTo;
private boolean blocking = false;
private boolean disableCertChecking = false;
private boolean useDefaultTrustStore = true;
private LinkedHashMap<String, String> trustStore = new LinkedHashMap<>();
@SuppressWarnings("NonConstantLogger")
private Logger logger;
private boolean blocking;
/**
*
@@ -284,4 +288,70 @@ public boolean getBlocking() {
return this.blocking;
}
/**
* Sets whether or not cert checking is disabled. If this is true, NO certificate checking is done, and all
* certificates will be considered valid. If this is true, {@link #setUseDefaultTrustStore(boolean)} and
* {@link #setTrustStore(java.util.Map)} are ignored.
*
* @param check
* @return
*/
public RequestSettings setDisableCertChecking(boolean check) {
this.disableCertChecking = check;
return this;
}
/**
* Returns whether or not the trust store should be disabled. Default is false.
*
* @return
*/
public boolean getDisableCertChecking() {
return this.disableCertChecking;
}
/**
* Sets whether or not to use the default trust store. If false, then only certificates registered using
* {@link #setTrustStore(java.util.Map)} will be accepted. If this is false, and
* {@link #setTrustStore(java.util.Map)} is false, this effectively prevents any ssl connections.
*
* @param useDefaultTrustStore
* @return
*/
public RequestSettings setUseDefaultTrustStore(boolean useDefaultTrustStore) {
this.useDefaultTrustStore = useDefaultTrustStore;
return this;
}
/**
* Returns whether or not the default trust store should be used.
*
* @return
*/
public boolean getUseDefaultTrustStore() {
return this.useDefaultTrustStore;
}
/**
* Sets the trust store. Values should be in the form: "02 79 AB D6 97 19 A2 CB E8 79 11 B2 7F AF 8D": "SHA-256"
* where the key is the fingerprint, and the value is the encryption scheme. Note that the map is cloned, and the
* original map is not used.
*
* @param trustStore The trust store to use
* @return
*/
public RequestSettings setTrustStore(LinkedHashMap<String, String> trustStore) {
this.trustStore = new LinkedHashMap<>(trustStore);
return this;
}
/**
* Returns the trust store in use. Note that the map is cloned, and the original map is not used.
*
* @return
*/
public LinkedHashMap<String, String> getTrustStore() {
return new LinkedHashMap<>(trustStore);
}
}
Oops, something went wrong.

0 comments on commit f935722

Please sign in to comment.