-
-
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
deleted file mode 100644
index fe0b0da..0000000
--- a/.idea/misc.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
deleted file mode 100644
index 94a25f7..0000000
--- a/.idea/vcs.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/CHANGELOG.md b/CHANGELOG.md
deleted file mode 100644
index 3ed86cc..0000000
--- a/CHANGELOG.md
+++ /dev/null
@@ -1,15 +0,0 @@
-### Improvements
-`core` module:
-- Made JSON library (`org.json`) an `api` dependency
-- Disabled types auto-boxing when working with Java primitives
-- Remove `ExecutedFunctionThrowException` and replace with direct exception propagation in `LPFCP`.
-
-`ktor` module:
-- Updated Ktor to version `3.1.3`
-- `Ktor.LPFCPServer` now holds the entire embedded server instead of `NettyApplicationEngine`
-- Added `exceptionDetailsConfiguration` parameter to `lpfcpServer` and `lpfcp` route.
-It allows specifying the details to be included in response when the exception is thrown.
-This will help to hide internal server implementations from users if needed.
-### Other
-- Updated dependencies' versions
-
diff --git a/LICENSE b/LICENSE
deleted file mode 100644
index fa0086a..0000000
--- a/LICENSE
+++ /dev/null
@@ -1,373 +0,0 @@
-Mozilla Public License Version 2.0
-==================================
-
-1. Definitions
---------------
-
-1.1. "Contributor"
- means each individual or legal entity that creates, contributes to
- the creation of, or owns Covered Software.
-
-1.2. "Contributor Version"
- means the combination of the Contributions of others (if any) used
- by a Contributor and that particular Contributor's Contribution.
-
-1.3. "Contribution"
- means Covered Software of a particular Contributor.
-
-1.4. "Covered Software"
- means Source Code Form to which the initial Contributor has attached
- the notice in Exhibit A, the Executable Form of such Source Code
- Form, and Modifications of such Source Code Form, in each case
- including portions thereof.
-
-1.5. "Incompatible With Secondary Licenses"
- means
-
- (a) that the initial Contributor has attached the notice described
- in Exhibit B to the Covered Software; or
-
- (b) that the Covered Software was made available under the terms of
- version 1.1 or earlier of the License, but not also under the
- terms of a Secondary License.
-
-1.6. "Executable Form"
- means any form of the work other than Source Code Form.
-
-1.7. "Larger Work"
- means a work that combines Covered Software with other material, in
- a separate file or files, that is not Covered Software.
-
-1.8. "License"
- means this document.
-
-1.9. "Licensable"
- means having the right to grant, to the maximum extent possible,
- whether at the time of the initial grant or subsequently, any and
- all of the rights conveyed by this License.
-
-1.10. "Modifications"
- means any of the following:
-
- (a) any file in Source Code Form that results from an addition to,
- deletion from, or modification of the contents of Covered
- Software; or
-
- (b) any new file in Source Code Form that contains any Covered
- Software.
-
-1.11. "Patent Claims" of a Contributor
- means any patent claim(s), including without limitation, method,
- process, and apparatus claims, in any patent Licensable by such
- Contributor that would be infringed, but for the grant of the
- License, by the making, using, selling, offering for sale, having
- made, import, or transfer of either its Contributions or its
- Contributor Version.
-
-1.12. "Secondary License"
- means either the GNU General Public License, Version 2.0, the GNU
- Lesser General Public License, Version 2.1, the GNU Affero General
- Public License, Version 3.0, or any later versions of those
- licenses.
-
-1.13. "Source Code Form"
- means the form of the work preferred for making modifications.
-
-1.14. "You" (or "Your")
- means an individual or a legal entity exercising rights under this
- License. For legal entities, "You" includes any entity that
- controls, is controlled by, or is under common control with You. For
- purposes of this definition, "control" means (a) the power, direct
- or indirect, to cause the direction or management of such entity,
- whether by contract or otherwise, or (b) ownership of more than
- fifty percent (50%) of the outstanding shares or beneficial
- ownership of such entity.
-
-2. License Grants and Conditions
---------------------------------
-
-2.1. Grants
-
-Each Contributor hereby grants You a world-wide, royalty-free,
-non-exclusive license:
-
-(a) under intellectual property rights (other than patent or trademark)
- Licensable by such Contributor to use, reproduce, make available,
- modify, display, perform, distribute, and otherwise exploit its
- Contributions, either on an unmodified basis, with Modifications, or
- as part of a Larger Work; and
-
-(b) under Patent Claims of such Contributor to make, use, sell, offer
- for sale, have made, import, and otherwise transfer either its
- Contributions or its Contributor Version.
-
-2.2. Effective Date
-
-The licenses granted in Section 2.1 with respect to any Contribution
-become effective for each Contribution on the date the Contributor first
-distributes such Contribution.
-
-2.3. Limitations on Grant Scope
-
-The licenses granted in this Section 2 are the only rights granted under
-this License. No additional rights or licenses will be implied from the
-distribution or licensing of Covered Software under this License.
-Notwithstanding Section 2.1(b) above, no patent license is granted by a
-Contributor:
-
-(a) for any code that a Contributor has removed from Covered Software;
- or
-
-(b) for infringements caused by: (i) Your and any other third party's
- modifications of Covered Software, or (ii) the combination of its
- Contributions with other software (except as part of its Contributor
- Version); or
-
-(c) under Patent Claims infringed by Covered Software in the absence of
- its Contributions.
-
-This License does not grant any rights in the trademarks, service marks,
-or logos of any Contributor (except as may be necessary to comply with
-the notice requirements in Section 3.4).
-
-2.4. Subsequent Licenses
-
-No Contributor makes additional grants as a result of Your choice to
-distribute the Covered Software under a subsequent version of this
-License (see Section 10.2) or under the terms of a Secondary License (if
-permitted under the terms of Section 3.3).
-
-2.5. Representation
-
-Each Contributor represents that the Contributor believes its
-Contributions are its original creation(s) or it has sufficient rights
-to grant the rights to its Contributions conveyed by this License.
-
-2.6. Fair Use
-
-This License is not intended to limit any rights You have under
-applicable copyright doctrines of fair use, fair dealing, or other
-equivalents.
-
-2.7. Conditions
-
-Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
-in Section 2.1.
-
-3. Responsibilities
--------------------
-
-3.1. Distribution of Source Form
-
-All distribution of Covered Software in Source Code Form, including any
-Modifications that You create or to which You contribute, must be under
-the terms of this License. You must inform recipients that the Source
-Code Form of the Covered Software is governed by the terms of this
-License, and how they can obtain a copy of this License. You may not
-attempt to alter or restrict the recipients' rights in the Source Code
-Form.
-
-3.2. Distribution of Executable Form
-
-If You distribute Covered Software in Executable Form then:
-
-(a) such Covered Software must also be made available in Source Code
- Form, as described in Section 3.1, and You must inform recipients of
- the Executable Form how they can obtain a copy of such Source Code
- Form by reasonable means in a timely manner, at a charge no more
- than the cost of distribution to the recipient; and
-
-(b) You may distribute such Executable Form under the terms of this
- License, or sublicense it under different terms, provided that the
- license for the Executable Form does not attempt to limit or alter
- the recipients' rights in the Source Code Form under this License.
-
-3.3. Distribution of a Larger Work
-
-You may create and distribute a Larger Work under terms of Your choice,
-provided that You also comply with the requirements of this License for
-the Covered Software. If the Larger Work is a combination of Covered
-Software with a work governed by one or more Secondary Licenses, and the
-Covered Software is not Incompatible With Secondary Licenses, this
-License permits You to additionally distribute such Covered Software
-under the terms of such Secondary License(s), so that the recipient of
-the Larger Work may, at their option, further distribute the Covered
-Software under the terms of either this License or such Secondary
-License(s).
-
-3.4. Notices
-
-You may not remove or alter the substance of any license notices
-(including copyright notices, patent notices, disclaimers of warranty,
-or limitations of liability) contained within the Source Code Form of
-the Covered Software, except that You may alter any license notices to
-the extent required to remedy known factual inaccuracies.
-
-3.5. Application of Additional Terms
-
-You may choose to offer, and to charge a fee for, warranty, support,
-indemnity or liability obligations to one or more recipients of Covered
-Software. However, You may do so only on Your own behalf, and not on
-behalf of any Contributor. You must make it absolutely clear that any
-such warranty, support, indemnity, or liability obligation is offered by
-You alone, and You hereby agree to indemnify every Contributor for any
-liability incurred by such Contributor as a result of warranty, support,
-indemnity or liability terms You offer. You may include additional
-disclaimers of warranty and limitations of liability specific to any
-jurisdiction.
-
-4. Inability to Comply Due to Statute or Regulation
----------------------------------------------------
-
-If it is impossible for You to comply with any of the terms of this
-License with respect to some or all of the Covered Software due to
-statute, judicial order, or regulation then You must: (a) comply with
-the terms of this License to the maximum extent possible; and (b)
-describe the limitations and the code they affect. Such description must
-be placed in a text file included with all distributions of the Covered
-Software under this License. Except to the extent prohibited by statute
-or regulation, such description must be sufficiently detailed for a
-recipient of ordinary skill to be able to understand it.
-
-5. Termination
---------------
-
-5.1. The rights granted under this License will terminate automatically
-if You fail to comply with any of its terms. However, if You become
-compliant, then the rights granted under this License from a particular
-Contributor are reinstated (a) provisionally, unless and until such
-Contributor explicitly and finally terminates Your grants, and (b) on an
-ongoing basis, if such Contributor fails to notify You of the
-non-compliance by some reasonable means prior to 60 days after You have
-come back into compliance. Moreover, Your grants from a particular
-Contributor are reinstated on an ongoing basis if such Contributor
-notifies You of the non-compliance by some reasonable means, this is the
-first time You have received notice of non-compliance with this License
-from such Contributor, and You become compliant prior to 30 days after
-Your receipt of the notice.
-
-5.2. If You initiate litigation against any entity by asserting a patent
-infringement claim (excluding declaratory judgment actions,
-counter-claims, and cross-claims) alleging that a Contributor Version
-directly or indirectly infringes any patent, then the rights granted to
-You by any and all Contributors for the Covered Software under Section
-2.1 of this License shall terminate.
-
-5.3. In the event of termination under Sections 5.1 or 5.2 above, all
-end user license agreements (excluding distributors and resellers) which
-have been validly granted by You or Your distributors under this License
-prior to termination shall survive termination.
-
-************************************************************************
-* *
-* 6. Disclaimer of Warranty *
-* ------------------------- *
-* *
-* Covered Software is provided under this License on an "as is" *
-* basis, without warranty of any kind, either expressed, implied, or *
-* statutory, including, without limitation, warranties that the *
-* Covered Software is free of defects, merchantable, fit for a *
-* particular purpose or non-infringing. The entire risk as to the *
-* quality and performance of the Covered Software is with You. *
-* Should any Covered Software prove defective in any respect, You *
-* (not any Contributor) assume the cost of any necessary servicing, *
-* repair, or correction. This disclaimer of warranty constitutes an *
-* essential part of this License. No use of any Covered Software is *
-* authorized under this License except under this disclaimer. *
-* *
-************************************************************************
-
-************************************************************************
-* *
-* 7. Limitation of Liability *
-* -------------------------- *
-* *
-* Under no circumstances and under no legal theory, whether tort *
-* (including negligence), contract, or otherwise, shall any *
-* Contributor, or anyone who distributes Covered Software as *
-* permitted above, be liable to You for any direct, indirect, *
-* special, incidental, or consequential damages of any character *
-* including, without limitation, damages for lost profits, loss of *
-* goodwill, work stoppage, computer failure or malfunction, or any *
-* and all other commercial damages or losses, even if such party *
-* shall have been informed of the possibility of such damages. This *
-* limitation of liability shall not apply to liability for death or *
-* personal injury resulting from such party's negligence to the *
-* extent applicable law prohibits such limitation. Some *
-* jurisdictions do not allow the exclusion or limitation of *
-* incidental or consequential damages, so this exclusion and *
-* limitation may not apply to You. *
-* *
-************************************************************************
-
-8. Litigation
--------------
-
-Any litigation relating to this License may be brought only in the
-courts of a jurisdiction where the defendant maintains its principal
-place of business and such litigation shall be governed by laws of that
-jurisdiction, without reference to its conflict-of-law provisions.
-Nothing in this Section shall prevent a party's ability to bring
-cross-claims or counter-claims.
-
-9. Miscellaneous
-----------------
-
-This License represents the complete agreement concerning the subject
-matter hereof. If any provision of this License is held to be
-unenforceable, such provision shall be reformed only to the extent
-necessary to make it enforceable. Any law or regulation which provides
-that the language of a contract shall be construed against the drafter
-shall not be used to construe this License against a Contributor.
-
-10. Versions of the License
----------------------------
-
-10.1. New Versions
-
-Mozilla Foundation is the license steward. Except as provided in Section
-10.3, no one other than the license steward has the right to modify or
-publish new versions of this License. Each version will be given a
-distinguishing version number.
-
-10.2. Effect of New Versions
-
-You may distribute the Covered Software under the terms of the version
-of the License under which You originally received the Covered Software,
-or under the terms of any subsequent version published by the license
-steward.
-
-10.3. Modified Versions
-
-If you create software not governed by this License, and you want to
-create a new license for such software, you may create and use a
-modified version of this License if you rename the license and remove
-any references to the name of the license steward (except to note that
-such modified license differs from this License).
-
-10.4. Distributing Source Code Form that is Incompatible With Secondary
-Licenses
-
-If You choose to distribute Source Code Form that is Incompatible With
-Secondary Licenses under the terms of this version of the License, the
-notice described in Exhibit B of this License must be attached.
-
-Exhibit A - Source Code Form License Notice
--------------------------------------------
-
- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-If it is not possible or desirable to put the notice in a particular
-file, then You may include the notice in a location (such as a LICENSE
-file in a relevant directory) where a recipient would be likely to look
-for such a notice.
-
-You may add additional accurate notices of copyright ownership.
-
-Exhibit B - "Incompatible With Secondary Licenses" Notice
----------------------------------------------------------
-
- This Source Code Form is "Incompatible With Secondary Licenses", as
- defined by the Mozilla Public License, v. 2.0.
\ No newline at end of file
diff --git a/README.md b/README.md
index 99ecc0e..c972303 100644
Binary files a/README.md and b/README.md differ
diff --git a/build.gradle.kts b/build.gradle.kts
deleted file mode 100644
index 42ec898..0000000
--- a/build.gradle.kts
+++ /dev/null
@@ -1,216 +0,0 @@
-/*
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at https://mozilla.org/MPL/2.0/.
- *
- * From https://github.com/likespro/lpfcp-java
- */
-
-val GROUP = "io.github.likespro" // Until normal group ID - eth.likespro.commons
-val VERSION = "1.1.0"
-val NAME = "LPFCP Java"
-val DESCRIPTION = "LPFCP protocol implementation in Java/Kotlin"
-val URL = "https://github.com/likespro/lpfcp-java"
-val LICENSES: MavenPomLicenseSpec.(project: Project) -> Unit = { project ->
- license {
- name.set("Mozilla Public License 2.0")
- url.set("https://www.mozilla.org/en-US/MPL/2.0/")
- }
-}
-val DEVELOPERS: MavenPomDeveloperSpec.() -> Unit = {
- developer {
- id.set("likespro")
- email.set("likespro.eth@gmail.com")
- }
-}
-val SCM: MavenPomScm.() -> Unit = {
- connection.set("scm:git:git://github.com/likespro/lpfcp-java.git")
- developerConnection.set("scm:git:ssh://github.com:likespro/lpfcp-java.git")
- url.set("https://github.com/likespro/lpfcp-java")
-}
-val PUBLISHED_ARTIFACTS_PREFIX = "lpfcp-" // Until normal group ID - eth.likespro.commons
-
-
-
-/* =================== *
- * AUTOMATIZED SECTION *
- * =================== */
-
-
-
-plugins {
- id("java-library")
- kotlin("jvm") version "2.1.21"
- id("jacoco")
- id("org.jetbrains.dokka") version "1.9.0"
- id("maven-publish")
- id("signing")
- id("com.gradleup.nmcp.aggregation").version("0.1.4")
- id("com.gradleup.nmcp").version("0.1.4")
-}
-
-allprojects {
- group = GROUP
- version = VERSION
-
- repositories {
- mavenCentral()
- // mavenLocal() // For easier testing
- }
-}
-
-subprojects {
- apply(plugin = "java-library")
- apply(plugin = "kotlin")
- apply(plugin = "jacoco")
- apply(plugin = "org.jetbrains.dokka")
- apply(plugin = "maven-publish")
- apply(plugin = "signing")
- apply(plugin = "com.gradleup.nmcp")
-
- dependencies {
- testImplementation(platform("org.junit:junit-bom:5.10.0"))
- testImplementation("org.junit.jupiter:junit-jupiter")
- }
-
- java {
- withJavadocJar()
- withSourcesJar()
- }
-
- jacoco {
- toolVersion = "0.8.10"
- }
- tasks.test {
- useJUnitPlatform()
- finalizedBy(tasks.jacocoTestReport)
- }
-
- tasks.create("documentate") {
- group = "documentation"
- dependsOn(tasks.dokkaHtml)
- }
-
- publishing {
- publications {
- create("mavenJava") {
- from(components["java"])
-
- artifactId = PUBLISHED_ARTIFACTS_PREFIX + project.name
-
- pom {
- name.set(NAME)
- description.set(DESCRIPTION)
- url.set(URL)
- licenses { LICENSES(project) }
- developers { DEVELOPERS() }
- scm { SCM() }
- }
- }
- }
-
- repositories {
- if(System.getenv("GITHUB_REPO") != null) {
- maven {
- name = "GitHubPackages"
- url = uri("https://maven.pkg.github.com/" + System.getenv("GITHUB_REPO"))
-
- credentials {
- username = System.getenv("GITHUB_USERNAME")
- password = System.getenv("GITHUB_TOKEN")
- }
- }
- }
- }
- }
-
- if(System.getenv("PGP_PRIVATE_KEY") != null) signing {
- sign(publishing.publications)
- useInMemoryPgpKeys(System.getenv("PGP_PRIVATE_KEY").replace("\\n", "\n")?.trimIndent(), System.getenv("PGP_PRIVATE_KEY_PASSWORD") ?: "")
- }
-}
-
-tasks.register("collectAllJars") {
- into(layout.buildDirectory.dir("libs"))
- subprojects.forEach { proj ->
- dependsOn(proj.tasks.named("jar"))
- from(proj.tasks.named("jar").flatMap { it.archiveFile })
- }
-}
-tasks.jar {
- enabled = false
- dependsOn("collectAllJars")
-}
-
-tasks.register("jacocoRootReport") {
- dependsOn(subprojects.map { it.tasks.named("test") })
-
- executionData.setFrom(
- subprojects.map {
- file("${it.buildDir}/jacoco/test.exec")
- }
- )
-
- // Classes (excluding generated and not-needed classes)
- classDirectories.setFrom(
- subprojects.map {
- files(
- fileTree("${it.buildDir}/classes/kotlin/main") {
- exclude("**/R.class", "**/R$*.class", "**/BuildConfig.*", "**/Manifest*.*")
- },
- fileTree("${it.buildDir}/classes/java/main") {
- exclude("**/R.class", "**/R$*.class", "**/BuildConfig.*", "**/Manifest*.*")
- }
- )
- }
- )
-
- // Sources of Kotlin & Java
- sourceDirectories.setFrom(
- subprojects.flatMap {
- listOf(
- file("${it.projectDir}/src/main/kotlin"),
- file("${it.projectDir}/src/main/java")
- )
- }
- )
-
- reports {
- xml.required.set(true)
- html.required.set(true)
- csv.required.set(false)
- }
-}
-tasks.build {
- finalizedBy(tasks.named("jacocoRootReport"))
-}
-
-tasks.create("documentate") {
- group = "documentation"
- dependsOn(tasks.dokkaHtmlMultiModule)
-}
-
-nmcpAggregation {
- centralPortal {
- username = System.getenv("SONATYPE_USERNAME")
- password = System.getenv("SONATYPE_PASSWORD")
- publishingType = "USER_MANAGED"
- }
-}
-dependencies {
- subprojects.forEach { nmcpAggregation(it) }
-}
-tasks.named("publish") {
- if(!(version as String).contains("-")) finalizedBy("publishAggregationToCentralPortal")
-}
-
-tasks.register("printProjectName") {
- doLast {
- println(rootProject.name)
- }
-}
-tasks.register("printProjectVersion") {
- doLast {
- println(version)
- }
-}
\ No newline at end of file
diff --git a/core/build.gradle.kts b/core/build.gradle.kts
deleted file mode 100644
index b6e7b07..0000000
--- a/core/build.gradle.kts
+++ /dev/null
@@ -1,9 +0,0 @@
-dependencies {
- api("io.github.likespro:commons-core-mit:3.1.0")
- implementation("io.github.likespro:commons-reflection:3.1.0")
- implementation("io.github.likespro:commons-network:3.1.0")
-
- implementation("com.google.code.gson:gson:2.13.1") // TODO remove this after commons:3.1.1
-
- implementation(kotlin("reflect"))
-}
\ No newline at end of file
diff --git a/core/src/main/java/eth/likespro/lpfcp/FunctionCallHandler.kt b/core/src/main/java/eth/likespro/lpfcp/FunctionCallHandler.kt
deleted file mode 100644
index ea1efed..0000000
--- a/core/src/main/java/eth/likespro/lpfcp/FunctionCallHandler.kt
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at https://mozilla.org/MPL/2.0/.
- *
- * From https://github.com/likespro/lpfcp-java
- */
-
-package eth.likespro.lpfcp
-
-import eth.likespro.commons.reflection.ObjectEncoding.encodeObject
-import org.json.JSONObject
-import java.lang.reflect.InvocationHandler
-import java.lang.reflect.Method
-import java.lang.reflect.Type
-import kotlin.reflect.jvm.javaType
-import kotlin.reflect.jvm.kotlinFunction
-
-/**
- * A handler for function calls that processes the request and returns the result. Used in Java/Kotlin proxies.
- *
- * @param processor A lambda function that takes a [JSONObject] request and a [Type] and returns the result of the function call.
- */
-class FunctionCallHandler(val processor: (JSONObject, Type) -> Any?) : InvocationHandler {
- override fun invoke(proxy: Any, method: Method, args: Array?): Any? {
- return processor(JSONObject().apply {
- put("functionName", method.name)
- put("functionArgs", JSONObject().apply {
- args?.forEachIndexed { index, arg ->
- put("${index + 1}", arg.encodeObject())
- }
- })
- }, method.kotlinFunction!!.returnType.javaType)
- }
-}
\ No newline at end of file
diff --git a/core/src/main/java/eth/likespro/lpfcp/LPFCP.kt b/core/src/main/java/eth/likespro/lpfcp/LPFCP.kt
deleted file mode 100644
index 2295781..0000000
--- a/core/src/main/java/eth/likespro/lpfcp/LPFCP.kt
+++ /dev/null
@@ -1,196 +0,0 @@
-/*
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at https://mozilla.org/MPL/2.0/.
- *
- * From https://github.com/likespro/lpfcp-java
- */
-
-package eth.likespro.lpfcp
-
-import eth.likespro.commons.models.EncodableResult
-import eth.likespro.commons.network.HTTPUtils.post
-import eth.likespro.commons.reflection.ObjectEncoding.decodeObject
-import eth.likespro.commons.reflection.ReflectionUtils.getParametrizedType
-import org.json.JSONException
-import org.json.JSONObject
-import java.lang.reflect.InvocationTargetException
-import java.lang.reflect.Proxy
-import java.lang.reflect.Type
-import java.net.URI
-import kotlin.collections.component1
-import kotlin.collections.component2
-import kotlin.collections.set
-import kotlin.reflect.KParameter
-import kotlin.reflect.full.findAnnotation
-import kotlin.reflect.full.functions
-import kotlin.reflect.full.instanceParameter
-import kotlin.reflect.javaType
-
-/**
- * The `LPFCP` object provides all core methods to make Server-side and Client-side working with LPFCP
- */
-object LPFCP {
- /**
- * Annotation to mark functions as exposed for processing requests.
- * Only functions annotated with `@ExposedFunction` can be invoked by `processRequest`.
- */
- @Target(AnnotationTarget.FUNCTION)
- annotation class ExposedFunction
-
- /**
- * Exception thrown when the `functionName` key is missing or invalid in the request.
- * @param msg The error message describing the issue.
- */
- class IncorrectFunctionNameException(msg: String) : RuntimeException(msg)
-
- /**
- * Exception thrown when the `functionArgs` key is missing or invalid in the request.
- * @param msg The error message describing the issue.
- */
- class IncorrectFunctionArgsException(msg: String) : RuntimeException(msg)
-
- /**
- * Exception thrown when no function with the specified name and parameters is found.
- * @param msg The error message describing the issue.
- */
- class NoMatchingFunctionFoundException(msg: String) : RuntimeException(msg)
-
-
-
- /*
- * --------------------------------------------------------------
- * PROCESSOR SIDE
- * --------------------------------------------------------------
- */
-
-
-
- /**
- * Processes a request to invoke a function on the given processor object safely.
- *
- * @param request A `JSONObject` containing the function name and arguments.
- * - `functionName`: The name of the function to invoke (String).
- * - `functionArgs`: The arguments for the function (JSONObject).
- * @param processor The object containing the functions to be invoked.
- * @return An `EncodableResult` containing the result of the function call or an error.
- */
- fun processRequest(request: JSONObject, processor: Any): EncodableResult {
- return try {
- EncodableResult.success(processRequestUnsafely(request, processor))
- } catch (e: Exception) {
- EncodableResult.failure(e)
- }
- }
-
- /**
- * Processes a request to invoke a function on the given processor object.
- *
- * @param request A `JSONObject` containing the function name and arguments.
- * - `functionName`: The name of the function to invoke (String).
- * - `functionArgs`: The arguments for the function (JSONObject).
- * @param processor The object containing the functions to be invoked.
- * @return A function's return value.
- *
- * @throws IncorrectFunctionNameException If the `functionName` key is missing or invalid.
- * @throws IncorrectFunctionArgsException If the `functionArgs` key is missing or invalid.
- * @throws NoMatchingFunctionFoundException If no matching function is found.
- */
- @OptIn(ExperimentalStdlibApi::class)
- fun processRequestUnsafely(request: JSONObject, processor: Any): Any? {
- val kClass = processor::class
-
- // Extract the function name from the request
- val functionName = try { request.getString("functionName") } catch (_: JSONException) { throw IncorrectFunctionNameException("`functionName` key not found or is not String.") }
-
- // Extract the function arguments from the request
- val functionArgs = try { request.getJSONObject("functionArgs") } catch (_: JSONException) { throw IncorrectFunctionArgsException("`functionArgs` key not found or is not JSON Object.") }
-
- // Filter functions in the processor class that match the name and are annotated with @ExposedFunction
- val functions = kClass.functions.filter { it.name == functionName && it.findAnnotation() != null }
- functions.forEach { function ->
- val args = mutableMapOf()
-
- // Map the provided arguments to the function's parameters
- functionArgs.toMap().forEach { (argName, argValue) ->
- function.parameters.find { it.name == argName || it.index.toString() == argName }?.let { param ->
- try {
- args[param] = (argValue as String).decodeObject(param.type.javaType)
- } catch (_: Exception) { }
- }
- }
-
- // Skip the function if not all passed arguments are used
- if(args.size != functionArgs.length()) {
- return@forEach
- }
-
- // Add the instance parameter if required
- function.instanceParameter!!.let { args[it] = processor }
-
- try {
- // Invoke the function with the mapped arguments
- val result = function.callBy(args)
- return result
- } catch (e: InvocationTargetException) {
- // Handle exceptions thrown by the invoked function
- throw e.cause!!
- } catch (_: IllegalArgumentException) {
- // Handle argument mismatch errors
- // Skip this function and continue searching for another one
- }
- }
-
- // Throw an exception if no matching function is found
- throw NoMatchingFunctionFoundException("Function with specified params not found. Ensure the function has @ExposedFunction annotation.")
- }
-
-
-
- /*
- * --------------------------------------------------------------
- * INVOKER SIDE
- * --------------------------------------------------------------
- */
-
-
-
- /**
- * Creates a proxy instance of the specified interface that forwards method calls to the provided processor LPFCP URI.
- *
- * @param Interface template parameter - Interface of the processor
- * @param processorLPFCPURI A string representing the processor LPFCP endpoint URI.
- * @return A proxy instance of the specified interface.
- */
- inline fun getProcessor(processorLPFCPURI: String) = getProcessor (URI(processorLPFCPURI))
-
- /**
- * Creates a proxy instance of the specified interface that forwards method calls to the provided processor LPFCP URI.
- *
- * @param Interface template parameter - Interface of the processor
- * @param processorLPFCP A URI representing the processor LPFCP endpoint.
- * @return A proxy instance of the specified interface.
- */
- inline fun getProcessor(processorLPFCP: URI) = getProcessor { request, type ->
- (processorLPFCP.post(request.toString()).decodeObject(EncodableResult::class.java.getParametrizedType(type)) as EncodableResult<*>).getOrThrow()
- }
-
- /**
- * Creates a proxy instance of the specified interface that forwards method calls to the provided processor function.
- *
- * @param Interface template parameter - Interface of the processor
- * @param processorLPFCP A function that takes:
- * - `JSONObject` - function call request in LPFCP format;
- * - `Type` - type of value that the called function must return.
- *
- * [processorLPFCP] returns an `Any?` - value from the invoked function.
- * @return A proxy instance of the specified interface.
- */
- inline fun getProcessor(noinline processorLPFCP: (JSONObject, Type) -> Any?): Interface {
- return Proxy.newProxyInstance(
- Interface::class.java.classLoader,
- arrayOf(Interface::class.java),
- FunctionCallHandler(processorLPFCP)
- ) as Interface
- }
-}
\ No newline at end of file
diff --git a/core/src/main/java/eth/likespro/lpfcp/LPFCPJava.java b/core/src/main/java/eth/likespro/lpfcp/LPFCPJava.java
deleted file mode 100644
index 6ea33b0..0000000
--- a/core/src/main/java/eth/likespro/lpfcp/LPFCPJava.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at https://mozilla.org/MPL/2.0/.
- *
- * From https://github.com/likespro/lpfcp-java
- */
-
-package eth.likespro.lpfcp;
-
-import eth.likespro.commons.models.EncodableResult;
-import eth.likespro.commons.network.HTTPUtils;
-import eth.likespro.commons.reflection.ObjectEncoding;
-import eth.likespro.commons.reflection.ReflectionUtils;
-
-import kotlin.jvm.functions.Function2;
-import org.json.JSONObject;
-
-import java.lang.reflect.Proxy;
-import java.lang.reflect.Type;
-import java.net.URI;
-
-/**
- * Class LPFCPJava contains some methods from LPFCP object rewritten specifically for Java.
- */
-public class LPFCPJava {
- /**
- * Creates a proxy instance of the specified interface that forwards method calls to the provided processor LPFCP URI.
- *
- * @param Interface of the processor
- * @param interfaceClass Interface class of the processor
- * @param processorLPFCPURI A string representing the processor LPFCP endpoint URI.
- * @return A proxy instance of the specified interface.
- */
- public static Interface getProcessor(Class interfaceClass, String processorLPFCPURI) {
- return getProcessor(interfaceClass, URI.create(processorLPFCPURI));
- }
-
- /**
- * Creates a proxy instance of the specified interface that forwards method calls to the provided processor LPFCP URI.
- *
- * @param Interface of the processor
- * @param interfaceClass Interface class of the processor
- * @param processorLPFCP A URI representing the processor LPFCP endpoint.
- *
- * @return A proxy instance of the specified interface.
- */
- public static Interface getProcessor(Class interfaceClass, URI processorLPFCP) {
- return getProcessor(interfaceClass, (request, returnType) -> {
- //noinspection unchecked
- return ((EncodableResult) ObjectEncoding.INSTANCE.decodeObject(
- HTTPUtils.INSTANCE.post(processorLPFCP, request.toString()),
- ReflectionUtils.INSTANCE.getParametrizedType(EncodableResult.class, returnType)
- )).getOrThrow();
- });
- }
-
- /**
- * Creates a proxy instance of the specified interface that forwards method calls to the provided processor function.
- *
- * @param Interface of the processor
- * @param interfaceClass Interface class of the processor
- * @param processorLPFCP A function that takes:
- * - `JSONObject` - function call request in LPFCP format;
- * - `Type` - type of value that the called function must return.
- *
- * [processorLPFCP] returns an `Any?` - value from the invoked function.
- *
- * @return A proxy instance of the specified interface.
- */
- public static Interface getProcessor(Class interfaceClass, Function2 processorLPFCP) {
- // noinspection unchecked
- return (Interface) Proxy.newProxyInstance(
- interfaceClass.getClassLoader(),
- new Class[]{interfaceClass},
- new FunctionCallHandler(processorLPFCP)
- );
- }
-}
diff --git a/core/src/test/java/eth/likespro/lpfcp/LPFCPJavaTest.java b/core/src/test/java/eth/likespro/lpfcp/LPFCPJavaTest.java
deleted file mode 100644
index f25109c..0000000
--- a/core/src/test/java/eth/likespro/lpfcp/LPFCPJavaTest.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package eth.likespro.lpfcp;
-
-import org.junit.jupiter.api.Test;
-
-import static org.junit.jupiter.api.Assertions.*;
-
-class LPFCPJavaTest {
- interface Calculator {
- String hello();
- int add(int a, int b);
- String add(String a, String b);
- int multiply(int a, int b);
- int divide(int a, int b);
- Integer divideSafely(int a, int b);
- }
-
- public static class CalculatorImpl implements Calculator {
- @Override @LPFCP.ExposedFunction
- public String hello() {
- return "Hello, World!";
- }
-
- @Override @LPFCP.ExposedFunction
- public int add(int a, int b) {
- return a + b;
- }
-
- @Override @LPFCP.ExposedFunction
- public String add(String a, String b) {
- return a + b;
- }
-
- @Override
- public int multiply(int a, int b) {
- return a * b;
- }
-
- @Override @LPFCP.ExposedFunction
- public int divide(int a, int b) {
- return a / b;
- }
-
- @Override @LPFCP.ExposedFunction
- public Integer divideSafely(int a, int b) {
- if (b == 0) return null;
- return a / b;
- }
- }
-
- public static CalculatorImpl calculator = new CalculatorImpl();
-
- @Test void getProcessor_withLambda_proceedsRequest_withValidFunctionWithNoArgsAndNoArgs_returnsSuccess() {
- Calculator processor = LPFCPJava.getProcessor(Calculator.class, (request, returnType) -> LPFCP.INSTANCE.processRequest(request, calculator).getOrThrow());
- String result = processor.hello();
- assertEquals("Hello, World!", result);
- }
-}
\ No newline at end of file
diff --git a/core/src/test/java/eth/likespro/lpfcp/LPFCPTests.kt b/core/src/test/java/eth/likespro/lpfcp/LPFCPTests.kt
deleted file mode 100644
index 144ef1a..0000000
--- a/core/src/test/java/eth/likespro/lpfcp/LPFCPTests.kt
+++ /dev/null
@@ -1,288 +0,0 @@
-package eth.likespro.lpfcp
-
-import eth.likespro.commons.models.EncodableResult
-import eth.likespro.commons.models.WrappedException
-import org.json.JSONObject
-import org.junit.jupiter.api.Assertions.assertEquals
-import org.junit.jupiter.api.Test
-import org.junit.jupiter.api.assertThrows
-import java.lang.ArithmeticException
-
-class LPFCPTests {
- /*
- * --------------------------------------------------------------
- * PROCESSOR SIDE
- * --------------------------------------------------------------
- */
-
-
-
- @Test
- fun processRequest_withValidFunctionWithNoArgsAndNoArgs_returnsSuccess() {
- val processor = object {
- @LPFCP.ExposedFunction
- fun hello(): String = "Hello, World!"
- }
- val request = JSONObject("""{"functionName": "hello", "functionArgs": {}}""")
- val result = LPFCP.processRequest(request, processor)
- assertEquals(EncodableResult.success("Hello, World!"), result as EncodableResult<*>)
- }
-
- @Test
- fun processRequest_withValidFunctionAndArgs_returnsSuccess() {
- val processor = object {
- @LPFCP.ExposedFunction
- fun add(a: Int, b: Int): Int = a + b
- }
- val request = JSONObject("""{"functionName": "add", "functionArgs": {"a": "3", "b": "5"}}""")
- val result = LPFCP.processRequest(request, processor)
- assertEquals(EncodableResult.success(8), result as EncodableResult<*>)
- }
-
- @Test
- fun processRequest_withValidFunctionReturningNullAndArgs_returnsSuccess() {
- val processor = object {
- @LPFCP.ExposedFunction
- fun divideSafely(a: Int, b: Int): Int? = if (b == 0) null else a / b
- }
- val request = JSONObject("""{"functionName": "divideSafely", "functionArgs": {"a": "3", "b": "0"}}""")
- val result = LPFCP.processRequest(request, processor)
- assertEquals(EncodableResult.success(null), result as EncodableResult<*>)
- }
-
- @Test
- fun processRequest_withValidFunctionWithDefaultArgsAndArgs_returnsSuccess() {
- val processor = object {
- @LPFCP.ExposedFunction
- fun add(a: Int = 1, b: Int = 2): Int = a + b
- }
- val request = JSONObject("""{"functionName": "add", "functionArgs": {"b": "10"}}""")
- val result = LPFCP.processRequest(request, processor)
- assertEquals(EncodableResult.success(11), result as EncodableResult<*>)
- }
-
- @Test
- fun processRequest_withValidOverloadedFunctionAndArgs_returnsSuccess() {
- val processor = object {
- @LPFCP.ExposedFunction
- fun add(a: Int, b: Int): Int = a + b
-
- @LPFCP.ExposedFunction
- fun add(a: String, b: String): String = a + b
- }
- val request = JSONObject("""{"functionName": "add", "functionArgs": {"a": "\"3\"", "b": "\"5\""}}""")
- val result = LPFCP.processRequest(request, processor)
- assertEquals(EncodableResult.success("35"), result as EncodableResult<*>)
- }
-
- @Test
- fun processRequest_withValidOverloadedFunctionWithMoreArgsAndArgs_returnsSuccess() {
- val processor = object {
- @LPFCP.ExposedFunction
- fun add(a: Int, b: Int): Int = a + b
-
- @LPFCP.ExposedFunction
- fun add(a: Int, b: Int, c: Int): Int = a + b + c
- }
- val request = JSONObject("""{"functionName": "add", "functionArgs": {"a": "3", "b": "5", "c": "7"}}""")
- val result = LPFCP.processRequest(request, processor)
- assertEquals(EncodableResult.success(15), result as EncodableResult<*>)
- }
-
- class StaticProcessor {
- companion object {
- @LPFCP.ExposedFunction
- @JvmStatic
- fun add(a: Int, b: Int): Int = a + b
- }
- }
- @Test
- fun processRequest_withValidStaticFunctionAndArgs_returnsSuccess() {
- val request = JSONObject("""{"functionName": "add", "functionArgs": {"a": "3", "b": "5"}}""")
- val result = LPFCP.processRequest(request, StaticProcessor)
- assertEquals(EncodableResult.success(8), result as EncodableResult<*>)
- }
-
- @Test
- fun processRequest_withMissingFunctionName_throwsIncorrectFunctionNameException() {
- val processor = object {}
- val request = JSONObject("""{"functionArgs": {"a": "3", "b": "5"}}""")
- val result = LPFCP.processRequest(request, processor)
- assertEquals(LPFCP.IncorrectFunctionNameException::class.java, result.failure?.exceptionClass)
- }
-
- @Test
- fun processRequest_withInvalidFunctionName_throwsNoMatchingFunctionFound() {
- val processor = object {
- @LPFCP.ExposedFunction
- fun multiply(a: Int, b: Int): Int = a * b
- }
- val request = JSONObject("""{"functionName": 123, "functionArgs": {"a": "3", "b": "5"}}""")
- val result = LPFCP.processRequest(request, processor)
- assertEquals(LPFCP.IncorrectFunctionNameException::class.java, result.failure?.exceptionClass)
- }
-
- @Test
- fun processRequest_withNotExistingFunctionName_throwsNoMatchingFunctionFound() {
- val processor = object {
- @LPFCP.ExposedFunction
- fun multiply(a: Int, b: Int): Int = a * b
- }
- val request = JSONObject("""{"functionName": "divide", "functionArgs": {"a": "3", "b": "5"}}""")
- val result = LPFCP.processRequest(request, processor)
- assertEquals(LPFCP.NoMatchingFunctionFoundException::class.java, result.failure?.exceptionClass)
- }
-
- @Test
- fun processRequest_withNotAnnotatedFunction_throwsNoMatchingFunctionFound() {
- val processor = object {
- fun multiply(a: Int, b: Int): Int = a * b
- }
- val request = JSONObject("""{"functionName": "multiply", "functionArgs": {"a": "3", "b": "5"}}""")
- val result = LPFCP.processRequest(request, processor)
- assertEquals(LPFCP.NoMatchingFunctionFoundException::class.java, result.failure?.exceptionClass)
- }
-
- @Test
- fun processRequest_withMissingFunctionArgs_throwsIncorrectFunctionArgsException() {
- val processor = object {
- @LPFCP.ExposedFunction
- fun subtract(a: Int, b: Int): Int = a - b
- }
- val request = JSONObject("""{"functionName": "subtract"}""")
- val result = LPFCP.processRequest(request, processor)
- assertEquals(LPFCP.IncorrectFunctionArgsException::class.java, result.failure?.exceptionClass)
- }
-
- @Test
- fun processRequest_withExtraArgs_skipsFunctionAndThrowsNoMatchingFunctionFound() {
- val processor = object {
- @LPFCP.ExposedFunction
- fun divide(a: Int, b: Int): Int = a / b
- }
- val request = JSONObject("""{"functionName": "divide", "functionArgs": {"a": "10", "b": "2", "c": "1"}}""")
- val result = LPFCP.processRequest(request, processor)
- assertEquals(LPFCP.NoMatchingFunctionFoundException::class.java, result.failure?.exceptionClass)
- }
-
- @Test
- fun processRequest_withFunctionThrowingException_returnsIllegalStateException() {
- val processor = object {
- @LPFCP.ExposedFunction
- fun throwError(): Nothing = throw kotlin.IllegalStateException("Error occurred")
- }
- val request = JSONObject("""{"functionName": "throwError", "functionArgs": {}}""")
- val result = LPFCP.processRequest(request, processor)
- assertEquals(IllegalStateException::class.java, result.failure?.exceptionClass)
- }
-
-
-
- /*
- * --------------------------------------------------------------
- * INVOKER SIDE
- * --------------------------------------------------------------
- */
-
-
-
- interface Calculator {
- fun hello(): String
- fun hello(name: String?): String
- fun add(a: Int, b: Int): Int
- fun add(a: String = "1", b: String = "2"): String
- fun multiply(a: Int, b: Int): Int
- fun divide(a: Int, b: Int): Int
- fun divideSafely(a: Int, b: Int): Int?
- }
-
- companion object {
- val calculator = object : Calculator {
- @LPFCP.ExposedFunction
- override fun hello(): String = "Hello, World!"
-
- @LPFCP.ExposedFunction
- override fun hello(name: String?): String = "Hello, $name!"
-
- @LPFCP.ExposedFunction
- override fun add(a: Int, b: Int): Int = a + b
-
- @LPFCP.ExposedFunction
- override fun add(a: String, b: String): String = a + b
-
- override fun multiply(a: Int, b: Int) = a * b
-
- @LPFCP.ExposedFunction
- override fun divide(a: Int, b: Int) = a / b
-
- @LPFCP.ExposedFunction
- override fun divideSafely(a: Int, b: Int): Int? = if (b == 0) null else a / b
- }
- }
-
- @Test fun getProcessor_withLambda_proceedsRequest_withValidFunctionWithNoArgs_returnsSuccess() {
- val processor = LPFCP.getProcessor { request, _ ->
- LPFCP.processRequest(request, calculator).getOrThrow()
- }
- val result = processor.hello()
- assertEquals("Hello, World!", result)
- }
-
- @Test fun getProcessor_withLambda_proceedsRequest_withValidFunctionWithNullArgs_returnsSuccess() {
- val processor = LPFCP.getProcessor { request, _ ->
- LPFCP.processRequest(request, calculator).getOrThrow()
- }
- val result = processor.hello(null)
- assertEquals("Hello, null!", result)
- }
-
- @Test fun getProcessor_withLambda_proceedsRequest_withValidFunctionAndArgs_returnsSuccess() {
- val processor = LPFCP.getProcessor { request, _ ->
- LPFCP.processRequest(request, calculator).getOrThrow()
- }
- val result = processor.add(3, 5)
- assertEquals(8, result)
- }
-
- @Test fun getProcessor_withLambda_proceedsRequest_withValidFunctionReturningNullAndArgs_returnsSuccess() {
- val processor = LPFCP.getProcessor { request, _ ->
- LPFCP.processRequest(request, calculator).getOrThrow()
- }
- val result = processor.divideSafely(3, 0)
- assertEquals(null, result)
- }
-
- @Test fun getProcessor_withLambda_proceedsRequest_withValidOverloadedFunctionAndArgs_returnsSuccess() {
- val processor = LPFCP.getProcessor { request, _ ->
- LPFCP.processRequest(request, calculator).getOrThrow()
- }
- val result = processor.add("3", "5")
- assertEquals("35", result)
- }
-
- @Test fun getProcessor_withLambda_proceedsRequest_withValidFunctionWithDefaultArgsAndArgs_returnsSuccess() {
- val processor = LPFCP.getProcessor { request, _ ->
- LPFCP.processRequest(request, calculator).getOrThrow()
- }
- val result = processor.add(b = "5")
- assertEquals("15", result)
- }
-
- @Test fun getProcessor_withLambda_proceedsRequest_withValidFunctionWithDefaultArgsAndArgsInReverseOrder_returnsSuccess() {
- val processor = LPFCP.getProcessor { request, _ ->
- LPFCP.processRequest(request, calculator).getOrThrow()
- }
- val result = processor.add(b = "5", a = "4")
- assertEquals("45", result)
- }
-
- @Test fun getProcessor_withLambda_proceedsRequest_withFunctionThrowingException_returnsArithmeticException() {
- val processor = LPFCP.getProcessor { request, _ ->
- LPFCP.processRequest(request, calculator).getOrThrow()
- }
- assertEquals(
- ArithmeticException::class.java,
- assertThrows { processor.divide(5, 0) }.wrappedException.exceptionClass
- )
- }
-}
\ No newline at end of file
diff --git a/examples/calculator-java/.gitignore b/examples/calculator-java/.gitignore
deleted file mode 100644
index b1dff0d..0000000
--- a/examples/calculator-java/.gitignore
+++ /dev/null
@@ -1,45 +0,0 @@
-.gradle
-build/
-!gradle/wrapper/gradle-wrapper.jar
-!**/src/main/**/build/
-!**/src/test/**/build/
-
-### IntelliJ IDEA ###
-.idea/modules.xml
-.idea/jarRepositories.xml
-.idea/compiler.xml
-.idea/libraries/
-*.iws
-*.iml
-*.ipr
-out/
-!**/src/main/**/out/
-!**/src/test/**/out/
-
-### Kotlin ###
-.kotlin
-
-### Eclipse ###
-.apt_generated
-.classpath
-.factorypath
-.project
-.settings
-.springBeans
-.sts4-cache
-bin/
-!**/src/main/**/bin/
-!**/src/test/**/bin/
-
-### NetBeans ###
-/nbproject/private/
-/nbbuild/
-/dist/
-/nbdist/
-/.nb-gradle/
-
-### VS Code ###
-.vscode/
-
-### Mac OS ###
-.DS_Store
\ No newline at end of file
diff --git a/examples/calculator-java/.idea/.gitignore b/examples/calculator-java/.idea/.gitignore
deleted file mode 100644
index 7d9a8e5..0000000
--- a/examples/calculator-java/.idea/.gitignore
+++ /dev/null
@@ -1,12 +0,0 @@
-# Default ignored files
-/shelf/
-/workspace.xml
-# Editor-based HTTP Client requests
-/httpRequests/
-# Environment-dependent path to Maven home directory
-/mavenHomeManager.xml
-# Datasource local storage ignored files
-/dataSources/
-/dataSources.local.xml
-# Zeppelin ignored files
-/ZeppelinRemoteNotebooks/
diff --git a/examples/calculator-java/.idea/gradle.xml b/examples/calculator-java/.idea/gradle.xml
deleted file mode 100644
index 7e65002..0000000
--- a/examples/calculator-java/.idea/gradle.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/examples/calculator-java/.idea/kotlinc.xml b/examples/calculator-java/.idea/kotlinc.xml
deleted file mode 100644
index 1e16934..0000000
--- a/examples/calculator-java/.idea/kotlinc.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-