From 758df9c183f9474e55ac63b4e39e75ea05bc9f00 Mon Sep 17 00:00:00 2001 From: ehlxr Date: Thu, 10 Dec 2020 11:05:29 +0800 Subject: [PATCH] add license --- src/main/java/io/github/ehlxr/CharToHex.java | 24 + .../java/io/github/ehlxr/ContentReplace.java | 67 +- .../java/io/github/ehlxr/ContentReplace2.java | 24 + src/main/java/io/github/ehlxr/DemoECDSA.java | 24 + src/main/java/io/github/ehlxr/DidSdkTest.java | 24 + src/main/java/io/github/ehlxr/DumpStack.java | 24 + .../io/github/ehlxr/FindRequestMapping.java | 24 + src/main/java/io/github/ehlxr/LambdaTest.java | 24 + src/main/java/io/github/ehlxr/MD2Json.java | 24 + src/main/java/io/github/ehlxr/Modify.java | 24 + .../github/ehlxr/PrintMatrixClockWisely.java | 24 + .../io/github/ehlxr/ReferenceCountingGC.java | 24 + src/main/java/io/github/ehlxr/Rename.java | 24 + .../io/github/ehlxr/SnowflakeIdWorker.java | 24 + .../java/io/github/ehlxr/VarArgsTest.java | 24 + .../io/github/ehlxr/activemq/JMSConsumer.java | 24 + .../io/github/ehlxr/activemq/JMSProducer.java | 24 + .../ehlxr/annotation/PkgAnnotation.java | 26 +- .../ehlxr/annotation/TestPkgAnnotation.java | 44 +- .../github/ehlxr/annotation/package-info.java | 34 +- .../java/io/github/ehlxr/cache/Cache.java | 42 +- .../io/github/ehlxr/cache/CacheManager.java | 43 +- .../io/github/ehlxr/cache/SimpleCache.java | 24 + .../github/ehlxr/cache/SimpleCacheUtil.java | 24 + src/main/java/io/github/ehlxr/cache/Test.java | 36 +- .../java/io/github/ehlxr/cache/TestCache.java | 24 + .../io/github/ehlxr/cache/TestFutureCahe.java | 24 + src/main/java/io/github/ehlxr/dfd.java | 25 + .../java/io/github/ehlxr/hashing/Cluster.java | 24 + .../java/io/github/ehlxr/hashing/Entry.java | 24 + .../java/io/github/ehlxr/hashing/Main.java | 24 + .../java/io/github/ehlxr/hashing/Server.java | 24 + .../ehlxr/hashing/consistent/Cluster.java | 24 + .../ehlxr/hashing/consistent/Entry.java | 24 + .../github/ehlxr/hashing/consistent/Main.java | 24 + .../ehlxr/hashing/consistent/Server.java | 24 + .../io/github/ehlxr/hbase/HBaseUtils.java | 24 + src/main/java/io/github/ehlxr/hbase/Main.java | 24 + .../io/github/ehlxr/leetcode/Solution4.java | 24 + .../io/github/ehlxr/leetcode/Solution5.java | 24 + .../java/io/github/ehlxr/pack/FileUtil.java | 24 + .../java/io/github/ehlxr/pack/PackView.java | 24 + .../ehlxr/powermock/ClassDependency.java | 24 + .../ehlxr/powermock/ClassUnderTest.java | 24 + .../ehlxr/powermock/TestClassUnderTest.java | 24 + src/main/java/io/github/ehlxr/proxy/Bird.java | 24 + .../java/io/github/ehlxr/proxy/Flyable.java | 24 + src/main/java/io/github/ehlxr/proxy/Main.java | 24 + .../ehlxr/proxy/MyInvocationHandler.java | 24 + .../github/ehlxr/rabbitmq/ConnectionUtil.java | 24 + .../ehlxr/rabbitmq/routing/Receiver1.java | 24 + .../ehlxr/rabbitmq/routing/Receiver2.java | 24 + .../github/ehlxr/rabbitmq/routing/Sender.java | 24 + .../ehlxr/rabbitmq/simple/Receiver.java | 24 + .../github/ehlxr/rabbitmq/simple/Sender.java | 24 + .../ehlxr/rabbitmq/topic/Receiver1.java | 24 + .../ehlxr/rabbitmq/topic/Receiver2.java | 24 + .../github/ehlxr/rabbitmq/topic/Sender.java | 24 + .../ehlxr/rabbitmq/worker/Receiver1.java | 24 + .../ehlxr/rabbitmq/worker/Receiver2.java | 24 + .../github/ehlxr/rabbitmq/worker/Sender.java | 24 + src/main/java/io/github/ehlxr/rate/Main.java | 24 + .../io/github/ehlxr/rate/RateBarrier.java | 24 + .../io/github/ehlxr/reactive/HelloRxJava.java | 52 +- .../github/ehlxr/reactive/SchedulerTest.java | 24 + .../io/github/ehlxr/reactive/TestFuture.java | 24 + .../io/github/ehlxr/reactive/TestLambda.java | 24 + .../java/io/github/ehlxr/reactive/TestRx.java | 24 + .../io/github/ehlxr/reactive/TestRx01.java | 24 + .../ehlxr/reactive/TimeConsumingService.java | 24 + .../io/github/ehlxr/readlogs/IReadLogs.java | 26 +- .../github/ehlxr/redis/JRedisPoolConfig.java | 36 +- .../java/io/github/ehlxr/redis/JedisUtil.java | 718 +++++++++--------- .../io/github/ehlxr/redis/SerializeUtil.java | 102 ++- .../java/io/github/ehlxr/sftp/SFTPUtil.java | 24 + .../github/ehlxr/shiro/LoginLogoutTest.java | 64 +- .../java/io/github/ehlxr/sort/BubbleSort.java | 24 + .../java/io/github/ehlxr/sort/HeapSort.java | 24 + .../java/io/github/ehlxr/sort/InsertSort.java | 24 + .../java/io/github/ehlxr/sort/MergeSort.java | 24 + .../java/io/github/ehlxr/sort/QuickSort.java | 24 + .../java/io/github/ehlxr/sort/SelectSort.java | 24 + .../java/io/github/ehlxr/sort/ShellSort.java | 24 + .../controller/ActivemqController.java | 112 +-- .../mq/consumer/queue/QueueReceiver1.java | 24 + .../mq/consumer/queue/QueueReceiver2.java | 24 + .../mq/consumer/topic/TopicReceiver1.java | 24 + .../mq/consumer/topic/TopicReceiver2.java | 26 +- .../mq/producer/queue/QueueSender.java | 60 +- .../mq/producer/topic/TopicSender.java | 24 + .../java/io/github/ehlxr/test/DirList.java | 24 + .../io/github/ehlxr/test/ExecBaics50Log.java | 24 + .../io/github/ehlxr/test/IChargeCounter.java | 24 + src/main/java/io/github/ehlxr/test/Main.java | 24 + .../ehlxr/test/OperateKPIBudgetRedisData.java | 154 ++-- .../github/ehlxr/test/StatisByHourModel.java | 24 + src/main/java/io/github/ehlxr/test/Test.java | 24 + .../java/io/github/ehlxr/test/TestAudiQ2.java | 24 + .../io/github/ehlxr/test/TestCalendar.java | 24 + .../java/io/github/ehlxr/test/TestCode.java | 24 + .../github/ehlxr/test/TestCountDownLatch.java | 86 ++- .../io/github/ehlxr/test/TestCounter.java | 24 + .../io/github/ehlxr/test/TestDecodeHex.java | 24 + .../io/github/ehlxr/test/TestException.java | 24 + .../java/io/github/ehlxr/test/TestFile.java | 24 + .../io/github/ehlxr/test/TestGeoHash.java | 24 + .../java/io/github/ehlxr/test/TestJdbc.java | 24 + .../io/github/ehlxr/test/TestJdbc143.java | 24 + .../java/io/github/ehlxr/test/TestJdbc26.java | 24 + .../io/github/ehlxr/test/TestReadFile.java | 24 + .../io/github/ehlxr/test/TestReference.java | 24 + .../io/github/ehlxr/test/TestSyncLogData.java | 24 + .../java/io/github/ehlxr/test/TestThread.java | 24 + .../ehlxr/testminisite/TestMinisite.java | 70 +- .../github/ehlxr/testopen/SignatureUtil.java | 38 +- .../github/ehlxr/testopen/TestOpenPuton.java | 514 +++++++------ .../thread/TestSingleThreadExecutor.java | 24 + .../ehlxr/thread/ThreadPoolExecutorTest.java | 24 + .../java/io/github/ehlxr/token/Base62.java | 24 + .../github/ehlxr/token/TokenCommonUtil.java | 24 + .../github/ehlxr/token/TokenServerUtil.java | 26 +- .../ehlxr/token/TokenVersionConfig.java | 24 + .../github/ehlxr/token/TokenVersionEnum.java | 24 + .../ehlxr/token/TokenVersionFactory.java | 24 + .../java/io/github/ehlxr/utils/AESTool.java | 36 +- .../java/io/github/ehlxr/utils/Base64.java | 163 ++-- .../java/io/github/ehlxr/utils/CCRDFile.java | 24 + src/main/java/io/github/ehlxr/utils/Code.java | 24 + .../io/github/ehlxr/utils/CommonUtils.java | 30 +- .../java/io/github/ehlxr/utils/DateUtil.java | 24 + .../java/io/github/ehlxr/utils/ExecShell.java | 25 + .../java/io/github/ehlxr/utils/FormType.java | 24 + .../java/io/github/ehlxr/utils/GeoHash.java | 24 + .../io/github/ehlxr/utils/HttpClientUtil.java | 24 + .../github/ehlxr/utils/HttpContentType.java | 24 + .../java/io/github/ehlxr/utils/HttpUtil.java | 24 + .../java/io/github/ehlxr/utils/JsonUtils.java | 24 + src/main/java/io/github/ehlxr/utils/MD5.java | 76 +- .../java/io/github/ehlxr/utils/MyUrlDemo.java | 24 + src/main/java/io/github/ehlxr/utils/Pair.java | 24 + .../java/io/github/ehlxr/utils/Result.java | 24 + .../io/github/ehlxr/utils/StringAlign.java | 24 + .../github/ehlxr/utils/SystemConstants.java | 40 +- src/main/java/io/github/ehlxr/utils/Try.java | 24 + .../ehlxr/viplugin/CheckLicenseFile.java | 24 + .../github/ehlxr/viplugin/CreateLicense.java | 24 + 146 files changed, 4489 insertions(+), 1090 deletions(-) diff --git a/src/main/java/io/github/ehlxr/CharToHex.java b/src/main/java/io/github/ehlxr/CharToHex.java index 9d7ebfa..10d0353 100644 --- a/src/main/java/io/github/ehlxr/CharToHex.java +++ b/src/main/java/io/github/ehlxr/CharToHex.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr; /** diff --git a/src/main/java/io/github/ehlxr/ContentReplace.java b/src/main/java/io/github/ehlxr/ContentReplace.java index db7e245..1501728 100644 --- a/src/main/java/io/github/ehlxr/ContentReplace.java +++ b/src/main/java/io/github/ehlxr/ContentReplace.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr; import java.io.*; @@ -12,13 +36,10 @@ public class ContentReplace { private static int unDeal = 0; public static void main(String[] args) throws IOException { - // File dir = new File("/Users/ehlxr/WorkSpaces/enncloud/Ceres"); - // deal(dir); - // System.out.println("总文件数:" + total); - // System.out.println("未处理文件数:" + unDeal); - - File license = new File("LICENSE"); - + File dir = new File("/Users/ehlxr/WorkSpaces/Budd"); + deal(dir); + System.out.println("总文件数:" + total); + System.out.println("未处理文件数:" + unDeal); } private static void deal(File file) throws IOException { @@ -54,21 +75,33 @@ public class ContentReplace { } raf.seek(0L); String tmpl = "/*\n" + - " * Copyright 2017-2017 the original author or authors.\n" + + " * The MIT License (MIT)\n" + " *\n" + - " * Licensed under the Apache License, Version 2.0 (the \"License\");\n" + - " * you may not use this file except in compliance with the License.\n" + - " * You may obtain a copy of the License at\n" + + " * Copyright © 2020 xrv \n" + " *\n" + - " * http://www.apache.org/licenses/LICENSE-2.0\n" + + " * Permission is hereby granted, free of charge, to any person obtaining a copy\n" + + " * of this software and associated documentation files (the \"Software\"), to deal\n" + + " * in the Software without restriction, including without limitation the rights\n" + + " * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n" + + " * copies of the Software, and to permit persons to whom the Software is\n" + + " * furnished to do so, subject to the following conditions:\n" + " *\n" + - " * Unless required by applicable law or agreed to in writing, software\n" + - " * distributed under the License is distributed on an \"AS IS\" BASIS,\n" + - " * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n" + - " * See the License for the specific language governing permissions and\n" + - " * limitations under the License.\n" + + " * The above copyright notice and this permission notice shall be included in\n" + + " * all copies or substantial portions of the Software.\n" + + " *\n" + + " * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n" + + " * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n" + + " * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n" + + " * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n" + + " * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n" + + " * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n" + + " * THE SOFTWARE.\n" + " */\n\n"; raf.write(tmpl.getBytes()); + // raf.write("/*\n".getBytes()); + // raf.write(Files.readAllBytes(Paths.get(System.getProperty("user.dir") + File.separator + "LICENSE"))); + // raf.write("\n*/\n\n".getBytes()); + // 追加临时文件内容 while ((hasRead = tmpIn.read(buf)) > 0) { raf.write(buf, 0, hasRead); diff --git a/src/main/java/io/github/ehlxr/ContentReplace2.java b/src/main/java/io/github/ehlxr/ContentReplace2.java index 3a16358..d3cd21e 100644 --- a/src/main/java/io/github/ehlxr/ContentReplace2.java +++ b/src/main/java/io/github/ehlxr/ContentReplace2.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr; import java.io.*; diff --git a/src/main/java/io/github/ehlxr/DemoECDSA.java b/src/main/java/io/github/ehlxr/DemoECDSA.java index 4be8b79..41b795d 100644 --- a/src/main/java/io/github/ehlxr/DemoECDSA.java +++ b/src/main/java/io/github/ehlxr/DemoECDSA.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr; import org.apache.commons.codec.binary.Base64; diff --git a/src/main/java/io/github/ehlxr/DidSdkTest.java b/src/main/java/io/github/ehlxr/DidSdkTest.java index 95581e7..57212cd 100644 --- a/src/main/java/io/github/ehlxr/DidSdkTest.java +++ b/src/main/java/io/github/ehlxr/DidSdkTest.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr; // // import cn.ceres.did.client.SdkClient; diff --git a/src/main/java/io/github/ehlxr/DumpStack.java b/src/main/java/io/github/ehlxr/DumpStack.java index 45c8fc8..e8db3b1 100644 --- a/src/main/java/io/github/ehlxr/DumpStack.java +++ b/src/main/java/io/github/ehlxr/DumpStack.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr; import java.io.*; diff --git a/src/main/java/io/github/ehlxr/FindRequestMapping.java b/src/main/java/io/github/ehlxr/FindRequestMapping.java index 0257244..4f25f22 100644 --- a/src/main/java/io/github/ehlxr/FindRequestMapping.java +++ b/src/main/java/io/github/ehlxr/FindRequestMapping.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr; import java.io.*; diff --git a/src/main/java/io/github/ehlxr/LambdaTest.java b/src/main/java/io/github/ehlxr/LambdaTest.java index ed1f3a1..6e7da06 100644 --- a/src/main/java/io/github/ehlxr/LambdaTest.java +++ b/src/main/java/io/github/ehlxr/LambdaTest.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr; import java.util.Arrays; diff --git a/src/main/java/io/github/ehlxr/MD2Json.java b/src/main/java/io/github/ehlxr/MD2Json.java index 0a18b61..ee9dd65 100644 --- a/src/main/java/io/github/ehlxr/MD2Json.java +++ b/src/main/java/io/github/ehlxr/MD2Json.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr; import net.sf.json.JSONObject; diff --git a/src/main/java/io/github/ehlxr/Modify.java b/src/main/java/io/github/ehlxr/Modify.java index 945bd03..2d99f19 100644 --- a/src/main/java/io/github/ehlxr/Modify.java +++ b/src/main/java/io/github/ehlxr/Modify.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr; import java.io.*; diff --git a/src/main/java/io/github/ehlxr/PrintMatrixClockWisely.java b/src/main/java/io/github/ehlxr/PrintMatrixClockWisely.java index 07a3420..b297936 100644 --- a/src/main/java/io/github/ehlxr/PrintMatrixClockWisely.java +++ b/src/main/java/io/github/ehlxr/PrintMatrixClockWisely.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr; /** diff --git a/src/main/java/io/github/ehlxr/ReferenceCountingGC.java b/src/main/java/io/github/ehlxr/ReferenceCountingGC.java index 0e53b41..2c6a45a 100644 --- a/src/main/java/io/github/ehlxr/ReferenceCountingGC.java +++ b/src/main/java/io/github/ehlxr/ReferenceCountingGC.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr; /** diff --git a/src/main/java/io/github/ehlxr/Rename.java b/src/main/java/io/github/ehlxr/Rename.java index 4da0a27..5a48e14 100644 --- a/src/main/java/io/github/ehlxr/Rename.java +++ b/src/main/java/io/github/ehlxr/Rename.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr; import java.io.*; diff --git a/src/main/java/io/github/ehlxr/SnowflakeIdWorker.java b/src/main/java/io/github/ehlxr/SnowflakeIdWorker.java index 8201fcb..1a42c6c 100644 --- a/src/main/java/io/github/ehlxr/SnowflakeIdWorker.java +++ b/src/main/java/io/github/ehlxr/SnowflakeIdWorker.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr; diff --git a/src/main/java/io/github/ehlxr/VarArgsTest.java b/src/main/java/io/github/ehlxr/VarArgsTest.java index 43d98cd..5840e53 100644 --- a/src/main/java/io/github/ehlxr/VarArgsTest.java +++ b/src/main/java/io/github/ehlxr/VarArgsTest.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr; /** diff --git a/src/main/java/io/github/ehlxr/activemq/JMSConsumer.java b/src/main/java/io/github/ehlxr/activemq/JMSConsumer.java index 32300a4..48e7570 100644 --- a/src/main/java/io/github/ehlxr/activemq/JMSConsumer.java +++ b/src/main/java/io/github/ehlxr/activemq/JMSConsumer.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.activemq; import org.apache.activemq.ActiveMQConnection; diff --git a/src/main/java/io/github/ehlxr/activemq/JMSProducer.java b/src/main/java/io/github/ehlxr/activemq/JMSProducer.java index fb85979..ce12bce 100644 --- a/src/main/java/io/github/ehlxr/activemq/JMSProducer.java +++ b/src/main/java/io/github/ehlxr/activemq/JMSProducer.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.activemq; import org.apache.activemq.ActiveMQConnection; diff --git a/src/main/java/io/github/ehlxr/annotation/PkgAnnotation.java b/src/main/java/io/github/ehlxr/annotation/PkgAnnotation.java index 001b904..f1c1c96 100644 --- a/src/main/java/io/github/ehlxr/annotation/PkgAnnotation.java +++ b/src/main/java/io/github/ehlxr/annotation/PkgAnnotation.java @@ -1,5 +1,29 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + /** - * + * */ package io.github.ehlxr.annotation; diff --git a/src/main/java/io/github/ehlxr/annotation/TestPkgAnnotation.java b/src/main/java/io/github/ehlxr/annotation/TestPkgAnnotation.java index 638708b..be89bb1 100644 --- a/src/main/java/io/github/ehlxr/annotation/TestPkgAnnotation.java +++ b/src/main/java/io/github/ehlxr/annotation/TestPkgAnnotation.java @@ -1,18 +1,42 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.annotation; import java.lang.annotation.Annotation; public class TestPkgAnnotation { - public static void main(String[] args) { - Package pkg = Package.getPackage("osc.git.eh3.annotation"); - Annotation[] annotations = pkg.getAnnotations(); - for (Annotation annotation : annotations) { - System.out.println(annotation); - } + public static void main(String[] args) { + Package pkg = Package.getPackage("osc.git.eh3.annotation"); + Annotation[] annotations = pkg.getAnnotations(); + for (Annotation annotation : annotations) { + System.out.println(annotation); + } - // ===========================友好类和包内访问常量============== - new MyPackageMethod().myPackageMethod(); - System.out.println(MyPackageConst.PACKAGE_STRING); - } + // ===========================友好类和包内访问常量============== + new MyPackageMethod().myPackageMethod(); + System.out.println(MyPackageConst.PACKAGE_STRING); + } } diff --git a/src/main/java/io/github/ehlxr/annotation/package-info.java b/src/main/java/io/github/ehlxr/annotation/package-info.java index f8d8242..ad5defd 100644 --- a/src/main/java/io/github/ehlxr/annotation/package-info.java +++ b/src/main/java/io/github/ehlxr/annotation/package-info.java @@ -1,5 +1,29 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + /** - * + * @author ehlxr */ /** * @author ehlxr @@ -12,14 +36,14 @@ package io.github.ehlxr.annotation; * 包内方法 */ class MyPackageMethod { - public void myPackageMethod() { - System.out.println("MyPackageMethod..."); - } + public void myPackageMethod() { + System.out.println("MyPackageMethod..."); + } } /** * 包内常量 */ class MyPackageConst { - static final java.lang.String PACKAGE_STRING = "myPackageConst"; + static final java.lang.String PACKAGE_STRING = "myPackageConst"; } \ No newline at end of file diff --git a/src/main/java/io/github/ehlxr/cache/Cache.java b/src/main/java/io/github/ehlxr/cache/Cache.java index 32e1847..72516bb 100644 --- a/src/main/java/io/github/ehlxr/cache/Cache.java +++ b/src/main/java/io/github/ehlxr/cache/Cache.java @@ -1,23 +1,29 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.cache; -/** - *

- * Title: - *

- * - *

- * Description: 缓存DTO - *

- * - *

- * Copyright: Copyright (c) 2008 - *

- * - *

- * Company: - *

- * - */ public class Cache { private String key;// 缓存ID private Object value;// 缓存数据 diff --git a/src/main/java/io/github/ehlxr/cache/CacheManager.java b/src/main/java/io/github/ehlxr/cache/CacheManager.java index 0a87177..1410d5f 100644 --- a/src/main/java/io/github/ehlxr/cache/CacheManager.java +++ b/src/main/java/io/github/ehlxr/cache/CacheManager.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.cache; import java.util.ArrayList; @@ -5,25 +29,6 @@ import java.util.HashMap; import java.util.Iterator; import java.util.Map.Entry; -/** - *

- * Title: - *

- * - *

- * Description: 管理缓存 - *

- * Deep blue 2008-11-28 think - * 可扩展的功能:当chche到内存溢出时必须清除掉最早期的一些缓存对象,这就要求对每个缓存对象保存创建时间 - *

- * Copyright: Copyright (c) 2008 - *

- * - *

- * Company: - *

- * - */ public class CacheManager { private static final HashMap cacheMap = new HashMap(); diff --git a/src/main/java/io/github/ehlxr/cache/SimpleCache.java b/src/main/java/io/github/ehlxr/cache/SimpleCache.java index 91ccda3..8bb677b 100644 --- a/src/main/java/io/github/ehlxr/cache/SimpleCache.java +++ b/src/main/java/io/github/ehlxr/cache/SimpleCache.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.cache; import java.util.Map; diff --git a/src/main/java/io/github/ehlxr/cache/SimpleCacheUtil.java b/src/main/java/io/github/ehlxr/cache/SimpleCacheUtil.java index 8fda9cc..eff235d 100644 --- a/src/main/java/io/github/ehlxr/cache/SimpleCacheUtil.java +++ b/src/main/java/io/github/ehlxr/cache/SimpleCacheUtil.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.cache; import java.util.Collections; diff --git a/src/main/java/io/github/ehlxr/cache/Test.java b/src/main/java/io/github/ehlxr/cache/Test.java index 4e705ba..88cfa78 100644 --- a/src/main/java/io/github/ehlxr/cache/Test.java +++ b/src/main/java/io/github/ehlxr/cache/Test.java @@ -1,11 +1,35 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.cache; public class Test { - public static void main(String[] args) { - SimpleCacheUtil cache2 = new SimpleCacheUtil<>(5); - cache2.put("123", "fdfd"); - - System.out.println(cache2.get("123")); - } + public static void main(String[] args) { + SimpleCacheUtil cache2 = new SimpleCacheUtil<>(5); + cache2.put("123", "fdfd"); + + System.out.println(cache2.get("123")); + } } diff --git a/src/main/java/io/github/ehlxr/cache/TestCache.java b/src/main/java/io/github/ehlxr/cache/TestCache.java index b0ff581..95c5dfc 100644 --- a/src/main/java/io/github/ehlxr/cache/TestCache.java +++ b/src/main/java/io/github/ehlxr/cache/TestCache.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.cache; import java.util.ArrayList; diff --git a/src/main/java/io/github/ehlxr/cache/TestFutureCahe.java b/src/main/java/io/github/ehlxr/cache/TestFutureCahe.java index 729e740..5e4be9c 100644 --- a/src/main/java/io/github/ehlxr/cache/TestFutureCahe.java +++ b/src/main/java/io/github/ehlxr/cache/TestFutureCahe.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.cache; import java.util.concurrent.Callable; diff --git a/src/main/java/io/github/ehlxr/dfd.java b/src/main/java/io/github/ehlxr/dfd.java index b4775d8..f2cb7c2 100644 --- a/src/main/java/io/github/ehlxr/dfd.java +++ b/src/main/java/io/github/ehlxr/dfd.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr; /** @@ -10,6 +34,7 @@ public class dfd { // map.put("d",1); // System.out.println(map); } + public void printCircle(int[][] matrix, int startX, int startY, int endX, int endY) { // only one column left if (startY == endY) { diff --git a/src/main/java/io/github/ehlxr/hashing/Cluster.java b/src/main/java/io/github/ehlxr/hashing/Cluster.java index 984e00f..9849cdc 100644 --- a/src/main/java/io/github/ehlxr/hashing/Cluster.java +++ b/src/main/java/io/github/ehlxr/hashing/Cluster.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.hashing; public class Cluster { diff --git a/src/main/java/io/github/ehlxr/hashing/Entry.java b/src/main/java/io/github/ehlxr/hashing/Entry.java index 74947c7..e9a67bc 100644 --- a/src/main/java/io/github/ehlxr/hashing/Entry.java +++ b/src/main/java/io/github/ehlxr/hashing/Entry.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.hashing; public class Entry { diff --git a/src/main/java/io/github/ehlxr/hashing/Main.java b/src/main/java/io/github/ehlxr/hashing/Main.java index c0663d9..bf2d3a0 100644 --- a/src/main/java/io/github/ehlxr/hashing/Main.java +++ b/src/main/java/io/github/ehlxr/hashing/Main.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.hashing; public class Main { diff --git a/src/main/java/io/github/ehlxr/hashing/Server.java b/src/main/java/io/github/ehlxr/hashing/Server.java index 509e5d1..a962a4b 100644 --- a/src/main/java/io/github/ehlxr/hashing/Server.java +++ b/src/main/java/io/github/ehlxr/hashing/Server.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.hashing; import java.util.HashMap; diff --git a/src/main/java/io/github/ehlxr/hashing/consistent/Cluster.java b/src/main/java/io/github/ehlxr/hashing/consistent/Cluster.java index 982f265..59a2f7c 100644 --- a/src/main/java/io/github/ehlxr/hashing/consistent/Cluster.java +++ b/src/main/java/io/github/ehlxr/hashing/consistent/Cluster.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.hashing.consistent; import java.util.SortedMap; diff --git a/src/main/java/io/github/ehlxr/hashing/consistent/Entry.java b/src/main/java/io/github/ehlxr/hashing/consistent/Entry.java index dae298f..6bafb27 100644 --- a/src/main/java/io/github/ehlxr/hashing/consistent/Entry.java +++ b/src/main/java/io/github/ehlxr/hashing/consistent/Entry.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.hashing.consistent; public class Entry { diff --git a/src/main/java/io/github/ehlxr/hashing/consistent/Main.java b/src/main/java/io/github/ehlxr/hashing/consistent/Main.java index 708d6c8..0ae1141 100644 --- a/src/main/java/io/github/ehlxr/hashing/consistent/Main.java +++ b/src/main/java/io/github/ehlxr/hashing/consistent/Main.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.hashing.consistent; public class Main { diff --git a/src/main/java/io/github/ehlxr/hashing/consistent/Server.java b/src/main/java/io/github/ehlxr/hashing/consistent/Server.java index b8efe8f..85bd436 100644 --- a/src/main/java/io/github/ehlxr/hashing/consistent/Server.java +++ b/src/main/java/io/github/ehlxr/hashing/consistent/Server.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.hashing.consistent; import java.util.HashMap; diff --git a/src/main/java/io/github/ehlxr/hbase/HBaseUtils.java b/src/main/java/io/github/ehlxr/hbase/HBaseUtils.java index 9648f54..3f42e7a 100644 --- a/src/main/java/io/github/ehlxr/hbase/HBaseUtils.java +++ b/src/main/java/io/github/ehlxr/hbase/HBaseUtils.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.hbase; import io.github.ehlxr.utils.Pair; diff --git a/src/main/java/io/github/ehlxr/hbase/Main.java b/src/main/java/io/github/ehlxr/hbase/Main.java index 0731b8e..40e6a5c 100644 --- a/src/main/java/io/github/ehlxr/hbase/Main.java +++ b/src/main/java/io/github/ehlxr/hbase/Main.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.hbase; import io.github.ehlxr.utils.Pair; diff --git a/src/main/java/io/github/ehlxr/leetcode/Solution4.java b/src/main/java/io/github/ehlxr/leetcode/Solution4.java index afd225f..cf8c190 100644 --- a/src/main/java/io/github/ehlxr/leetcode/Solution4.java +++ b/src/main/java/io/github/ehlxr/leetcode/Solution4.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.leetcode; /** diff --git a/src/main/java/io/github/ehlxr/leetcode/Solution5.java b/src/main/java/io/github/ehlxr/leetcode/Solution5.java index a15eeae..50192ce 100644 --- a/src/main/java/io/github/ehlxr/leetcode/Solution5.java +++ b/src/main/java/io/github/ehlxr/leetcode/Solution5.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.leetcode; import java.util.Arrays; diff --git a/src/main/java/io/github/ehlxr/pack/FileUtil.java b/src/main/java/io/github/ehlxr/pack/FileUtil.java index c891f1c..27e6419 100644 --- a/src/main/java/io/github/ehlxr/pack/FileUtil.java +++ b/src/main/java/io/github/ehlxr/pack/FileUtil.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.pack; import javax.swing.*; diff --git a/src/main/java/io/github/ehlxr/pack/PackView.java b/src/main/java/io/github/ehlxr/pack/PackView.java index d1f2907..700f13b 100644 --- a/src/main/java/io/github/ehlxr/pack/PackView.java +++ b/src/main/java/io/github/ehlxr/pack/PackView.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.pack; import javax.swing.*; diff --git a/src/main/java/io/github/ehlxr/powermock/ClassDependency.java b/src/main/java/io/github/ehlxr/powermock/ClassDependency.java index 38afc2f..6d46643 100644 --- a/src/main/java/io/github/ehlxr/powermock/ClassDependency.java +++ b/src/main/java/io/github/ehlxr/powermock/ClassDependency.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.powermock; /** diff --git a/src/main/java/io/github/ehlxr/powermock/ClassUnderTest.java b/src/main/java/io/github/ehlxr/powermock/ClassUnderTest.java index 43398f8..e791c6a 100644 --- a/src/main/java/io/github/ehlxr/powermock/ClassUnderTest.java +++ b/src/main/java/io/github/ehlxr/powermock/ClassUnderTest.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.powermock; /** diff --git a/src/main/java/io/github/ehlxr/powermock/TestClassUnderTest.java b/src/main/java/io/github/ehlxr/powermock/TestClassUnderTest.java index 36ff8da..b934cc0 100644 --- a/src/main/java/io/github/ehlxr/powermock/TestClassUnderTest.java +++ b/src/main/java/io/github/ehlxr/powermock/TestClassUnderTest.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.powermock; import org.junit.Assert; diff --git a/src/main/java/io/github/ehlxr/proxy/Bird.java b/src/main/java/io/github/ehlxr/proxy/Bird.java index 99efaad..6c1a29b 100644 --- a/src/main/java/io/github/ehlxr/proxy/Bird.java +++ b/src/main/java/io/github/ehlxr/proxy/Bird.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.proxy; import java.util.Random; diff --git a/src/main/java/io/github/ehlxr/proxy/Flyable.java b/src/main/java/io/github/ehlxr/proxy/Flyable.java index a1186df..4bf730f 100644 --- a/src/main/java/io/github/ehlxr/proxy/Flyable.java +++ b/src/main/java/io/github/ehlxr/proxy/Flyable.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.proxy; /** diff --git a/src/main/java/io/github/ehlxr/proxy/Main.java b/src/main/java/io/github/ehlxr/proxy/Main.java index be7ea5c..3a17294 100644 --- a/src/main/java/io/github/ehlxr/proxy/Main.java +++ b/src/main/java/io/github/ehlxr/proxy/Main.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.proxy; import java.lang.reflect.Proxy; diff --git a/src/main/java/io/github/ehlxr/proxy/MyInvocationHandler.java b/src/main/java/io/github/ehlxr/proxy/MyInvocationHandler.java index 0a29166..286ea05 100644 --- a/src/main/java/io/github/ehlxr/proxy/MyInvocationHandler.java +++ b/src/main/java/io/github/ehlxr/proxy/MyInvocationHandler.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.proxy; import java.lang.reflect.InvocationHandler; diff --git a/src/main/java/io/github/ehlxr/rabbitmq/ConnectionUtil.java b/src/main/java/io/github/ehlxr/rabbitmq/ConnectionUtil.java index 5db7513..302d5f8 100644 --- a/src/main/java/io/github/ehlxr/rabbitmq/ConnectionUtil.java +++ b/src/main/java/io/github/ehlxr/rabbitmq/ConnectionUtil.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.rabbitmq; import com.rabbitmq.client.Connection; diff --git a/src/main/java/io/github/ehlxr/rabbitmq/routing/Receiver1.java b/src/main/java/io/github/ehlxr/rabbitmq/routing/Receiver1.java index d792b9e..b17607c 100755 --- a/src/main/java/io/github/ehlxr/rabbitmq/routing/Receiver1.java +++ b/src/main/java/io/github/ehlxr/rabbitmq/routing/Receiver1.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.rabbitmq.routing; import com.rabbitmq.client.Channel; diff --git a/src/main/java/io/github/ehlxr/rabbitmq/routing/Receiver2.java b/src/main/java/io/github/ehlxr/rabbitmq/routing/Receiver2.java index ff37a07..acfd54f 100755 --- a/src/main/java/io/github/ehlxr/rabbitmq/routing/Receiver2.java +++ b/src/main/java/io/github/ehlxr/rabbitmq/routing/Receiver2.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.rabbitmq.routing; import com.rabbitmq.client.Channel; diff --git a/src/main/java/io/github/ehlxr/rabbitmq/routing/Sender.java b/src/main/java/io/github/ehlxr/rabbitmq/routing/Sender.java index 62a2d03..4862ff4 100755 --- a/src/main/java/io/github/ehlxr/rabbitmq/routing/Sender.java +++ b/src/main/java/io/github/ehlxr/rabbitmq/routing/Sender.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.rabbitmq.routing; import com.rabbitmq.client.Channel; diff --git a/src/main/java/io/github/ehlxr/rabbitmq/simple/Receiver.java b/src/main/java/io/github/ehlxr/rabbitmq/simple/Receiver.java index bd0afc8..e2e18c3 100644 --- a/src/main/java/io/github/ehlxr/rabbitmq/simple/Receiver.java +++ b/src/main/java/io/github/ehlxr/rabbitmq/simple/Receiver.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.rabbitmq.simple; import com.rabbitmq.client.Channel; diff --git a/src/main/java/io/github/ehlxr/rabbitmq/simple/Sender.java b/src/main/java/io/github/ehlxr/rabbitmq/simple/Sender.java index 2c38130..3d1aef3 100644 --- a/src/main/java/io/github/ehlxr/rabbitmq/simple/Sender.java +++ b/src/main/java/io/github/ehlxr/rabbitmq/simple/Sender.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.rabbitmq.simple; import com.rabbitmq.client.Channel; diff --git a/src/main/java/io/github/ehlxr/rabbitmq/topic/Receiver1.java b/src/main/java/io/github/ehlxr/rabbitmq/topic/Receiver1.java index 83e3ebb..b349a71 100755 --- a/src/main/java/io/github/ehlxr/rabbitmq/topic/Receiver1.java +++ b/src/main/java/io/github/ehlxr/rabbitmq/topic/Receiver1.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.rabbitmq.topic; import com.rabbitmq.client.Channel; diff --git a/src/main/java/io/github/ehlxr/rabbitmq/topic/Receiver2.java b/src/main/java/io/github/ehlxr/rabbitmq/topic/Receiver2.java index b96f093..920031c 100755 --- a/src/main/java/io/github/ehlxr/rabbitmq/topic/Receiver2.java +++ b/src/main/java/io/github/ehlxr/rabbitmq/topic/Receiver2.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.rabbitmq.topic; import com.rabbitmq.client.Channel; diff --git a/src/main/java/io/github/ehlxr/rabbitmq/topic/Sender.java b/src/main/java/io/github/ehlxr/rabbitmq/topic/Sender.java index 3ceb040..7160929 100755 --- a/src/main/java/io/github/ehlxr/rabbitmq/topic/Sender.java +++ b/src/main/java/io/github/ehlxr/rabbitmq/topic/Sender.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.rabbitmq.topic; import com.rabbitmq.client.Channel; diff --git a/src/main/java/io/github/ehlxr/rabbitmq/worker/Receiver1.java b/src/main/java/io/github/ehlxr/rabbitmq/worker/Receiver1.java index d124227..8a45d16 100644 --- a/src/main/java/io/github/ehlxr/rabbitmq/worker/Receiver1.java +++ b/src/main/java/io/github/ehlxr/rabbitmq/worker/Receiver1.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.rabbitmq.worker; import com.rabbitmq.client.Channel; diff --git a/src/main/java/io/github/ehlxr/rabbitmq/worker/Receiver2.java b/src/main/java/io/github/ehlxr/rabbitmq/worker/Receiver2.java index 413bceb..25e9f9d 100644 --- a/src/main/java/io/github/ehlxr/rabbitmq/worker/Receiver2.java +++ b/src/main/java/io/github/ehlxr/rabbitmq/worker/Receiver2.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.rabbitmq.worker; import com.rabbitmq.client.Channel; diff --git a/src/main/java/io/github/ehlxr/rabbitmq/worker/Sender.java b/src/main/java/io/github/ehlxr/rabbitmq/worker/Sender.java index 915f40c..71d285c 100644 --- a/src/main/java/io/github/ehlxr/rabbitmq/worker/Sender.java +++ b/src/main/java/io/github/ehlxr/rabbitmq/worker/Sender.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.rabbitmq.worker; import com.rabbitmq.client.Channel; diff --git a/src/main/java/io/github/ehlxr/rate/Main.java b/src/main/java/io/github/ehlxr/rate/Main.java index a89c212..d7d26be 100644 --- a/src/main/java/io/github/ehlxr/rate/Main.java +++ b/src/main/java/io/github/ehlxr/rate/Main.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.rate; /** diff --git a/src/main/java/io/github/ehlxr/rate/RateBarrier.java b/src/main/java/io/github/ehlxr/rate/RateBarrier.java index dfe16c1..b404953 100644 --- a/src/main/java/io/github/ehlxr/rate/RateBarrier.java +++ b/src/main/java/io/github/ehlxr/rate/RateBarrier.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.rate; import java.util.ArrayList; diff --git a/src/main/java/io/github/ehlxr/reactive/HelloRxJava.java b/src/main/java/io/github/ehlxr/reactive/HelloRxJava.java index 10502a2..4a4a4a9 100644 --- a/src/main/java/io/github/ehlxr/reactive/HelloRxJava.java +++ b/src/main/java/io/github/ehlxr/reactive/HelloRxJava.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.reactive; import rx.Observable; @@ -13,23 +37,23 @@ public class HelloRxJava { } private static void hello(String... names) { - Observable.from(names).subscribe(new Subscriber() { - @Override - public void onCompleted() { - System.out.println("Completed!"); - } + Observable.from(names).subscribe(new Subscriber() { + @Override + public void onCompleted() { + System.out.println("Completed!"); + } - @Override - public void onError(Throwable throwable) { - throwable.printStackTrace(); - } + @Override + public void onError(Throwable throwable) { + throwable.printStackTrace(); + } - @Override - public void onNext(String strings) { - System.out.println("say hello " + strings); - } + @Override + public void onNext(String strings) { + System.out.println("say hello " + strings); + } - }); + }); // Observable.from(names).subscribe(name -> System.out.println("say hello " + name), Throwable::printStackTrace, () -> System.out.println("Completed!")); } diff --git a/src/main/java/io/github/ehlxr/reactive/SchedulerTest.java b/src/main/java/io/github/ehlxr/reactive/SchedulerTest.java index 598b1eb..65e9fea 100644 --- a/src/main/java/io/github/ehlxr/reactive/SchedulerTest.java +++ b/src/main/java/io/github/ehlxr/reactive/SchedulerTest.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.reactive; diff --git a/src/main/java/io/github/ehlxr/reactive/TestFuture.java b/src/main/java/io/github/ehlxr/reactive/TestFuture.java index 6d4f7c5..46a7f40 100644 --- a/src/main/java/io/github/ehlxr/reactive/TestFuture.java +++ b/src/main/java/io/github/ehlxr/reactive/TestFuture.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.reactive; import java.util.concurrent.ExecutorService; diff --git a/src/main/java/io/github/ehlxr/reactive/TestLambda.java b/src/main/java/io/github/ehlxr/reactive/TestLambda.java index f5291e3..27d445e 100644 --- a/src/main/java/io/github/ehlxr/reactive/TestLambda.java +++ b/src/main/java/io/github/ehlxr/reactive/TestLambda.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.reactive; /** diff --git a/src/main/java/io/github/ehlxr/reactive/TestRx.java b/src/main/java/io/github/ehlxr/reactive/TestRx.java index 4f6cf25..15dbe8e 100644 --- a/src/main/java/io/github/ehlxr/reactive/TestRx.java +++ b/src/main/java/io/github/ehlxr/reactive/TestRx.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.reactive; import rx.Observable; diff --git a/src/main/java/io/github/ehlxr/reactive/TestRx01.java b/src/main/java/io/github/ehlxr/reactive/TestRx01.java index a4d6820..1877e3b 100644 --- a/src/main/java/io/github/ehlxr/reactive/TestRx01.java +++ b/src/main/java/io/github/ehlxr/reactive/TestRx01.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.reactive; diff --git a/src/main/java/io/github/ehlxr/reactive/TimeConsumingService.java b/src/main/java/io/github/ehlxr/reactive/TimeConsumingService.java index 231bfcc..89f4ad1 100644 --- a/src/main/java/io/github/ehlxr/reactive/TimeConsumingService.java +++ b/src/main/java/io/github/ehlxr/reactive/TimeConsumingService.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.reactive; import java.util.Arrays; diff --git a/src/main/java/io/github/ehlxr/readlogs/IReadLogs.java b/src/main/java/io/github/ehlxr/readlogs/IReadLogs.java index 77d96b2..e6397de 100644 --- a/src/main/java/io/github/ehlxr/readlogs/IReadLogs.java +++ b/src/main/java/io/github/ehlxr/readlogs/IReadLogs.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.readlogs; import java.util.Date; @@ -5,5 +29,5 @@ import java.util.List; import java.util.Map; public interface IReadLogs { - String readFile(Date startDate, Date endDate, List mapids, String groupid, Map adxs); + String readFile(Date startDate, Date endDate, List mapids, String groupid, Map adxs); } \ No newline at end of file diff --git a/src/main/java/io/github/ehlxr/redis/JRedisPoolConfig.java b/src/main/java/io/github/ehlxr/redis/JRedisPoolConfig.java index 68415dd..e92e308 100644 --- a/src/main/java/io/github/ehlxr/redis/JRedisPoolConfig.java +++ b/src/main/java/io/github/ehlxr/redis/JRedisPoolConfig.java @@ -1,10 +1,34 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.redis; import java.io.InputStream; import java.util.Properties; - + public class JRedisPoolConfig { - + public static String REDIS_IP; public static int REDIS_PORT; public static String REDIS_PASSWORD; @@ -13,15 +37,15 @@ public class JRedisPoolConfig { public static long MAX_WAIT; public static boolean TEST_ON_BORROW; public static boolean TEST_ON_RETURN; - + static { init(); } - + public static void init() { try { InputStream propFile = JRedisPoolConfig.class.getResourceAsStream("redis.properties"); - if(propFile != null){ + if(propFile != null){ Properties p = new Properties(); p.load(propFile); REDIS_IP = p.getProperty("redis.ip"); @@ -40,5 +64,5 @@ public class JRedisPoolConfig { e.printStackTrace(); } } - + } \ No newline at end of file diff --git a/src/main/java/io/github/ehlxr/redis/JedisUtil.java b/src/main/java/io/github/ehlxr/redis/JedisUtil.java index 7f53cfa..d4652a0 100644 --- a/src/main/java/io/github/ehlxr/redis/JedisUtil.java +++ b/src/main/java/io/github/ehlxr/redis/JedisUtil.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.redis; import org.springframework.util.StringUtils; @@ -13,374 +37,374 @@ import java.util.concurrent.TimeUnit; public class JedisUtil { - - private static JedisPool jedisPool = null; - /** 缓存生存时间 */ - private final static int expire = 60000; + private static JedisPool jedisPool = null; - private final static String PUBLISH_CHANNEL = "dsp_news"; - - private static final int DEFAULT_SINGLE_EXPIRE_TIME = 3; - - private static final String CONST_STR = "_storm"; - - static { - JedisPoolConfig config = new JedisPoolConfig(); - config.setMaxTotal(JRedisPoolConfig.MAX_ACTIVE); - config.setMaxIdle(JRedisPoolConfig.MAX_IDLE); - config.setMaxWaitMillis(JRedisPoolConfig.MAX_WAIT); - config.setTestOnBorrow(JRedisPoolConfig.TEST_ON_BORROW); - config.setTestOnReturn(JRedisPoolConfig.TEST_ON_RETURN); - // redis如果设置了密码: - if (StringUtils.isEmpty(JRedisPoolConfig.REDIS_PASSWORD)) { - jedisPool = new JedisPool(config, JRedisPoolConfig.REDIS_IP, - JRedisPoolConfig.REDIS_PORT, 10000); - } else { - jedisPool = new JedisPool(config, JRedisPoolConfig.REDIS_IP, - JRedisPoolConfig.REDIS_PORT, 10000, - JRedisPoolConfig.REDIS_PASSWORD); - } - } + /** 缓存生存时间 */ + private final static int expire = 60000; - public static JedisPool getPool() { - return jedisPool; - } + private final static String PUBLISH_CHANNEL = "dsp_news"; - /** - * 从jedis连接池中获取获取jedis对象 - */ - public static Jedis getJedis() { - return jedisPool.getResource(); - } + private static final int DEFAULT_SINGLE_EXPIRE_TIME = 3; - /** - * 回收jedis - */ - public static void returnJedis(Jedis jedis) { - if (jedis != null) - jedisPool.returnResource(jedis); - } + private static final String CONST_STR = "_storm"; - /** - * 设置过期时间 - */ - public static void expire(String key, int seconds) { - if (seconds <= 0) { - return; - } - Jedis jedis = getJedis(); - jedis.expire(key, seconds); - returnJedis(jedis); - } + static { + JedisPoolConfig config = new JedisPoolConfig(); + config.setMaxTotal(JRedisPoolConfig.MAX_ACTIVE); + config.setMaxIdle(JRedisPoolConfig.MAX_IDLE); + config.setMaxWaitMillis(JRedisPoolConfig.MAX_WAIT); + config.setTestOnBorrow(JRedisPoolConfig.TEST_ON_BORROW); + config.setTestOnReturn(JRedisPoolConfig.TEST_ON_RETURN); + // redis如果设置了密码: + if (StringUtils.isEmpty(JRedisPoolConfig.REDIS_PASSWORD)) { + jedisPool = new JedisPool(config, JRedisPoolConfig.REDIS_IP, + JRedisPoolConfig.REDIS_PORT, 10000); + } else { + jedisPool = new JedisPool(config, JRedisPoolConfig.REDIS_IP, + JRedisPoolConfig.REDIS_PORT, 10000, + JRedisPoolConfig.REDIS_PASSWORD); + } + } - /** - * 设置默认过期时间 - */ - public static void expire(String key) { - expire(key, expire); - } + public static JedisPool getPool() { + return jedisPool; + } - public static void set(String key, String value) { - if (isBlank(key)) - return; - Jedis jedis = getJedis(); - jedis.set(key, value); - returnJedis(jedis); - } + /** + * 从jedis连接池中获取获取jedis对象 + */ + public static Jedis getJedis() { + return jedisPool.getResource(); + } - public static void set(String key, Object value) { - if (isBlank(key)) - return; - Jedis jedis = getJedis(); - jedis.set(key.getBytes(), SerializeUtil.serialize(value)); - returnJedis(jedis); - } + /** + * 回收jedis + */ + public static void returnJedis(Jedis jedis) { + if (jedis != null) + jedisPool.returnResource(jedis); + } - public static void set(String key, int value) { - if (isBlank(key)) - return; - set(key, String.valueOf(value)); - } + /** + * 设置过期时间 + */ + public static void expire(String key, int seconds) { + if (seconds <= 0) { + return; + } + Jedis jedis = getJedis(); + jedis.expire(key, seconds); + returnJedis(jedis); + } - public static void set(String key, long value) { - if (isBlank(key)) - return; - set(key, String.valueOf(value)); - } + /** + * 设置默认过期时间 + */ + public static void expire(String key) { + expire(key, expire); + } - public static void set(String key, float value) { - if (isBlank(key)) - return; - set(key, String.valueOf(value)); - } + public static void set(String key, String value) { + if (isBlank(key)) + return; + Jedis jedis = getJedis(); + jedis.set(key, value); + returnJedis(jedis); + } - public static void set(String key, double value) { - if (isBlank(key)) - return; - set(key, String.valueOf(value)); - } + public static void set(String key, Object value) { + if (isBlank(key)) + return; + Jedis jedis = getJedis(); + jedis.set(key.getBytes(), SerializeUtil.serialize(value)); + returnJedis(jedis); + } - public static Float getFloat(String key) { - if (isBlank(key)) - return null; - return Float.valueOf(getStr(key)); - } + public static void set(String key, int value) { + if (isBlank(key)) + return; + set(key, String.valueOf(value)); + } - public static Double getDouble(String key) { - if (isBlank(key)) - return null; - return Double.valueOf(getStr(key)); - } + public static void set(String key, long value) { + if (isBlank(key)) + return; + set(key, String.valueOf(value)); + } - public static Long getLong(String key) { - if (isBlank(key)) - return null; - return Long.valueOf(getStr(key)); - } + public static void set(String key, float value) { + if (isBlank(key)) + return; + set(key, String.valueOf(value)); + } - public static Integer getInt(String key) { - if (isBlank(key)) - return null; - return Integer.valueOf(getStr(key)); - } + public static void set(String key, double value) { + if (isBlank(key)) + return; + set(key, String.valueOf(value)); + } - public static String getStr(String key) { - if (isBlank(key)) - return null; - Jedis jedis = getJedis(); - String value = jedis.get(key); - returnJedis(jedis); - return value; - } + public static Float getFloat(String key) { + if (isBlank(key)) + return null; + return Float.valueOf(getStr(key)); + } - public static Object getObj(String key) { - if (isBlank(key)) - return null; - Jedis jedis = getJedis(); - if(jedis.get(key.getBytes()) == null) { - return null; - } - byte[] bits = jedis.get(key.getBytes()); - Object obj = SerializeUtil.unserialize(bits); - returnJedis(jedis); - return obj; - } + public static Double getDouble(String key) { + if (isBlank(key)) + return null; + return Double.valueOf(getStr(key)); + } - public static void delete(String key) { - Jedis jedis = getJedis(); - if (jedis.get(key) != null) { - jedis.del(key); - } - returnJedis(jedis); - } - - public static String[] getKeys(String pattern) { - if(isBlank(pattern)) { - return null; - } - Jedis jedis = getJedis(); - Set keySet = jedis.keys(pattern); - String[] keys = new String[keySet.size()]; - int index = 0; - for(String key : keySet) { - keys[index] = key; - index ++; - } - returnJedis(jedis); - return keys; - } - - public static void deleteByPattern(String pattern) { - Jedis jedis = getJedis(); - String[] keys = getKeys(pattern); - if(keys != null && keys.length != 0) { - if(keys.length == 1) { - jedis.del(keys[0]); - }else { - jedis.del(keys); - } - } - returnJedis(jedis); - } - - public static Set sget(String key) { - Jedis jedis = getJedis(); - returnJedis(jedis); - return jedis.smembers(key); - } - - public static void sset(String key, String... members) { - Jedis jedis = getJedis(); - jedis.sadd(key, members); - returnJedis(jedis); - } - - public static boolean sismember(String key, String member) { - Jedis jedis = getJedis(); - boolean res = jedis.sismember(key, member); - returnJedis(jedis); - return res; - } - - public static void sdelete(String key, String... members) { - Jedis jedis = getJedis(); - jedis.srem(key, members); - returnJedis(jedis); - } - - public static void hset(String key, Map value) { - Jedis jedis = getJedis(); - jedis.hmset(key, value); - returnJedis(jedis); - } - - public static void hdelete(String key) { - Jedis jedis = getJedis(); - if (jedis.hgetAll(key) != null) { - jedis.del(key); - } - returnJedis(jedis); - } - - public static boolean isBlank(String str) { - return str == null || "".equals(str.trim()); - } - - public static boolean exists(String key) { - Jedis jedis = getJedis(); - boolean isexist = jedis.exists(key); - returnJedis(jedis); - return isexist; - } - - public static void publishNews(String str){ - Jedis jedis = getJedis(); - jedis.publish(PUBLISH_CHANNEL, str); - returnJedis(jedis); - } - - /** - * 锁在给定的等待时间内空闲,则获取锁成功 返回true, 否则返回false - * @param key - * @param timeout - * @param unit - * @return - */ - private static boolean trylock(String key) { - Jedis jedis = null; - TimeUnit timeUnit = TimeUnit.SECONDS; - long timeout = 4; - try { - jedis = getJedis(); - long nano = System.nanoTime(); - do { - Long i = jedis.setnx(key + CONST_STR, key); - if (i == 1) { - jedis.expire(key + CONST_STR, DEFAULT_SINGLE_EXPIRE_TIME); - return Boolean.TRUE; - } else { // 存在锁 - String desc = jedis.get(key + CONST_STR); - System.out.println(desc); - } - Thread.sleep(300); - } while ((System.nanoTime() - nano) < timeUnit.toNanos(timeout)); - } catch (RuntimeException e) { - e.printStackTrace(); - } catch (InterruptedException e) { - e.printStackTrace(); - } finally { - returnJedis(jedis); - } - return Boolean.FALSE; - } - - /** - * 释放锁 - * @param key - */ - public static void unlock(String key) { - delete(key + CONST_STR); - } - - public static void setWithLock(String key, String value) { - Jedis jedis = null; - try { - jedis = getJedis(); - jedis.set(key, value); - if (jedis.get(key + CONST_STR) != null) { - unlock(key); - } - } catch (RuntimeException e) { - e.printStackTrace(); - } finally { - returnJedis(jedis); - } - } + public static Long getLong(String key) { + if (isBlank(key)) + return null; + return Long.valueOf(getStr(key)); + } - public static String getStrWithLock(String key) { - String value = null; - Jedis jedis = null; - try { - jedis = getJedis(); - if (jedis.get(key) != null && trylock(key)) { - value = jedis.get(key); - if (value == null) { - unlock(key); - } - } - } catch (RuntimeException e) { - e.printStackTrace(); - } finally { - returnJedis(jedis); - } - return value; - } + public static Integer getInt(String key) { + if (isBlank(key)) + return null; + return Integer.valueOf(getStr(key)); + } - public static void lpush(String key, String value) { - if (isBlank(key)) - return; - Jedis jedis = getJedis(); - jedis.lpush(key, value); - returnJedis(jedis); - } - - public static String[] hkeys(String key){ - if (isBlank(key)) - return null; - Jedis jedis = getJedis(); - Set keySet = jedis.hkeys(key); - List keys = new ArrayList(); - for(String hkey : keySet) { - keys.add(hkey); - } - returnJedis(jedis); - return keys.toArray(new String[keys.size()]); - } - - public static String hget(String key, String hkey) { - if (isBlank(key)||isBlank(hkey)) - return ""; - Jedis jedis = getJedis(); - String value = jedis.hget(key, hkey); - returnJedis(jedis); - - return value; - } - - public static List hmget(String key, String[] hkey) { - if (isBlank(key)) - return null; - Jedis jedis = getJedis(); - List value = jedis.hmget(key, hkey); - returnJedis(jedis); - - return value; - } - - public static void main(String[] args) { - JedisUtil.set("lxr", "hah ehlxr"); - System.out.println(JedisUtil.getStr("lxr")); - } + public static String getStr(String key) { + if (isBlank(key)) + return null; + Jedis jedis = getJedis(); + String value = jedis.get(key); + returnJedis(jedis); + return value; + } + + public static Object getObj(String key) { + if (isBlank(key)) + return null; + Jedis jedis = getJedis(); + if(jedis.get(key.getBytes()) == null) { + return null; + } + byte[] bits = jedis.get(key.getBytes()); + Object obj = SerializeUtil.unserialize(bits); + returnJedis(jedis); + return obj; + } + + public static void delete(String key) { + Jedis jedis = getJedis(); + if (jedis.get(key) != null) { + jedis.del(key); + } + returnJedis(jedis); + } + + public static String[] getKeys(String pattern) { + if(isBlank(pattern)) { + return null; + } + Jedis jedis = getJedis(); + Set keySet = jedis.keys(pattern); + String[] keys = new String[keySet.size()]; + int index = 0; + for(String key : keySet) { + keys[index] = key; + index ++; + } + returnJedis(jedis); + return keys; + } + + public static void deleteByPattern(String pattern) { + Jedis jedis = getJedis(); + String[] keys = getKeys(pattern); + if(keys != null && keys.length != 0) { + if(keys.length == 1) { + jedis.del(keys[0]); + }else { + jedis.del(keys); + } + } + returnJedis(jedis); + } + + public static Set sget(String key) { + Jedis jedis = getJedis(); + returnJedis(jedis); + return jedis.smembers(key); + } + + public static void sset(String key, String... members) { + Jedis jedis = getJedis(); + jedis.sadd(key, members); + returnJedis(jedis); + } + + public static boolean sismember(String key, String member) { + Jedis jedis = getJedis(); + boolean res = jedis.sismember(key, member); + returnJedis(jedis); + return res; + } + + public static void sdelete(String key, String... members) { + Jedis jedis = getJedis(); + jedis.srem(key, members); + returnJedis(jedis); + } + + public static void hset(String key, Map value) { + Jedis jedis = getJedis(); + jedis.hmset(key, value); + returnJedis(jedis); + } + + public static void hdelete(String key) { + Jedis jedis = getJedis(); + if (jedis.hgetAll(key) != null) { + jedis.del(key); + } + returnJedis(jedis); + } + + public static boolean isBlank(String str) { + return str == null || "".equals(str.trim()); + } + + public static boolean exists(String key) { + Jedis jedis = getJedis(); + boolean isexist = jedis.exists(key); + returnJedis(jedis); + return isexist; + } + + public static void publishNews(String str){ + Jedis jedis = getJedis(); + jedis.publish(PUBLISH_CHANNEL, str); + returnJedis(jedis); + } + + /** + * 锁在给定的等待时间内空闲,则获取锁成功 返回true, 否则返回false + * @param key + * @param timeout + * @param unit + * @return + */ + private static boolean trylock(String key) { + Jedis jedis = null; + TimeUnit timeUnit = TimeUnit.SECONDS; + long timeout = 4; + try { + jedis = getJedis(); + long nano = System.nanoTime(); + do { + Long i = jedis.setnx(key + CONST_STR, key); + if (i == 1) { + jedis.expire(key + CONST_STR, DEFAULT_SINGLE_EXPIRE_TIME); + return Boolean.TRUE; + } else { // 存在锁 + String desc = jedis.get(key + CONST_STR); + System.out.println(desc); + } + Thread.sleep(300); + } while ((System.nanoTime() - nano) < timeUnit.toNanos(timeout)); + } catch (RuntimeException e) { + e.printStackTrace(); + } catch (InterruptedException e) { + e.printStackTrace(); + } finally { + returnJedis(jedis); + } + return Boolean.FALSE; + } + + /** + * 释放锁 + * @param key + */ + public static void unlock(String key) { + delete(key + CONST_STR); + } + + public static void setWithLock(String key, String value) { + Jedis jedis = null; + try { + jedis = getJedis(); + jedis.set(key, value); + if (jedis.get(key + CONST_STR) != null) { + unlock(key); + } + } catch (RuntimeException e) { + e.printStackTrace(); + } finally { + returnJedis(jedis); + } + } + + public static String getStrWithLock(String key) { + String value = null; + Jedis jedis = null; + try { + jedis = getJedis(); + if (jedis.get(key) != null && trylock(key)) { + value = jedis.get(key); + if (value == null) { + unlock(key); + } + } + } catch (RuntimeException e) { + e.printStackTrace(); + } finally { + returnJedis(jedis); + } + return value; + } + + public static void lpush(String key, String value) { + if (isBlank(key)) + return; + Jedis jedis = getJedis(); + jedis.lpush(key, value); + returnJedis(jedis); + } + + public static String[] hkeys(String key){ + if (isBlank(key)) + return null; + Jedis jedis = getJedis(); + Set keySet = jedis.hkeys(key); + List keys = new ArrayList(); + for(String hkey : keySet) { + keys.add(hkey); + } + returnJedis(jedis); + return keys.toArray(new String[keys.size()]); + } + + public static String hget(String key, String hkey) { + if (isBlank(key)||isBlank(hkey)) + return ""; + Jedis jedis = getJedis(); + String value = jedis.hget(key, hkey); + returnJedis(jedis); + + return value; + } + + public static List hmget(String key, String[] hkey) { + if (isBlank(key)) + return null; + Jedis jedis = getJedis(); + List value = jedis.hmget(key, hkey); + returnJedis(jedis); + + return value; + } + + public static void main(String[] args) { + JedisUtil.set("lxr", "hah ehlxr"); + System.out.println(JedisUtil.getStr("lxr")); + } } diff --git a/src/main/java/io/github/ehlxr/redis/SerializeUtil.java b/src/main/java/io/github/ehlxr/redis/SerializeUtil.java index f9750ab..67265ec 100644 --- a/src/main/java/io/github/ehlxr/redis/SerializeUtil.java +++ b/src/main/java/io/github/ehlxr/redis/SerializeUtil.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.redis; import java.io.ByteArrayInputStream; @@ -6,44 +30,44 @@ import java.io.ObjectInputStream; import java.io.ObjectOutputStream; public class SerializeUtil { - /** - * 序列化 - * - * @param object - * @return - */ - public static byte[] serialize(Object object) { - ObjectOutputStream oos = null; - ByteArrayOutputStream baos = null; - try { - // 序列化 - baos = new ByteArrayOutputStream(); - oos = new ObjectOutputStream(baos); - oos.writeObject(object); - byte[] bytes = baos.toByteArray(); - return bytes; - } catch (Exception e) { - e.printStackTrace(); - } - return null; - } + /** + * 序列化 + * + * @param object + * @return + */ + public static byte[] serialize(Object object) { + ObjectOutputStream oos = null; + ByteArrayOutputStream baos = null; + try { + // 序列化 + baos = new ByteArrayOutputStream(); + oos = new ObjectOutputStream(baos); + oos.writeObject(object); + byte[] bytes = baos.toByteArray(); + return bytes; + } catch (Exception e) { + e.printStackTrace(); + } + return null; + } - /** - * 反序列化 - * - * @param bytes - * @return - */ - public static Object unserialize(byte[] bytes) { - ByteArrayInputStream bais = null; - try { - // 反序列化 - bais = new ByteArrayInputStream(bytes); - ObjectInputStream ois = new ObjectInputStream(bais); - return ois.readObject(); - } catch (Exception e) { - e.printStackTrace(); - } - return null; - } + /** + * 反序列化 + * + * @param bytes + * @return + */ + public static Object unserialize(byte[] bytes) { + ByteArrayInputStream bais = null; + try { + // 反序列化 + bais = new ByteArrayInputStream(bytes); + ObjectInputStream ois = new ObjectInputStream(bais); + return ois.readObject(); + } catch (Exception e) { + e.printStackTrace(); + } + return null; + } } diff --git a/src/main/java/io/github/ehlxr/sftp/SFTPUtil.java b/src/main/java/io/github/ehlxr/sftp/SFTPUtil.java index 6869e24..62b3688 100644 --- a/src/main/java/io/github/ehlxr/sftp/SFTPUtil.java +++ b/src/main/java/io/github/ehlxr/sftp/SFTPUtil.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.sftp; import com.jcraft.jsch.*; diff --git a/src/main/java/io/github/ehlxr/shiro/LoginLogoutTest.java b/src/main/java/io/github/ehlxr/shiro/LoginLogoutTest.java index 9e0386d..ef65b98 100644 --- a/src/main/java/io/github/ehlxr/shiro/LoginLogoutTest.java +++ b/src/main/java/io/github/ehlxr/shiro/LoginLogoutTest.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.shiro; import org.apache.shiro.SecurityUtils; @@ -10,24 +34,24 @@ import org.junit.Assert; import org.junit.Test; public class LoginLogoutTest { - @Test - public void testHelloworld() { - // 1、获取SecurityManager工厂,此处使用Ini配置文件初始化SecurityManager - Factory factory = new IniSecurityManagerFactory("classpath:shiro.ini"); - // 2、得到SecurityManager实例并绑定给SecurityUtils - org.apache.shiro.mgt.SecurityManager securityManager = factory.getInstance(); - SecurityUtils.setSecurityManager(securityManager); - // 3、得到Subject及创建用户名/密码身份验证Token(即用户身份/凭证) - Subject subject = SecurityUtils.getSubject(); - UsernamePasswordToken token = new UsernamePasswordToken("zhang", "123"); - try { - // 4、登录,即身份验证 - subject.login(token); - } catch (AuthenticationException e) { - // 5、身份验证失败 - } - Assert.assertEquals(true, subject.isAuthenticated()); // 断言用户已经登录 - // 6、退出 - subject.logout(); - } + @Test + public void testHelloworld() { + // 1、获取SecurityManager工厂,此处使用Ini配置文件初始化SecurityManager + Factory factory = new IniSecurityManagerFactory("classpath:shiro.ini"); + // 2、得到SecurityManager实例并绑定给SecurityUtils + org.apache.shiro.mgt.SecurityManager securityManager = factory.getInstance(); + SecurityUtils.setSecurityManager(securityManager); + // 3、得到Subject及创建用户名/密码身份验证Token(即用户身份/凭证) + Subject subject = SecurityUtils.getSubject(); + UsernamePasswordToken token = new UsernamePasswordToken("zhang", "123"); + try { + // 4、登录,即身份验证 + subject.login(token); + } catch (AuthenticationException e) { + // 5、身份验证失败 + } + Assert.assertEquals(true, subject.isAuthenticated()); // 断言用户已经登录 + // 6、退出 + subject.logout(); + } } diff --git a/src/main/java/io/github/ehlxr/sort/BubbleSort.java b/src/main/java/io/github/ehlxr/sort/BubbleSort.java index 13b93c7..894545e 100644 --- a/src/main/java/io/github/ehlxr/sort/BubbleSort.java +++ b/src/main/java/io/github/ehlxr/sort/BubbleSort.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.sort; import java.util.Arrays; diff --git a/src/main/java/io/github/ehlxr/sort/HeapSort.java b/src/main/java/io/github/ehlxr/sort/HeapSort.java index 5614027..0d5c4b5 100644 --- a/src/main/java/io/github/ehlxr/sort/HeapSort.java +++ b/src/main/java/io/github/ehlxr/sort/HeapSort.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.sort; import java.util.Arrays; diff --git a/src/main/java/io/github/ehlxr/sort/InsertSort.java b/src/main/java/io/github/ehlxr/sort/InsertSort.java index 5351ff5..0814c7b 100644 --- a/src/main/java/io/github/ehlxr/sort/InsertSort.java +++ b/src/main/java/io/github/ehlxr/sort/InsertSort.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.sort; import java.util.Arrays; diff --git a/src/main/java/io/github/ehlxr/sort/MergeSort.java b/src/main/java/io/github/ehlxr/sort/MergeSort.java index 5dc9baa..3c9e5ac 100644 --- a/src/main/java/io/github/ehlxr/sort/MergeSort.java +++ b/src/main/java/io/github/ehlxr/sort/MergeSort.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.sort; import java.util.Arrays; diff --git a/src/main/java/io/github/ehlxr/sort/QuickSort.java b/src/main/java/io/github/ehlxr/sort/QuickSort.java index 0842b82..1b50551 100644 --- a/src/main/java/io/github/ehlxr/sort/QuickSort.java +++ b/src/main/java/io/github/ehlxr/sort/QuickSort.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.sort; import java.util.Arrays; diff --git a/src/main/java/io/github/ehlxr/sort/SelectSort.java b/src/main/java/io/github/ehlxr/sort/SelectSort.java index 549a739..ac131ea 100644 --- a/src/main/java/io/github/ehlxr/sort/SelectSort.java +++ b/src/main/java/io/github/ehlxr/sort/SelectSort.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.sort; import java.util.Arrays; diff --git a/src/main/java/io/github/ehlxr/sort/ShellSort.java b/src/main/java/io/github/ehlxr/sort/ShellSort.java index c24d341..f678e16 100644 --- a/src/main/java/io/github/ehlxr/sort/ShellSort.java +++ b/src/main/java/io/github/ehlxr/sort/ShellSort.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.sort; import java.util.Arrays; diff --git a/src/main/java/io/github/ehlxr/springamq/controller/ActivemqController.java b/src/main/java/io/github/ehlxr/springamq/controller/ActivemqController.java index 98ada85..5350e9d 100644 --- a/src/main/java/io/github/ehlxr/springamq/controller/ActivemqController.java +++ b/src/main/java/io/github/ehlxr/springamq/controller/ActivemqController.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.springamq.controller; import io.github.ehlxr.springamq.mq.producer.queue.QueueSender; @@ -16,48 +40,48 @@ import javax.annotation.Resource; @Controller @RequestMapping("/activemq") public class ActivemqController { - - @Resource - QueueSender queueSender; - @Resource - TopicSender topicSender; - - /** - * 发送消息到队列 - * Queue队列:仅有一个订阅者会收到消息,消息一旦被处理就不会存在队列中 - * @param message - * @return String - */ - @ResponseBody - @RequestMapping("queueSender") - public String queueSender(@RequestParam("message")String message){ - String opt=""; - try { - queueSender.send("test.queue", message); - opt = "suc"; - } catch (Exception e) { - opt = e.getCause().toString(); - } - return opt; - } - - /** - * 发送消息到主题 - * Topic主题 :放入一个消息,所有订阅者都会收到 - * 这个是主题目的地是一对多的 - * @param message - * @return String - */ - @ResponseBody - @RequestMapping("topicSender") - public String topicSender(@RequestParam("message")String message){ - String opt = ""; - try { - topicSender.send("test.topic", message); - opt = "suc"; - } catch (Exception e) { - opt = e.getCause().toString(); - } - return opt; - } + + @Resource + QueueSender queueSender; + @Resource + TopicSender topicSender; + + /** + * 发送消息到队列 + * Queue队列:仅有一个订阅者会收到消息,消息一旦被处理就不会存在队列中 + * @param message + * @return String + */ + @ResponseBody + @RequestMapping("queueSender") + public String queueSender(@RequestParam("message")String message){ + String opt=""; + try { + queueSender.send("test.queue", message); + opt = "suc"; + } catch (Exception e) { + opt = e.getCause().toString(); + } + return opt; + } + + /** + * 发送消息到主题 + * Topic主题 :放入一个消息,所有订阅者都会收到 + * 这个是主题目的地是一对多的 + * @param message + * @return String + */ + @ResponseBody + @RequestMapping("topicSender") + public String topicSender(@RequestParam("message")String message){ + String opt = ""; + try { + topicSender.send("test.topic", message); + opt = "suc"; + } catch (Exception e) { + opt = e.getCause().toString(); + } + return opt; + } } diff --git a/src/main/java/io/github/ehlxr/springamq/mq/consumer/queue/QueueReceiver1.java b/src/main/java/io/github/ehlxr/springamq/mq/consumer/queue/QueueReceiver1.java index 7d93982..b00662c 100644 --- a/src/main/java/io/github/ehlxr/springamq/mq/consumer/queue/QueueReceiver1.java +++ b/src/main/java/io/github/ehlxr/springamq/mq/consumer/queue/QueueReceiver1.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.springamq.mq.consumer.queue; diff --git a/src/main/java/io/github/ehlxr/springamq/mq/consumer/queue/QueueReceiver2.java b/src/main/java/io/github/ehlxr/springamq/mq/consumer/queue/QueueReceiver2.java index 5eb4f63..9ebaa23 100644 --- a/src/main/java/io/github/ehlxr/springamq/mq/consumer/queue/QueueReceiver2.java +++ b/src/main/java/io/github/ehlxr/springamq/mq/consumer/queue/QueueReceiver2.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.springamq.mq.consumer.queue; diff --git a/src/main/java/io/github/ehlxr/springamq/mq/consumer/topic/TopicReceiver1.java b/src/main/java/io/github/ehlxr/springamq/mq/consumer/topic/TopicReceiver1.java index e289d25..b6ac7fd 100644 --- a/src/main/java/io/github/ehlxr/springamq/mq/consumer/topic/TopicReceiver1.java +++ b/src/main/java/io/github/ehlxr/springamq/mq/consumer/topic/TopicReceiver1.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.springamq.mq.consumer.topic; import org.springframework.stereotype.Component; diff --git a/src/main/java/io/github/ehlxr/springamq/mq/consumer/topic/TopicReceiver2.java b/src/main/java/io/github/ehlxr/springamq/mq/consumer/topic/TopicReceiver2.java index 71ca1a2..e492482 100644 --- a/src/main/java/io/github/ehlxr/springamq/mq/consumer/topic/TopicReceiver2.java +++ b/src/main/java/io/github/ehlxr/springamq/mq/consumer/topic/TopicReceiver2.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.springamq.mq.consumer.topic; import org.springframework.stereotype.Component; @@ -21,5 +45,5 @@ public class TopicReceiver2 implements MessageListener{ e.printStackTrace(); } } - + } diff --git a/src/main/java/io/github/ehlxr/springamq/mq/producer/queue/QueueSender.java b/src/main/java/io/github/ehlxr/springamq/mq/producer/queue/QueueSender.java index eee22ef..74022f3 100644 --- a/src/main/java/io/github/ehlxr/springamq/mq/producer/queue/QueueSender.java +++ b/src/main/java/io/github/ehlxr/springamq/mq/producer/queue/QueueSender.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.springamq.mq.producer.queue; import org.springframework.beans.factory.annotation.Autowired; @@ -15,22 +39,22 @@ import javax.jms.Session; */ @Component("queueSender") public class QueueSender { - - @Autowired - @Qualifier("jmsQueueTemplate") - private JmsTemplate jmsTemplate;//通过@Qualifier修饰符来注入对应的bean - - /** - * 发送一条消息到指定的队列(目标) - * @param queueName 队列名称 - * @param message 消息内容 - */ - public void send(String queueName,final String message){ - jmsTemplate.send(queueName, new MessageCreator() { - @Override - public Message createMessage(Session session) throws JMSException { - return session.createTextMessage(message); - } - }); - } + + @Autowired + @Qualifier("jmsQueueTemplate") + private JmsTemplate jmsTemplate;//通过@Qualifier修饰符来注入对应的bean + + /** + * 发送一条消息到指定的队列(目标) + * @param queueName 队列名称 + * @param message 消息内容 + */ + public void send(String queueName,final String message){ + jmsTemplate.send(queueName, new MessageCreator() { + @Override + public Message createMessage(Session session) throws JMSException { + return session.createTextMessage(message); + } + }); + } } \ No newline at end of file diff --git a/src/main/java/io/github/ehlxr/springamq/mq/producer/topic/TopicSender.java b/src/main/java/io/github/ehlxr/springamq/mq/producer/topic/TopicSender.java index 620de0a..6bc6fb2 100644 --- a/src/main/java/io/github/ehlxr/springamq/mq/producer/topic/TopicSender.java +++ b/src/main/java/io/github/ehlxr/springamq/mq/producer/topic/TopicSender.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.springamq.mq.producer.topic; import org.springframework.beans.factory.annotation.Autowired; diff --git a/src/main/java/io/github/ehlxr/test/DirList.java b/src/main/java/io/github/ehlxr/test/DirList.java index 2607b53..0dfecc6 100644 --- a/src/main/java/io/github/ehlxr/test/DirList.java +++ b/src/main/java/io/github/ehlxr/test/DirList.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.test; import java.io.File; diff --git a/src/main/java/io/github/ehlxr/test/ExecBaics50Log.java b/src/main/java/io/github/ehlxr/test/ExecBaics50Log.java index f497fe3..de6ad1f 100644 --- a/src/main/java/io/github/ehlxr/test/ExecBaics50Log.java +++ b/src/main/java/io/github/ehlxr/test/ExecBaics50Log.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.test; import java.io.BufferedReader; diff --git a/src/main/java/io/github/ehlxr/test/IChargeCounter.java b/src/main/java/io/github/ehlxr/test/IChargeCounter.java index f0b97c8..6854113 100644 --- a/src/main/java/io/github/ehlxr/test/IChargeCounter.java +++ b/src/main/java/io/github/ehlxr/test/IChargeCounter.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.test; import java.math.BigDecimal; diff --git a/src/main/java/io/github/ehlxr/test/Main.java b/src/main/java/io/github/ehlxr/test/Main.java index e92adce..0f6a53f 100644 --- a/src/main/java/io/github/ehlxr/test/Main.java +++ b/src/main/java/io/github/ehlxr/test/Main.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.test; import io.github.ehlxr.redis.JedisUtil; diff --git a/src/main/java/io/github/ehlxr/test/OperateKPIBudgetRedisData.java b/src/main/java/io/github/ehlxr/test/OperateKPIBudgetRedisData.java index fa52500..d22c076 100644 --- a/src/main/java/io/github/ehlxr/test/OperateKPIBudgetRedisData.java +++ b/src/main/java/io/github/ehlxr/test/OperateKPIBudgetRedisData.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.test; import io.github.ehlxr.redis.JedisUtil; @@ -8,70 +32,70 @@ import java.math.BigDecimal; public class OperateKPIBudgetRedisData { - public static void main(String[] args) throws IOException { - showSom("58d355d7-4c66-461c-b63c-146c149bdcac"); - // delete("c46b8885-4c1d-48f9-befb-3ba3a0f33d4a"); - } + public static void main(String[] args) throws IOException { + showSom("58d355d7-4c66-461c-b63c-146c149bdcac"); + // delete("c46b8885-4c1d-48f9-befb-3ba3a0f33d4a"); + } - public static void showSom(String groupid){ - String[] keys = JedisUtil.getKeys("dsp_budget_*_"+groupid); - BigDecimal totals = new BigDecimal(0); - for (String key : keys) { - System.out.println(key+"-----------:"+JedisUtil.getStr(key)); - totals = totals.add(new BigDecimal(JedisUtil.getStr(key))); - } - System.out.println("budget_balance_"+groupid+"----------:"+JedisUtil.getStr("budget_balance_"+groupid)); - totals = totals.add(new BigDecimal(JedisUtil.getStr("budget_balance_"+groupid))); - System.out.println("-------------------------------------------------------------:"+totals.toPlainString()); - System.out.println(); - - totals = new BigDecimal(0); - keys = JedisUtil.getKeys("dsp_counter_*_"+groupid); - for (String key : keys) { - System.out.println(key+"-----------:"+JedisUtil.getStr(key)); - String[] split = JedisUtil.getStr(key).split(","); - if(split.length>1){ - totals = totals.add(new BigDecimal(split[1])); - }else{ - totals = totals.add(new BigDecimal(split[0])); - } - } - System.out.println("counter_balance_"+groupid+"---------:"+JedisUtil.getStr("counter_balance_"+groupid)); - String[] split = JedisUtil.getStr("counter_balance_"+groupid).split(","); - if(split.length>1){ - totals = totals.add(new BigDecimal(split[1])); - }else{ - totals = totals.add(new BigDecimal(split[0])); - } - System.out.println("-------------------------------------------------------------:"+totals.toPlainString()); - } - - - public static void delete(String groupid){ - - - String[] keys ={"d012aa41-35b8-4ef9-a3ee-9bc918d0da82", - "f26701ea-3bfc-4b4f-ae88-f39bff59c77c", - "a4e14ee1-1ae3-4e04-8850-c1345c5af200", - "d3ca7a1a-7a8d-4e43-be28-46f450a84d99", - "f9fdd963-558c-4d5a-b18f-c7d8386fac2d", - "a4dbe6b6-bd69-4bab-aa84-d5459860ad7b", - "6d3508d8-c978-4446-ba4c-895196af5021", - "033d5820-2ca8-4304-87ab-aaad6a0d0652", - "b4572eae-3f4f-46e2-95be-78ec3cb47b75", - "8c6f32fc-450d-4912-a7e3-7bbc7e4341a9", - "7275405b-b12d-4f8b-95a4-7274cbf3f942", - "6f1d947b-bc03-4560-b3ff-1200725f352c", - "52a9558d-bada-4e2b-8e71-d83ee40e804f", - "92b8bd98-6698-48b7-b402-5ccf49e9c674", - "b605daa7-6a85-40dc-8c5e-d9022e8fc3d2", - "853aad03-a2f5-4665-aaac-26aadd42be84", - "5f3668bf-ebb9-4db7-ac29-62216fd86f2d"}; - - for (String key : keys) { - JedisUtil.delete("dsp_mapid_"+key); - } - - - } + public static void showSom(String groupid){ + String[] keys = JedisUtil.getKeys("dsp_budget_*_"+groupid); + BigDecimal totals = new BigDecimal(0); + for (String key : keys) { + System.out.println(key+"-----------:"+JedisUtil.getStr(key)); + totals = totals.add(new BigDecimal(JedisUtil.getStr(key))); + } + System.out.println("budget_balance_"+groupid+"----------:"+JedisUtil.getStr("budget_balance_"+groupid)); + totals = totals.add(new BigDecimal(JedisUtil.getStr("budget_balance_"+groupid))); + System.out.println("-------------------------------------------------------------:"+totals.toPlainString()); + System.out.println(); + + totals = new BigDecimal(0); + keys = JedisUtil.getKeys("dsp_counter_*_"+groupid); + for (String key : keys) { + System.out.println(key+"-----------:"+JedisUtil.getStr(key)); + String[] split = JedisUtil.getStr(key).split(","); + if(split.length>1){ + totals = totals.add(new BigDecimal(split[1])); + }else{ + totals = totals.add(new BigDecimal(split[0])); + } + } + System.out.println("counter_balance_"+groupid+"---------:"+JedisUtil.getStr("counter_balance_"+groupid)); + String[] split = JedisUtil.getStr("counter_balance_"+groupid).split(","); + if(split.length>1){ + totals = totals.add(new BigDecimal(split[1])); + }else{ + totals = totals.add(new BigDecimal(split[0])); + } + System.out.println("-------------------------------------------------------------:"+totals.toPlainString()); + } + + + public static void delete(String groupid){ + + + String[] keys ={"d012aa41-35b8-4ef9-a3ee-9bc918d0da82", + "f26701ea-3bfc-4b4f-ae88-f39bff59c77c", + "a4e14ee1-1ae3-4e04-8850-c1345c5af200", + "d3ca7a1a-7a8d-4e43-be28-46f450a84d99", + "f9fdd963-558c-4d5a-b18f-c7d8386fac2d", + "a4dbe6b6-bd69-4bab-aa84-d5459860ad7b", + "6d3508d8-c978-4446-ba4c-895196af5021", + "033d5820-2ca8-4304-87ab-aaad6a0d0652", + "b4572eae-3f4f-46e2-95be-78ec3cb47b75", + "8c6f32fc-450d-4912-a7e3-7bbc7e4341a9", + "7275405b-b12d-4f8b-95a4-7274cbf3f942", + "6f1d947b-bc03-4560-b3ff-1200725f352c", + "52a9558d-bada-4e2b-8e71-d83ee40e804f", + "92b8bd98-6698-48b7-b402-5ccf49e9c674", + "b605daa7-6a85-40dc-8c5e-d9022e8fc3d2", + "853aad03-a2f5-4665-aaac-26aadd42be84", + "5f3668bf-ebb9-4db7-ac29-62216fd86f2d"}; + + for (String key : keys) { + JedisUtil.delete("dsp_mapid_"+key); + } + + + } } \ No newline at end of file diff --git a/src/main/java/io/github/ehlxr/test/StatisByHourModel.java b/src/main/java/io/github/ehlxr/test/StatisByHourModel.java index 9a5b72f..da1dd44 100644 --- a/src/main/java/io/github/ehlxr/test/StatisByHourModel.java +++ b/src/main/java/io/github/ehlxr/test/StatisByHourModel.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.test; import java.math.BigDecimal; diff --git a/src/main/java/io/github/ehlxr/test/Test.java b/src/main/java/io/github/ehlxr/test/Test.java index 3e81399..82f1355 100644 --- a/src/main/java/io/github/ehlxr/test/Test.java +++ b/src/main/java/io/github/ehlxr/test/Test.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.test; /** diff --git a/src/main/java/io/github/ehlxr/test/TestAudiQ2.java b/src/main/java/io/github/ehlxr/test/TestAudiQ2.java index 34b5eb2..92bc43d 100644 --- a/src/main/java/io/github/ehlxr/test/TestAudiQ2.java +++ b/src/main/java/io/github/ehlxr/test/TestAudiQ2.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.test; import io.github.ehlxr.utils.HttpClientUtil; diff --git a/src/main/java/io/github/ehlxr/test/TestCalendar.java b/src/main/java/io/github/ehlxr/test/TestCalendar.java index 4981617..5ffd585 100644 --- a/src/main/java/io/github/ehlxr/test/TestCalendar.java +++ b/src/main/java/io/github/ehlxr/test/TestCalendar.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.test; import java.util.Calendar; diff --git a/src/main/java/io/github/ehlxr/test/TestCode.java b/src/main/java/io/github/ehlxr/test/TestCode.java index a54dea0..c609063 100644 --- a/src/main/java/io/github/ehlxr/test/TestCode.java +++ b/src/main/java/io/github/ehlxr/test/TestCode.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.test; import java.text.ParseException; diff --git a/src/main/java/io/github/ehlxr/test/TestCountDownLatch.java b/src/main/java/io/github/ehlxr/test/TestCountDownLatch.java index 7190cd8..6ad7ff6 100644 --- a/src/main/java/io/github/ehlxr/test/TestCountDownLatch.java +++ b/src/main/java/io/github/ehlxr/test/TestCountDownLatch.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.test; import java.util.Map; @@ -6,43 +30,43 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.CountDownLatch; public class TestCountDownLatch { - private static final int N = 10; + private static final int N = 10; - private static final Map cache = new ConcurrentHashMap(); + private static final Map cache = new ConcurrentHashMap(); - public static void main(String[] args) throws InterruptedException { - CountDownLatch doneSignal = new CountDownLatch(N); + public static void main(String[] args) throws InterruptedException { + CountDownLatch doneSignal = new CountDownLatch(N); - for (int i = 1; i <= N; i++) { - new Thread(new Worker(i, doneSignal)).start();// 线程启动了 - } - System.out.println("begin------------"); - doneSignal.await();// 等待所有的线程执行完毕 - System.out.println("Ok"); + for (int i = 1; i <= N; i++) { + new Thread(new Worker(i, doneSignal)).start();// 线程启动了 + } + System.out.println("begin------------"); + doneSignal.await();// 等待所有的线程执行完毕 + System.out.println("Ok"); - System.out.println(cache.size()); + System.out.println(cache.size()); - Set keySet = cache.keySet(); - for (String key : keySet) { - System.out.println(key + " = " + cache.get(key)); - } - } + Set keySet = cache.keySet(); + for (String key : keySet) { + System.out.println(key + " = " + cache.get(key)); + } + } - static class Worker implements Runnable { - private final CountDownLatch doneSignal; - private int beginIndex; + static class Worker implements Runnable { + private final CountDownLatch doneSignal; + private int beginIndex; - Worker(int beginIndex, CountDownLatch doneSignal) { - this.beginIndex = beginIndex; - this.doneSignal = doneSignal; - } + Worker(int beginIndex, CountDownLatch doneSignal) { + this.beginIndex = beginIndex; + this.doneSignal = doneSignal; + } - public void run() { - beginIndex = (beginIndex - 1) * 10 + 1; - for (int i = beginIndex; i <= beginIndex + 10; i++) { - cache.put(i + "key", i); - } - doneSignal.countDown(); - } - } + public void run() { + beginIndex = (beginIndex - 1) * 10 + 1; + for (int i = beginIndex; i <= beginIndex + 10; i++) { + cache.put(i + "key", i); + } + doneSignal.countDown(); + } + } } \ No newline at end of file diff --git a/src/main/java/io/github/ehlxr/test/TestCounter.java b/src/main/java/io/github/ehlxr/test/TestCounter.java index bcf94af..55eb020 100644 --- a/src/main/java/io/github/ehlxr/test/TestCounter.java +++ b/src/main/java/io/github/ehlxr/test/TestCounter.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.test; public class TestCounter { diff --git a/src/main/java/io/github/ehlxr/test/TestDecodeHex.java b/src/main/java/io/github/ehlxr/test/TestDecodeHex.java index fe40551..bf143ec 100644 --- a/src/main/java/io/github/ehlxr/test/TestDecodeHex.java +++ b/src/main/java/io/github/ehlxr/test/TestDecodeHex.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.test; import org.apache.commons.codec.binary.Hex; diff --git a/src/main/java/io/github/ehlxr/test/TestException.java b/src/main/java/io/github/ehlxr/test/TestException.java index b0c99b7..e075848 100644 --- a/src/main/java/io/github/ehlxr/test/TestException.java +++ b/src/main/java/io/github/ehlxr/test/TestException.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.test; /** diff --git a/src/main/java/io/github/ehlxr/test/TestFile.java b/src/main/java/io/github/ehlxr/test/TestFile.java index b33679c..0719d44 100644 --- a/src/main/java/io/github/ehlxr/test/TestFile.java +++ b/src/main/java/io/github/ehlxr/test/TestFile.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.test; import java.io.BufferedReader; diff --git a/src/main/java/io/github/ehlxr/test/TestGeoHash.java b/src/main/java/io/github/ehlxr/test/TestGeoHash.java index b3fa2fd..6670606 100644 --- a/src/main/java/io/github/ehlxr/test/TestGeoHash.java +++ b/src/main/java/io/github/ehlxr/test/TestGeoHash.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.test; import io.github.ehlxr.utils.GeoHash; diff --git a/src/main/java/io/github/ehlxr/test/TestJdbc.java b/src/main/java/io/github/ehlxr/test/TestJdbc.java index e4a43e3..06e6176 100644 --- a/src/main/java/io/github/ehlxr/test/TestJdbc.java +++ b/src/main/java/io/github/ehlxr/test/TestJdbc.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.test; import io.github.ehlxr.redis.JedisUtil; diff --git a/src/main/java/io/github/ehlxr/test/TestJdbc143.java b/src/main/java/io/github/ehlxr/test/TestJdbc143.java index 69ae9d3..7ec5579 100644 --- a/src/main/java/io/github/ehlxr/test/TestJdbc143.java +++ b/src/main/java/io/github/ehlxr/test/TestJdbc143.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.test; import java.sql.Connection; diff --git a/src/main/java/io/github/ehlxr/test/TestJdbc26.java b/src/main/java/io/github/ehlxr/test/TestJdbc26.java index 94130a7..dfcc43c 100644 --- a/src/main/java/io/github/ehlxr/test/TestJdbc26.java +++ b/src/main/java/io/github/ehlxr/test/TestJdbc26.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.test; import java.sql.Connection; diff --git a/src/main/java/io/github/ehlxr/test/TestReadFile.java b/src/main/java/io/github/ehlxr/test/TestReadFile.java index 7d6aa0c..2e2d772 100644 --- a/src/main/java/io/github/ehlxr/test/TestReadFile.java +++ b/src/main/java/io/github/ehlxr/test/TestReadFile.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.test; import java.io.BufferedReader; diff --git a/src/main/java/io/github/ehlxr/test/TestReference.java b/src/main/java/io/github/ehlxr/test/TestReference.java index 855cff7..3ca44e5 100644 --- a/src/main/java/io/github/ehlxr/test/TestReference.java +++ b/src/main/java/io/github/ehlxr/test/TestReference.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.test; /** diff --git a/src/main/java/io/github/ehlxr/test/TestSyncLogData.java b/src/main/java/io/github/ehlxr/test/TestSyncLogData.java index 31f1cb9..324b9c5 100644 --- a/src/main/java/io/github/ehlxr/test/TestSyncLogData.java +++ b/src/main/java/io/github/ehlxr/test/TestSyncLogData.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.test; import com.caucho.hessian.client.HessianProxyFactory; diff --git a/src/main/java/io/github/ehlxr/test/TestThread.java b/src/main/java/io/github/ehlxr/test/TestThread.java index b9f16d1..7aae2d7 100644 --- a/src/main/java/io/github/ehlxr/test/TestThread.java +++ b/src/main/java/io/github/ehlxr/test/TestThread.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.test; import io.github.ehlxr.utils.HttpClientUtil; diff --git a/src/main/java/io/github/ehlxr/testminisite/TestMinisite.java b/src/main/java/io/github/ehlxr/testminisite/TestMinisite.java index ac1822f..4d5dc0a 100644 --- a/src/main/java/io/github/ehlxr/testminisite/TestMinisite.java +++ b/src/main/java/io/github/ehlxr/testminisite/TestMinisite.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.testminisite; import io.github.ehlxr.utils.HttpClientUtil; @@ -6,29 +30,29 @@ import java.util.HashMap; import java.util.Map; public class TestMinisite { - public static String URL = "http://127.0.0.1:8080/dsp-minisite/Audi2016Q2/getProvinces"; + public static String URL = "http://127.0.0.1:8080/dsp-minisite/Audi2016Q2/getProvinces"; - public static void main(String[] args) throws Exception { - Map params = new HashMap<>(); - params.put("project", "1"); - params.put("bid","1"); - params.put("mapid","1"); - params.put("name","1"); - params.put("gender","1"); - params.put("tel","1"); - params.put("favoriteModel","1"); - params.put("province","1"); - params.put("city","1"); - params.put("dealerName","1"); - params.put("dealerCode","1"); - params.put("scheduledTime","1"); - params.put("budget","1"); - - params.put("provinceName","北京"); - params.put("cityName","北京"); - -// System.out.println(HttpClientUtil.sendPostParam(URL, params)); - System.out.println(HttpClientUtil.sendGet(URL)); - } + public static void main(String[] args) throws Exception { + Map params = new HashMap<>(); + params.put("project", "1"); + params.put("bid","1"); + params.put("mapid","1"); + params.put("name","1"); + params.put("gender","1"); + params.put("tel","1"); + params.put("favoriteModel","1"); + params.put("province","1"); + params.put("city","1"); + params.put("dealerName","1"); + params.put("dealerCode","1"); + params.put("scheduledTime","1"); + params.put("budget","1"); + + params.put("provinceName","北京"); + params.put("cityName","北京"); + + // System.out.println(HttpClientUtil.sendPostParam(URL, params)); + System.out.println(HttpClientUtil.sendGet(URL)); + } } diff --git a/src/main/java/io/github/ehlxr/testopen/SignatureUtil.java b/src/main/java/io/github/ehlxr/testopen/SignatureUtil.java index d5f4c01..6b86a6f 100644 --- a/src/main/java/io/github/ehlxr/testopen/SignatureUtil.java +++ b/src/main/java/io/github/ehlxr/testopen/SignatureUtil.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.testopen; @@ -40,7 +64,7 @@ public class SignatureUtil { /** * 使用指定算法生成消息摘要,默认是md5 - * + * * @param strSrc * , a string will be encrypted;
* @param encName @@ -66,7 +90,7 @@ public class SignatureUtil { /** * 根据appid、token、lol以及时间戳来生成签名 - * + * * @param appid * @param token * @param lol @@ -101,7 +125,7 @@ public class SignatureUtil { * 1.根据appid获取该渠道的token;
* 2.根据appid、token、lol以及时间戳计算一次签名;
* 3.比较传过来的签名以及计算出的签名是否一致; - * + * * @param signature * @param appid * @param lol @@ -117,17 +141,17 @@ public class SignatureUtil { public static void main(String[] args) { String xmlString = "testtesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttest"; System.out.println(xmlString.getBytes().length); - + //消息 String digest = SignatureUtil.digest(xmlString, "MD5"); System.out.println("----" + digest); System.out.println(digest.getBytes().length); - - + + String appid = "canairport001"; String token = "111ddff"; long millis = System.currentTimeMillis(); - + //生成签名 String signature = SignatureUtil.generateSignature(appid, token, digest, millis); diff --git a/src/main/java/io/github/ehlxr/testopen/TestOpenPuton.java b/src/main/java/io/github/ehlxr/testopen/TestOpenPuton.java index 6ba91c0..7b2e3d6 100644 --- a/src/main/java/io/github/ehlxr/testopen/TestOpenPuton.java +++ b/src/main/java/io/github/ehlxr/testopen/TestOpenPuton.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.testopen; import io.github.ehlxr.utils.AESTool; @@ -11,263 +35,263 @@ import java.util.HashMap; import java.util.Map; public class TestOpenPuton { - private static final String URL = "http://127.0.0.1:8080/dsp-open/pxene/dsp.do"; - private static final String key = "adjdjfjfjfjdkdkd";// - private static final String appid = "t123456";// 用户 - private static final String token = "cst123456";// 令牌 + private static final String URL = "http://127.0.0.1:8080/dsp-open/pxene/dsp.do"; + private static final String key = "adjdjfjfjfjdkdkd";// + private static final String appid = "t123456";// 用户 + private static final String token = "cst123456";// 令牌 - public static void main(String[] args) throws Exception { + public static void main(String[] args) throws Exception { - // String sendPostParam = HttpClientUtil.sendPostParam(URL, getPostParam("setAdxProp"));// 获得数据并且发送请求 - // String data = getData(sendPostParam); - // System.out.println(JSONObject.fromObject(data)); + // String sendPostParam = HttpClientUtil.sendPostParam(URL, getPostParam("setAdxProp"));// 获得数据并且发送请求 + // String data = getData(sendPostParam); + // System.out.println(JSONObject.fromObject(data)); - JSONObject json = new JSONObject(); - json.put("param", "中午"); - String str = "{\"order_info\":{\"put_time\":[],\"cost_type\":1,\"order_budget\":{\"budget_all\":100.0},\"cost_single\":100.0,\"type\":1,\"order_id\":14575,\"landing_page\":\"www.baidu.com\",\"order_name\":\"tony-test-31\",\"brand_en\":null,\"plat\":1,\"end_time\":\"2016-05-03\",\"creative_group\":[{\"group_name\":\"test_五一\",\"plat\":1,\"ratio\":\"-\",\"group_id\":405,\"click_code\":null,\"impression_code\":null,\"landing_page\":\"www.baidu.com\"}],\"buy_type\":1,\"order_freq\":{\"imp_day_req\":5,\"click_total_freq\":5,\"imp_total_req\":10,\"click_day_freq\":1},\"ad_owner\":{\"owner_qualification\":[],\"owner_name\":\"ABI\",\"organization_code\":null,\"owner_id\":107,\"owner_category\":\"食品饮料>健康饮料,运动饮料,功能性饮料\",\"website_url\":\"http://sedrin.reloadbuzz.com/food2/xueJin/index.php/home/user/index\"},\"start_time\":\"2016-05-03\",\"order_goal\":{\"order_total_show\":1},\"brand_zh\":\"Sedrin\",\"industry\":\"食品饮料>健康饮料,运动饮料,功能性饮料\",\"note\":\"媒体类型定向:\\nnull\\n\\n关键词定向:\\n123\\n\\n广告素材轮播:\\n平均\\n\\n备注:\\n备注1(资源设置):\\n321\\n\\n\\n\"}}"; + JSONObject json = new JSONObject(); + json.put("param", "中午"); + String str = "{\"order_info\":{\"put_time\":[],\"cost_type\":1,\"order_budget\":{\"budget_all\":100.0},\"cost_single\":100.0,\"type\":1,\"order_id\":14575,\"landing_page\":\"www.baidu.com\",\"order_name\":\"tony-test-31\",\"brand_en\":null,\"plat\":1,\"end_time\":\"2016-05-03\",\"creative_group\":[{\"group_name\":\"test_五一\",\"plat\":1,\"ratio\":\"-\",\"group_id\":405,\"click_code\":null,\"impression_code\":null,\"landing_page\":\"www.baidu.com\"}],\"buy_type\":1,\"order_freq\":{\"imp_day_req\":5,\"click_total_freq\":5,\"imp_total_req\":10,\"click_day_freq\":1},\"ad_owner\":{\"owner_qualification\":[],\"owner_name\":\"ABI\",\"organization_code\":null,\"owner_id\":107,\"owner_category\":\"食品饮料>健康饮料,运动饮料,功能性饮料\",\"website_url\":\"http://sedrin.reloadbuzz.com/food2/xueJin/index.php/home/user/index\"},\"start_time\":\"2016-05-03\",\"order_goal\":{\"order_total_show\":1},\"brand_zh\":\"Sedrin\",\"industry\":\"食品饮料>健康饮料,运动饮料,功能性饮料\",\"note\":\"媒体类型定向:\\nnull\\n\\n关键词定向:\\n123\\n\\n广告素材轮播:\\n平均\\n\\n备注:\\n备注1(资源设置):\\n321\\n\\n\\n\"}}"; - System.out.println(HttpClientUtil.sendPostJSONData(URL, str)); - } + System.out.println(HttpClientUtil.sendPostJSONData(URL, str)); + } - public static String getData(String encryptString) throws Exception { - byte[] decode = Base64.decode(encryptString.getBytes()); - String aString = new String(decode, StandardCharsets.UTF_8); - String decrypt = AESTool.decrypt(aString, key); - return decrypt; - } + public static String getData(String encryptString) throws Exception { + byte[] decode = Base64.decode(encryptString.getBytes()); + String aString = new String(decode, StandardCharsets.UTF_8); + String decrypt = AESTool.decrypt(aString, key); + return decrypt; + } - public static Map getPostParam(String content) throws Exception { - Map postParam = new HashMap(); - content = getContent(content); + public static Map getPostParam(String content) throws Exception { + Map postParam = new HashMap(); + content = getContent(content); - // 业务数据 - long millis = System.currentTimeMillis();// 时间戳j - content = AESTool.encrypt(content, key);// 使用aes加密 - String lol = SignatureUtil.digest(content, "MD5");// 摘要 - String signature = SignatureUtil.generateSignature(appid, token, lol, millis);// 签名 + // 业务数据 + long millis = System.currentTimeMillis();// 时间戳j + content = AESTool.encrypt(content, key);// 使用aes加密 + String lol = SignatureUtil.digest(content, "MD5");// 摘要 + String signature = SignatureUtil.generateSignature(appid, token, lol, millis);// 签名 - // 准备提交数据 - postParam.put("appid", appid); - postParam.put("content", content); - postParam.put("lol", lol); - postParam.put("signature", signature); - postParam.put("millis", millis + ""); + // 准备提交数据 + postParam.put("appid", appid); + postParam.put("content", content); + postParam.put("lol", lol); + postParam.put("signature", signature); + postParam.put("millis", millis + ""); - return postParam; - } + return postParam; + } - // 在这里写请求数据 - public static String getContent(String contentName) { - JSONObject content = new JSONObject(); - JSONObject param = new JSONObject(); - content.put("servicename", "putonServiceCall"); + // 在这里写请求数据 + public static String getContent(String contentName) { + JSONObject content = new JSONObject(); + JSONObject param = new JSONObject(); + content.put("servicename", "putonServiceCall"); - switch (contentName) { - case "putOnByCreative": - param.put("campaignid", "26861f62-5cd7-4073-9186-676f8f5d7b24"); - param.put("groupid", "022ea1a5-3f21-40dd-9c24-c0edfa82bfda"); - param.put("adxid", "1fed4171-9925-4834-aa7b-9b4d3a58841b"); - - JSONArray mapIds = new JSONArray(); - mapIds.add("28f13909-dbbe-42e4-b9fd-edd97a31d6ce"); - mapIds.add("8b7b1b4a-eb3a-4be0-809b-b497c58a14f6"); - mapIds.add("b7f39e0c-3025-4fa3-8e83-ef1f492fe358"); - param.put("mapids", mapIds); + switch (contentName) { + case "putOnByCreative": + param.put("campaignid", "26861f62-5cd7-4073-9186-676f8f5d7b24"); + param.put("groupid", "022ea1a5-3f21-40dd-9c24-c0edfa82bfda"); + param.put("adxid", "1fed4171-9925-4834-aa7b-9b4d3a58841b"); - content.put("funcname", "putOnByCreative"); - content.put("methodparam", param); - break; - case "pauseByCreative": - param.put("groupid", "022ea1a5-3f21-40dd-9c24-c0edfa82bfda"); - param.put("adxid", "1fed4171-9925-4834-aa7b-9b4d3a58841b"); - - mapIds = new JSONArray(); - mapIds.add("28f13909-dbbe-42e4-b9fd-edd97a31d6ce"); - mapIds.add("8b7b1b4a-eb3a-4be0-809b-b497c58a14f6"); - mapIds.add("b7f39e0c-3025-4fa3-8e83-ef1f492fe358"); - param.put("mapids", mapIds); - - content.put("funcname", "pauseByCreative"); - content.put("methodparam", param); - break; - case "putOnByAdx": - param.put("campaignid", "26861f62-5cd7-4073-9186-676f8f5d7b24"); - - JSONArray groupAdxs = new JSONArray(); - JSONObject groupAdx = new JSONObject(); - groupAdx.put("groupid", "022ea1a5-3f21-40dd-9c24-c0edfa82bfda"); - groupAdx.put("adxid", "1fed4171-9925-4834-aa7b-9b4d3a58841b"); - groupAdxs.add(groupAdx); - groupAdx = new JSONObject(); - groupAdx.put("groupid", "022ea1a5-3f21-40dd-9c24-c0edfa82bfda"); - groupAdx.put("adxid", "6246ae47-d24b-4afa-88ba-57417ccab6aa"); - groupAdxs.add(groupAdx); - groupAdx = new JSONObject(); - groupAdx.put("groupid", "022ea1a5-3f21-40dd-9c24-c0edfa82bfda"); - groupAdx.put("adxid", "ce579246-e707-4cb9-b982-88cad7944b92"); - groupAdxs.add(groupAdx); - - param.put("groupadxs", groupAdxs); - - content.put("funcname", "putOnByAdx"); - content.put("methodparam", param); - break; - case "pauseByAdx": - groupAdxs = new JSONArray(); - groupAdx = new JSONObject(); - groupAdx.put("groupid", "022ea1a5-3f21-40dd-9c24-c0edfa82bfda"); - groupAdx.put("adxid", "1fed4171-9925-4834-aa7b-9b4d3a58841b"); - groupAdxs.add(groupAdx); - groupAdx = new JSONObject(); - groupAdx.put("groupid", "022ea1a5-3f21-40dd-9c24-c0edfa82bfda"); - groupAdx.put("adxid", "6246ae47-d24b-4afa-88ba-57417ccab6aa"); - groupAdxs.add(groupAdx); - groupAdx = new JSONObject(); - groupAdx.put("groupid", "022ea1a5-3f21-40dd-9c24-c0edfa82bfda"); - groupAdx.put("adxid", "ce579246-e707-4cb9-b982-88cad7944b92"); - groupAdxs.add(groupAdx); - - param.put("groupadxs", groupAdxs); - - content.put("funcname", "pauseByAdx"); - content.put("methodparam", param); - break; - case "putOnByGroup": - param.put("campaignid", "26861f62-5cd7-4073-9186-676f8f5d7b24"); - - JSONArray groupids = new JSONArray(); - groupids.add("022ea1a5-3f21-40dd-9c24-c0edfa82bfda"); - param.put("groupids", groupids); + JSONArray mapIds = new JSONArray(); + mapIds.add("28f13909-dbbe-42e4-b9fd-edd97a31d6ce"); + mapIds.add("8b7b1b4a-eb3a-4be0-809b-b497c58a14f6"); + mapIds.add("b7f39e0c-3025-4fa3-8e83-ef1f492fe358"); + param.put("mapids", mapIds); - content.put("funcname", "putOnByGroup"); - content.put("methodparam", param); - break; - case "pauseByGroup": - groupids = new JSONArray(); - groupids.add("022ea1a5-3f21-40dd-9c24-c0edfa82bfda"); - param.put("groupids", groupids); - - content.put("funcname", "pauseByGroup"); - content.put("methodparam", param); - break; - case "putOnByCampaign": - JSONArray campaignids = new JSONArray(); - campaignids.add("26861f62-5cd7-4073-9186-676f8f5d7b24"); - param.put("campaignids", campaignids); - - content.put("funcname", "putOnByCampaign"); - content.put("methodparam", param); - break; - case "pauseByCampaign": - campaignids = new JSONArray(); - campaignids.add("26861f62-5cd7-4073-9186-676f8f5d7b24"); - param.put("campaignids", campaignids); - - content.put("funcname", "pauseByCampaign"); - content.put("methodparam", param); - break; - case "setAdxProp": - JSONArray propdatas = new JSONArray(); - JSONObject propdata = new JSONObject(); - JSONObject adxprop = new JSONObject(); - JSONArray adxprops = new JSONArray(); - - adxprop.put("adxid", "1fed4171-9925-4834-aa7b-9b4d3a58841b"); - adxprop.put("prop", 20); - adxprops.add(adxprop); - - adxprop = new JSONObject(); - adxprop.put("adxid", "6246ae47-d24b-4afa-88ba-57417ccab6aa"); - adxprop.put("prop", 15.5); - adxprops.add(adxprop); - - adxprop = new JSONObject(); - adxprop.put("adxid", "ce579246-e707-4cb9-b982-88cad7944b92"); - adxprop.put("prop", 26.5); - adxprops.add(adxprop); - - propdata.put("groupid", "022ea1a5-3f21-40dd-9c24-c0edfa82bfda"); - propdata.put("adxprops", adxprops); - - propdatas.add(propdata); - - param.put("propdatas", propdatas); - content.put("funcname", "setAdxProp"); - content.put("methodparam", param); - break; - case "setCreateivePrice": - JSONArray createiveprices = new JSONArray(); - - JSONObject createiveprice = new JSONObject(); - createiveprice.put("mapid", "28f13909-dbbe-42e4-b9fd-edd97a31d6ce"); - createiveprice.put("price", 10); - createiveprices.add(createiveprice); - - createiveprice = new JSONObject(); - createiveprice.put("mapid", "8b7b1b4a-eb3a-4be0-809b-b497c58a14f6"); - createiveprice.put("price", 6); - createiveprices.add(createiveprice); - - createiveprice = new JSONObject(); - createiveprice.put("mapid", "b7f39e0c-3025-4fa3-8e83-ef1f492fe358"); - createiveprice.put("price", 8); - createiveprices.add(createiveprice); - - param.put("groupid", "022ea1a5-3f21-40dd-9c24-c0edfa82bfda"); - param.put("adxid", "1fed4171-9925-4834-aa7b-9b4d3a58841b"); - param.put("createiveprices", createiveprices); - - content.put("funcname", "setCreateivePrice"); - content.put("methodparam", param); - break; - case "getKpiByCampaignIds": - campaignids = new JSONArray(); - campaignids.add("26861f62-5cd7-4073-9186-676f8f5d7b24"); - - param.put("campaignids", campaignids); - - content.put("funcname", "getKpiByCampaignIds"); - content.put("methodparam", param); - break; - case "getKpiByGroupIds": - groupids = new JSONArray(); - groupids.add("022ea1a5-3f21-40dd-9c24-c0edfa82bfda"); - - param.put("groupids", groupids); - - content.put("funcname", "getKpiByGroupIds"); - content.put("methodparam", param); - break; - case "getKpiByAdxIds": - JSONArray adxids = new JSONArray(); - adxids.add("1fed4171-9925-4834-aa7b-9b4d3a58841b"); - adxids.add("6246ae47-d24b-4afa-88ba-57417ccab6aa"); - adxids.add("ce579246-e707-4cb9-b982-88cad7944b92"); - - param.put("groupid", "022ea1a5-3f21-40dd-9c24-c0edfa82bfda"); - param.put("adxids", adxids); - - content.put("funcname", "getKpiByAdxIds"); - content.put("methodparam", param); - break; - case "getKpiByMapIds": - JSONArray mapids = new JSONArray(); - mapids.add("28f13909-dbbe-42e4-b9fd-edd97a31d6ce"); - mapids.add("8b7b1b4a-eb3a-4be0-809b-b497c58a14f6"); - mapids.add("b7f39e0c-3025-4fa3-8e83-ef1f492fe358"); - - param.put("groupid", "022ea1a5-3f21-40dd-9c24-c0edfa82bfda"); - param.put("adxid", "1fed4171-9925-4834-aa7b-9b4d3a58841b"); - param.put("mapids", mapids); - - content.put("funcname", "getKpiByMapIds"); - content.put("methodparam", param); - break; - default: - break; - } - System.out.println(content.toString()); - return content.toString(); - } + content.put("funcname", "putOnByCreative"); + content.put("methodparam", param); + break; + case "pauseByCreative": + param.put("groupid", "022ea1a5-3f21-40dd-9c24-c0edfa82bfda"); + param.put("adxid", "1fed4171-9925-4834-aa7b-9b4d3a58841b"); + + mapIds = new JSONArray(); + mapIds.add("28f13909-dbbe-42e4-b9fd-edd97a31d6ce"); + mapIds.add("8b7b1b4a-eb3a-4be0-809b-b497c58a14f6"); + mapIds.add("b7f39e0c-3025-4fa3-8e83-ef1f492fe358"); + param.put("mapids", mapIds); + + content.put("funcname", "pauseByCreative"); + content.put("methodparam", param); + break; + case "putOnByAdx": + param.put("campaignid", "26861f62-5cd7-4073-9186-676f8f5d7b24"); + + JSONArray groupAdxs = new JSONArray(); + JSONObject groupAdx = new JSONObject(); + groupAdx.put("groupid", "022ea1a5-3f21-40dd-9c24-c0edfa82bfda"); + groupAdx.put("adxid", "1fed4171-9925-4834-aa7b-9b4d3a58841b"); + groupAdxs.add(groupAdx); + groupAdx = new JSONObject(); + groupAdx.put("groupid", "022ea1a5-3f21-40dd-9c24-c0edfa82bfda"); + groupAdx.put("adxid", "6246ae47-d24b-4afa-88ba-57417ccab6aa"); + groupAdxs.add(groupAdx); + groupAdx = new JSONObject(); + groupAdx.put("groupid", "022ea1a5-3f21-40dd-9c24-c0edfa82bfda"); + groupAdx.put("adxid", "ce579246-e707-4cb9-b982-88cad7944b92"); + groupAdxs.add(groupAdx); + + param.put("groupadxs", groupAdxs); + + content.put("funcname", "putOnByAdx"); + content.put("methodparam", param); + break; + case "pauseByAdx": + groupAdxs = new JSONArray(); + groupAdx = new JSONObject(); + groupAdx.put("groupid", "022ea1a5-3f21-40dd-9c24-c0edfa82bfda"); + groupAdx.put("adxid", "1fed4171-9925-4834-aa7b-9b4d3a58841b"); + groupAdxs.add(groupAdx); + groupAdx = new JSONObject(); + groupAdx.put("groupid", "022ea1a5-3f21-40dd-9c24-c0edfa82bfda"); + groupAdx.put("adxid", "6246ae47-d24b-4afa-88ba-57417ccab6aa"); + groupAdxs.add(groupAdx); + groupAdx = new JSONObject(); + groupAdx.put("groupid", "022ea1a5-3f21-40dd-9c24-c0edfa82bfda"); + groupAdx.put("adxid", "ce579246-e707-4cb9-b982-88cad7944b92"); + groupAdxs.add(groupAdx); + + param.put("groupadxs", groupAdxs); + + content.put("funcname", "pauseByAdx"); + content.put("methodparam", param); + break; + case "putOnByGroup": + param.put("campaignid", "26861f62-5cd7-4073-9186-676f8f5d7b24"); + + JSONArray groupids = new JSONArray(); + groupids.add("022ea1a5-3f21-40dd-9c24-c0edfa82bfda"); + param.put("groupids", groupids); + + content.put("funcname", "putOnByGroup"); + content.put("methodparam", param); + break; + case "pauseByGroup": + groupids = new JSONArray(); + groupids.add("022ea1a5-3f21-40dd-9c24-c0edfa82bfda"); + param.put("groupids", groupids); + + content.put("funcname", "pauseByGroup"); + content.put("methodparam", param); + break; + case "putOnByCampaign": + JSONArray campaignids = new JSONArray(); + campaignids.add("26861f62-5cd7-4073-9186-676f8f5d7b24"); + param.put("campaignids", campaignids); + + content.put("funcname", "putOnByCampaign"); + content.put("methodparam", param); + break; + case "pauseByCampaign": + campaignids = new JSONArray(); + campaignids.add("26861f62-5cd7-4073-9186-676f8f5d7b24"); + param.put("campaignids", campaignids); + + content.put("funcname", "pauseByCampaign"); + content.put("methodparam", param); + break; + case "setAdxProp": + JSONArray propdatas = new JSONArray(); + JSONObject propdata = new JSONObject(); + JSONObject adxprop = new JSONObject(); + JSONArray adxprops = new JSONArray(); + + adxprop.put("adxid", "1fed4171-9925-4834-aa7b-9b4d3a58841b"); + adxprop.put("prop", 20); + adxprops.add(adxprop); + + adxprop = new JSONObject(); + adxprop.put("adxid", "6246ae47-d24b-4afa-88ba-57417ccab6aa"); + adxprop.put("prop", 15.5); + adxprops.add(adxprop); + + adxprop = new JSONObject(); + adxprop.put("adxid", "ce579246-e707-4cb9-b982-88cad7944b92"); + adxprop.put("prop", 26.5); + adxprops.add(adxprop); + + propdata.put("groupid", "022ea1a5-3f21-40dd-9c24-c0edfa82bfda"); + propdata.put("adxprops", adxprops); + + propdatas.add(propdata); + + param.put("propdatas", propdatas); + content.put("funcname", "setAdxProp"); + content.put("methodparam", param); + break; + case "setCreateivePrice": + JSONArray createiveprices = new JSONArray(); + + JSONObject createiveprice = new JSONObject(); + createiveprice.put("mapid", "28f13909-dbbe-42e4-b9fd-edd97a31d6ce"); + createiveprice.put("price", 10); + createiveprices.add(createiveprice); + + createiveprice = new JSONObject(); + createiveprice.put("mapid", "8b7b1b4a-eb3a-4be0-809b-b497c58a14f6"); + createiveprice.put("price", 6); + createiveprices.add(createiveprice); + + createiveprice = new JSONObject(); + createiveprice.put("mapid", "b7f39e0c-3025-4fa3-8e83-ef1f492fe358"); + createiveprice.put("price", 8); + createiveprices.add(createiveprice); + + param.put("groupid", "022ea1a5-3f21-40dd-9c24-c0edfa82bfda"); + param.put("adxid", "1fed4171-9925-4834-aa7b-9b4d3a58841b"); + param.put("createiveprices", createiveprices); + + content.put("funcname", "setCreateivePrice"); + content.put("methodparam", param); + break; + case "getKpiByCampaignIds": + campaignids = new JSONArray(); + campaignids.add("26861f62-5cd7-4073-9186-676f8f5d7b24"); + + param.put("campaignids", campaignids); + + content.put("funcname", "getKpiByCampaignIds"); + content.put("methodparam", param); + break; + case "getKpiByGroupIds": + groupids = new JSONArray(); + groupids.add("022ea1a5-3f21-40dd-9c24-c0edfa82bfda"); + + param.put("groupids", groupids); + + content.put("funcname", "getKpiByGroupIds"); + content.put("methodparam", param); + break; + case "getKpiByAdxIds": + JSONArray adxids = new JSONArray(); + adxids.add("1fed4171-9925-4834-aa7b-9b4d3a58841b"); + adxids.add("6246ae47-d24b-4afa-88ba-57417ccab6aa"); + adxids.add("ce579246-e707-4cb9-b982-88cad7944b92"); + + param.put("groupid", "022ea1a5-3f21-40dd-9c24-c0edfa82bfda"); + param.put("adxids", adxids); + + content.put("funcname", "getKpiByAdxIds"); + content.put("methodparam", param); + break; + case "getKpiByMapIds": + JSONArray mapids = new JSONArray(); + mapids.add("28f13909-dbbe-42e4-b9fd-edd97a31d6ce"); + mapids.add("8b7b1b4a-eb3a-4be0-809b-b497c58a14f6"); + mapids.add("b7f39e0c-3025-4fa3-8e83-ef1f492fe358"); + + param.put("groupid", "022ea1a5-3f21-40dd-9c24-c0edfa82bfda"); + param.put("adxid", "1fed4171-9925-4834-aa7b-9b4d3a58841b"); + param.put("mapids", mapids); + + content.put("funcname", "getKpiByMapIds"); + content.put("methodparam", param); + break; + default: + break; + } + System.out.println(content.toString()); + return content.toString(); + } } diff --git a/src/main/java/io/github/ehlxr/thread/TestSingleThreadExecutor.java b/src/main/java/io/github/ehlxr/thread/TestSingleThreadExecutor.java index 9a2aefc..63c8fc0 100644 --- a/src/main/java/io/github/ehlxr/thread/TestSingleThreadExecutor.java +++ b/src/main/java/io/github/ehlxr/thread/TestSingleThreadExecutor.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.thread; import java.util.concurrent.ExecutorService; diff --git a/src/main/java/io/github/ehlxr/thread/ThreadPoolExecutorTest.java b/src/main/java/io/github/ehlxr/thread/ThreadPoolExecutorTest.java index c6f3497..9032000 100644 --- a/src/main/java/io/github/ehlxr/thread/ThreadPoolExecutorTest.java +++ b/src/main/java/io/github/ehlxr/thread/ThreadPoolExecutorTest.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.thread; import java.util.concurrent.ExecutorService; diff --git a/src/main/java/io/github/ehlxr/token/Base62.java b/src/main/java/io/github/ehlxr/token/Base62.java index 324d83e..44db990 100644 --- a/src/main/java/io/github/ehlxr/token/Base62.java +++ b/src/main/java/io/github/ehlxr/token/Base62.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.token; diff --git a/src/main/java/io/github/ehlxr/token/TokenCommonUtil.java b/src/main/java/io/github/ehlxr/token/TokenCommonUtil.java index 38d2591..626cfa3 100644 --- a/src/main/java/io/github/ehlxr/token/TokenCommonUtil.java +++ b/src/main/java/io/github/ehlxr/token/TokenCommonUtil.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.token; import java.security.MessageDigest; diff --git a/src/main/java/io/github/ehlxr/token/TokenServerUtil.java b/src/main/java/io/github/ehlxr/token/TokenServerUtil.java index 7b705d1..e657d5d 100644 --- a/src/main/java/io/github/ehlxr/token/TokenServerUtil.java +++ b/src/main/java/io/github/ehlxr/token/TokenServerUtil.java @@ -1,5 +1,28 @@ -package io.github.ehlxr.token; +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package io.github.ehlxr.token; import java.io.IOException; @@ -10,7 +33,6 @@ import java.io.IOException; public class TokenServerUtil { - public static void main(String[] args) throws Exception { Long uid = 178934567l; // System.out.println(Long.toBinaryString(uid)); diff --git a/src/main/java/io/github/ehlxr/token/TokenVersionConfig.java b/src/main/java/io/github/ehlxr/token/TokenVersionConfig.java index e1b1368..6c70aaf 100644 --- a/src/main/java/io/github/ehlxr/token/TokenVersionConfig.java +++ b/src/main/java/io/github/ehlxr/token/TokenVersionConfig.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.token; /** diff --git a/src/main/java/io/github/ehlxr/token/TokenVersionEnum.java b/src/main/java/io/github/ehlxr/token/TokenVersionEnum.java index 9fa04e2..2a51911 100644 --- a/src/main/java/io/github/ehlxr/token/TokenVersionEnum.java +++ b/src/main/java/io/github/ehlxr/token/TokenVersionEnum.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.token; import com.google.common.collect.BiMap; diff --git a/src/main/java/io/github/ehlxr/token/TokenVersionFactory.java b/src/main/java/io/github/ehlxr/token/TokenVersionFactory.java index c86b04f..2b21645 100644 --- a/src/main/java/io/github/ehlxr/token/TokenVersionFactory.java +++ b/src/main/java/io/github/ehlxr/token/TokenVersionFactory.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.token; diff --git a/src/main/java/io/github/ehlxr/utils/AESTool.java b/src/main/java/io/github/ehlxr/utils/AESTool.java index 08ea457..1da852f 100644 --- a/src/main/java/io/github/ehlxr/utils/AESTool.java +++ b/src/main/java/io/github/ehlxr/utils/AESTool.java @@ -1,5 +1,29 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.utils; - + import org.bouncycastle.crypto.CipherParameters; import org.bouncycastle.crypto.engines.AESFastEngine; import org.bouncycastle.crypto.modes.CBCBlockCipher; @@ -41,12 +65,12 @@ public class AESTool { /** * Decrypt the content with a given key using aes algorithm. - * + * * @param content * @param key * must contain exactly 32 characters * @return - * @throws Exception + * @throws Exception */ public static String decrypt(String content, String key) throws Exception { if (key == null) { @@ -68,7 +92,7 @@ public class AESTool { /** * Encrypt data. - * + * * @param plain * @param key * @param iv @@ -86,7 +110,7 @@ public class AESTool { /** * Decrypt data. - * + * * @param cipher * @param key * @param iv @@ -105,7 +129,7 @@ public class AESTool { /** * Encrypt or decrypt data. - * + * * @param cipher * @param data * @return diff --git a/src/main/java/io/github/ehlxr/utils/Base64.java b/src/main/java/io/github/ehlxr/utils/Base64.java index 0946d89..b1b5de3 100644 --- a/src/main/java/io/github/ehlxr/utils/Base64.java +++ b/src/main/java/io/github/ehlxr/utils/Base64.java @@ -1,84 +1,31 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.utils; import java.util.Arrays; -/** - * A very fast and memory efficient class to encode and decode to and from - * BASE64 in full accordance with RFC 2045.
- *
- * On Windows XP sp1 with 1.4.2_04 and later ;), this encoder and decoder is - * about 10 times faster on small arrays (10 - 1000 bytes) and 2-3 times as fast - * on larger arrays (10000 - 1000000 bytes) compared to - * sun.misc.Encoder()/Decoder().
- *
- * - * On byte arrays the encoder is about 20% faster than Jakarta Commons Base64 - * Codec for encode and about 50% faster for decoding large arrays. This - * implementation is about twice as fast on very small arrays (< 30 bytes). If - * source/destination is a String this version is about three times - * as fast due to the fact that the Commons Codec result has to be recoded to a - * String from byte[], which is very expensive.
- *
- * - * This encode/decode algorithm doesn't create any temporary arrays as many - * other codecs do, it only allocates the resulting array. This produces less - * garbage and it is possible to handle arrays twice as large as algorithms that - * create a temporary array. (E.g. Jakarta Commons Codec). It is unknown whether - * Sun's sun.misc.Encoder()/Decoder() produce temporary arrays but - * since performance is quite low it probably does.
- *
- * - * The encoder produces the same output as the Sun one except that the Sun's - * encoder appends a trailing line separator if the last character isn't a pad. - * Unclear why but it only adds to the length and is probably a side effect. - * Both are in conformance with RFC 2045 though.
- * Commons codec seem to always att a trailing line separator.
- *
- * - * Note! The encode/decode method pairs (types) come in three versions - * with the exact same algorithm and thus a lot of code redundancy. This - * is to not create any temporary arrays for transcoding to/from different - * format types. The methods not used can simply be commented out.
- *
- * - * There is also a "fast" version of all decode methods that works the same way - * as the normal ones, but har a few demands on the decoded input. Normally - * though, these fast verions should be used if the source if the input is known - * and it hasn't bee tampered with.
- *
- * - * If you find the code useful or you find a bug, please send me a note at - * base64 @ miginfocom . com. - * - * Licence (BSD): ============== - * - * Copyright (c) 2004, Mikael Grev, MiG InfoCom AB. (base64 @ miginfocom . com) - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. Redistributions in binary - * form must reproduce the above copyright notice, this list of conditions and - * the following disclaimer in the documentation and/or other materials provided - * with the distribution. Neither the name of the MiG InfoCom AB nor the names - * of its contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - */ - public class Base64 { private static final char[] CA = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".toCharArray(); private static final int[] IA = new int[256]; @@ -97,7 +44,7 @@ public class Base64 { /** * Encodes a raw byte array into a BASE64 char[] representation * i accordance with RFC 2045. - * + * * @param sArr * The bytes to convert. If null or length 0 an * empty array will be returned. @@ -116,8 +63,8 @@ public class Base64 { int eLen = (sLen / 3) * 3; // Length of even 24-bits. int cCnt = ((sLen - 1) / 3 + 1) << 2; // Returned character count int dLen = cCnt + (lineSep ? (cCnt - 1) / 76 << 1 : 0); // Length of - // returned - // array + // returned + // array char[] dArr = new char[dLen]; // Encode even 24-bits @@ -158,7 +105,7 @@ public class Base64 { /** * Decodes a BASE64 encoded char array. All illegal characters will be * ignored and can handle both arrays with and without line separators. - * + * * @param sArr * The source array. null or length 0 will return an * empty array. @@ -176,7 +123,7 @@ public class Base64 { // returned array will be, // so we don't have to reallocate & copy it later. int sepCnt = 0; // Number of separator characters. (Actually illegal - // characters, but that's a bonus...) + // characters, but that's a bonus...) for (int i = 0; i < sLen; i++) // If input is "pure" (I.e. no line separators or illegal chars) // base64 this loop can be commented out. @@ -201,7 +148,7 @@ public class Base64 { // Assemble three bytes into an int from four "valid" characters. int i = 0; for (int j = 0; j < 4; j++) { // j only increased if a valid char - // was found. + // was found. int c = IA[sArr[s++]]; if (c >= 0) i |= c << (18 - j * 6); @@ -229,7 +176,7 @@ public class Base64 { * must not contain illegal characters within the encoded string
* + The array CAN have illegal characters at the beginning and end, those * will be dealt with appropriately.
- * + * * @param sArr * The source array. Length 0 will return an empty array. * null will throw an exception. @@ -253,14 +200,14 @@ public class Base64 { // get the padding count (=) (0, 1 or 2) int pad = sArr[eIx] == '=' ? (sArr[eIx - 1] == '=' ? 2 : 1) : 0; // Count - // '=' - // at - // end. + // '=' + // at + // end. int cCnt = eIx - sIx + 1; // Content count including possible separators int sepCnt = sLen > 76 ? (sArr[76] == '\r' ? cCnt / 78 : 0) << 1 : 0; int len = ((cCnt - sepCnt) * 6 >> 3) - pad; // The number of decoded - // bytes + // bytes byte[] dArr = new byte[len]; // Preallocate byte[] of exact length // Decode all but the last 0 - 2 bytes. @@ -301,7 +248,7 @@ public class Base64 { /** * Encodes a raw byte array into a BASE64 byte[] representation * i accordance with RFC 2045. - * + * * @param sArr * The bytes to convert. If null or length 0 an * empty array will be returned. @@ -320,8 +267,8 @@ public class Base64 { int eLen = (sLen / 3) * 3; // Length of even 24-bits. int cCnt = ((sLen - 1) / 3 + 1) << 2; // Returned character count int dLen = cCnt + (lineSep ? (cCnt - 1) / 76 << 1 : 0); // Length of - // returned - // array + // returned + // array byte[] dArr = new byte[dLen]; // Encode even 24-bits @@ -362,7 +309,7 @@ public class Base64 { /** * Decodes a BASE64 encoded byte array. All illegal characters will be * ignored and can handle both arrays with and without line separators. - * + * * @param sArr * The source array. Length 0 will return an empty array. * null will throw an exception. @@ -378,7 +325,7 @@ public class Base64 { // returned array will be, // so we don't have to reallocate & copy it later. int sepCnt = 0; // Number of separator characters. (Actually illegal - // characters, but that's a bonus...) + // characters, but that's a bonus...) for (int i = 0; i < sLen; i++) // If input is "pure" (I.e. no line separators or illegal chars) // base64 this loop can be commented out. @@ -403,7 +350,7 @@ public class Base64 { // Assemble three bytes into an int from four "valid" characters. int i = 0; for (int j = 0; j < 4; j++) { // j only increased if a valid char - // was found. + // was found. int c = IA[sArr[s++] & 0xff]; if (c >= 0) i |= c << (18 - j * 6); @@ -433,7 +380,7 @@ public class Base64 { * must not contain illegal characters within the encoded string
* + The array CAN have illegal characters at the beginning and end, those * will be dealt with appropriately.
- * + * * @param sArr * The source array. Length 0 will return an empty array. * null will throw an exception. @@ -457,14 +404,14 @@ public class Base64 { // get the padding count (=) (0, 1 or 2) int pad = sArr[eIx] == '=' ? (sArr[eIx - 1] == '=' ? 2 : 1) : 0; // Count - // '=' - // at - // end. + // '=' + // at + // end. int cCnt = eIx - sIx + 1; // Content count including possible separators int sepCnt = sLen > 76 ? (sArr[76] == '\r' ? cCnt / 78 : 0) << 1 : 0; int len = ((cCnt - sepCnt) * 6 >> 3) - pad; // The number of decoded - // bytes + // bytes byte[] dArr = new byte[len]; // Preallocate byte[] of exact length // Decode all but the last 0 - 2 bytes. @@ -505,7 +452,7 @@ public class Base64 { /** * Encodes a raw byte array into a BASE64 String representation * i accordance with RFC 2045. - * + * * @param sArr * The bytes to convert. If null or length 0 an * empty array will be returned. @@ -529,7 +476,7 @@ public class Base64 { * decode(str.toCharArray()) instead. That will create a * temporary array though. This version will use str.charAt(i) * to iterate the string. - * + * * @param str * The source string. null or length 0 will return * an empty array. @@ -547,7 +494,7 @@ public class Base64 { // returned array will be, // so we don't have to reallocate & copy it later. int sepCnt = 0; // Number of separator characters. (Actually illegal - // characters, but that's a bonus...) + // characters, but that's a bonus...) for (int i = 0; i < sLen; i++) // If input is "pure" (I.e. no line separators or illegal chars) // base64 this loop can be commented out. @@ -573,7 +520,7 @@ public class Base64 { // Assemble three bytes into an int from four "valid" characters. int i = 0; for (int j = 0; j < 4; j++) { // j only increased if a valid char - // was found. + // was found. int c = IA[str.charAt(s++)]; if (c >= 0) i |= c << (18 - j * 6); @@ -601,7 +548,7 @@ public class Base64 { * must not contain illegal characters within the encoded string
* + The array CAN have illegal characters at the beginning and end, those * will be dealt with appropriately.
- * + * * @param s * The source string. Length 0 will return an empty array. * null will throw an exception. @@ -625,14 +572,14 @@ public class Base64 { // get the padding count (=) (0, 1 or 2) int pad = s.charAt(eIx) == '=' ? (s.charAt(eIx - 1) == '=' ? 2 : 1) : 0; // Count - // '=' - // at - // end. + // '=' + // at + // end. int cCnt = eIx - sIx + 1; // Content count including possible separators int sepCnt = sLen > 76 ? (s.charAt(76) == '\r' ? cCnt / 78 : 0) << 1 : 0; int len = ((cCnt - sepCnt) * 6 >> 3) - pad; // The number of decoded - // bytes + // bytes byte[] dArr = new byte[len]; // Preallocate byte[] of exact length // Decode all but the last 0 - 2 bytes. diff --git a/src/main/java/io/github/ehlxr/utils/CCRDFile.java b/src/main/java/io/github/ehlxr/utils/CCRDFile.java index 3ef2e85..69848d1 100644 --- a/src/main/java/io/github/ehlxr/utils/CCRDFile.java +++ b/src/main/java/io/github/ehlxr/utils/CCRDFile.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.utils; /** diff --git a/src/main/java/io/github/ehlxr/utils/Code.java b/src/main/java/io/github/ehlxr/utils/Code.java index aa799a4..b04e686 100644 --- a/src/main/java/io/github/ehlxr/utils/Code.java +++ b/src/main/java/io/github/ehlxr/utils/Code.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.utils; /** diff --git a/src/main/java/io/github/ehlxr/utils/CommonUtils.java b/src/main/java/io/github/ehlxr/utils/CommonUtils.java index 86dd705..46e32f3 100644 --- a/src/main/java/io/github/ehlxr/utils/CommonUtils.java +++ b/src/main/java/io/github/ehlxr/utils/CommonUtils.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.utils; import javax.servlet.http.HttpServletRequest; @@ -25,7 +49,7 @@ public class CommonUtils { /** * 对象转换成另一个类对象 - * + * * @param bean * 转换的数据对象 * @param clazz @@ -127,7 +151,7 @@ public class CommonUtils { /** * 获取当前网络ip - * + * * @param request * @return */ @@ -191,7 +215,7 @@ public class CommonUtils { /** * 基于googleMap中的算法得到两经纬度之间的距离,计算精度与谷歌地图的距离精度差不多,相差范围在0.2米以下 - * + * * @param lon1 * 第一点的精度 * @param lat1 diff --git a/src/main/java/io/github/ehlxr/utils/DateUtil.java b/src/main/java/io/github/ehlxr/utils/DateUtil.java index 3056aaa..a1e1198 100644 --- a/src/main/java/io/github/ehlxr/utils/DateUtil.java +++ b/src/main/java/io/github/ehlxr/utils/DateUtil.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.utils; import java.text.ParseException; diff --git a/src/main/java/io/github/ehlxr/utils/ExecShell.java b/src/main/java/io/github/ehlxr/utils/ExecShell.java index a64ef7e..2ec4c7c 100644 --- a/src/main/java/io/github/ehlxr/utils/ExecShell.java +++ b/src/main/java/io/github/ehlxr/utils/ExecShell.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.utils; import org.slf4j.Logger; @@ -16,6 +40,7 @@ import java.io.InputStreamReader; */ public class ExecShell { private static final Logger log = LoggerFactory.getLogger(ExecShell.class); + public static void execShellCommand(final String command) { Process process = null; DataOutputStream dataOutputStream = null; diff --git a/src/main/java/io/github/ehlxr/utils/FormType.java b/src/main/java/io/github/ehlxr/utils/FormType.java index 12ea562..265da99 100644 --- a/src/main/java/io/github/ehlxr/utils/FormType.java +++ b/src/main/java/io/github/ehlxr/utils/FormType.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.utils; /** diff --git a/src/main/java/io/github/ehlxr/utils/GeoHash.java b/src/main/java/io/github/ehlxr/utils/GeoHash.java index a72f19d..60d9c8c 100644 --- a/src/main/java/io/github/ehlxr/utils/GeoHash.java +++ b/src/main/java/io/github/ehlxr/utils/GeoHash.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.utils; import java.util.BitSet; diff --git a/src/main/java/io/github/ehlxr/utils/HttpClientUtil.java b/src/main/java/io/github/ehlxr/utils/HttpClientUtil.java index cdb65e2..078f9ac 100644 --- a/src/main/java/io/github/ehlxr/utils/HttpClientUtil.java +++ b/src/main/java/io/github/ehlxr/utils/HttpClientUtil.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.utils; import org.apache.commons.logging.Log; diff --git a/src/main/java/io/github/ehlxr/utils/HttpContentType.java b/src/main/java/io/github/ehlxr/utils/HttpContentType.java index 4cd0604..6172fdb 100644 --- a/src/main/java/io/github/ehlxr/utils/HttpContentType.java +++ b/src/main/java/io/github/ehlxr/utils/HttpContentType.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.utils; /** diff --git a/src/main/java/io/github/ehlxr/utils/HttpUtil.java b/src/main/java/io/github/ehlxr/utils/HttpUtil.java index a91b686..9310e58 100644 --- a/src/main/java/io/github/ehlxr/utils/HttpUtil.java +++ b/src/main/java/io/github/ehlxr/utils/HttpUtil.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.utils; import com.google.common.collect.Maps; diff --git a/src/main/java/io/github/ehlxr/utils/JsonUtils.java b/src/main/java/io/github/ehlxr/utils/JsonUtils.java index d69d07b..4a11790 100644 --- a/src/main/java/io/github/ehlxr/utils/JsonUtils.java +++ b/src/main/java/io/github/ehlxr/utils/JsonUtils.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.utils; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/src/main/java/io/github/ehlxr/utils/MD5.java b/src/main/java/io/github/ehlxr/utils/MD5.java index 36cb360..2f9d362 100644 --- a/src/main/java/io/github/ehlxr/utils/MD5.java +++ b/src/main/java/io/github/ehlxr/utils/MD5.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.utils; import org.apache.commons.codec.digest.DigestUtils; @@ -6,33 +30,33 @@ import java.io.UnsupportedEncodingException; public class MD5 { - public static String sign(String text, String key) { - return sign(text, key, "UTF-8"); - } + public static String sign(String text, String key) { + return sign(text, key, "UTF-8"); + } - public static String sign(String text, String key, String input_charset) { - text = text + key; - return DigestUtils.md5Hex(getContentBytes(text, input_charset)); - } - - public static boolean verify(String text, String sign, String key) { - return verify(text, sign, key, "UTF-8"); - } + public static String sign(String text, String key, String input_charset) { + text = text + key; + return DigestUtils.md5Hex(getContentBytes(text, input_charset)); + } - public static boolean verify(String text, String sign, String key, String input_charset) { - text = text + key; - String mysign = DigestUtils.md5Hex(getContentBytes(text, input_charset)); - return mysign.equals(sign); - } + public static boolean verify(String text, String sign, String key) { + return verify(text, sign, key, "UTF-8"); + } - private static byte[] getContentBytes(String content, String charset) { - if (charset == null || "".equals(charset)) { - return content.getBytes(); - } - try { - return content.getBytes(charset); - } catch (UnsupportedEncodingException e) { - throw new RuntimeException("MD5签名过程中出现错误,指定的编码集不对,您目前指定的编码集是:" + charset); - } - } + public static boolean verify(String text, String sign, String key, String input_charset) { + text = text + key; + String mysign = DigestUtils.md5Hex(getContentBytes(text, input_charset)); + return mysign.equals(sign); + } + + private static byte[] getContentBytes(String content, String charset) { + if (charset == null || "".equals(charset)) { + return content.getBytes(); + } + try { + return content.getBytes(charset); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException("MD5签名过程中出现错误,指定的编码集不对,您目前指定的编码集是:" + charset); + } + } } diff --git a/src/main/java/io/github/ehlxr/utils/MyUrlDemo.java b/src/main/java/io/github/ehlxr/utils/MyUrlDemo.java index ded79e6..d73588a 100644 --- a/src/main/java/io/github/ehlxr/utils/MyUrlDemo.java +++ b/src/main/java/io/github/ehlxr/utils/MyUrlDemo.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.utils; import java.io.File; diff --git a/src/main/java/io/github/ehlxr/utils/Pair.java b/src/main/java/io/github/ehlxr/utils/Pair.java index 1493c01..9a5d045 100644 --- a/src/main/java/io/github/ehlxr/utils/Pair.java +++ b/src/main/java/io/github/ehlxr/utils/Pair.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.utils; diff --git a/src/main/java/io/github/ehlxr/utils/Result.java b/src/main/java/io/github/ehlxr/utils/Result.java index 4435481..1d555e6 100644 --- a/src/main/java/io/github/ehlxr/utils/Result.java +++ b/src/main/java/io/github/ehlxr/utils/Result.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.utils; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/src/main/java/io/github/ehlxr/utils/StringAlign.java b/src/main/java/io/github/ehlxr/utils/StringAlign.java index bac27fc..450c774 100644 --- a/src/main/java/io/github/ehlxr/utils/StringAlign.java +++ b/src/main/java/io/github/ehlxr/utils/StringAlign.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.utils; /** diff --git a/src/main/java/io/github/ehlxr/utils/SystemConstants.java b/src/main/java/io/github/ehlxr/utils/SystemConstants.java index 2af483c..ea9d5b3 100644 --- a/src/main/java/io/github/ehlxr/utils/SystemConstants.java +++ b/src/main/java/io/github/ehlxr/utils/SystemConstants.java @@ -1,15 +1,39 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.utils; public class SystemConstants { - public final static String RES_CODE = "rescode"; + public final static String RES_CODE = "rescode"; - public final static String RES_DES = "resdes"; + public final static String RES_DES = "resdes"; - public final static String SYSTEM_ERROR = "201"; + public final static String SYSTEM_ERROR = "201"; - public final static String SYSTEM_SUCCESS = "200"; - - public final static String SYSTEM_SUCCESS_HEART = "203"; - - public final static String SYSTEM_ERROR_CANOT_CALL_INSURE = "206"; + public final static String SYSTEM_SUCCESS = "200"; + + public final static String SYSTEM_SUCCESS_HEART = "203"; + + public final static String SYSTEM_ERROR_CANOT_CALL_INSURE = "206"; } diff --git a/src/main/java/io/github/ehlxr/utils/Try.java b/src/main/java/io/github/ehlxr/utils/Try.java index 8db4137..3a9b1c3 100644 --- a/src/main/java/io/github/ehlxr/utils/Try.java +++ b/src/main/java/io/github/ehlxr/utils/Try.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.utils; import java.util.ArrayList; diff --git a/src/main/java/io/github/ehlxr/viplugin/CheckLicenseFile.java b/src/main/java/io/github/ehlxr/viplugin/CheckLicenseFile.java index e1a093a..a4106b4 100644 --- a/src/main/java/io/github/ehlxr/viplugin/CheckLicenseFile.java +++ b/src/main/java/io/github/ehlxr/viplugin/CheckLicenseFile.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.viplugin; import org.apache.commons.codec.binary.Base64; diff --git a/src/main/java/io/github/ehlxr/viplugin/CreateLicense.java b/src/main/java/io/github/ehlxr/viplugin/CreateLicense.java index 4894950..262f0fa 100644 --- a/src/main/java/io/github/ehlxr/viplugin/CreateLicense.java +++ b/src/main/java/io/github/ehlxr/viplugin/CreateLicense.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright © 2020 xrv + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package io.github.ehlxr.viplugin; public class CreateLicense {