# Microsoft Graph SDK for Java
## Version 6.1.0 now Generally Available!

[![Download](https://img.shields.io/maven-central/v/com.microsoft.graph/microsoft-graph.svg)](https://search.maven.org/artifact/com.microsoft.graph/microsoft-graph-beta)

Get started with the Microsoft Graph SDK for Java by integrating the [Microsoft Graph API](https://developer.microsoft.com/en-us/graph/get-started/java) into your Java application!

> **Note:** this SDK allows you to build applications using the [beta](https://docs.microsoft.com/en-us/graph/use-the-api#version) of Microsoft Graph. If you want to use the production supported Microsoft Graph APIs under v1.0, use our [v1.0 SDK](https://github.com/microsoftgraph/msgraph-sdk-java) instead.

## 1. Installation

### 1.1 Install via Gradle

Add the repository and a compile dependency for `microsoft-graph-beta` to your project's `build.gradle`:

```Groovy
repositories {
  mavenCentral()
}

dependencies {
    // Include the sdk as a dependency
    // x-release-please-start-version
    implementation 'com.microsoft.graph:microsoft-graph-beta:6.13.0'
    // x-release-please-end
    // This dependency is only needed if you are using the TokenCrendentialAuthProvider
    implementation 'com.azure:azure-identity:1.11.0'
}
```

### 1.2 Install via Maven

Add the dependency in `dependencies` in pom.xml

```xml
<dependency>
  <!-- Include the sdk as a dependency -->
  <groupId>com.microsoft.graph</groupId>
  <artifactId>microsoft-graph-beta</artifactId>
  <!--x-release-please-start-version-->
  <version>6.13.0</version>
  <!--x-release-please-end-->
</dependency>
<dependency>
  <!-- This dependency is only needed if you are using the TokenCrendentialAuthProvider -->
  <groupId>com.azure</groupId>
  <artifactId>azure-identity</artifactId>
  <version>1.11.0</version>
</dependency>
```

>**Note:** if the `repositories` node doesn't exist, add it in `project`. For more information about the maven repositories configuration, [refer to this documentation](https://maven.apache.org/guides/mini/guide-multiple-repositories.html).

### 1.3 Enable ProGuard (Android)

The nature of the Graph API is such that the SDK needs quite a large set of classes to describe its functionality. You need to ensure that [ProGuard](https://developer.android.com/studio/build/shrink-code.html) is enabled on your project. Otherwise, you will incur long build times for functionality that is not necessarily relevant to your particular application. If you are still hitting the 64K method limit, you can also enable [multidexing](https://developer.android.com/studio/build/multidex.html). Checkout the [recommended rules](./docs/proguard-rules.txt).

## 2. Getting started

### 2.1 Register your application

Register your application by following the steps at [Register your app with the Microsoft Identity Platform](https://docs.microsoft.com/graph/auth-register-app-v2).

### 2.2 Create an IAuthenticationProvider object

An instance of the **GraphServiceClient** class handles building requests, sending them to the Microsoft Graph API, and processing the responses. To create a new instance of this class, you need to provide an instance of `AuthenticationProvider`, which can authenticate requests to Microsoft Graph.

For an example of how to get an authentication provider, see [choose a Microsoft Graph authentication provider](https://docs.microsoft.com/graph/sdks/choose-authentication-providers?tabs=Java).

### 2.3 Get a GraphServiceClient object

After you have set the correct application ID and URL, you must get a **GraphServiceClient** object to make requests against the service. The SDK stores the account information for you, but when a user signs in for the first time, it invokes the UI to get the user's account information.

```java
final AzureIdentityAuthenticationProvider authenticationProvider =
        new AzureIdentityAuthenticationProvider(credential, null, scopes);
GraphServiceClient graphClient = new GraphServiceClient(authenticationProvider)

//Alternatively
GraphServiceClient graphClient = new GraphServiceClient(credential, scopes);
```

## 3. Make requests against the service

After you have a GraphServiceClient that is authenticated, you can begin making calls against the service. The requests against the service look like our [REST API](https://developer.microsoft.com/en-us/graph/docs/concepts/overview).

### 3.1 Get the user info

To retrieve the user's information:

```java
User me = graphClient.me().get();
System.out.printf("Hello %s, your ID is %s%n", me.getDisplayName(), me.getId());
```
## 4. Documentation

For more detailed documentation, see:

* [Overview](https://docs.microsoft.com/graph/overview)
* [Collections](https://docs.microsoft.com/graph/sdks/paging)
* [Making requests](https://docs.microsoft.com/graph/sdks/create-requests)
* [Known issues](https://github.com/MicrosoftGraph/msgraph-sdk-java/issues)
* [Contributions](https://github.com/microsoftgraph/msgraph-beta-sdk-java/blob/master/CONTRIBUTING.md)

## 5. Issues

For known issues, see [issues](https://github.com/MicrosoftGraph/msgraph-beta-sdk-java/issues).

## 6. Contributions

The Microsoft Graph SDK is open for contribution. To contribute to this project, see [Contributing](https://github.com/microsoftgraph/msgraph-beta-sdk-java/blob/master/CONTRIBUTING.md).

## 7. Supported Java versions

The Microsoft Graph beta SDK for Java library is supported at runtime for Java 8+ and [Android API revision 26](http://source.android.com/source/build-numbers.html) and greater.

## 8. License

Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the [MIT license](LICENSE).

## 9. Third-party notices

[Third-party notices](THIRD%20PARTY%20NOTICES)


<!--
    Copyright (c) 2011 Red Hat, Inc. and others

    This program and the accompanying materials are made available under the
    Apache Software License 2.0 which is available at:
    https://www.apache.org/licenses/LICENSE-2.0.

    SPDX-License-Identifier: Apache-2.0
-->

# GitHub Pages
The latest news for CDI 4.x can be found in the [GitHub pages](https://jakartaee.github.io/cdi/)

Sources in GIT
====

The main branch contains the work-in-progress on CDI.next specification (5.0)

# Legacy Releases
Check out the [cdi-spec.org](http://cdi-spec.org) for more info on CDI 2.0 and CDI 1.2


[<img src="https://directory.apache.org/fortress/gen-docs/1.0.1/apidocs/org/apache/directory/fortress/core/doc-files/apacheds-logo.jpeg" align="right" />](https://directory.apache.org/scimple/)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)

Apache Directory SCIMple
========================

Jakarta EE implementation of the [Simple Cross-domain Identity Management](http://www.simplecloud.info/) (SCIM) version 2.0 specification as defined by the following RFCs:

* [RFC7643 - SCIM: Core Schema](https://tools.ietf.org/html/rfc7643)

* [RFC7644 - SCIM: Protocol](https://tools.ietf.org/html/rfc7644)

* [RFC7642 - SCIM: Definitions, Overview, Concepts, and Requirements](https://tools.ietf.org/html/rfc7642)

## Project

Please fork this project and contribute Pull-Requests via this project's Github page.  Issue tracking is being transitioned to the [Apache Foundation's Jira server](http://issues.apache.org/jira/browse/SCIMPLE).

Please visit our project page at https://directory.apache.org/scimple.

## Features

* A full-featured Java SCIM client
* Declarative creation of new ResourceTypes and Extensions
* Dynamic generation of the Schema and ResourceType end-points.
* A suite of tools to allow the creation of SCIM resources that can then be verified against the appropriate schemas.

## Future features

* Example implementations of the server with various persistence paradigms.
* A set of verification tests to ensure the project meets the specification and to allow inter-operability testing.

## Example code

Examples of the project's declarative syntax are shown below. The first example shows how a SCIM resource is declared:

```java
@Data
@EqualsAndHashCode(callSuper = true)
@ScimResourceType(
    id = ScimUser.RESOURCE_NAME,
    name = ScimUser.RESOURCE_NAME,
    schema = ScimUser.SCHEMA_URI,
    description = "Top level ScimUser",
    endpoint = "/Users"
)
@XmlRootElement(name = ScimUser.RESOURCE_NAME)
@XmlAccessorType(XmlAccessType.FIELD)
public class ScimUser extends ScimResource {

    public static final String RESOURCE_NAME = "User";
    public static final String SCHEMA_URI = "urn:ietf:params:scim:schemas:core:2.0:User";

    @ScimAttribute(
    description="A Boolean value indicating the User's administrative status.",
    type=Type.BOOLEAN
    )

    @XmlElement(name = "active")
    Boolean active = true;

    @ScimAttribute(
    type = Type.COMPLEX,
    description="A physical mailing address for this User, as described in (address Element). Canonical Type Values of work, home, and other. The value attribute is a complex type with the following sub-attributes."
    )
    @XmlElement(name = "addresses")
    List<Address> addresses;
```

In the example above, annotations are used at the class level and member level to declare a new SCIM resource and its attributes respectively.  The example below shows the equivalent declaration for a resource Extension:

```java
@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
@ScimExtensionType(
    required = false,
    name = "EnterpriseUser",
    id = EnterpriseExtension.URN,
    description = "Attributes commonly used in representing users that belong to, or act on behalf of, a business or enterprise."
)
@Data
public class EnterpriseExtension implements ScimExtension {

    public static final String URN = "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User";

    @XmlType
    @XmlAccessorType(XmlAccessType.NONE)
    @Data
    @Accessors(chain = true)
    public static class Manager {

        @ScimAttribute(
        description = "The \"id\" of the SCIM resource representing the user's manager.  RECOMMENDED."
        )

        @XmlElement
        private String value;

        @ScimAttribute(
        description = "The URI of the SCIM resource representing the User's manager.  RECOMMENDED."
        )

        @XmlElement
        private String $ref;
```

This example shows how an extension is declared at the class level, but also provides an example of how complex SCIM types can be simply defined as suitably annotated inner classes.

Implementations are fully customizable without altering the core server code. The example below shows how the implementation for a repository is declared:

```java
public class InMemoryUserService implements Respository<ScimUser> {
```

Implementing the repository interface allows the customization of create, retrieve, update, and delete methods (as well as find).  Customization is flexible - if your system implements soft deletes, create a delete method that simply sets a flag and alter the find and retrieve methods to only return "undeleted" resources.

## Requests to Repository Mappings

At a high level SCIMple provides the marshaling and unmarshaling of SCIM requests and responses to and from the appropriate repository methods and supporting endpoints (e.g. `/Schema`, `/ServiceProvider`, and `/ResourceTypes`).  The following table shows the mapping of SCIM requests to repository methods:

| SCIM Endpoint | HTTP Method   | Repository Method       |
|---------------|---------------|-------------------------|
| **Users**     |               |                         |
| /Users        | GET           | `repository.find()`     |
| /Users        | POST          | `repository.create()`   |
| /Users/{id}   | GET           | `repository.get()`      |
| /Users/{id}   | PUT           | `repository.update()`   |
| /Users/{id}   | PATCH         | `repository.patch()`    |
| /Users/{id}   | DELETE        | `repository.delete()`   |
| **Groups**    |               |                         |
| /Groups       | GET           | `repository.find()`     |
| /Groups       | POST          | `repository.create()`   |
| /Groups/{id}  | GET           | `repository.get()`      |
| /Groups/{id}  | PUT           | `repository.update()`   |
| /Groups/{id}  | PATCH         | `repository.patch()`    |
| /Groups/{id}  | DELETE        | `repository.delete()`   |
| **Other**     |               |                         |
| /Bulk         | POST          | `repository.*`          |

> **NOTE:** The `/Bulk` endpoint enables clients to send a potentially large collection of resource operations
in a single request, replacing the need to send multiple requests.

## Building & Contributing

Clone the code and build it!

**Prerequisites**

* Java 17+
> NOTE: The build runs with Java 17+, but compiles to Java 11.

```bash
git clone https://github.com/apache/directory-scimple.git
cd directory-scimple
./mvnw package
# or on windows
# mvnw.bat package
```

### Project modules

| Name                         | Description                                                                                |
|------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| scim-spec/scim-spec-schema   | SCIM relate models from [RFC7643](https://www.rfc-editor.org/rfc/rfc7643.html) and Filter related models from [RFC7644](https://www.rfc-editor.org/rfc/rfc7644.html) |
| scim-spec/scim-spec-protocol | All other REST related models from [RFC7644](https://www.rfc-editor.org/rfc/rfc7644.html)                                                                            |
| scim-client                  | A SCIM REST Client                                                                                |
| scim-core                    | SCIMple Repository related classes, used to provide CRUD operations to a data store (e.g. a database), see above example                                             |
| scim-server                  | REST Endpoint implementations                                                                                |
| scim-server-examples         | Various server examples                                                                                |
| scim-compliance-tests        | Integration tests that can be used to test a SCIM server                                                                                |


Modello
=======================

[![Maven Central](https://img.shields.io/maven-central/v/org.codehaus.modello/modello.svg?label=Maven%20Central)](https://search.maven.org/artifact/org.codehaus.modello/modello)
[![MIT License](https://img.shields.io/github/license/codehaus-plexus/modello.svg?label=License)](http://www.apache.org/licenses/)
![Build Status](https://github.com/codehaus-plexus/modello/workflows/GitHub%20CI/badge.svg)

Modello is a framework for code generation from a simple model.

Modello generates code from a simple model format: based on a plugin architecture, various types of code and descriptors can be generated from the single model, including Java POJOs, XML/JSON/YAML marshallers/unmarshallers, XSD and documentation.

# Documentation

Documentation can be found on the Modello site hosted at [Github.io](http://codehaus-plexus.github.io/modello/).

This site is generated by running:

```
mvn -Prun-its,reporting clean verify site site:stage
```

# Licensing

Modello is licensed under the therms of the [MIT License](http://opensource.org/licenses/mit-license.php)


![current build](https://github.com/opendcs/opendcs/actions/workflows/build.yml/badge.svg)

# OpenDCS

OpenDCS is a tool for doing the following:
 - retrieving data from the NOAA GOES Satellite system and processing it to a more usual form
 - retrieving data from arbitrary systems
 - near real-time timeseries data processing.

OpenDCS is currently used by:

- U.S. Army Corps of Engineers
- U.S. Bureau of Reclamation
- U.S. National Oceanic and Atmospheric Administration

And others.

If you're agency/company/etc uses OpenDCS and wishes that to be known, please submit either an issue indicating
you would like the name added, or a pull request that updates the list above. Company/Agency Logos are welcome in place
of plain text.

# Getting started

Documentation on how to use OpenDCS is available at https://opendcs-env.readthedocs.io/en/latest/index.html

# Getting help

We have a mailing list at https://www.freelists.org/list/opendcs.

Additionally you can open a discussion at https://github.com/opendcs/opendcs/discussions

# Contributing

First of, if you feel a desire to contribute - which to us includes trying to use the software and reporting issues - thanks!

Checkout the CONTRIBUTING.md file, and don't be too scared by all the legalese; the project started at several government agencies who
have chosen to properly open source the project and we felt a little solid copy-pasting from other government contributing documents was
a good idea.

The short version is, add you're name to the CONTRIBUTORS.md file, and submit changes to the default branch, currently named master.

As for what to contribute: https://github.com/opendcs/opendcs/projects shows our current major projects, as well as a
project each for tracking bugs and features; Wiki (https://github.com/opendcs/opendcs) pages prefixed with "Project -" will have more
information about some projects.
If you want to contribute and aren't sure where to start that should be a good place to see our plans and priorities; please do not hesitate to
ask questions on the mailing list, discussions, or within an issue itself.

We are currently in the process of some major overhauls to various subsystems and while that
can be scary we would like to encourage you to join us anyways.

# Compiling

- Installing Ant and adding to your PATH
  - Follow the instructions listed [here](https://ant.apache.org/manual/install.html)
  - Ant version 1.10.12 or higher is required.
- OpenDCS 7.x targets Java 8. A JDK 8 is recommended for build though 11 and 17 will work, except for the generating the installer.
- Our runtime target is Java 8, however we will support 11 and 17 at runtime (NOTE: the installer doesn't currently work with 17)

To build the file opendcs.jar run the following:

`ant jar`

If you want to build the installer run:

`ant opendcs`

To get a simple baseline environment going:

`ant run`

This will start the "launcher_start" application and do an initial setup of an XML database suitable for DECODES operations
going that you can use for manual and exploratory testing.

# General Development

To verify everything can work on your system run the following:

```
# General tests
ant test
# NOTE: this will flash a few interfaces onto your display, let the task finish or the tests get stuck.
# However, you can just run through the GUIs to finish the tests. Though be aware if you don't follow the
# programmed script the task may return failure.

# Test the GUI (NOTE: leave your hands off the keyboard and mouse or the runner gets confused.)
ant gui-test -Dno.docs=true

# Tests of a "live" system.
ant integration-test -Dno.docs=true -Dopendcs.test.engine=OpenDCS-XML
# and if you have docker
ant integration-test -Dno.docs=true -Dopendcs.test.engine=OpenDCS-Postgres

#To test the LRGS
ant lrgs-test -Dno.docs=true
```

This will run all of the various tests and let you know you have everything setup such that you can start development.

For all test tasks you can add `-DdebugPort=<a port number>` and the JVMs started will wait for a debug connection.
Beware that gui-test and integration-test depend on test running, so you will have to attach the remote debugger twice.
This is a current limitation of the ant build.

To run a specific test only use:

```
ant <test target> -Dtests=<Test class name>
```

It is possible a file glob will work in the tests parameter above but we have not tested this.

See https://opendcs-env.readthedocs.io/en/latest/dev-docs.html for guidance on some of the newer components.

# IDE integration

While the OpenDCS maintainers don't have time to maintain files for other IDEs, we want to make
it as easy as possible for anyone to help and will welcome baseline configuration for others.
If you wish to help in this way please created additional targets and required files to generate them.

## Visual Studio Code or Eclipse

To create the appropriate project files for VS Code or Eclipse you can run the following task:

`ant eclipse-ide-files`

This will create the appropriate .project and .classpath files for intellisense to behave correctly.

## Intellij

See https://github.com/opendcs/opendcs/wiki/Coding-OpenDCS-with-IntelliJ for guidance in setting up intellij.


[![vaas-dotnet-ci](https://github.com/GDATASoftwareAG/vaas/actions/workflows/ci-dotnet.yaml/badge.svg)](https://github.com/GDATASoftwareAG/vaas/actions/workflows/ci-dotnet.yaml)
[![vaas-rust-ci](https://github.com/GDATASoftwareAG/vaas/actions/workflows/ci-rust.yaml/badge.svg)](https://github.com/GDATASoftwareAG/vaas/actions/workflows/ci-rust.yaml)[![vaas-typescript-ci](https://github.com/GDATASoftwareAG/vaas/actions/workflows/ci-typescript.yaml/badge.svg)](https://github.com/GDATASoftwareAG/vaas/actions/workflows/ci-typescript.yaml)
[![vaas-ruby-ci](https://github.com/GDATASoftwareAG/vaas/actions/workflows/ci-ruby.yaml/badge.svg)](https://github.com/GDATASoftwareAG/vaas/actions/workflows/ci-ruby.yaml)
[![vaas-java-ci](https://github.com/GDATASoftwareAG/vaas/actions/workflows/ci-java.yaml/badge.svg)](https://github.com/GDATASoftwareAG/vaas/actions/workflows/ci-java.yaml)
[![vaas-python-ci](https://github.com/GDATASoftwareAG/vaas/actions/workflows/ci-python.yaml/badge.svg)](https://github.com/GDATASoftwareAG/vaas/actions/workflows/ci-python.yaml)
[![vaas-php-ci](https://github.com/GDATASoftwareAG/vaas/actions/workflows/ci-php.yaml/badge.svg)](https://github.com/GDATASoftwareAG/vaas/actions/workflows/ci-php.yaml)
[![vaas-golang-ci](https://github.com/GDATASoftwareAG/vaas/actions/workflows/ci-golang.yaml/badge.svg)](https://github.com/GDATASoftwareAG/vaas/actions/workflows/ci-golang.yaml)

# Verdict-as-a-Service

*Verdict-as-a-Service* (VaaS) is a cloud service that provides capabilities to scan files for malware and other threats. It allows you to easily integrate malware detection in your application with a few lines of code. You can use VaaS to secure any scenario where a file is exchanged or stored, such as:

- Upload forms with file submissions
- Collaboration software like MS Teams, Nextcloud or Slack
- Backup and distributed file storage like Dropbox or OneDrive

With minimal effort, you can check a file, URL or hashsum for malicious content. No local installation of any anti-malware product is necessary. VaaS works out of the box, by providing detections from the G DATA cloud. Hosting VaaS on your own Kubernetes cluster, is an option as well.

Simple example in Rust. Check below for more programming languages.

```rust
use vaas::{error::VResult, CancellationToken, Vaas, VaasVerdict};
use vaas::auth::authenticators::ClientCredentials;
use std::convert::TryFrom;
use std::time::Duration;

#[tokio::main]
async fn main() -> VResult<()> {
    // Cancel the request after 10 seconds if no response is received
    let ct = CancellationToken::from_seconds(10);

    // Authenticate and create VaaS instance
    let authenticator = ClientCredentials::new(CLIENT_ID, CLIENT_SECRET);
    let vaas = Vaas::builder(authenticator).build()?.connect().await?;

    // Open a file we want to check
    let file = std::path::PathBuf::from("myfile");

    // Ask VaaS for a verdict
    let verdict = vaas.for_file(&file, &ct).await?;

    // Prints "Clean", "Pup" or "Malicious"
    println!("{}", verdict.verdict);
    Ok(())
}
```

## How to get started with VaaS
If you are interested in trying out VaaS, you can sign up on our website to create a free trial account. Visit our registration page and follow the instructions to get started. If you have a business case or specific requirements, please contact us at oem@gdata.de to discuss your needs and explore how VaaS can best fit your organization.

## SDKs
We provide SDKs for various programming languages to make it easy for you to integrate VaaS in your application. You can find the source code, examples, and documentation for each SDK in the corresponding repository. Currently, we support the following languages:

|Language|Source Code|Examples|Documentation|Repository|
|--------|-----------|--------|-------------|----------|
|Rust|[Rust SDK](./rust/)| [Examples](./rust/examples)| [docs.rs](https://docs.rs/vaas/latest/vaas/) | [crates.io](https://crates.io/crates/vaas) |
|Java|[Java SDK](./java/)|[Examples](./java/examples)| [Readme](https://github.com/GDATASoftwareAG/vaas/blob/main/java/Readme.md) | [maven central](https://mvnrepository.com/artifact/de.gdata/vaas)|
|PHP|[PHP SDK](./php/)|[Examples](./php/examples)||[packagist](https://packagist.org/packages/gdata/vaas)|
|TypeScript|[TypeScript SDK](./typescript/)|[Examples](./typescript/examples)|[Readme](https://github.com/GDATASoftwareAG/vaas/blob/main/typescript/Readme.md)|[npmjs](https://www.npmjs.com/package/gdata-vaas)
|Python|[Python SDK](./python/)|[Examples](./python/examples)|[Readme](https://github.com/GDATASoftwareAG/vaas/blob/main/python/README.md)|[pypi](https://pypi.org/project/gdata-vaas/)|
|.NET|[.NET SDK](./dotnet/)|[Examples](./dotnet/examples)||[nuget.org](https://www.nuget.org/packages/GDataCyberDefense.Vaas)|
|Ruby|[Ruby SDK](./ruby/)|[Examples](./ruby/examples)|[Reamde](https://github.com/GDATASoftwareAG/vaas/blob/main/ruby/README.md)|[rubygems](https://rubygems.org/gems/vaas)|
|Go|[Go SDK](./golang/vaas/)|[Examples](./golang/examples)|[Readme](https://github.com/GDATASoftwareAG/vaas/blob/main/golang/vaas/README.md)|[Github](https://github.com/GDATASoftwareAG/vaas/tree/main/golang/vaas)|

The following table shows the functionality supported by each SDK:

|Functionality|Rust|Java|PHP|TypeScript|.NET|Python|Ruby|Golang
|---|---|---|---|---|---|---|---|---|
|Check SHA256|✅|✅|✅|✅|✅|✅|✅|✅|
|Check SHA256 list|✅|✅|❌|✅|✅|❌|❌|✅|
|Check URL|✅|✅|✅|✅|✅|✅|✅|✅|
|Check file|✅|✅|✅|✅|✅|✅|✅|✅|
|Check file list|✅|✅|❌|✅|✅|❌|❌|✅|
|Custom Guids for tracability on user side|❌|❌|✅|❌|❌|✅|❌|❌|

## Integration Ideas for Malware Detection trough VaaS
You can use VaaS to create various applications that scan for malicious content with a few lines of code. Here are some examples:

Create a command line scanner to find malware: [Example](rust/examples/gscan)

Create a KDE Dolphin plugin to scan for malicious content: [Example](rust/examples/kde_dolphin)

Create a WordPress plugin that scans all file uploads for malware: [Example](php/examples/wordpress)


火山引擎SDK for Java

欢迎使用火山引擎SDK for Java，本文档为您介绍如何获取及调用SDK。

## 前置准备
### 服务开通
请确保您已开通了您需要访问的服务。您可前往[火山引擎控制台](https://console.volcengine.com/ )，在左侧菜单中选择或在顶部搜索栏中搜索您需要使用的服务，进入服务控制台内完成开通流程。
### 获取安全凭证
Access Key（访问密钥）是访问火山引擎服务的安全凭证，包含Access Key ID（简称为AK）和Secret Access Key（简称为SK）两部分。您可登录[火山引擎控制台](https://console.volcengine.com/ )，前往“[访问控制](https://console.volcengine.com/iam )”的“[访问密钥](https://console.volcengine.com/iam/keymanage/ )”中创建及管理您的Access Key。更多信息可参考[访问密钥帮助文档](https://www.volcengine.com/docs/6291/65568 )。

## 获取与安装
推荐通过Maven依赖使用火山引擎SDK for Java

[![maven](https://img.shields.io/maven-central/v/com.volcengine/volc-sdk-java)](https://search.maven.org/artifact/com.volcengine/volc-sdk-java)
```xml
<dependency>
    <groupId>com.volcengine</groupId>
    <artifactId>volc-sdk-java</artifactId>
    <version>最新版本</version>
</dependency>
```
如果 SDK版本 高于或者等于 Java 9 请依赖javax.annotation-api 由于在高于或者等于 Java 9 中 javax.annotation-api 被移除

请在使用中引用
```xml
<dependency>
  <groupId>javax.annotation</groupId>
  <artifactId>javax.annotation-api</artifactId>
  <version>1.3.2</version>
</dependency>
```

### SNAPSHOT发布说明
[版本号：2.0.1-SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/com/volcengine/volc-sdk-java)

*注意：SNAPSHOT版本可能存在潜在问题，源码分支为2.0.0-SNAPSHOT，如您有沟通需求，请提交[工单](https://console.volcengine.com/workorder/create)选择对应产品获得沟通*

#### 变更说明
1. 使用OkHttp作为底层数据交互的http组件库，可以兼容安卓手机端
2. 解决大量凭证潜在的线程泄露问题
3. 抽象部分与网络库相关的model，避免冲突
4. 业务包基本不感知底层变更，理论上可以平滑迁移

如何使用SNAPSHOT版本
1. 添加SNAPSHOT的Maven仓库，SNAPSHOT策略配置请自行查阅文档
```xml
 <repository>
    <id>snapshots-repo</id>
    <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</repository>
```
2. 添加依赖
```xml
<dependency>
    <groupId>com.volcengine</groupId>
    <artifactId>volc-sdk-java</artifactId>
    <version>2.0.1-SNAPSHOT</version>
</dependency>

```

## 相关配置
### 安全凭证配置
火山引擎SDK for Java支持以下几种方式进行凭证管理：

*注意：代码中Your AK及Your SK需要分别替换为您的AK及SK。*

**方式一**：在Client中显式指定AK/SK **（推荐）**
```java
iamService.setAccessKey("Your AK");
iamService.setSecretKey("Your SK");
```

**方式二**：从环境变量加载AK/SK
  ```bash
  VOLC_ACCESSKEY="Your AK"
  VOLC_SECRETKEY="Your SK"
  ```
**方式三**：从HOME文件加载AK/SK

在本地的~/.volc/config中添加如下内容：
  ```json
    {
      "ak": "Your AK",
      "sk": "Your SK"
    }
  ```

### 释放资源
当您调用完成后，通过显式的调用destroy来释放守护线程
```java
iamService.destroy()
```

##其它资源
示例参见[example](./example)


# Link to starter repository #

[OneDataShare Starter](https://github.com/didclab/ODS-Starter)

Recommended IDEs (used by ODS team for development):
1. IntelliJ Idea Community Edition (for backend code)
2. Visual Studio Code (for front-end code)

## Installation Procedure ##

1. Clone OneDataShare GitHub repository.
	Open command prompt (Windows OS) or terminal (Unix-based OS)
	Run following command –
	git clone https://github.com/didclab/onedatashare.git

2. Open the cloned repository in IntelliJ and import it as a Maven project.

3. Install Lombok Plugin in IntelliJ.
	In IntelliJ, goto File > Settings > Plugins.
	In the search box, type ‘Lombok’ and click on ‘search in repositories’.
	Install the Lombok plugin.

	_Note – Lombok plugin enables us to avoid writing boilerplate code such as getters, setters and parameterized constructors._

4. Navigate to the front-end codebase (<cloned_directory>/src/main/react-front-end/) and build.
	For Windows OS, run following commands:
		npm install
		npm run build-win
	For Unix-based OS, run following commands:
		npm install
		npm run build

5. To execute ODS as a standalone application, follow steps mentioned in the standalone-execution.txt file.
   To execute ODS using docker containers, follow steps mentioned in the docker-execution.txt file.

## Contact ODS Team ##

Please direct all issues/concerns/queries with respect to OneDataShare using the support page (https://www.onedatashare.org/support) or by sending us an email at admin@onedatashare.org.

## OneDataShare Team ##

Dr. Tevfik Kosar (tkosar@buffalo.edu)
Product Owner
https://cse.buffalo.edu/faculty/tkosar/
Associate Professor, University at Buffalo

Jacob Goldverg (jacobgol@buffalo.edu)
Lead Developer
https://engineering.buffalo.edu/computer-science-engineering/people/phd-candidates.html
PhD candidate, University at Buffalo


 [![Maven Central](https://img.shields.io/maven-central/v/org.instancio/instancio-core.svg)](https://search.maven.org/artifact/org.instancio/instancio-core/)
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=instancio_instancio&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=instancio_instancio)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=instancio_instancio&metric=coverage)](https://sonarcloud.io/summary/new_code?id=instancio_instancio)

---

# What is it?

Instancio is a Java library that automatically creates and populates objects for your unit tests.

Instead of manually setting up test data:

```java
Address address  = new Address();
address.setStreet("street");
address.setCity("city");
//...

Person person = new Person();
person.setFirstName("first-name");
person.setLastName("last-name");
person.setAge(22);
person.setGender(Gender.MALE);
person.setAddress(address);
//...
```

You can simply do the following:

```java
Person person = Instancio.create(Person.class);
```

This one-liner returns a fully-populated person, including nested objects and collections.

The object is populated with random data that can be reproduced in case of test failure.

### What else can Instancio do?

1. Create collections of objects:

```java
List<Person> persons = Instancio.ofList(Person.class).size(10).create();
```

2. Create streams of objects:

```java
Stream<Person> persons = Instancio.stream(Person.class).limit(5);
```

3. Create generic types:

```java
Pair<List<Foo>, List<Bar>> pairOfLists = Instancio.create(new TypeToken<Pair<List<Foo>, List<Bar>>>() {});
```

4. Customise generated values:

```java
Person person = Instancio.of(Person.class)
    .generate(field(Person::getDateOfBirth), gen -> gen.temporal().localDate().past())
    .generate(field(Phone::getAreaCode), gen -> gen.oneOf("604", "778"))
    .generate(field(Phone::getNumber), gen -> gen.text().pattern("#d#d#d-#d#d-#d#d"))
    .subtype(all(AbstractAddress.class), AddressImpl.class)
    .supply(all(LocalDateTime.class), () -> LocalDateTime.now())
    .onComplete(all(Person.class), (Person p) -> p.setName(p.getGender() == Gender.MALE ? "John" : "Jane"))
    .create();
```

5. Create reusable templates (Models) of objects:

```java
Model<Person> simpsons = Instancio.of(Person.class)
    .set(field(Person::getLastName), "Simpson")
    .set(field(Address::getCity), "Springfield")
    .generate(field(Person::getAge), gen -> gen.ints().range(40, 50))
    .toModel();

Person homer = Instancio.of(simpsons)
    .set(field(Person::getFirstName), "Homer")
    .create();

Person marge = Instancio.of(simpsons)
    .set(field(Person::getFirstName), "Marge")
    .create();
```

## Main Features

- Fully reproducible data in case of test failures.
- Support for generics, `record` and `sealed` classes, Java 21 sequenced collections.
- Data generation based on JPA and Bean Validation annotations (Hibernate, jakarta, javax).
- Flexible configuration options and SPIs.
- Support for defining custom generators.
- `InstancioExtension` for Junit 5 `@ExtendWith`.
- Object population via fields and setters.

## Getting Started

- [User guide](https://www.instancio.org/user-guide) (instancio.org)
- [Javadocs](https://javadoc.io/doc/org.instancio/instancio-core/latest/) (javadoc.io)
- [Quickstart](https://github.com/instancio/instancio-quickstart) (github.com) sample Maven project with usage examples

  ```sh
  git clone https://github.com/instancio/instancio-quickstart.git
  ```

# Maven Coordinates

If you have JUnit 5 on the classpath, use the `instancio-junit` dependency.

```xml
<dependency>
    <groupId>org.instancio</groupId>
    <artifactId>instancio-junit</artifactId>
    <version>LATEST</version>
    <scope>test</scope>
</dependency>
```

To use Instancio with JUnit 4, TestNG, or standalone, use `instancio-core`:

```xml
<dependency>
    <groupId>org.instancio</groupId>
    <artifactId>instancio-core</artifactId>
    <version>LATEST</version>
    <scope>test</scope>
</dependency>
```

# Feedback

Feedback and bug reports are greatly appreciated!

- Please submit an [issue](https://github.com/instancio/instancio/issues) for bug reports and feature requests.
- For general feedback or questions, please create a post in the [Discussions](https://github.com/instancio/instancio/discussions).

Please check the [User Guide](https://www.instancio.org/user-guide), previous issues and discussions before creating a new one.

# Third-party Extensions

- [instancio-jpa](https://github.com/Mobe91/instancio-jpa) created by [Moritz Becker](https://github.com/Mobe91)

> Instancio-jpa is an extension on top of the Instancio library that enables the creation and population
> of JPA entities including the subsequent persistence of these entities using JPA for the purpose of test
> data generation in integration tests.

# Sponsors

If you like Instancio, please consider supporting its maintenance and development
by becoming a [sponsor](https://github.com/sponsors/armandino).

A big thank you to the current project sponsors:

- [@BjarkeTornager](https://github.com/BjarkeTornager)
- [@darthblonderss](https://github.com/darthblonderss)

Thanks to [JetBrains](https://www.jetbrains.com/opensource) and [YourKit](https://www.yourkit.com)
for supporting this project with their open source licenses.

## For Enterprise

Available as part of the Tidelift Subscription

The maintainers of Instancio and thousands of other packages are working with Tidelift to deliver commercial
support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk,
and improve code health, while paying the maintainers of the exact dependencies you use.
[Learn more.](https://tidelift.com/subscription/pkg/maven-org.instancio.instancio-core?utm_source=maven-org.instancio.instancio-core&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)


- [简介](#简介)
- [领域生态](#领域生态)
- [使用手册](#使用手册)
- [更新日志](#更新日志)
- [社区活动](#社区活动)
- [开发背景](#开发背景)
- [功能模块](#功能模块)
  - [一、平台工具(www.dokit.cn)](#一平台工具wwwdokitcn)
  - [二、常用工具](#二常用工具)
  - [三、性能检测](#三性能检测)
  - [四、视觉工具](#四视觉工具)
  - [五、Weex专项工具（CML专项工具）](#五weex专项工具cml专项工具)
  - [六、支持自定义的业务工具集成到面板中](#六支持自定义的业务工具集成到面板中)
  - [七、微信小程序专项工具](#七微信小程序专项工具)
- [相关文档](#相关文档)
- [微信交流群(一群满员，已开二群)](#一群满员，已开二群)
- [QQ 交流群](#qq-交流群)
- [微信公众号](#微信公众号)
- [项目成员](#项目成员)
- [使用提醒](#使用提醒)
- [友情链接](#友情链接)
- [协议](#协议)

## 简介

DoKit诞生于滴滴城运服体验技术部，是一款面向泛前端产品研发全生命周期的效率平台。经过两年的发展，当前DoKit已经发展成了一个相对完整的生态，比如DoKit For Android、DoKit For iOS、DoKit For 小程序、DoKit For Flutter、DoKit For Web。同时我们的项目被BAT以及滴滴、字节、快手、京东等等头部独角兽企业广泛使用并获得良好的口碑。随着dokit.cn平台端的推出，标志着DoKit已经从单纯的效率工具正式进入了效率工具平台的阶段。与此同时我们一直都未停下持续探索的精神，积极地在更多平台领域进行尝试，不给自己设限。我们相信DoKit的未来充满无限可能。

> [English Readme](README_EN.md)

## 领域生态

## 使用手册
访问[DoKit官网](https://www.dokit.cn/)，点击"[使用中心](http://xingyun.xiaojukeji.com/docs/dokit/#/intro)"。

**温馨提示：当前DoKit的所有功能都只针对Debug环境，Release环境未经过实际验证，所以请大家严格按照官方文档来集成，也不建议大家在Release环境上使用DoKit的任何功能。如果大家一定要在Release环境上使用，请自行进行充分的测试和验证，DoKit官方将不承担任何责任和损失。**
## 更新日志

- [Android-ReleaseNotes](http://xingyun.xiaojukeji.com/docs/dokit/#/AndroidReleaseNote)
- [iOS-ReleaseNotes](Doc/iOS-ReleaseNotes.md)
- [微信小程序-ReleaseNotes](Doc/miniapp-ReleaseNotes.md)
- [DoKit For Flutter-ReleaseNotes](Flutter/README.md)

## 社区活动

**DoKit调研问卷**
亲爱的DoKit用户,动动你的小手指参与一下我们的官方调研活动吧。我们极度渴望听到你们的声音:

链接:https://page.juyanwenjuan.com/jy_0CMpJzlu.html

## 开发背景

每一个稍微有点规模的 App，总会自带一些线下的测试功能代码，比如环境切换功能、帧率查看功能等等，这些功能的切换入口往往放在各式各样的入口中，比如一些特殊的手势，双击 statusBar，双击某一个功能区块，或者新建一个 keyWindow 始终至于 App 最上方等等，而且每一个 App 里面的线下附带功能模块很多是相似的，比如帧率查看、内存和 CPU 监控等等，但是现在基本上都是每个 App 都是自己实现了一份，经历了以上的问题之后，DoKit 就有了它存在的意义。

DoKit 是一个功能平台，能够让每一个 App 快速接入一些常用的或者你没有实现的一些辅助开发工具、测试效率工具、视觉辅助工具，而且能够完美在 Doraemon 面板中接入你已经实现的与业务紧密耦合的一些非通有的辅助工具，并搭配我们的[dokit](https://www.dokit.cn)平台，让功能得到延伸，接入方便，便于扩展。

**简单总结**

1、DoKit 能够快速让你的业务测试代码能够在这里统一管理，统一收口；

2、DoKit 内置很多常用的工具，避免重复实现，一次接入，你将会拥有强大的工具集合；

3、搭配dokit平台，借助[接口Mock](https://www.dokit.cn/#/index/dataMockPage)、[健康体检](https://www.dokit.cn/#/index/checkDataPage)、[文件同步助手](https://www.dokit.cn/#/index/fileSyncPage)、[一机多控]()让你方便和他人协同，极大的提升研发过程中的效率。

## 功能模块

### 一、平台工具(www.dokit.cn)
1. **【数据Mock】** App接口Mock解决方案，提供一套基于App网络拦截的接口Mock方案，无需修改代码即可完成对于接口数据的Mock。
2. **【健康体检】** 一键式操作，整合DoKit多项工具，数据可视化，快速准确定位问题，让你对app的性能了如指掌。
3. **【文件同步助手】** 通过终端服务，让你的终端空间在平台端完整的展现并提供强大的文件以及数据库操作能力。
4. **【一机多控】** 主从同步，释放人力，让研发测试效率提升看得见

### 二、常用工具

1. **【App 信息查看】** 快速查看手机信息，App 基础信息、签名相关、权限信息的渠道，避免去手机设置查找或者查看项目源代码的麻烦；
2. **【开发者选项 Android特有】** 一键跳转开发者选项，避免安卓由于平台差异导致的入口不一致
3. **【本地语言】** 一键跳转本地语言，避免安卓由于平台差异导致的入口不一致
4. **【沙盒浏览】** App 内部文件浏览的功能，支持删除和预览, 并且能通过 AirDrop 或者其他分享方式上传到 PC 中，进行更加细致的操作；
5. **【MockGPS】** App 能定位到全国各地，支持地图地位和手动输入经纬度；
6. **【H5任意门】** 开发测试同学可以快速输入 H5 页面地址，查看该页面效果；
7. **【Crash查看】** 方便本地打印出出现 Crash 的堆栈；
8. **【子线程UI】** 快速定位哪一些 UI 操作在非主线程中进行渲染，避免不必要的问题；（iOS独有）
9. **【清除本地数据】** 一键删除沙盒中所有数据；
10. **【NSLog】** 把所有 NSLog 信息打印到UI界面，避免没有开发证书无法调试的尴尬；
11. **【Lumberjack】** 每一条 CocoaLumberjack 的日志信息，都在在 App 的界面中显示出来，再也不需要导出日志这么麻烦;（iOS独有）
12. **【DBView】** 通过网页方便快捷的操作应用内数据库，让数据库的调试变得非常优雅;
13. **【模拟弱网】** 限制网速，模拟弱网环境下App的运行情况;（android独有）
14. **【JS脚本】** 在指定WebView运行JS脚本。（iOS独有）

### 三、性能检测

1. **【帧率】** App 帧率信息提供波形图查看功能，让帧率监控的趋势更加明显；
2. **【CPU】** App CPU 使用率信息提供波形图查看功能，让 CPU 监控的趋势更加形象；
3. **【内存】** App 内存使用量信息提供波形图查看功能，让内存监控的趋势更加鲜明；
4. **【流量监控】** 拦截 App 内部流量信息，提供波形图展示、流量概要展示、流量列表展示、流量筛选、流量详情，对流量信息统一拦截，成为我们 App 中自带的 "Charles"；
5. **【卡顿】** 锁定 App 出现卡顿的时刻，打印出对应的代码调用堆栈；
6. **【大图检测】** 通过流量监测，找出所有的大小超标的图片，避免下载大图造成的流量浪费和渲染大图带来的CPU消耗。
7. **【启动耗时】** 无侵入的统计出App启动过程的总共耗时；
8. **【UI层级检查】** 检查出每一个页面中层级最深的元素；
9. **【函数耗时】** 从函数级别分析app性能瓶颈；
10. **【Load】** 找出所有的Load方法，并给出耗时分析；（iOS独有）
11. **【内存泄漏】** 找出App中所有的内存泄漏的问题。

### 四、视觉工具

1. **【颜色吸管】** 方便设计师 UI 捉虫的时候，查看每一个组件的颜色值是否设置正确；
2. **【组件检查】** 可以抓取任意一个UI控件，查看它们的详细信息，包括控件名称、控件位置、背景色、字体颜色、字体大小；
3. **【对齐标尺】** 参考 Android 系统自带测试工具，能够实时捕获屏幕坐标，并且可以查看组件是否对齐；
4. **【元素边框线】** 绘制出每一个 UI 组件的边框，对于组件布局有一定的参考意义。

### 五、Weex专项工具（CML专项工具）

1. **【console日志查看】** 方便在端上查看每一个Weex文件中的console日志，提供分级和搜索功能；
2. **【storage缓存查看】** 将Weex中的storage模块的本地缓存数据可视化展示；
3. **【容器信息】** 查看每一个打开的Weex页面的基本信息和性能数据；
4. **【DevTool】** 快速开启Weex DevTool的扫码入口。

tips ： 如果使用我们滴滴优秀的开源跨端方案 [chameleon](https://github.com/didi/chameleon) 也可以集成该工具集合

### 六、支持自定义的业务工具集成到面板中

统一维护和管理所有的测试模块，详见接入手册

### 七、微信小程序专项工具

详见 [Doraemon mini program debugger](https://github.com/didi/DoraemonKit/tree/master/miniapp)

## 相关文档
- [iOS 研发助手 DoKit 技术实现（一）](https://www.jianshu.com/p/00763123dbc4)
- [iOS 研发助手 DoKit 技术实现（二）](https://blog.csdn.net/weixin_33847182/article/details/91472599)
- [DoKit支持iOS本地crash查看功能](https://juejin.im/post/5d76184ce51d4561d106cc65)
- [开源组件 DoKit 之 Android 版本技术实现（一）](https://blog.csdn.net/weixin_33711647/article/details/88004429)
- [开源组件 DoKit 之 Android 版本技术实现（二）](https://blog.csdn.net/weixin_34148456/article/details/88004414)
- [DoKit支持Activity启动耗时统计方案](https://juejin.im/post/5d70bc3051882571ed61e407)
- [DoKit 微信小程序SDK对外发布](https://juejin.im/post/5d9bf252518825095c3c5e32)
- [滴滴DoKit2.0 - 泛前端开发者的百宝箱](https://juejin.im/post/5dc3cdfa51882538d22d5948)
- [滴滴正式发布开源客户端研发助手 DoKit 3.0，新特性解读](https://juejin.im/post/5e818e29f265da4804697d25)
- [滴滴DoKit Android核心原理揭秘之函数耗时](https://juejin.im/post/5eba5ce15188256d6f268c98)
- [滴滴DoKit Android核心原理揭秘之AOP字节码实现](https://juejin.im/post/6891887877613944840)

## QQ 技术交流群

## 项目成员

**创始人**
[yixiangboy(易翔)](https://github.com/yixiangboy)
**负责人**
[小枫](https://github.com/bbssyyuui)

**内部核心成员**
[小枫](https://github.com/bbssyyuui) 、
[ChasonTang](https://github.com/ChasonTang) 、
[AdamCaoQAQ](https://github.com/AdamCaoQAQ) 、
[fangyeqing123](https://github.com/fangyeqing123) 、
[RealOnlyone](https://github.com/RealOnlyone) 、
[HeyCFarmer](https://github.com/HeyCFarmer) 、
[yFeii](https://github.com/yFeii) 、
[卡布达](https://github.com/kabda) 、
[maxiee](https://github.com/maxiee) 、
[zhugeafanti](https://github.com/zhugeafanti)

**贡献者榜单**
[yixiangboy(易翔)](https://github.com/yixiangboy)、
[jtsky(金台)](https://github.com/jtsky) 、
[LinJZong](https://github.com/LinJZong) 、
[wanglikun7342](https://github.com/wanglikun7342) 、
[jayconscious](https://github.com/jayconscious) 、
[jellybean](https://github.com/excitedhaha) 、
[linusflow](https://github.com/xu984386604) 、
[wangzhipeng](https://github.com/WangLao100)、
[BzCoder](https://github.com/BzCoder) 、
[changzuozhen](https://github.com/changzuozhen)、
[momoxiangbei](https://github.com/momoxiangbei)、
[wenquanlebao](https://github.com/wenquanlebao) 、
[hiXgb](https://github.com/hiXgb) 、
[Chinnko](https://github.com/Chinnko) 、
[y644938647](https://github.com/y644938647) 、
[wm219](https://github.com/wm219)、
[goolong](https://github.com/goolong) 、
[miracle9312](https://github.com/miracle9312) 、
[lwhsgz123](https://github.com/lwhsgz123)、
[huakucha](https://github.com/huakucha) 、
[HuginChen](https://github.com/HuginChen) 、
[feng562925462](https://github.com/feng562925462) 、
[azhon](https://github.com/azhon) 、
[rex26](https://github.com/rex26) 、
[csc-EricWu](https://github.com/csc-EricWu) 、
[xiandanin](https://github.com/xiandanin) 、
[0xd-cc](https://github.com/0xd-cc) 、
[k373379320](https://github.com/k373379320) 、
[fabcz](https://github.com/fabcz) 、
[y500](https://github.com/y500) 、
[Knight-ZXW](https://github.com/Knight-ZXW) 、
[boai](https://github.com/boai) 、
[klone1127](https://github.com/klone1127) 、
[DeveloperLY](https://github.com/DeveloperLY) 、
[sagdragon](https://github.com/sagdragon) 、
[ccworld1000](https://github.com/ccworld1000) 、
[HDB-Li](https://github.com/HDB-Li)、
[yu-jianfeng](https://github.com/yu-jianfeng)、
[ydlsl](https://github.com/ydlsl)

如何成为外部贡献者？ 提交有意义的PR，并被采纳。

## 使用提醒
因为SDK目前会配合[dokit.cn](http://www.dokit.cn/)平台, 会产生一些网络数据，这些信息我们收集绝不用于任何恶意用途。

**以下为所有涉及到网络请求的部分**

1. 统计有多少用户集成了dokit

    Android : DoraemonStatisticsUtil#uploadUserInfo

    iOS : DoraemonStatisticsUtil#upLoadUserInfo

2. 统计每个内置kit的使用情况

    Android : DataPickManager#realPost

    iOS : DoraemonBuriedPointManager#uploadData

3. 上传健康体检的相关数据

    Android : AppHealthInfoUtil#post

    iOS : DoraemonHealthManager#upLoadData

4. 数据mock的相关网络请求

    Android : NetWorkMockFragment 里涉及到接口mock的相关网络请求

    iOS : DoraemonMockManager#queryMockData&uploadSaveData

敬请各位用户知晓。

## 友情链接
1. [Hummer](https://github.com/didi/Hummer)，Hummer 是一套高性能高可用的跨端开发框架，一套代码可以同时支持开发 Android 和 iOS 应用。现已经支持 Vue/TypeScript/JavaScript 三种语法，面向大前端开发人员，总有一款适合你。

2. [Chameleon]( https://github.com/didi/chameleon)，简写CML，中文意思变色龙，意味着就像变色龙一样能适应不同环境的跨端整体解决方案，达到真正意义上"一套代码，多端运行"的终极目标

3. [Booster](https://github.com/didi/booster) 是一款专门为移动应用设计的易用、轻量级且可扩展的质量优化框架，其目标主要是为了解决随着 APP 复杂度的提升而带来的性能、稳定性、包体积等一系列质量问题。Booster 提供了性能检测、多线程优化、资源索引内联、资源去冗余、资源压缩、系统 Bug 修复等一系列功能模块，可以使得稳定性能够提升 15% ~ 25%，包体积可以减小 1MB ~ 10MB。**同时DoKit插件的底层也是基于Booster进行开发的。**

4. [AoE](https://github.com/didi/AoE)，一个终端侧AI集成运行时环境

5. [Mand Mobile](https://github.com/didi/mand-mobile) 一款优秀的面向金融场景的 移动端UI组件库

6. 我们团队的技术公众号【滴滴OrangeLab】，欢迎关注，我们会在这里持续输出团队内部比较有深度的技术沉淀和经验分享，欢迎一起交流。

## 协议

DoKit 基于 Apache-2.0 协议进行分发和使用，更多信息参见 [协议文件](LICENSE)。


[![Java CI](https://img.shields.io/github/actions/workflow/status/alibaba/fastjson2/ci.yaml?branch=main&logo=github&logoColor=white)](https://github.com/alibaba/fastjson2/actions/workflows/ci.yaml)
[![Codecov](https://img.shields.io/codecov/c/github/alibaba/fastjson2/main?logo=codecov&logoColor=white)](https://codecov.io/gh/alibaba/fastjson2/branch/main)
[![Maven Central](https://img.shields.io/maven-central/v/com.alibaba.fastjson2/fastjson2?logo=apache-maven&logoColor=white)](https://search.maven.org/artifact/com.alibaba.fastjson2/fastjson2)
[![GitHub release](https://img.shields.io/github/release/alibaba/fastjson2)](https://github.com/alibaba/fastjson2/releases)
[![Java support](https://img.shields.io/badge/Java-8+-green?logo=java&logoColor=white)](https://openjdk.java.net/)
[![License](https://img.shields.io/github/license/alibaba/fastjson2?color=4D7A97&logo=apache)](https://www.apache.org/licenses/LICENSE-2.0.html)
[![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-ready--to--code-green?label=gitpod&logo=gitpod&logoColor=white)](https://gitpod.io/#https://github.com/alibaba/fastjson2)
[![Last SNAPSHOT](https://img.shields.io/nexus/snapshots/https/oss.sonatype.org/com.alibaba.fastjson2/fastjson2?label=latest%20snapshot)](https://oss.sonatype.org/content/repositories/snapshots/com/alibaba/fastjson2/)
[![GitHub Stars](https://img.shields.io/github/stars/alibaba/fastjson2)](https://github.com/alibaba/fastjson2/stargazers)
[![GitHub Forks](https://img.shields.io/github/forks/alibaba/fastjson2)](https://github.com/alibaba/fastjson2/fork)
[![user repos](https://badgen.net/github/dependents-repo/alibaba/fastjson2?label=user%20repos)](https://github.com/alibaba/fastjson2/network/dependents)
[![GitHub Contributors](https://img.shields.io/github/contributors/alibaba/fastjson2)](https://github.com/alibaba/fastjson2/graphs/contributors)

##### [📖 English Documentation](README_EN.md) | 📖 中文文档
##### 本项目的Issues会被同步沉淀至[阿里云开发者社区](https://developer.aliyun.com/ask/)

# FASTJSON v2

`FASTJSON 2`是一个性能极致并且简单易用的Java JSON库。

- `FASTJSON 2`是`FASTJSON`项目的重要升级，和FASTJSON 1相比，性能有非常大的提升，解决了autoType功能因为兼容和白名单的安全性问题。
- 性能极致，性能远超过其他流行JSON库，包括jackson/gson/org.json，性能数据: [https://github.com/alibaba/fastjson2/wiki/fastjson_benchmark](https://github.com/alibaba/fastjson2/wiki/fastjson_benchmark)
- 支持JDK新特性，包括`JDK 11`/`JDK 17`，针对`compact string`优化，支持Record，支持`GraalVM Native-Image`
- 完善的[`JSONPath`](https://alibaba.github.io/fastjson2/jsonpath_cn)支持，支持[SQL:2016](https://en.wikipedia.org/wiki/SQL:2016)的JSONPath语法
- 支持`Android 8+`，客户端和服务器一套API
- 支持`Kotlin` [https://alibaba.github.io/fastjson2/kotlin_cn](https://alibaba.github.io/fastjson2/kotlin_cn)
- 支持`JSON Schema` [https://alibaba.github.io/fastjson2/json_schema_cn](https://alibaba.github.io/fastjson2/json_schema_cn)
- 新增加支持二进制格式JSONB [https://alibaba.github.io/fastjson2/jsonb_format_cn](https://alibaba.github.io/fastjson2/jsonb_format_cn)

![fastjson logo](https://user-images.githubusercontent.com/1063891/233821110-0c912009-4de3-4664-a27e-25274f2fa9c1.jpg)

# 1. 使用准备

## 1.1 添加依赖

在`fastjson v2`中，`groupId`和`1.x`不一样，是`com.alibaba.fastjson2`：

`Maven`:

```xml
<dependency>
    <groupId>com.alibaba.fastjson2</groupId>
    <artifactId>fastjson2</artifactId>
    <version>2.0.51</version>
</dependency>
```

`Gradle`:

```groovy
dependencies {
    implementation 'com.alibaba.fastjson2:fastjson2:2.0.51'
}
```

可以在 [maven.org](https://search.maven.org/artifact/com.alibaba.fastjson2/fastjson2) 查看最新可用的版本。

## 1.2 其他模块

### `Fastjson v1`兼容模块

如果原来使用`fastjson 1.2.x`版本，可以使用兼容包，兼容包不能保证100%兼容，请仔细测试验证，发现问题请及时反馈。

`Maven`:

```xml
<dependency>
    <groupId>com.alibaba</groupId>
    <artifactId>fastjson</artifactId>
    <version>2.0.51</version>
</dependency>
```

`Gradle`:

```groovy
dependencies {
    implementation 'com.alibaba:fastjson:2.0.51'
}
```

### `Fastjson Kotlin`集成模块

如果项目使用`Kotlin`，可以使用`fastjson-kotlin`模块，使用方式上采用`kotlin`的特性。

* `Maven`:

```xml
<dependency>
    <groupId>com.alibaba.fastjson2</groupId>
    <artifactId>fastjson2-kotlin</artifactId>
    <version>2.0.51</version>
</dependency>
```

酌情添加标准库(kotlin-stdlib)、反射库(kotlin-reflect)，
其中若使用数据类(data class)、通过构造函数传入参数则添加反射库。

```xml
<dependency>
    <groupId>org.jetbrains.kotlin</groupId>
    <artifactId>kotlin-stdlib</artifactId>
    <version>${kotlin-version}</version>
</dependency>

<dependency>
    <groupId>org.jetbrains.kotlin</groupId>
    <artifactId>kotlin-reflect</artifactId>
    <version>${kotlin-version}</version>
</dependency>
```

* `Kotlin Gradle`:

```kotlin
dependencies {
    implementation("com.alibaba.fastjson2:fastjson2-kotlin:2.0.51")
}
```

```kotlin
dependencies {
    implementation("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version")
    implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlin_version")
}
```

### `Fastjson Extension`扩展模块

如果项目使用`SpringFramework`等框架，可以使用`fastjson-extension`模块，使用方式参考 [SpringFramework Support](docs/spring_support_cn.md)。

`Maven`:

```xml
<dependency>
    <groupId>com.alibaba.fastjson2</groupId>
    <artifactId>fastjson2-extension-spring5</artifactId>
    <version>2.0.51</version>
</dependency>
```

```xml
<dependency>
    <groupId>com.alibaba.fastjson2</groupId>
    <artifactId>fastjson2-extension-spring6</artifactId>
    <version>2.0.51</version>
</dependency>
```

`Gradle`:

```groovy
dependencies {
    implementation 'com.alibaba.fastjson2:fastjson2-extension-spring5:2.0.51'
}
```

```groovy
dependencies {
    implementation 'com.alibaba.fastjson2:fastjson2-extension-spring6:2.0.51'
}
```

# 2. 简单使用

在`fastjson v2`中，`package`和`1.x`不一样，是`com.alibaba.fastjson2`。如果你之前用的是`fastjson1`，大多数情况直接更包名就即可。

### 2.1 将`JSON`解析为`JSONObject`

`Java`:

```java
String text = "...";
JSONObject data = JSON.parseObject(text);

byte[] bytes = ...;
JSONObject data = JSON.parseObject(bytes);
```

`Kotlin`:

```kotlin
import com.alibaba.fastjson2.*

val text = ... // String
val data = text.parseObject()

val bytes = ... // ByteArray
val data = bytes.parseObject() // JSONObject
```

### 2.2 将`JSON`解析为`JSONArray`

`Java`:

```java
String text = "...";
JSONArray data = JSON.parseArray(text);
```

`Kotlin`:

```kotlin
import com.alibaba.fastjson2.*

val text = ... // String
val data = text.parseArray() // JSONArray
```

### 2.3 将`JSON`解析为`Java`对象

`Java`:

```java
String text = "...";
User data = JSON.parseObject(text, User.class);
```

`Kotlin`:

```kotlin
import com.alibaba.fastjson2.*

val text = ... // String
val data = text.to<User>() // User
val data = text.parseObject<User>() // User
```

### 2.4 将`Java`对象序列化为`JSON`

`Java`:

```java
Object data = "...";
String text = JSON.toJSONString(data);
byte[] text = JSON.toJSONBytes(data);
```

`Kotlin`:

```kotlin
import com.alibaba.fastjson2.*

val data = ... // Any
val text = text.toJSONString() // String
val bytes = text.toJSONByteArray() // ByteArray
```

### 2.5 使用`JSONObject`、`JSONArray`

#### 2.5.1 获取简单属性

```java
String text = "{\"id\": 2,\"name\": \"fastjson2\"}";
JSONObject obj = JSON.parseObject(text);

int id = obj.getIntValue("id");
String name = obj.getString("name");
```

```java
String text = "[2, \"fastjson2\"]";
JSONArray array = JSON.parseArray(text);

int id = array.getIntValue(0);
String name = array.getString(1);
```

#### 2.5.2 读取`JavaBean`

`Java`:

```java
JSONArray array = ...
JSONObject obj = ...

User user = array.getObject(0, User.class);
User user = obj.getObject("key", User.class);
```

`Kotlin`:

```kotlin
val array = ... // JSONArray
val obj = ... // JSONObject

val user = array.to<User>(0)
val user = obj.to<User>("key")
```

#### 2.5.3 转为`JavaBean`

`Java`:

```java
JSONArray array = ...
JSONObject obj = ...

User user = obj.toJavaObject(User.class);
List<User> users = array.toJavaList(User.class);
```

`Kotlin`:

```kotlin
val array = ... // JSONArray
val obj = ... // JSONObject

val user = obj.to<User>() // User
val users = array.toList<User>() // List<User>
```

### 2.6 将`JavaBean`对象序列化为`JSON`

`Java`:

```java
class User {
    public int id;
    public String name;
}

User user = new User();
user.id = 2;
user.name = "FastJson2";

String text = JSON.toJSONString(user);
byte[] bytes = JSON.toJSONBytes(user);
```

`Kotlin`:

```kotlin
class User(
    var id: Int,
    var name: String
)

val user = User()
user.id = 2
user.name = "FastJson2"

val text = user.toJSONString() // String
val bytes = user.toJSONByteArray() // ByteArray
```

序列化结果:

```json
{
    "id"   : 2,
    "name" : "FastJson2"
}
```

# 3. 进阶使用

### 3.1 使用`JSONB`

#### 3.1.1 将`JavaBean`对象序列化`JSONB`

```java
User user = ...;
byte[] bytes = JSONB.toBytes(user);
byte[] bytes = JSONB.toBytes(user, JSONWriter.Feature.BeanToArray);
```

#### 3.1.2 将`JSONB`数据解析为`JavaBean`

```java
byte[] bytes = ...
User user = JSONB.parseObject(bytes, User.class);
User user = JSONB.parseObject(bytes, User.class, JSONReader.Feature.SupportBeanArrayMapping);
```

### 3.2 使用`JSONPath`

#### 3.2.1 使用`JSONPath`读取部分数据

```java
String text = ...;
JSONPath path = JSONPath.of("$.id"); // 缓存起来重复使用能提升性能

JSONReader parser = JSONReader.of(text);
Object result = path.extract(parser);
```

#### 3.2.2 使用`JSONPath`读取部分`byte[]`的数据

```java
byte[] bytes = ...;
JSONPath path = JSONPath.of("$.id"); // 缓存起来重复使用能提升性能

JSONReader parser = JSONReader.of(bytes);
Object result = path.extract(parser);
```

#### 3.2.3 使用`JSONPath`读取部分`byte[]`的数据

```java
byte[] bytes = ...;
JSONPath path = JSONPath.of("$.id"); // 缓存起来重复使用能提升性能

JSONReader parser = JSONReader.ofJSONB(bytes); // 注意这里使用ofJSONB方法
Object result = path.extract(parser);
```

## Star History

[![Star History Chart](https://api.star-history.com/svg?repos=alibaba/fastjson2&type=Date)](https://star-history.com/#alibaba/fastjson2)


# CDI TCK Development

Check out the [TCK Reference Guide](https://jakartaee.github.io/cdi-tck/) to get acquainted with the CDI TCK and learn how to execute and debug it.

## Building CDI TCK artifacts
To build the CDI TCK artifacts, use:

`mvn install`

or when compiling against staged Jakarta artifacts:

`mvn -Pstaging install`

## Building the CDI TCK distribution
The CDI TCK distribution artifact is built by specifying an additional `-Drelease` property to build the TCK reference
documentation and distribution bundle, e.g.:

`mvn -Drelease install`

## Eclipse Continuous Integration Environment
The Eclipse continuous integration environment interface for the CDI project is located at https://ci.eclipse.org/cdi/
The https://github.com/jakartaee/cdi/wiki/Eclipse-CI-Release-Jobs page describes the jobs found there.

## Sources in GIT

Master branch contains the CDI TCK 4.1

### Source Layout

* .github - the GitHub actions configuration
* api - Api/Spi for vendor integration
* dist-build - assembly project to create the distribution zip
* doc - the TCK user guide source
* docs - the content for the CDI project github pages
* ext-lib - A sample library used by some integration tests
* ide-configs - useful settings for Eclipse and Intellij IDEs
* impl - The core set of tests, excluding those that depend on web and full platform containers
* lang-model - A standalone test suite for the CDI language model; see its [README](./lang-model/README.adoc)
* README.md - this doc


![](/asciidoc/src/main/docs/asciidoc/images/white-logo.png)

# Java rate-limiting library based on token-bucket algorithm.

[![Licence](https://img.shields.io/hexpm/l/plug.svg)](https://github.com/bucket4j/bucket4j/blob/master/LICENSE.txt)

#### Get dependency
The Bucket4j is distributed through [Maven Central](http://search.maven.org/):

##### Java 17 dependency
```xml
<!-- For java 17+ -->
<dependency>
  <groupId>com.bucket4j</groupId>
  <artifactId>bucket4j_jdk17-core</artifactId>
  <version>8.13.1</version>
</dependency>
```
##### Java 11 dependency
```xml
<!-- For java 11 -->
<dependency>
  <groupId>com.bucket4j</groupId>
  <artifactId>bucket4j_jdk11-core</artifactId>
  <version>8.13.1</version>
</dependency>
```

#### Quick start
```java
import io.github.bucket4j.Bucket;

...
// bucket with capacity 20 tokens and with refilling speed 1 token per each 6 second
private static Bucket bucket = Bucket.builder()
      .addLimit(limit -> limit.capacity(20).refillGreedy(10, Duration.ofMinutes(1)))
      .build();

private void doSomethingProtected() {
   if (bucket.tryConsume(1)) {
      doSomething();
   } else {
      throw new SomeRateLimitingException();
   }
}
```
More examples [can be found there](https://bucket4j.github.io/8.13.1/toc.html#quick-start-examples)

## [Documentation](https://bucket4j.github.io)
* [Reference](https://bucket4j.github.io/8.13.1/toc.html)
* [Quick start examples](https://bucket4j.github.io/8.13.1/toc.html#quick-start-examples)
* [Third-party articles](https://bucket4j.github.io/#third-party-articles)

## Bucket4j basic features
* *Absolutely non-compromise precision* - Bucket4j does not operate with floats or doubles, all calculation are performed in the integer arithmetic, this feature protects end users from calculation errors involved by rounding.
* *Effective implementation in terms of concurrency*:
  - Bucket4j is good scalable for multi-threading case it by defaults uses lock-free implementation.
  - In same time, library provides different concurrency strategies that can be chosen when default lock-free strategy is not desired.
* *Effective API in terms of garbage collector footprint*: Bucket4j API tries to use primitive types as much as it is possible in order to avoid boxing and other types of floating garbage.
* *Pluggable listener API* that allows to implement monitoring and logging.
* *Rich diagnostic API* that allows to investigate internal state.
* *Rich configuration management* - configuration of the bucket can be changed on fly

## Bucket4j distributed features
In additional to basic features described above, ```Bucket4j``` provides ability to implement rate-limiting in cluster of JVMs:
- Bucket4j out of the box supports any GRID solution which compatible with JCache API (JSR 107) specification.
- Bucket4j provides the framework that allows to quickly build integration with your own persistent technology like RDMS or a key-value storage.
- For clustered usage scenarios Bucket4j supports asynchronous API that extremely matters when going to distribute world, because asynchronous API allows avoiding blocking your application threads each time when you need to execute Network request.

## [Spring boot starter](https://github.com/MarcGiffing/bucket4j-spring-boot-starter)
Bucket4j is not a framework, it is a library, with Bucket4j you need to write a code to achive your goals.
For generic use-cases, try to look at powerfull [Spring Boot Starter for Bucket4j](https://github.com/MarcGiffing/bucket4j-spring-boot-starter), that allows you to set access limits on your API effortlessly.
Its key advantage lies in the configuration via properties or yaml files, eliminating the need for manual code authoring.

### Supported JCache compatible(or similar) back-ends
In addition to local in-memory buckets, the Bucket4j supports clustered usage scenario on top of following back-ends:

| Back-end                   |  Async supported | Flexible per-entry expiration | Optimized serialization | Thin-client support |                                  Documentation link                                   |
| :---                       | :---:            |:-----------------------------:|:-----------------------:|:-------------------:|:-------------------------------------------------------------------------------------:|
| ```JCache API (JSR 107)``` |  No              |              No               |          No             |         No          |     [bucket4j-jcache](https://bucket4j.github.io/8.13.1/toc.html#bucket4j-jcache)     |
| ```Hazelcast```            |  Yes             |              Yes              |           Yes           |         No          |  [bucket4j-hazelcast](https://bucket4j.github.io/8.13.1/toc.html#bucket4j-hazelcast)  |
| ```Apache Ignite```        |  Yes             |              No               |           n/a           |         Yes         |     [bucket4j-ignite](https://bucket4j.github.io/8.13.1/toc.html#bucket4j-ignite)     |
| ```Inifinispan```          |  Yes             |              Yes              |           Yes           |         No          | [bucket4j-infinispan](https://bucket4j.github.io/8.13.1/toc.html#bucket4j-infinispan) |
| ```Oracle Coherence```     |  Yes             |              Yes              |           Yes           |         No          |  [bucket4j-coherence](https://bucket4j.github.io/8.13.1/toc.html#bucket4j-coherence)  |

### Redis back-ends
| Back-end                   |  Async supported | Redis cluster supported |                                       Documentation link                                       |
| :---                       | :---:            |:-----------------------:|:----------------------------------------------------------------------------------------------:|
| ```Redis/Redisson```       |  Yes             |           Yes           |    [bucket4j-redis/Redisson](https://bucket4j.github.io/8.13.1/toc.html#bucket4j-redisson)     |
| ```Redis/Jedis```          |  No              |           Yes           |  [bucket4j-redis/Jedis](https://bucket4j.github.io/8.13.1/toc.html#toc.html#bucket4j-jedis)    |
| ```Redis/Lettuce```        |  Yes             |           Yes           | [bucket4j-redis/Lettuce](https://bucket4j.github.io/8.13.1/toc.html#toc.html#bucket4j-lettuce) |

### JDBC back-ends
| Back-end                   |                                  Documentation link                                   |
|:---------------------------|:-------------------------------------------------------------------------------------:|
| ```MySQL```                |    [bucket4j-mysql](https://bucket4j.github.io/8.13.1/toc.html#bucket4j-mysql)        |
| ```PostgreSQL```           | [bucket4j-postgresql](https://bucket4j.github.io/8.13.1/toc.html#bucket4j-postgresql) |
| ```Oracle```               |     [bucket4j-oracle](https://bucket4j.github.io/8.13.1/toc.html#bucket4j-oracle)     |
| ```Microsoft SQL Server``` |      [bucket4j-mssql](https://bucket4j.github.io/8.13.1/toc.html#bucket4j-mssql)      |
| ```MariaDB```              |    [bucket4j-mariadb](https://bucket4j.github.io/8.13.1/toc.html#bucket4j-mariadb)    |

### Local caches support
Sometimes you are having deal with bucket per key scenarios but distributed synchronization is unnecessary, for example where request stickiness is provided by a load balancer, or other use-cases where stickiness can be achieved by the application itself, for example, Kafka consumer. For such scenarios Bucket4j provides support for following list of local caching libraries:
| Back-end                      | Documentation link      |
| :---                          | :---:                   |
| ```Caffeine```                | [bucket4j-caffeine](https://github.com/bucket4j/bucket4j/blob/8.12/bucket4j-caffeine/src/main/java/io/github/bucket4j/caffeine/CaffeineProxyManager.java)      |

### Third-party integrations
| Back-end                      |                               Project page                               |
| :---                          |:------------------------------------------------------------------------:|
| ```Datomic Database```        | [clj-bucket4j-datomic](https://github.com/fr33m0nk/clj-bucket4j-datomic) |

## [Bucket4j Backward compatibility policy](backward-compatibility-policy.md)

## Have a question?
Feel free to ask via:
* [Bucket4j issue tracker](https://github.com/bucket4j/bucket4j/issues/new) to report a bug.
* [Bucket4j discussions](https://github.com/bucket4j/bucket4j/discussions) for questions, feature proposals, sharing of experience.

## License
Copyright 2015-2024 Vladimir Bukhtoyarov
Licensed under the Apache Software License, Version 2.0: <http://www.apache.org/licenses/LICENSE-2.0>.


[![Build Status](https://github.com/heutelbeck/sapl-demos/workflows/build/badge.svg)](https://github.com/heutelbeck/sapl-demos/actions)

# SAPL Demo Projects

> ** Attention ** The build of the sapl-demo-ethereum module may fail if [this web service of web3labs.com](https://internal.services.web3labs.com/api/solidity/versions/) is unreachable. In this case copy the file ' `sapl-demo-ethereum/src/main/solc/releases.json` to `~/.web3j/solc`.

This project contains some demo modules demonstrating the usage of the SAPL engine.
A good point to start exploring SAPL is by running and experimenting with modifying these demo projects.

If you are interested in how SAPL would be used in an application, you should take a look at [sapl-demo-mvc-app](https://github.com/heutelbeck/sapl-demos/tree/master/sapl-demo-mvc-app) and [sapl-demo-webflux](https://github.com/heutelbeck/sapl-demos/tree/master/sapl-demo-webflux).

If you want to get familiar with using a PDP directly, start with [sapl-demo-embedded](https://github.com/heutelbeck/sapl-demos/tree/master/sapl-demo-embedded).

After that pick a demo that matches your interest.

* [sapl-demo-webflux](https://github.com/heutelbeck/sapl-demos/tree/master/sapl-demo-webflux): Demonstrates how to hook a SAPL PEP into method security with Spring Security and Webflux.

* [sapl-demo-webflux-filterchain](https://github.com/heutelbeck/sapl-demos/tree/master/sapl-demo-webflux-filterchain): Demonstrates how to hook a SAPL PEP into the Spring Security reactive filter chain in Webflux.

* [sapl-demo-mvc-app](https://github.com/heutelbeck/sapl-demos/tree/master/sapl-demo-mvc-app): A full stack Spring MVC application secured with SAPL. Demonstrates non-reactive declarative Policy Enforcement Points via annotations.

* [sapl-demo-filterchain](https://github.com/heutelbeck/sapl-demos/tree/master/sapl-demo-filterchain): Demonstrates how to hook a SAPL PEP into the Spring Security filter chain for non-reactive environments.

* [sapl-demo-embedded](https://github.com/heutelbeck/sapl-demos/tree/master/sapl-demo-embedded): Manually instantiating a SAPL Policy Decision Point (PDP) and basic PDP interaction. Reading policies from bundled resources or monitoring a file system.

* [sapl-demo-remote](https://github.com/heutelbeck/sapl-demos/tree/master/sapl-demo-remote): Connect to a dedicated SAPL PDP Server.

* [sapl-demo-extension](https://github.com/heutelbeck/sapl-demos/tree/master/sapl-demo-extension): Write a custom Policy Information Point (PIP) and function library to extend SAPL with custom attributes and functions.

* [sapl-demo-jwt](https://github.com/heutelbeck/sapl-demos/tree/master/sapl-demo-jwt): A resource server secured with OAuth 2.0, JSON Web Tokens (JWT) and SAPL, with a matching OAuth authorization server and client application.

* [sapl-demo-web-editor](https://github.com/heutelbeck/sapl-demos/tree/master/sapl-demo-web-editor): Demonstrates the Vaadin-based SAPL policy editor component.

* [sapl-demo-playground](https://github.com/heutelbeck/sapl-demos/tree/master/sapl-demo-playground): An integrated policy testing and learning application. Also see <https://playground.sapl.io/> for a deployed version ready to use.

* [sapl-demo-testing](https://github.com/heutelbeck/sapl-demos/tree/master/sapl-demo-testing): Demonstrates how to test SAPL policies with unit tests, including test code coverage reports.

* [sapl-demo-mqtt-pip](https://github.com/heutelbeck/sapl-demos/tree/master/sapl-demo-mqtt-pip): Demonstrates how to evaluate MQTT messages with a Policy Information Point.


[![Contributors][contributors-shield]][contributors-url]
[![Forks][forks-shield]][forks-url]
[![Stargazers][stars-shield]][stars-url]
[![Issues][issues-shield]][issues-url]
[![MIT License][license-shield]][license-url]
[![LinkedIn][linkedin-shield]][linkedin-url]
[![Discord][discord-shield]][discord-url]

Forgero [Fabric]

    A tool creation and customization mod for Minecraft!

    Explore the docs »

    Report Bug
    ·
    Request Feature

## About

**Forgero was created to fill a gap in the mods available for Fabric. The aim of the mod is to give tool creation and
customization in Minecraft a greater depth.**

## Key features

* A wide variety of materials that have their own strength, weaknesses and visuals;
* Schematics which will enhance the look, attributes and abilities of your tools;
* Vanilla friendly, everything in the base mod is made to fit the vanilla art style;
* Gems, which can further enhance stats on tools;
* Enchanting is fully supported;
* Support for adding and customizing materials, schematics and gems entirely through config/json files.

## Roadmap

Forgero is in active development, and features are being added frequently.
We support [Semantic Versioning](https://semver.org/), which means we make sure to not introduce breaking changes unless
we are moving to a new major version. Upcoming things are:

- [ ] Progression and station overhaul
- [ ] Gem and extended module overhaul
- [ ] Armor sets
- [ ] Smithing

See the [open issues](https://github.com/sigmundgranaas/forgero/issues) for a full list of proposed features and known
bugs.

Do keep in mind we work on this in our freetime and when we feel like it. Development can be sporadic.

## Contributing

If you want to improve a feature or fix a bug in Forgero, feel free to fork the repo and create a pull request.
You can also simply open an issue with the tag `enhancement`.

1. [Fork](https://github.com/sigmundgranaas/forgero/fork) Forgero to your Github account
2. Set up the project as described in the [development section](#development)
3. Create your feature branch: `git checkout -b feature/amazing-feature`
4. Commit your changes: `git commit -m 'Add an amazing feature'`
5. Push to the branch: `git push origin feature/amazing-feature`
6. Open a [pull request](https://github.com/sigmundgranaas/forgero/pulls)

Don't forget to give the project a star! Thanks again!
Your contributions are **greatly appreciated**.

Thank you to Forgero's contributors (
see [`CONTRIBUTORS.md`](https://github.com/SigmundGranaas/forgero/blob/1.19/CONTRIBUTORS.md)).

## Development

Modding Minecraft is very easy thanks to the tools developed by the modding community.

### Prerequisites

#### IntelliJ IDEA

IntelliJ IDEA should already come with their own Java JDK and Gradle version out of the box, and is recommended for
Minecraft development:

- [IntelliJ IDEA](https://www.jetbrains.com/idea/download)
- [Minecraft Development plugin](https://mcdev.io/)

#### Different IDE/no IDE

If you don't want to use IntelliJ IDEA, but instead you want to use another IDE (or no IDE) that doesn't contain these
prerequisites out of the box:

* Your preferred build of Java 17, we recommend using [Adoptium Temurin OpenJDK 17](https://adoptium.net/temurin/)
* [Gradle](https://gradle.org/)

### Setting up the repository

1. Clone this repository (can be done via the command line or your IDE):
   ```sh
   git clone https://github.com/sigmundgranaas/forgero.git
   ```

2. Open Forgero in IntelliJ IDEA (or your IDE of choice/no IDE):
   ```sh
   new > project from existing sources > choose forgero folder
   ```
3. Make changes and run Forgero (can be done via the command line or your IDE):
   ```sh
   ./gradlew runClient
   ```

## License

Distributed under the MIT License. See [`LICENSE`](https://github.com/SigmundGranaas/forgero/blob/1.19/LICENSE) for more
information.

## Contact

Sigmund Granaas Sandring:

- [GitHub](https://github.com/SigmundGranaas)
- [Discord](https://discord.gg/3vK7ZwEDex)

## Acknowledgments

Creating this project could not have been done without the prior work of the community.

* [Minecraft](https://www.minecraft.net)
* [The Fabric Project](https://fabricmc.net/)
* [Fabric mod template](https://github.com/FabricMC/fabric-example-mod)
* [Fabric API](https://github.com/FabricMC/fabric)
* [Tinker's Construct](https://github.com/SlimeKnights/TinkersConstruct)
* [Smithee](https://github.com/LordDeatHunter/Smithee)
* [Readme template](https://github.com/othneildrew/Best-README-Template/)

[product-screenshot]: assets/Banner.png

[contributors-shield]: https://img.shields.io/github/contributors/sigmundgranaas/forgero.svg?style=for-the-badge

[contributors-url]: https://github.com/sigmundgranaas/forgero/graphs/contributors

[forks-shield]: https://img.shields.io/github/forks/sigmundgranaas/forgero.svg?style=for-the-badge

[forks-url]: https://github.com/sigmundgranaas/forgero/network/members

[stars-shield]: https://img.shields.io/github/stars/sigmundgranaas/forgero.svg?style=for-the-badge

[stars-url]: https://github.com/sigmundgranaas/forgero/stargazers

[issues-shield]: https://img.shields.io/github/issues/sigmundgranaas/forgero.svg?style=for-the-badge

[issues-url]: https://github.com/othneildrew/Best-README-Template/issues

[license-shield]: https://img.shields.io/github/license/sigmundgranaas/forgero.svg?style=for-the-badge

[license-url]: https://github.com/sigmundgranaas/forgero/blob/master/LICENSE.txt

[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge&logo=linkedin&colorB=555

[linkedin-url]: https://linkedin.com/in/sigmundgranaas

[discord-shield]: https://img.shields.io/discord/981828752029925408?label=chat%20on%20Discord&logo=Discord&style=for-the-badge

[discord-url]: https://discord.gg/3vK7ZwEDex


# Autostyle: fix code style automatically

<!---freshmark shields
output = [
  link(image('Travis CI', 'https://travis-ci.org/{{org}}/{{name}}.svg?branch=master'), 'https://travis-ci.org/{{org}}/{{name}}'),
  link(image('CI Status', 'https://github.com/{{org}}/{{name}}/workflows/CI/badge.svg'), 'https://github.com/{{org}}/{{name}}/actions'),
  ].join('\n');
-->
[![Travis CI](https://travis-ci.org/autostyle/autostyle.svg?branch=master)](https://travis-ci.org/autostyle/autostyle)
[![CI Status](https://github.com/autostyle/autostyle/workflows/CI/badge.svg)](https://github.com/autostyle/autostyle/actions)
<!---freshmark /shields -->

Autostyle can format <java | kotlin | scala | sql | groovy | javascript | flow | typeScript | css | scss | less | jsx | vue | graphql | json | yaml | markdown | license headers | anything> using <Gradle>.

- [Autostyle for Gradle 5.6+](plugin-gradle)
- [Other build systems](CONTRIBUTING.md#how-to-add-a-new-plugin-for-a-build-system)

Ideally, a code formatter can do more than just find formatting errors - it should fix them as well. Such a formatter is really just a `Function<String, String>`, which returns a formatted version of its potentially unformatted input.

It's easy to build such a function, but there are some gotchas and lots of integration work (newlines, character encodings, idempotency, and build-system integration). Autostyle tackles those for you so you can focus on just a simple `Function<String, String>` which can compose with any of the other formatters and build tools in Autostyle' arsenal.

## Current feature matrix

<!---freshmark matrix
function lib(className)   { return '| [`' + className + '`](lib/src/main/java/com/github/autostyle/' + className.replace('.', '/') + '.java) | ' }
function extra(className) { return '| [`' + className + '`](lib-extra/src/main/java/com/github/autostyle/extra/' + className.replace('.', '/') + '.java) | ' }

//                                               | GRADLE        | (new)   |
output = [
'| Feature / FormatterStep                       | [plugin-gradle](plugin-gradle/README.md) | [(Your build tool here)](CONTRIBUTING.md#how-to-add-a-new-plugin-for-a-build-system) |',
'| --------------------------------------------- | ------------- | --------|',
lib('generic.EndWithNewlineStep')                +'{{yes}}       | {{no}}  |',
lib('generic.IndentStep')                        +'{{yes}}       | {{no}}  |',
lib('generic.LicenseHeaderStep')                 +'{{yes}}       | {{no}}  |',
lib('generic.ReplaceRegexStep')                  +'{{yes}}       | {{no}}  |',
lib('generic.ReplaceStep')                       +'{{yes}}       | {{no}}  |',
lib('generic.TrimTrailingWhitespaceStep')        +'{{yes}}       | {{no}}  |',
lib('java.GoogleJavaFormatStep')                 +'{{yes}}       | {{no}}  |',
lib('java.ImportOrderStep')                      +'{{yes}}       | {{no}}  |',
lib('java.RemoveUnusedImportsStep')              +'{{yes}}       | {{no}}  |',
lib('kotlin.KtLintStep')                         +'{{yes}}       | {{no}}  |',
lib('markdown.FreshMarkStep')                    +'{{yes}}       | {{no}}  |',
lib('npm.PrettierFormatterStep')                 +'{{yes}}       | {{no}}  |',
lib('npm.TsFmtFormatterStep')                    +'{{yes}}       | {{no}}  |',
lib('scala.ScalaFmtStep')                        +'{{yes}}       | {{no}}  |',
lib('sql.DBeaverSQLFormatterStep')               +'{{yes}}       | {{no}}  |',
'| [(Your FormatterStep here)](CONTRIBUTING.md#how-to-add-a-new-formatterstep) | {{no}}       | {{no}}  |',
'| Fast up-to-date checking                      | {{yes}}       | {{no}}  |',
'| Automatic idempotency safeguard               | {{yes}}       | {{no}}  |',
''
].join('\n');
-->
| Feature / FormatterStep                       | [plugin-gradle](plugin-gradle/README.md) | [(Your build tool here)](CONTRIBUTING.md#how-to-add-a-new-plugin-for-a-build-system) |
| --------------------------------------------- | ------------- | --------|
| [`generic.EndWithNewlineStep`](lib/src/main/java/com/github/autostyle/generic/EndWithNewlineStep.java) | :+1:       | :white_large_square:  |
| [`generic.IndentStep`](lib/src/main/java/com/github/autostyle/generic/IndentStep.java) | :+1:       | :white_large_square:  |
| [`generic.LicenseHeaderStep`](lib/src/main/java/com/github/autostyle/generic/LicenseHeaderStep.java) | :+1:       | :white_large_square:  |
| [`generic.ReplaceRegexStep`](lib/src/main/java/com/github/autostyle/generic/ReplaceRegexStep.java) | :+1:       | :white_large_square:  |
| [`generic.ReplaceStep`](lib/src/main/java/com/github/autostyle/generic/ReplaceStep.java) | :+1:       | :white_large_square:  |
| [`generic.TrimTrailingWhitespaceStep`](lib/src/main/java/com/github/autostyle/generic/TrimTrailingWhitespaceStep.java) | :+1:       | :white_large_square:  |
| [`java.GoogleJavaFormatStep`](lib/src/main/java/com/github/autostyle/java/GoogleJavaFormatStep.java) | :+1:       | :white_large_square:  |
| [`java.ImportOrderStep`](lib/src/main/java/com/github/autostyle/java/ImportOrderStep.java) | :+1:       | :white_large_square:  |
| [`java.RemoveUnusedImportsStep`](lib/src/main/java/com/github/autostyle/java/RemoveUnusedImportsStep.java) | :+1:       | :white_large_square:  |
| [`kotlin.KtLintStep`](lib/src/main/java/com/github/autostyle/kotlin/KtLintStep.java) | :+1:       | :white_large_square:  |
| [`markdown.FreshMarkStep`](lib/src/main/java/com/github/autostyle/markdown/FreshMarkStep.java) | :+1:       | :white_large_square:  |
| [`npm.PrettierFormatterStep`](lib/src/main/java/com/github/autostyle/npm/PrettierFormatterStep.java) | :+1:       | :white_large_square:  |
| [`npm.TsFmtFormatterStep`](lib/src/main/java/com/github/autostyle/npm/TsFmtFormatterStep.java) | :+1:       | :white_large_square:  |
| [`scala.ScalaFmtStep`](lib/src/main/java/com/github/autostyle/scala/ScalaFmtStep.java) | :+1:       | :white_large_square:  |
| [`sql.DBeaverSQLFormatterStep`](lib/src/main/java/com/github/autostyle/sql/DBeaverSQLFormatterStep.java) | :+1:       | :white_large_square:  |
| [(Your FormatterStep here)](CONTRIBUTING.md#how-to-add-a-new-formatterstep) | :white_large_square:       | :white_large_square:  |
| Fast up-to-date checking                      | :+1:       | :white_large_square:  |
| Automatic idempotency safeguard               | :+1:       | :white_large_square:  |
<!---freshmark /matrix -->

*Why are there empty squares?* Many projects get harder to work on as they get bigger.
Autostyle is easier to work on than ever, and one of the reasons why is that we don't require
contributors to "fill the matrix". So far Autostyle works better with Gradle, however we would consider PRs
even if it only supports the one formatter you use.

And if you want to add FooFormatter support, we'll happily accept the PR even if it only supports the one build system you use.

Once someone has filled in one square of the formatter/build system matrix,
it's easy for interested parties to fill in any empty squares, since you'll now have a working example for every piece needed.

## Acknowledgements
- Thanks to contributors of [Spotless](https://github.com/diffplug/spotless).
- Built by [Gradle](https://gradle.org/).
- Tested by [JUnit](https://junit.org/).
- Maintained by [Vladimir Sitnikov](https://github.com/vlsi).


# Jollyday [![Build Status](https://github.com/focus-shift/jollyday/workflows/Build/badge.svg)](https://github.com/focus-shift/jollyday/actions/workflows/build.yml) [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=focus-shift_jollyday&metric=coverage)](https://sonarcloud.io/summary/overall?id=focus-shift_jollyday) [![Maven Central](https://img.shields.io/maven-central/v/de.focus-shift/jollyday-core.svg)](https://maven-badges.herokuapp.com/maven-central/de.focus-shift/jollyday-core) [![Javadocs](https://www.javadoc.io/badge/de.focus-shift/jollyday-core.svg)](https://www.javadoc.io/doc/de.focus-shift/jollyday-core)

Jollyday is a java library to query public holidays. Currently, we support **over 80 countries**.

## How to use it

**Jollyday** is based on **Java 11** and can be used directly as dependency via maven or gradle e.g.
The calculation basis of the public holidays for each country is based on a xml file and will be mapped via Jakarta XML Binding or Jackson.
If you already use one of these libraries in your project than just use the specific jollyday dependency.

  Maven (click to expand)

  You need the core library, that defines all functionality and the api for you as developer.

  ```xml
  <dependency>
    <groupId>de.focus-shift</groupId>
    <artifactId>jollyday-core</artifactId>
    <version>${version}</version>
  </dependency>
  ```

  ### XML-Binding libraries

  Additionally, the XML-Binding library of your choice. At the moment we do support JAXB and Jackson,
  but in the future there could be more that these.

  **Jakarta XML Binding (JAXB)**

  ```xml
  <dependency>
    <groupId>de.focus-shift</groupId>
    <artifactId>jollyday-jaxb</artifactId>
    <version>${version}</version>
  </dependency>
  ```

  **Jackson**

  ```xml
  <dependency>
    <groupId>de.focus-shift</groupId>
    <artifactId>jollyday-jackson</artifactId>
    <version>${version}</version>
  </dependency>
  ```

  Gradle (click to expand)

  You need the core library, that defines all functionality and the api for you as developer.

  ```gradle
  implementation group: 'de.focus-shift', name: 'jollyday-core', version: '${version}'
  ```

  ### XML-Binding libraries

  Additionally, the XML-Binding library of your choice. At the moment we do support JAXB and Jackson,
  but in the future there could be more that these.

  **Jakarta XML Binding (JAXB)**

  ```gradle
  implementation group: 'de.focus-shift', name: 'jollyday-jaxb', version: '${version}'
  ```

  **Jackson**

  ```gradle
  implementation group: 'de.focus-shift', name: 'jollyday-jackson', version: '${version}'
  ```

  with the Java Platform Module System (click to expand)

  If you want to use Jollyday in a project that is modularized via java modules you need to require the `de.focus_shift.jollyday.core` module via

  ```java
  module your.application {
    ...
    requires de.focus_shift.jollyday.core;
    ...
  }
```

### Examples

  Retrieve public holidays for a year (click to expand)

  Returns all **german** public holidays in **2022**
  ```java
  import de.focus_shift.jollyday.core.Holiday;
  import de.focus_shift.jollyday.core.HolidayManager;
  import de.focus_shift.jollyday.core.ManagerParameters;

  import java.util.Set;

  import static de.focus_shift.jollyday.core.HolidayCalendar.GERMANY;

  final HolidayManager holidayManager = HolidayManager.getInstance(ManagerParameters.create(GERMANY));
  final Set<Holiday> holidays = holidayManager.getHolidays(2022);
  ```

  Retrieve public holidays for a period of days (click to expand)

  Returns all german public holidays from the **15th of april in 2022** until the **31st of may in 2023**
  ```java
  import de.focus_shift.jollyday.core.Holiday;
  import de.focus_shift.jollyday.core.HolidayManager;
  import de.focus_shift.jollyday.core.ManagerParameters;

  import java.time.LocalDate;
  import java.util.Set;

  import static de.focus_shift.jollyday.core.HolidayCalendar.GERMANY;

  final HolidayManager holidayManager = HolidayManager.getInstance(ManagerParameters.create(GERMANY));
  final Set<Holiday> holidays = holidayManager.getHolidays(LocalDate.of(2022, 4, 15), LocalDate.of(2023, 5, 31));
  ```

  Check if a specific date is a public holiday (click to expand)

  Returns true or false if a date is a public holidays in germany.
  ```java
  import de.focus_shift.jollyday.core.HolidayManager;
  import de.focus_shift.jollyday.core.ManagerParameters;

  import java.time.LocalDate;

  import static de.focus_shift.jollyday.core.HolidayCalendar.GERMANY;

  final HolidayManager holidayManager = HolidayManager.getInstance(ManagerParameters.create(GERMANY));
  final boolean isHoliday = holidayManager.isHoliday(LocalDate.of(2022, 6, 6));
  ```

  Returns true or false if a date is a public holidays in Baden-Württemberg in germany.
  ```java
  import de.focus_shift.jollyday.core.HolidayManager;
  import de.focus_shift.jollyday.core.ManagerParameters;

  import java.time.LocalDate;

  import static de.focus_shift.jollyday.core.HolidayCalendar.GERMANY;

  final HolidayManager holidayManager = HolidayManager.getInstance(ManagerParameters.create(GERMANY));
  final boolean isHoliday = holidayManager.isHoliday(LocalDate.of(2022, 6, 6), "bw");
  ```

  Override an existing country (click to expand)

  If you want to override the public holidays of a provided country like **germany**, you need to put a holiday file
  with the name `Holiday_de.xml` on your classpath. Jollyday will pick up yours at first. The File and the hierarchy needs
  to be identical to the one you want to override.

  The holiday file structure needs to look like the one below. The XML Schema Definition file can be viewed [here](jollyday-core/src/main/resources/focus_shift.de/jollyday/schema/holiday/holiday.xsd)

  ```xml
  <?xml version="1.0" encoding="UTF-8"?>

  <Configuration hierarchy="de" description="Germany"
                 xmlns="https://focus_shift.de/jollyday/schema/holiday"
                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                 xsi:schemaLocation="https://focus_shift.de/jollyday/schema/holiday https://focus_shift.de/jollyday/schema/holiday/holiday.xsd">
    <Holidays>
      <!-- Add the holidays here-->
    </Holidays>

    ...

    <SubConfigurations hierarchy="bw" description="Baden-Württemberg">
      <Holidays>
      ...
      </Holidays>
    </SubConfigurations>
  </Configuration>
  ```

## ISO 3166

To retrieve the public holidays of a country the [ISO 3166-1 alpha-2] standard is used. An [list of current ISO 3166-1 alpha-2 codes] is available at wikipedia.

To access the public holidays of a subdivision of a country, e.g. Baden-Württemberg of Germany the [ISO 3166-2] standard is used. A [list of current ISO 3166-2 codes] is available at wikipedia.

### Data precision

| Precision                      | Supported |
|--------------------------------|-----------|
| Country ([ISO 3166-1 alpha-2]) | Yes       |
| Subdivisions ([ISO 3166-2])    | Yes       |
| City Holiday                   | Yes       |

## Development

If you want to **support** us at the development on **jollyday** than take a look at [Contributing to jollyday](./CONTRIBUTING.md).
If you have any kind of **questions** please go to [Discussions] and see if there are already answers and if not please open a discussion with your question.
If you want to raise an **issue or bug** you can create a [new issue](https://github.com/focus-shift/jollyday/issues/new/choose)

### Requirements

* [JDK 11](https://openjdk.java.net/install/)

### Architecture decision record (ADR)

 * [Document empty subdivision](.adr/001-document-every-subdivision.md)

## License

[Apache License, Version 2.0](LICENSE)

[Discussions]: https://github.com/focus-shift/jollyday/discussions
[ISO 3166-1 alpha-2]: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
[list of current ISO 3166-1 alpha-2 codes]: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Current_codes
[ISO 3166-2]: https://en.wikipedia.org/wiki/ISO_3166-2
[list of current ISO 3166-2 codes]: https://en.wikipedia.org/wiki/ISO_3166-2#Current_codes


[![Ceasefire now](https://img.shields.io/badge/%F0%9F%87%B5%F0%9F%87%B8_Ceasefire_Now-techforpalestine.org-000000?labelColor=gray&color=D83838&style=for-the-badge)](https://techforpalestine.org/learn-more)

# SHAFT: Unified Test Automation Engine

   Fully documented

   Award Winning

   Selenium Ecosystem

## 🏃 Quick Start Guide

### Option 1: Maven Archetype
(Recommended for new local sandbox projects)

- The easiest and most straightforward way to create a new project that uses SHAFT.
- Just [follow the simple steps here](https://github.com/ShaftHQ/testng-archetype) to generate your new project with one command (all configurations included).

### Option 2: Template Project
(Recommended for new source controlled projects)

- Use our [Template Project](https://github.com/ShaftHQ/using_SHAFT_Engine) to create a new project with one click.
- Follow the steps in the ReadMe to handle project configuration.

### Option 3: Start from scratch
(Recommended if you're upgrading an existing project from Native Selenium WebDriver to SHAFT)

#### Step 1: Initial Setup

- Create a new Java/Maven project using Eclipse, IntelliJ or your favourite IDE.
- Copy the highlighted contents of
  this [pom.xml](https://github.com/ShaftHQ/using_SHAFT_Engine/blob/main/GUI_Web/pom.xml#L11-L200) file into yours
  inside the ```<project>``` tag.
- Follow the steps in this footnote in case you are using IntelliJ[^1].

#### Step 2: Creating Tests
- Create a new Package ```TestPackage``` under ```src/test/java``` and create a new Java Class ```TestClass``` under that package.
- Copy the below imports into your newly created java class.
```java
import com.shaft.driver.SHAFT;
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
```
- Copy the below code snippet into your newly created java class.
```java
SHAFT.GUI.WebDriver driver;
SHAFT.TestData.JSON testData;

By searchBox = By.name("q");
By resultStats = By.id("result-stats");

@Test
public void test() {
    driver.browser().navigateToURL("https://www.google.com/");
    driver.verifyThat().browser().title().isEqualTo("Google").perform();
    driver.element().type(searchBox, testData.getTestData("searchQuery"))
            .keyPress(searchBox, Keys.ENTER);
    driver.assertThat().element(resultStats).text().doesNotEqual("")
            .withCustomReportMessage("Check that result stats is not empty").perform();
}

@BeforeClass
public void beforeClass() {
    driver = new SHAFT.GUI.WebDriver();
    testData = new SHAFT.TestData.JSON("simpleJSON.json");
    }

@AfterClass(alwaysRun = true)
public void afterClass(){
        driver.quit();
    }
```

#### Step 3: Managing Test Data
- Create the following file ```src/test/resources/testDataFiles/simpleJSON.json```.
- Copy the below code snippet into your newly created json file.
```json
{
  "searchQuery": "SHAFT_Engine"
}
```

#### Step 4: Running Tests
- Run your ```TestClass.java``` as a TestNG Test Class.
- The execution report will open automatically in your default web browser after the test run is completed.
- Join our ![GitHub Repo stars](https://img.shields.io/github/stars/shafthq/shaft_engine?logoColor=black&style=social) to get notified by email when a new release is pushed out.
- After upgrading your Engine to a new major release it is sometimes recommended to delete the properties
  folder ```src\main\resources\properties``` and allow SHAFT to regenerate the defaults by running any test method.
  [^1]: If you're using Cucumber due to a known issue with IntelliJ you need to edit your run configuration template before running your tests by following these steps:

- Open 'Edit Run/Debug Configurations' dialog > Edit Configurations... > Edit configuration templates...

- Select Cucumber Java > Program Arguments > and add this argument:

`--plugin com.shaft.listeners.CucumberFeatureListener`

- After saving the changes, remember to delete any old runs you may have triggered by mistake before adding the needed config.

## 📚 User Guide
- Check out our [comprehensive user guide](https://shafthq.github.io/) for details on the features we support.

## 👨💻 Tech Stack

## 🦸 Powered by

## 🙏 Big thanks for the open source licenses and support

## 🤝 Support & Contributions
- Join us via Slack & Facebook

- And feel free to create PRs directly. [This lovely tutorial](https://dev.to/genicsblog/how-to-create-a-pull-request-in-github-correctly-20np) will help.

## 🌍 Who else is using SHAFT? [^4]

[^4]: Company names are collected via anonymous surveys and provided freely by engineers who claimed to be using SHAFT_Engine within these companies.

#### Stop Reinventing the wheel! Start using SHAFT!