text:
package iothub

// Copyright (c) Microsoft and contributors.  All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.

import (
	"context"
	"github.com/Azure/go-autorest/autorest"
	"github.com/Azure/go-autorest/autorest/azure"
	"github.com/Azure/go-autorest/autorest/date"
	"github.com/Azure/go-autorest/autorest/validation"
	"github.com/Azure/go-autorest/tracing"
	"net/http"
)

// DpsCertificateClient is the API for using the Azure IoT Hub Device Provisioning Service features.
type DpsCertificateClient struct {
	BaseClient
}

// NewDpsCertificateClient creates an instance of the DpsCertificateClient client.
func NewDpsCertificateClient(subscriptionID string) DpsCertificateClient {
	return NewDpsCertificateClientWithBaseURI(DefaultBaseURI, subscriptionID)
}

// NewDpsCertificateClientWithBaseURI creates an instance of the DpsCertificateClient client.
func NewDpsCertificateClientWithBaseURI(baseURI string, subscriptionID string) DpsCertificateClient {
	return DpsCertificateClient{NewWithBaseURI(baseURI, subscriptionID)}
}

// CreateOrUpdate add new certificate or update an existing certificate.
// Parameters:
// resourceGroupName - resource group identifier.
// provisioningServiceName - the name of the provisioning service.
// certificateName - the name of the certificate create or update.
// certificateDescription - the certificate body.
// ifMatch - eTag of the certificate. This is required to update an existing certificate, and ignored while
// creating a brand new certificate.
func (client DpsCertificateClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, provisioningServiceName string, certificateName string, certificateDescription CertificateBodyDescription, ifMatch string) (result CertificateResponse, err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/DpsCertificateClient.CreateOrUpdate")
		defer func() {
			sc := -1
			if result.Response.Response != nil {
				sc = result.Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	if err := validation.Validate([]validation.Validation{
		{TargetValue: certificateName,
			Constraints: []validation.Constraint{{Target: "certificateName", Name: validation.MaxLength, Rule: 256, Chain: nil}}}}); err != nil {
		return result, validation.NewError("iothub.DpsCertificateClient", "CreateOrUpdate", err.Error())
	}

	req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, provisioningServiceName, certificateName, certificateDescription, ifMatch)
	if err != nil {
		err = autorest.NewErrorWithError(err, "iothub.DpsCertificateClient", "CreateOrUpdate", nil, "Failure preparing request")
		return
	}

	resp, err := client.CreateOrUpdateSender(req)
	if err != nil {
		result.Response = autorest.Response{Response: resp}
		err = autorest.NewErrorWithError(err, "iothub.DpsCertificateClient", "CreateOrUpdate", resp, "Failure sending request")
		return
	}

	result, err = client.CreateOrUpdateResponder(resp)
	if err != nil {
		err = autorest.NewErrorWithError(err, "iothub.DpsCertificateClient", "CreateOrUpdate", resp, "Failure responding to request")
	}

	return
}

// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
func (client DpsCertificateClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, provisioningServiceName string, certificateName string, certificateDescription CertificateBodyDescription, ifMatch string) (*http.Request, error) {
	pathParameters := map[string]interface{}{
		"certificateName":         autorest.Encode("path", certificateName),
		"provisioningServiceName": autorest.Encode("path", provisioningServiceName),
		"resourceGroupName":       autorest.Encode("path", resourceGroupName),
		"subscriptionId":          autorest.Encode("path", client.SubscriptionID),
	}

	const APIVersion = "2017-11-15"
	queryParameters := map[string]interface{}{
		"api-version": APIVersion,
	}

	preparer := autorest.CreatePreparer(
		autorest.AsContentType("application/json; charset=utf-8"),
		autorest.AsPut(),
		autorest.WithBaseURL(client.BaseURI),
		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/certificates/{certificateName}", pathParameters),
		autorest.WithJSON(certificateDescription),
		autorest.WithQueryParameters(queryParameters))
	if len(ifMatch) > 0 {
		preparer = autorest.DecoratePreparer(preparer,
			autorest.WithHeader("If-Match", autorest.String(ifMatch)))
	}
	return preparer.Prepare((&http.Request{}).WithContext(ctx))
}

// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
// http.Response Body if it receives an error.
func (client DpsCertificateClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
	sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client))
	return autorest.SendWithSender(client, req, sd...)
}

// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
// closes the http.Response Body.
func (client DpsCertificateClient) CreateOrUpdateResponder(resp *http.Response) (result CertificateResponse, err error) {
	err = autorest.Respond(
		resp,
		client.ByInspecting(),
		azure.WithErrorUnlessStatusCode(http.StatusOK),
		autorest.ByUnmarshallingJSON(&result),
		autorest.ByClosing())
	result.Response = autorest.Response{Response: resp}
	return
}

// Delete deletes the specified certificate associated with the Provisioning Service
// Parameters:
// resourceGroupName - resource group identifier.
// ifMatch - eTag of the certificate
// provisioningServiceName - the name of the provisioning service.
// certificateName - this is a mandatory field, and is the logical name of the certificate that the
// provisioning service will access by.
// certificatename - this is optional, and it is the Common Name of the certificate.
// certificaterawBytes - raw data within the certificate.
// certificateisVerified - indicates if certificate has been verified by owner of the private key.
// certificatepurpose - a description that mentions the purpose of the certificate.
// certificatecreated - time the certificate is created.
// certificatelastUpdated - time the certificate is last updated.
// certificatehasPrivateKey - indicates if the certificate contains a private key.
// certificatenonce - random number generated to indicate Proof of Possession.
func (client DpsCertificateClient) Delete(ctx context.Context, resourceGroupName string, ifMatch string, provisioningServiceName string, certificateName string, certificatename string, certificaterawBytes []byte, certificateisVerified *bool, certificatepurpose CertificatePurpose, certificatecreated *date.Time, certificatelastUpdated *date.Time, certificatehasPrivateKey *bool, certificatenonce string) (result autorest.Response, err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/DpsCertificateClient.Delete")
		defer func() {
			sc := -1
			if result.Response != nil {
				sc = result.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	req, err := client.DeletePreparer(ctx, resourceGroupName, ifMatch, provisioningServiceName, certificateName, certificatename, certificaterawBytes, certificateisVerified, certificatepurpose, certificatecreated, certificatelastUpdated, certificatehasPrivateKey, certificatenonce)
	if err != nil {
		err = autorest.NewErrorWithError(err, "iothub.DpsCertificateClient", "Delete", nil, "Failure preparing request")
		return
	}

	resp, err := client.DeleteSender(req)
	if err != nil {
		result.Response = resp
		err = autorest.NewErrorWithError(err, "iothub.DpsCertificateClient", "Delete", resp, "Failure sending request")
		return
	}

	result, err = client.DeleteResponder(resp)
	if err != nil {
		err = autorest.NewErrorWithError(err, "iothub.DpsCertificateClient", "Delete", resp, "Failure responding to request")
	}

	return
}

// DeletePreparer prepares the Delete request.
func (client DpsCertificateClient) DeletePreparer(ctx context.Context, resourceGroupName string, ifMatch string, provisioningServiceName string, certificateName string, certificatename string, certificaterawBytes []byte, certificateisVerified *bool, certificatepurpose CertificatePurpose, certificatecreated *date.Time, certificatelastUpdated *date.Time, certificatehasPrivateKey *bool, certificatenonce string) (*http.Request, error) {
	pathParameters := map[string]interface{}{
		"certificateName":         autorest.Encode("path", certificateName),
		"provisioningServiceName": autorest.Encode("path", provisioningServiceName),
		"resourceGroupName":       autorest.Encode("path", resourceGroupName),
		"subscriptionId":          autorest.Encode("path", client.SubscriptionID),
	}

	const APIVersion = "2017-11-15"
	queryParameters := map[string]interface{}{
		"api-version": APIVersion,
	}
	if len(certificatename) > 0 {
		queryParameters["certificate.name"] = autorest.Encode("query", certificatename)
	}
	if certificaterawBytes != nil && len(certificaterawBytes) > 0 {
		queryParameters["certificate.rawBytes"] = autorest.Encode("query", certificaterawBytes)
	}
	if certificateisVerified != nil {
		queryParameters["certificate.isVerified"] = autorest.Encode("query", *certificateisVerified)
	}
	if len(string(certificatepurpose)) > 0 {
		queryParameters["certificate.purpose"] = autorest.Encode("query", certificatepurpose)
	}
	if certificatecreated != nil {
		queryParameters["certificate.created"] = autorest.Encode("query", *certificatecreated)
	}
	if certificatelastUpdated != nil {
		queryParameters["certificate.lastUpdated"] = autorest.Encode("query", *certificatelastUpdated)
	}
	if certificatehasPrivateKey != nil {
		queryParameters["certificate.hasPrivateKey"] = autorest.Encode("query", *certificatehasPrivateKey)
	}
	if len(certificatenonce) > 0 {
		queryParameters["certificate.nonce"] = autorest.Encode("query", certificatenonce)
	}

	preparer := autorest.CreatePreparer(
		autorest.AsDelete(),
		autorest.WithBaseURL(client.BaseURI),
		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/certificates/{certificateName}", pathParameters),
		autorest.WithQueryParameters(queryParameters),
		autorest.WithHeader("If-Match", autorest.String(ifMatch)))
	return preparer.Prepare((&http.Request{}).WithContext(ctx))
}

// DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error.
func (client DpsCertificateClient) DeleteSender(req *http.Request) (*http.Response, error) {
	sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client))
	return autorest.SendWithSender(client, req, sd...)
}

// DeleteResponder handles the response to the Delete request. The method always
// closes the http.Response Body.
func (client DpsCertificateClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
	err = autorest.Respond(
		resp,
		client.ByInspecting(),
		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
		autorest.ByClosing())
	result.Response = resp
	return
}

// GenerateVerificationCode generate verification code for Proof of Possession.
// Parameters:
// certificateName - the mandatory logical name of the certificate, that the provisioning service uses to
// access.
// ifMatch - eTag of the certificate. This is required to update an existing certificate, and ignored while
// creating a brand new certificate.
// resourceGroupName - name of resource group.
// provisioningServiceName - name of provisioning service.
// certificatename - common Name for the certificate.
// certificaterawBytes - raw data of certificate.
// certificateisVerified - indicates if the certificate has been verified by owner of the private key.
// certificatepurpose - description mentioning the purpose of the certificate.
// certificatecreated - certificate creation time.
// certificatelastUpdated - certificate last updated time.
// certificatehasPrivateKey - indicates if the certificate contains private key.
// certificatenonce - random number generated to indicate Proof of Possession.
func (client DpsCertificateClient) GenerateVerificationCode(ctx context.Context, certificateName string, ifMatch string, resourceGroupName string, provisioningServiceName string, certificatename string, certificaterawBytes []byte, certificateisVerified *bool, certificatepurpose CertificatePurpose, certificatecreated *date.Time, certificatelastUpdated *date.Time, certificatehasPrivateKey *bool, certificatenonce string) (result VerificationCodeResponse, err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/DpsCertificateClient.GenerateVerificationCode")
		defer func() {
			sc := -1
			if result.Response.Response != nil {
				sc = result.Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	req, err := client.GenerateVerificationCodePreparer(ctx, certificateName, ifMatch, resourceGroupName, provisioningServiceName, certificatename, certificaterawBytes, certificateisVerified, certificatepurpose, certificatecreated, certificatelastUpdated, certificatehasPrivateKey, certificatenonce)
	if err != nil {
		err = autorest.NewErrorWithError(err, "iothub.DpsCertificateClient", "GenerateVerificationCode", nil, "Failure preparing request")
		return
	}

	resp, err := client.GenerateVerificationCodeSender(req)
	if err != nil {
		result.Response = autorest.Response{Response: resp}
		err = autorest.NewErrorWithError(err, "iothub.DpsCertificateClient", "GenerateVerificationCode", resp, "Failure sending request")
		return
	}

	result, err = client.GenerateVerificationCodeResponder(resp)
	if err != nil {
		err = autorest.NewErrorWithError(err, "iothub.DpsCertificateClient", "GenerateVerificationCode", resp, "Failure responding to request")
	}

	return
}

// GenerateVerificationCodePreparer prepares the GenerateVerificationCode request.
func (client DpsCertificateClient) GenerateVerificationCodePreparer(ctx context.Context, certificateName string, ifMatch string, resourceGroupName string, provisioningServiceName string, certificatename string, certificaterawBytes []byte, certificateisVerified *bool, certificatepurpose CertificatePurpose, certificatecreated *date.Time, certificatelastUpdated *date.Time, certificatehasPrivateKey *bool, certificatenonce string) (*http.Request, error) {
	pathParameters := map[string]interface{}{
		"certificateName":         autorest.Encode("path", certificateName),
		"provisioningServiceName": autorest.Encode("path", provisioningServiceName),
		"resourceGroupName":       autorest.Encode("path", resourceGroupName),
		"subscriptionId":          autorest.Encode("path", client.SubscriptionID),
	}

	const APIVersion = "2017-11-15"
	queryParameters := map[string]interface{}{
		"api-version": APIVersion,
	}
	if len(certificatename) > 0 {
		queryParameters["certificate.name"] = autorest.Encode("query", certificatename)
	}
	if certificaterawBytes != nil && len(certificaterawBytes) > 0 {
		queryParameters["certificate.rawBytes"] = autorest.Encode("query", certificaterawBytes)
	}
	if certificateisVerified != nil {
		queryParameters["certificate.isVerified"] = autorest.Encode("query", *certificateisVerified)
	}
	if len(string(certificatepurpose)) > 0 {
		queryParameters["certificate.purpose"] = autorest.Encode("query", certificatepurpose)
	}
	if certificatecreated != nil {
		queryParameters["certificate.created"] = autorest.Encode("query", *certificatecreated)
	}
	if certificatelastUpdated != nil {
		queryParameters["certificate.lastUpdated"] = autorest.Encode("query", *certificatelastUpdated)
	}
	if certificatehasPrivateKey != nil {
		queryParameters["certificate.hasPrivateKey"] = autorest.Encode("query", *certificatehasPrivateKey)
	}
	if len(certificatenonce) > 0 {
		queryParameters["certificate.nonce"] = autorest.Encode("query", certificatenonce)
	}

	preparer := autorest.CreatePreparer(
		autorest.AsPost(),
		autorest.WithBaseURL(client.BaseURI),
		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/certificates/{certificateName}/generateVerificationCode", pathParameters),
		autorest.WithQueryParameters(queryParameters),
		autorest.WithHeader("If-Match", autorest.String(ifMatch)))
	return preparer.Prepare((&http.Request{}).WithContext(ctx))
}

// GenerateVerificationCodeSender sends the GenerateVerificationCode request. The method will close the
// http.Response Body if it receives an error.
func (client DpsCertificateClient) GenerateVerificationCodeSender(req *http.Request) (*http.Response, error) {
	sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client))
	return autorest.SendWithSender(client, req, sd...)
}

// GenerateVerificationCodeResponder handles the response to the GenerateVerificationCode request. The method always
// closes the http.Response Body.
func (client DpsCertificateClient) GenerateVerificationCodeResponder(resp *http.Response) (result VerificationCodeResponse, err error) {
	err = autorest.Respond(
		resp,
		client.ByInspecting(),
		azure.WithErrorUnlessStatusCode(http.StatusOK),
		autorest.ByUnmarshallingJSON(&result),
		autorest.ByClosing())
	result.Response = autorest.Response{Response: resp}
	return
}

// Get get the certificate from the provisioning service.
// Parameters:
// certificateName - name of the certificate to retrieve.
// resourceGroupName - resource group identifier.
// provisioningServiceName - name of the provisioning service the certificate is associated with.
// ifMatch - eTag of the certificate.
func (client DpsCertificateClient) Get(ctx context.Context, certificateName string, resourceGroupName string, provisioningServiceName string, ifMatch string) (result CertificateResponse, err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/DpsCertificateClient.Get")
		defer func() {
			sc := -1
			if result.Response.Response != nil {
				sc = result.Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	req, err := client.GetPreparer(ctx, certificateName, resourceGroupName, provisioningServiceName, ifMatch)
	if err != nil {
		err = autorest.NewErrorWithError(err, "iothub.DpsCertificateClient", "Get", nil, "Failure preparing request")
		return
	}

	resp, err := client.GetSender(req)
	if err != nil {
		result.Response = autorest.Response{Response: resp}
		err = autorest.NewErrorWithError(err, "iothub.DpsCertificateClient", "Get", resp, "Failure sending request")
		return
	}

	result, err = client.GetResponder(resp)
	if err != nil {
		err = autorest.NewErrorWithError(err, "iothub.DpsCertificateClient", "Get", resp, "Failure responding to request")
	}

	return
}

// GetPreparer prepares the Get request.
func (client DpsCertificateClient) GetPreparer(ctx context.Context, certificateName string, resourceGroupName string, provisioningServiceName string, ifMatch string) (*http.Request, error) {
	pathParameters := map[string]interface{}{
		"certificateName":         autorest.Encode("path", certificateName),
		"provisioningServiceName": autorest.Encode("path", provisioningServiceName),
		"resourceGroupName":       autorest.Encode("path", resourceGroupName),
		"subscriptionId":          autorest.Encode("path", client.SubscriptionID),
	}

	const APIVersion = "2017-11-15"
	queryParameters := map[string]interface{}{
		"api-version": APIVersion,
	}

	preparer := autorest.CreatePreparer(
		autorest.AsGet(),
		autorest.WithBaseURL(client.BaseURI),
		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/certificates/{certificateName}", pathParameters),
		autorest.WithQueryParameters(queryParameters))
	if len(ifMatch) > 0 {
		preparer = autorest.DecoratePreparer(preparer,
			autorest.WithHeader("If-Match", autorest.String(ifMatch)))
	}
	return preparer.Prepare((&http.Request{}).WithContext(ctx))
}

// GetSender sends the Get request. The method will close the
// http.Response Body if it receives an error.
func (client DpsCertificateClient) GetSender(req *http.Request) (*http.Response, error) {
	sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client))
	return autorest.SendWithSender(client, req, sd...)
}

// GetResponder handles the response to the Get request. The method always
// closes the http.Response Body.
func (client DpsCertificateClient) GetResponder(resp *http.Response) (result CertificateResponse, err error) {
	err = autorest.Respond(
		resp,
		client.ByInspecting(),
		azure.WithErrorUnlessStatusCode(http.StatusOK),
		autorest.ByUnmarshallingJSON(&result),
		autorest.ByClosing())
	result.Response = autorest.Response{Response: resp}
	return
}

// List get all the certificates tied to the provisioning service.
// Parameters:
// resourceGroupName - name of resource group.
// provisioningServiceName - name of provisioning service to retrieve certificates for.
func (client DpsCertificateClient) List(ctx context.Context, resourceGroupName string, provisioningServiceName string) (result CertificateListDescription, err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/DpsCertificateClient.List")
		defer func() {
			sc := -1
			if result.Response.Response != nil {
				sc = result.Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	req, err := client.ListPreparer(ctx, resourceGroupName, provisioningServiceName)
	if err != nil {
		err = autorest.NewErrorWithError(err, "iothub.DpsCertificateClient", "List", nil, "Failure preparing request")
		return
	}

	resp, err := client.ListSender(req)
	if err != nil {
		result.Response = autorest.Response{Response: resp}
		err = autorest.NewErrorWithError(err, "iothub.DpsCertificateClient", "List", resp, "Failure sending request")
		return
	}

	result, err = client.ListResponder(resp)
	if err != nil {
		err = autorest.NewErrorWithError(err, "iothub.DpsCertificateClient", "List", resp, "Failure responding to request")
	}

	return
}

// ListPreparer prepares the List request.
func (client DpsCertificateClient) ListPreparer(ctx context.Context, resourceGroupName string, provisioningServiceName string) (*http.Request, error) {
	pathParameters := map[string]interface{}{
		"provisioningServiceName": autorest.Encode("path", provisioningServiceName),
		"resourceGroupName":       autorest.Encode("path", resourceGroupName),
		"subscriptionId":          autorest.Encode("path", client.SubscriptionID),
	}

	const APIVersion = "2017-11-15"
	queryParameters := map[string]interface{}{
		"api-version": APIVersion,
	}

	preparer := autorest.CreatePreparer(
		autorest.AsGet(),
		autorest.WithBaseURL(client.BaseURI),
		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/certificates", pathParameters),
		autorest.WithQueryParameters(queryParameters))
	return preparer.Prepare((&http.Request{}).WithContext(ctx))
}

// ListSender sends the List request. The method will close the
// http.Response Body if it receives an error.
func (client DpsCertificateClient) ListSender(req *http.Request) (*http.Response, error) {
	sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client))
	return autorest.SendWithSender(client, req, sd...)
}

// ListResponder handles the response to the List request. The method always
// closes the http.Response Body.
func (client DpsCertificateClient) ListResponder(resp *http.Response) (result CertificateListDescription, err error) {
	err = autorest.Respond(
		resp,
		client.ByInspecting(),
		azure.WithErrorUnlessStatusCode(http.StatusOK),
		autorest.ByUnmarshallingJSON(&result),
		autorest.ByClosing())
	result.Response = autorest.Response{Response: resp}
	return
}

// VerifyCertificate verifies the certificate's private key possession by providing the leaf cert issued by the
// verifying pre uploaded certificate.
// Parameters:
// certificateName - the mandatory logical name of the certificate, that the provisioning service uses to
// access.
// ifMatch - eTag of the certificate.
// request - the name of the certificate
// resourceGroupName - resource group name.
// provisioningServiceName - provisioning service name.
// certificatename - common Name for the certificate.
// certificaterawBytes - raw data of certificate.
// certificateisVerified - indicates if the certificate has been verified by owner of the private key.
// certificatepurpose - describe the purpose of the certificate.
// certificatecreated - certificate creation time.
// certificatelastUpdated - certificate last updated time.
// certificatehasPrivateKey - indicates if the certificate contains private key.
// certificatenonce - random number generated to indicate Proof of Possession.
func (client DpsCertificateClient) VerifyCertificate(ctx context.Context, certificateName string, ifMatch string, request VerificationCodeRequest, resourceGroupName string, provisioningServiceName string, certificatename string, certificaterawBytes []byte, certificateisVerified *bool, certificatepurpose CertificatePurpose, certificatecreated *date.Time, certificatelastUpdated *date.Time, certificatehasPrivateKey *bool, certificatenonce string) (result CertificateResponse, err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/DpsCertificateClient.VerifyCertificate")
		defer func() {
			sc := -1
			if result.Response.Response != nil {
				sc = result.Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	req, err := client.VerifyCertificatePreparer(ctx, certificateName, ifMatch, request, resourceGroupName, provisioningServiceName, certificatename, certificaterawBytes, certificateisVerified, certificatepurpose, certificatecreated, certificatelastUpdated, certificatehasPrivateKey, certificatenonce)
	if err != nil {
		err = autorest.NewErrorWithError(err, "iothub.DpsCertificateClient", "VerifyCertificate", nil, "Failure preparing request")
		return
	}

	resp, err := client.VerifyCertificateSender(req)
	if err != nil {
		result.Response = autorest.Response{Response: resp}
		err = autorest.NewErrorWithError(err, "iothub.DpsCertificateClient", "VerifyCertificate", resp, "Failure sending request")
		return
	}

	result, err = client.VerifyCertificateResponder(resp)
	if err != nil {
		err = autorest.NewErrorWithError(err, "iothub.DpsCertificateClient", "VerifyCertificate", resp, "Failure responding to request")
	}

	return
}

// VerifyCertificatePreparer prepares the VerifyCertificate request.
func (client DpsCertificateClient) VerifyCertificatePreparer(ctx context.Context, certificateName string, ifMatch string, request VerificationCodeRequest, resourceGroupName string, provisioningServiceName string, certificatename string, certificaterawBytes []byte, certificateisVerified *bool, certificatepurpose CertificatePurpose, certificatecreated *date.Time, certificatelastUpdated *date.Time, certificatehasPrivateKey *bool, certificatenonce string) (*http.Request, error) {
	pathParameters := map[string]interface{}{
		"certificateName":         autorest.Encode("path", certificateName),
		"provisioningServiceName": autorest.Encode("path", provisioningServiceName),
		"resourceGroupName":       autorest.Encode("path", resourceGroupName),
		"subscriptionId":          autorest.Encode("path", client.SubscriptionID),
	}

	const APIVersion = "2017-11-15"
	queryParameters := map[string]interface{}{
		"api-version": APIVersion,
	}
	if len(certificatename) > 0 {
		queryParameters["certificate.name"] = autorest.Encode("query", certificatename)
	}
	if certificaterawBytes != nil && len(certificaterawBytes) > 0 {
		queryParameters["certificate.rawBytes"] = autorest.Encode("query", certificaterawBytes)
	}
	if certificateisVerified != nil {
		queryParameters["certificate.isVerified"] = autorest.Encode("query", *certificateisVerified)
	}
	if len(string(certificatepurpose)) > 0 {
		queryParameters["certificate.purpose"] = autorest.Encode("query", certificatepurpose)
	}
	if certificatecreated != nil {
		queryParameters["certificate.created"] = autorest.Encode("query", *certificatecreated)
	}
	if certificatelastUpdated != nil {
		queryParameters["certificate.lastUpdated"] = autorest.Encode("query", *certificatelastUpdated)
	}
	if certificatehasPrivateKey != nil {
		queryParameters["certificate.hasPrivateKey"] = autorest.Encode("query", *certificatehasPrivateKey)
	}
	if len(certificatenonce) > 0 {
		queryParameters["certificate.nonce"] = autorest.Encode("query", certificatenonce)
	}

	preparer := autorest.CreatePreparer(
		autorest.AsContentType("application/json; charset=utf-8"),
		autorest.AsPost(),
		autorest.WithBaseURL(client.BaseURI),
		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/certificates/{certificateName}/verify", pathParameters),
		autorest.WithJSON(request),
		autorest.WithQueryParameters(queryParameters),
		autorest.WithHeader("If-Match", autorest.String(ifMatch)))
	return preparer.Prepare((&http.Request{}).WithContext(ctx))
}

// VerifyCertificateSender sends the VerifyCertificate request. The method will close the
// http.Response Body if it receives an error.
func (client DpsCertificateClient) VerifyCertificateSender(req *http.Request) (*http.Response, error) {
	sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client))
	return autorest.SendWithSender(client, req, sd...)
}

// VerifyCertificateResponder handles the response to the VerifyCertificate request. The method always
// closes the http.Response Body.
func (client DpsCertificateClient) VerifyCertificateResponder(resp *http.Response) (result CertificateResponse, err error) {
	err = autorest.Respond(
		resp,
		client.ByInspecting(),
		azure.WithErrorUnlessStatusCode(http.StatusOK),
		autorest.ByUnmarshallingJSON(&result),
		autorest.ByClosing())
	result.Response = autorest.Response{Response: resp}
	return
}


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="course.examples.permissionexample.boom"
    android:versionCode="1"
    android:versionName="1.0">

    <!-- Defines a custom permission -->
    <permission
        android:name="course.examples.permissionexample.BOOM_PERM"
        android:description="@string/boom_perm_string"
        android:label="@string/boom_permission_label_string"
        android:protectionLevel="dangerous" />

    <!--  Enforces the BOOM_PERM permission on users of this application  -->
    <application
        android:allowBackup="false"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:permission="course.examples.permissionexample.BOOM_PERM"
        android:theme="@style/MaterialTheme">

        <activity
            android:name=".BoomActivity"
            android:label="@string/app_name">
            <!-- Normally wouldn't include this IntentFilter because the Launcher doesn't have the
            custom permission and so can't run this app-->
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>

            <!--  Sets up an Intent Filter for the dangerous operation defined by the
                   Action String "....boom_action"  -->
            <intent-filter>
                <action android:name="course.examples.permissionexample.boom.boom_action" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
    </application>

</manifest>

redpajama_set_name: RedPajamaGithub


text:
var GTALK_CNF , JABBER_CNF, EXTENSIONS_CNF;

var EDIT_BUDDY ;
var EDIT_ACCOUNT ;

var MANAGE_BUDDIES = {
	listBuddies : function(){ // MANAGE_BUDDIES.listBuddies
		var addCell = ASTGUI.domActions.tr_addCell; // temporarily store the function
		var TBL = _$('table_BuddiesList');
		ASTGUI.domActions.clear_table(TBL);

		for( buddy in GTALK_CNF ){
			if( !GTALK_CNF.hasOwnProperty(buddy) || buddy == 'general' ) continue;

			var newRow = TBL.insertRow(-1);
			newRow.className = ((TBL.rows.length)%2==1)?'odd':'even';
			addCell( newRow , { html:GTALK_CNF[buddy].username , align:'left'});

			var tmp_context = GTALK_CNF[buddy].context || '' ;

			var dest_line = ( tmp_context && tmp_context.contains(ASTGUI.contexts.gtalkIncomingContext) && EXTENSIONS_CNF.hasOwnProperty(tmp_context) ) ? EXTENSIONS_CNF[tmp_context][0] : '' ;
			var dest_args = ASTGUI.parseContextLine.getArgs(dest_line) ;
			addCell( newRow , { html: ASTGUI.parseContextLine.toKnownContext(dest_args) , align:'left' } );

			addCell( newRow , { html:GTALK_CNF[buddy].connection });

			var tmp = "Edit "
					+ "Delete" ;
			addCell( newRow , { html: tmp });
		}

		if( TBL.rows.length == 0 ){
			var newRow = TBL.insertRow(-1);
			addCell( newRow , { html: "
No peers configured. To send or receive calls from your friends on google talk, Add the peer name by clicking on the 'New peer' button.

" });
		}else{
			var newRow = TBL.insertRow(0);
			newRow.className = 'frow' ;
			addCell( newRow , { html: 'UserName' , align: 'left' });
			addCell( newRow , { html: 'Incoming Calls', align: 'left' });
			addCell( newRow , { html: 'Connection' });
			addCell( newRow , { html: '' });
		}
	},

	deleteBuddy : function(a , silentmode){ // MANAGE_BUDDIES.deleteBuddy(); use silentmode to delete while editing buddy
		if(!silentmode){
			if( !confirm("Delete peer '"+ a + "' ?") ) return true;
		}

		var u = new listOfSynActions('gtalk.conf');
			u.new_action('delcat', a, '', '');
		u.callActions();

		u.clearActions('extensions.conf');
			u.new_action('delcat', GTALK_CNF[a].context , '', '');
		u.callActions();

		if(!silentmode){
			ASTGUI.feedback( { msg:"deleted peer '" + a + "'" , showfor: 3, color:'red', bgcolor:'#FFFFFF' } );
			window.location.reload();
		}
	},

	addBuddy: function(){ // MANAGE_BUDDIES.addBuddy();

		if ( EDIT_BUDDY ){
			this.deleteBuddy(EDIT_BUDDY , true);
		}

		var v = new listOfActions('gtalk.conf');
		var tmp_uname = ASTGUI.getFieldValue('edit_buddyName_text');
		var tmp_connection = ASTGUI.getFieldValue('edit_buddyConnection_select');
		if( !tmp_uname.contains('@') ){
			tmp_uname = tmp_uname + '@gmail.com';
		}
		var catname = ( EDIT_BUDDY ) ? EDIT_BUDDY : tmp_uname.beforeChar('@');

		v.new_action('newcat', catname, '', '');
		v.new_action('append', catname , 'username', tmp_uname );
		v.new_action('append', catname , 'disallow', 'all');
		v.new_action('append', catname , 'allow', 'all');
		v.new_action('append', catname , 'context', ASTGUI.contexts.gtalkIncomingContext + catname );

		v.new_action('append', catname , 'connection', tmp_connection );
		v.callActions( function(){

			var W = new listOfSynActions('extensions.conf') ;
			W.new_action('newcat', ASTGUI.contexts.gtalkIncomingContext + catname , '', '');
			W.new_action('append', ASTGUI.contexts.gtalkIncomingContext + catname , 'exten', 's,1,' + ASTGUI.getFieldValue('edit_buddyIncomingCalls_select') );
			W.callActions();

			ASTGUI.feedback( { msg:"updated peer" , showfor: 3, color:'red', bgcolor:'#FFFFFF' } );
			window.location.reload();
		});
	},

	new_buddy_form : function(){ // MANAGE_BUDDIES.new_buddy_form();
		EDIT_BUDDY = '';
		ASTGUI.resetTheseFields([ 'edit_buddyName_text', 'edit_buddyConnection_select', 'edit_buddyIncomingCalls_select']);
		$('#buddy_editdiv .dialog_title > span').html('Add Peer');
		$('#buddy_editdiv').showWithBg();
	},

	edit_buddy_form : function(a){ // MANAGE_BUDDIES.edit_buddy_form();
		if(!a) return;
		EDIT_BUDDY = a;
		ASTGUI.updateFieldToValue( 'edit_buddyName_text',  GTALK_CNF[EDIT_BUDDY].username );
		ASTGUI.updateFieldToValue( 'edit_buddyConnection_select', GTALK_CNF[EDIT_BUDDY].connection );

		var dest_line = ( EXTENSIONS_CNF.hasOwnProperty( GTALK_CNF[EDIT_BUDDY].context ) ) ? EXTENSIONS_CNF[ GTALK_CNF[EDIT_BUDDY].context ][0] : '' ;
		ASTGUI.selectbox.selectDestinationOption( 'edit_buddyIncomingCalls_select' , ASTGUI.parseContextLine.getAppWithArgs(dest_line) );

		$('#buddy_editdiv .dialog_title > span').html( 'Edit Peer ' + EDIT_BUDDY);
		$('#buddy_editdiv').showWithBg();
	}
};

var MANAGE_ACCOUNTS = {
	listAccounts : function(){
		var addCell = ASTGUI.domActions.tr_addCell; // temporarily store the function
		var TBL = _$('table_AccountsList');
		ASTGUI.domActions.clear_table(TBL);

		for( account in JABBER_CNF ){
			if( !JABBER_CNF.hasOwnProperty(account) || account == 'general' ) continue;
			ASTGUI.selectbox.append('edit_buddyConnection_select', account , account);

			var newRow = TBL.insertRow(-1);
			newRow.className = ((TBL.rows.length)%2==1) ? 'odd':'even';
			addCell( newRow , { html: JABBER_CNF[account].username, align: 'left' });
			addCell( newRow , { html: account, align: 'left' });
				var tmp = "Edit "
					+ "Delete" ;
			addCell( newRow , { html: tmp, align: 'center' });
		}

		if( TBL.rows.length == 0 ){
			var newRow = TBL.insertRow(-1);
			addCell( newRow , { html: "
No google talk accounts configured.
 Please click on 'New gtalk Account' button to send and receive calls via your google talk account.

"});
		}else{
			var newRow = TBL.insertRow(0);
			newRow.className = 'frow' ;
			addCell( newRow , { html: 'UserName' , align: 'left' });
			addCell( newRow , { html: 'Account', align: 'left' });
			addCell( newRow , { html: '' });
		}
	},

	deleteAccount : function(a, silentmode){ // MANAGE_ACCOUNTS.deleteAccount()
		if(!silentmode && !confirm("Delete account '"+ a + "' ?")) { return true; }
		var u = new listOfSynActions('jabber.conf') ;
		u.new_action('delcat', a, '', '');
		u.callActions();
		if( !silentmode ){
			ASTGUI.feedback({ msg:"Deleted jabber account '" + a + "'", showfor: 3, color:'red', bgcolor:'#FFFFFF' });
			window.location.reload();
		}
	},

	saveAccount : function(){ // MANAGE_ACCOUNTS.saveAccount()
		if ( EDIT_ACCOUNT ){
			this.deleteAccount(EDIT_ACCOUNT, true);
		}

		var v = new listOfActions('jabber.conf');
		var tmp_uname = ASTGUI.getFieldValue('edit_account_text');
		if( !tmp_uname.contains('@') ){
			tmp_uname = tmp_uname + '@gmail.com';
		}
		var catname = ( EDIT_ACCOUNT ) ? EDIT_ACCOUNT : tmp_uname.beforeChar('@');
		v.new_action('newcat', catname, '', '');
		v.new_action('append', catname , 'type', 'client');
		v.new_action('append', catname , 'serverhost', 'talk.google.com');
		v.new_action('append', catname , 'username', tmp_uname);
		v.new_action('append', catname , 'secret', ASTGUI.getFieldValue('edit_account_secret'));
		v.new_action('append', catname , 'port', '5222');
		v.new_action('append', catname , 'usetls', 'yes');
		v.new_action('append', catname , 'usesasl', 'yes');
		v.new_action('append', catname , 'statusmessage', ASTGUI.getFieldValue('edit_account_status'));
		v.new_action('append', catname , 'timeout', '100');
		v.callActions( function(){
			ASTGUI.feedback( { msg:"updated account" , showfor: 3, color:'red', bgcolor:'#FFFFFF' } );
			window.location.reload();
		});

	},

	new_Account_form : function(){ // MANAGE_ACCOUNTS.new_Account_form()
		EDIT_ACCOUNT = '';
		ASTGUI.resetTheseFields([ 'edit_account_text', 'edit_account_secret','edit_account_status' ]);
		$('#account_editdiv .dialog_title > span').html('Add new Account');
		$('#account_editdiv').showWithBg();
	},

	edit_Account_form : function(a){ // MANAGE_ACCOUNTS.edit_Account_form()
		if(!a) return;
		EDIT_ACCOUNT = a;

		ASTGUI.updateFieldToValue( 'edit_account_text',  JABBER_CNF[EDIT_ACCOUNT].username );
		ASTGUI.updateFieldToValue( 'edit_account_secret',  JABBER_CNF[EDIT_ACCOUNT].secret );
		ASTGUI.updateFieldToValue( 'edit_account_status',  JABBER_CNF[EDIT_ACCOUNT].statusmessage );

		$('#account_editdiv .dialog_title > span').html('Edit Account ' + EDIT_ACCOUNT );
		$('#account_editdiv').showWithBg();

	}

};

var localajaxinit = function(){
	top.document.title = 'Google Talk Preferences' ;
	GTALK_CNF = config2json({ filename:'gtalk.conf', usf:1 }); // buddies
	JABBER_CNF = config2json({ filename:'jabber.conf', usf:1 }); // accounts
	EXTENSIONS_CNF = config2json({ filename:'extensions.conf', usf:0 });

	var someArray = parent.miscFunctions.getAllDestinations() ;
	ASTGUI.selectbox.populateArray('edit_buddyIncomingCalls_select', someArray);

	(function(){
		// check if the general section of the config files are configured
		var u = new listOfSynActions('gtalk.conf') ;
		if( !GTALK_CNF.hasOwnProperty('general') ){
			u.new_action('newcat', 'general' , '', '');
		}
		if( GTALK_CNF.hasOwnProperty('general') && !GTALK_CNF['general'].hasOwnProperty('allowguest') ){
			u.new_action('append', 'general' , 'allowguest', 'no');
		}

		var v = new listOfSynActions('jabber.conf') ;
		if( !JABBER_CNF.hasOwnProperty('general') ){
			v.new_action('newcat', 'general' , '', '');
		}
		if( JABBER_CNF.hasOwnProperty('general') && !JABBER_CNF['general'].hasOwnProperty('autoprune') ){
			v.new_action('append', 'general' , 'autoprune', 'no');
		}
		if( JABBER_CNF.hasOwnProperty('general') && !JABBER_CNF['general'].hasOwnProperty('autoregister') ){
			v.new_action('append', 'general' , 'autoregister', 'yes');
		}

		if( u.actionCount || v.actionCount ) {
			u.callActions();
			v.callActions();
			window.location.reload();
		}
	})();

	(function(){
		var t = [{	url:'#',
				desc:'Google Talk Accounts',
				click_function: function(){
					$('#table_BuddiesList_DIV').hide();
					$('#table_AccountsList_DIV').show();
				}
			},{	url: '#',
				desc: '   Peers   ',
				click_function: function(){
					$('#table_BuddiesList_DIV').show();
					$('#table_AccountsList_DIV').hide();
				}
			}];

		ASTGUI.tabbedOptions( _$('tabbedMenu') , t );

		$('#tabbedMenu').find('A:eq(0)').click();
	})();

	MANAGE_ACCOUNTS.listAccounts();
	MANAGE_BUDDIES.listBuddies();
};


text:
package adf.launcher.option;

import adf.launcher.ConfigKey;
import rescuecore2.Constants;
import rescuecore2.config.Config;

public class OptionDebug extends Option
{
	@Override
	public boolean hasValue()
	{
		return true;
	}

	@Override
	public String getKey()
	{
		return "-d";
	}

	@Override
	public void setValue(Config config, String data)
	{
		config.setValue(ConfigKey.KEY_DEBUG_FLAG, data);
	}
}


text:
package org.sleuthkit.autopsy.report.taggedhashes;

import java.awt.Component;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.logging.Level;
import javax.swing.JCheckBox;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JOptionPane;
import javax.swing.ListCellRenderer;
import javax.swing.ListModel;
import javax.swing.event.ListDataListener;
import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.autopsy.modules.hashdatabase.HashDbManager.HashDb;
import org.sleuthkit.autopsy.modules.hashdatabase.HashDbManager;
import org.sleuthkit.autopsy.modules.hashdatabase.HashLookupSettingsPanel;
import org.sleuthkit.datamodel.TagName;
import org.sleuthkit.datamodel.TskCoreException;

/**
 * Instances of this class are used to configure the report module plug in that
 * provides a convenient way to add content hashes to hash set databases.
 */
@SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives
class AddTaggedHashesToHashDbConfigPanel extends javax.swing.JPanel {

    private static final long serialVersionUID = 1L;
    private List<TagName> tagNames;
    private final Map<String, Boolean> tagNameSelections = new LinkedHashMap<>();
    private final TagNamesListModel tagsNamesListModel = new TagNamesListModel();
    private final TagsNamesListCellRenderer tagsNamesRenderer = new TagsNamesListCellRenderer();
    private HashDb selectedHashSet = null;

    AddTaggedHashesToHashDbConfigPanel() {
        initComponents();
        customizeComponents();
    }

    private void customizeComponents() {
        populateTagNameComponents();
        populateHashSetComponents();
    }

    private void populateTagNameComponents() {
        // Get the tag names in use for the current case.
        try {
            tagNames = Case.getCurrentCaseThrows().getServices().getTagsManager().getTagNamesInUse();
        } catch (TskCoreException ex) {
            Logger.getLogger(AddTaggedHashesToHashDbConfigPanel.class.getName()).log(Level.SEVERE, "Failed to get tag names", ex);
            JOptionPane.showMessageDialog(this, "Error getting tag names for case.", "Tag Names Not Found", JOptionPane.ERROR_MESSAGE);
        } catch (NoCurrentCaseException ex) {
            Logger.getLogger(AddTaggedHashesToHashDbConfigPanel.class.getName()).log(Level.SEVERE, "Exception while getting open case.", ex);
            JOptionPane.showMessageDialog(this, "Error getting tag names for case.", "Exception while getting open case.", JOptionPane.ERROR_MESSAGE);
        }

        // Mark the tag names as unselected. Note that tagNameSelections is a
        // LinkedHashMap so that order is preserved and the tagNames and tagNameSelections
        // containers are "parallel" containers.
        for (TagName tagName : tagNames) {
            tagNameSelections.put(tagName.getDisplayName(), Boolean.FALSE);
        }

        // Set up the tag names JList component to be a collection of check boxes
        // for selecting tag names. The mouse click listener updates tagNameSelections
        // to reflect user choices.
        tagNamesListBox.setModel(tagsNamesListModel);
        tagNamesListBox.setCellRenderer(tagsNamesRenderer);
        tagNamesListBox.setVisibleRowCount(-1);
        tagNamesListBox.addMouseListener(new MouseAdapter() {
            @Override
            public void mousePressed(MouseEvent evt) {
                JList<?> list = (JList) evt.getSource();
                int index = list.locationToIndex(evt.getPoint());
                if (index > -1) {
                    String value = tagsNamesListModel.getElementAt(index);
                    tagNameSelections.put(value, !tagNameSelections.get(value));
                    list.repaint();
                }
            }
        });
    }

    private void populateHashSetComponents() {
        // Clear the components because this method is called both during construction
        // and when the user changes the hash set configuration.
        hashSetsComboBox.removeAllItems();

        // Get the updateable hash databases and add their hash set names to the
        // JComboBox component.
        List<HashDb> updateableHashSets = HashDbManager.getInstance().getUpdateableHashSets();
        if (!updateableHashSets.isEmpty()) {
            for (HashDb hashDb : updateableHashSets) {
                hashSetsComboBox.addItem(hashDb);
            }
            hashSetsComboBox.setEnabled(true);
        } else {
            hashSetsComboBox.setEnabled(false);
        }
    }

    /**
     * Gets the subset of the tag names in use selected by the user.
     *
     * @return A list, possibly empty, of TagName data transfer objects (DTOs).
     */
    List<TagName> getSelectedTagNames() {
        List<TagName> selectedTagNames = new ArrayList<>();
        for (TagName tagName : tagNames) {
            if (tagNameSelections.get(tagName.getDisplayName())) {
                selectedTagNames.add(tagName);
            }
        }
        return selectedTagNames;
    }

    /**
     * Gets the hash set database selected by the user.
     *
     * @return A HashDb object representing the database or null.
     */
    HashDb getSelectedHashDatabase() {
        return selectedHashSet;
    }

    // This class is a list model for the tag names JList component.
    private class TagNamesListModel implements ListModel<String> {

        @Override
        public int getSize() {
            return tagNames.size();
        }

        @Override
        public String getElementAt(int index) {
            return tagNames.get(index).getDisplayName();
        }

        @Override
        public void addListDataListener(ListDataListener l) {
        }

        @Override
        public void removeListDataListener(ListDataListener l) {
        }
    }

    // This class renders the items in the tag names JList component as JCheckbox components.
    private class TagsNamesListCellRenderer extends JCheckBox implements ListCellRenderer<String> {
        private static final long serialVersionUID = 1L;

        @Override
        public Component getListCellRendererComponent(JList<? extends String> list, String value, int index, boolean isSelected, boolean cellHasFocus) {
            if (value != null) {
                setEnabled(list.isEnabled());
                setSelected(tagNameSelections.get(value));
                setFont(list.getFont());
                setBackground(list.getBackground());
                setForeground(list.getForeground());
                setText(value);
                return this;
            }
            return new JLabel();
        }
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane1 = new javax.swing.JScrollPane();
        tagNamesListBox = new javax.swing.JList<>();
        selectAllButton = new javax.swing.JButton();
        deselectAllButton = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        hashSetsComboBox = new javax.swing.JComboBox<>();
        configureHashDatabasesButton = new javax.swing.JButton();
        jLabel2 = new javax.swing.JLabel();

        jScrollPane1.setViewportView(tagNamesListBox);

        org.openide.awt.Mnemonics.setLocalizedText(selectAllButton, org.openide.util.NbBundle.getMessage(AddTaggedHashesToHashDbConfigPanel.class, "AddTaggedHashesToHashDbConfigPanel.selectAllButton.text")); // NOI18N
        selectAllButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                selectAllButtonActionPerformed(evt);
            }
        });

        org.openide.awt.Mnemonics.setLocalizedText(deselectAllButton, org.openide.util.NbBundle.getMessage(AddTaggedHashesToHashDbConfigPanel.class, "AddTaggedHashesToHashDbConfigPanel.deselectAllButton.text")); // NOI18N
        deselectAllButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                deselectAllButtonActionPerformed(evt);
            }
        });

        org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(AddTaggedHashesToHashDbConfigPanel.class, "AddTaggedHashesToHashDbConfigPanel.jLabel1.text")); // NOI18N

        hashSetsComboBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                hashSetsComboBoxActionPerformed(evt);
            }
        });

        org.openide.awt.Mnemonics.setLocalizedText(configureHashDatabasesButton, org.openide.util.NbBundle.getMessage(AddTaggedHashesToHashDbConfigPanel.class, "AddTaggedHashesToHashDbConfigPanel.configureHashDatabasesButton.text")); // NOI18N
        configureHashDatabasesButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                configureHashDatabasesButtonActionPerformed(evt);
            }
        });

        org.openide.awt.Mnemonics.setLocalizedText(jLabel2, org.openide.util.NbBundle.getMessage(AddTaggedHashesToHashDbConfigPanel.class, "AddTaggedHashesToHashDbConfigPanel.jLabel2.text")); // NOI18N

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel2)
                    .addComponent(jLabel1)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jScrollPane1)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(hashSetsComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 159, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(configureHashDatabasesButton)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(deselectAllButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(selectAllButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
                .addContainerGap())
        );

        layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {deselectAllButton, selectAllButton});

        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(selectAllButton)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(deselectAllButton))
                    .addComponent(jScrollPane1))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel2)
                .addGap(4, 4, 4)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(hashSetsComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(configureHashDatabasesButton))
                .addContainerGap())
        );
    }// </editor-fold>//GEN-END:initComponents

    private void selectAllButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_selectAllButtonActionPerformed
        for (TagName tagName : tagNames) {
            tagNameSelections.put(tagName.getDisplayName(), Boolean.TRUE);
        }
        tagNamesListBox.repaint();
    }//GEN-LAST:event_selectAllButtonActionPerformed

    private void hashSetsComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_hashSetsComboBoxActionPerformed
        selectedHashSet = (HashDb)hashSetsComboBox.getSelectedItem();
    }//GEN-LAST:event_hashSetsComboBoxActionPerformed

    private void deselectAllButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deselectAllButtonActionPerformed
        for (TagName tagName : tagNames) {
            tagNameSelections.put(tagName.getDisplayName(), Boolean.FALSE);
        }
        tagNamesListBox.repaint();
    }//GEN-LAST:event_deselectAllButtonActionPerformed

    private void configureHashDatabasesButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_configureHashDatabasesButtonActionPerformed
        HashLookupSettingsPanel configPanel = new HashLookupSettingsPanel();
        configPanel.load();
        if (JOptionPane.showConfirmDialog(this, configPanel, "Hash Set Configuration", JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE) == JOptionPane.OK_OPTION) {
            configPanel.store();
            populateHashSetComponents();
        } else {
            configPanel.cancel();
            populateHashSetComponents();
        }
    }//GEN-LAST:event_configureHashDatabasesButtonActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton configureHashDatabasesButton;
    private javax.swing.JButton deselectAllButton;
    private javax.swing.JComboBox<HashDb> hashSetsComboBox;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JButton selectAllButton;
    private javax.swing.JList<String> tagNamesListBox;
    // End of variables declaration//GEN-END:variables
}


text:
<?php

namespace App\Http\Middleware;

use Carbon\Carbon;
use Closure;
use Illuminate\Support\Facades\App;

/**
 * Class LangMiddleware
 * Middleware implementat al Kernel per tal de realitzar la comprovació del llenguatge sel·leccionat per l'usuari.
 * @package App\Http\Middleware
 */
class LangMiddleware
{
    /**
     * Estableix el llenguatge de l'aplicació.
     * @param $request
     * @param Closure $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
        if(!empty(session('lang'))){
            \App::setLocale(session('lang'));
        }

        Carbon::setLocale(App::getLocale());

        return $next($request);
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="CoreNLP-to-HTML.xsl" type="text/xsl"?>
<root>
  <document>
    <sentences>
      <sentence id="1">
        <tokens>
          <token id="1">
            <word>Radiation</word>
            <lemma>Radiation</lemma>
            <CharacterOffsetBegin>0</CharacterOffsetBegin>
            <CharacterOffsetEnd>9</CharacterOffsetEnd>
            <POS>NNP</POS>
          </token>
          <token id="2">
            <word>at</word>
            <lemma>at</lemma>
            <CharacterOffsetBegin>10</CharacterOffsetBegin>
            <CharacterOffsetEnd>12</CharacterOffsetEnd>
            <POS>IN</POS>
          </token>
          <token id="3">
            <word>Japan</word>
            <lemma>Japan</lemma>
            <CharacterOffsetBegin>13</CharacterOffsetBegin>
            <CharacterOffsetEnd>18</CharacterOffsetEnd>
            <POS>NNP</POS>
          </token>
          <token id="4">
            <word>'s</word>
            <lemma>'s</lemma>
            <CharacterOffsetBegin>18</CharacterOffsetBegin>
            <CharacterOffsetEnd>20</CharacterOffsetEnd>
            <POS>POS</POS>
          </token>
          <token id="5">
            <word>damaged</word>
            <lemma>damage</lemma>
            <CharacterOffsetBegin>21</CharacterOffsetBegin>
            <CharacterOffsetEnd>28</CharacterOffsetEnd>
            <POS>VBN</POS>
          </token>
          <token id="6">
            <word>Fukushima</word>
            <lemma>Fukushima</lemma>
            <CharacterOffsetBegin>29</CharacterOffsetBegin>
            <CharacterOffsetEnd>38</CharacterOffsetEnd>
            <POS>NNP</POS>
          </token>
          <token id="7">
            <word>Nuclear</word>
            <lemma>Nuclear</lemma>
            <CharacterOffsetBegin>39</CharacterOffsetBegin>
            <CharacterOffsetEnd>46</CharacterOffsetEnd>
            <POS>NNP</POS>
          </token>
          <token id="8">
            <word>Power</word>
            <lemma>Power</lemma>
            <CharacterOffsetBegin>47</CharacterOffsetBegin>
            <CharacterOffsetEnd>52</CharacterOffsetEnd>
            <POS>NNP</POS>
          </token>
          <token id="9">
            <word>Plant</word>
            <lemma>Plant</lemma>
            <CharacterOffsetBegin>53</CharacterOffsetBegin>
            <CharacterOffsetEnd>58</CharacterOffsetEnd>
            <POS>NNP</POS>
          </token>
          <token id="10">
            <word>yesterday</word>
            <lemma>yesterday</lemma>
            <CharacterOffsetBegin>59</CharacterOffsetBegin>
            <CharacterOffsetEnd>68</CharacterOffsetEnd>
            <POS>NN</POS>
          </token>
          <token id="11">
            <word>spiked</word>
            <lemma>spike</lemma>
            <CharacterOffsetBegin>69</CharacterOffsetBegin>
            <CharacterOffsetEnd>75</CharacterOffsetEnd>
            <POS>VBD</POS>
          </token>
          <token id="12">
            <word>to</word>
            <lemma>to</lemma>
            <CharacterOffsetBegin>76</CharacterOffsetBegin>
            <CharacterOffsetEnd>78</CharacterOffsetEnd>
            <POS>TO</POS>
          </token>
          <token id="13">
            <word>lethal</word>
            <lemma>lethal</lemma>
            <CharacterOffsetBegin>79</CharacterOffsetBegin>
            <CharacterOffsetEnd>85</CharacterOffsetEnd>
            <POS>JJ</POS>
          </token>
          <token id="14">
            <word>levels</word>
            <lemma>level</lemma>
            <CharacterOffsetBegin>86</CharacterOffsetBegin>
            <CharacterOffsetEnd>92</CharacterOffsetEnd>
            <POS>NNS</POS>
          </token>
          <token id="15">
            <word>around</word>
            <lemma>around</lemma>
            <CharacterOffsetBegin>93</CharacterOffsetBegin>
            <CharacterOffsetEnd>99</CharacterOffsetEnd>
            <POS>IN</POS>
          </token>
          <token id="16">
            <word>a</word>
            <lemma>a</lemma>
            <CharacterOffsetBegin>100</CharacterOffsetBegin>
            <CharacterOffsetEnd>101</CharacterOffsetEnd>
            <POS>DT</POS>
          </token>
          <token id="17">
            <word>leaking</word>
            <lemma>leak</lemma>
            <CharacterOffsetBegin>102</CharacterOffsetBegin>
            <CharacterOffsetEnd>109</CharacterOffsetEnd>
            <POS>VBG</POS>
          </token>
          <token id="18">
            <word>tank</word>
            <lemma>tank</lemma>
            <CharacterOffsetBegin>110</CharacterOffsetBegin>
            <CharacterOffsetEnd>114</CharacterOffsetEnd>
            <POS>NN</POS>
          </token>
          <token id="19">
            <word>.</word>
            <lemma>.</lemma>
            <CharacterOffsetBegin>114</CharacterOffsetBegin>
            <CharacterOffsetEnd>115</CharacterOffsetEnd>
            <POS>.</POS>
          </token>
        </tokens>
        <parse>(ROOT (S (NP (NP (NNP Radiation)) (PP (IN at) (NP (NP (NNP Japan) (POS 's)) (ADJP (VBN damaged)) (NNP Fukushima) (NNP Nuclear) (NNP Power) (NNP Plant) (NN yesterday)))) (VP (VBD spiked) (PP (TO to) (NP (JJ lethal) (NNS levels))) (PP (IN around) (NP (DT a) (VBG leaking) (NN tank)))) (. .))) </parse>
        <dependencies type="basic-dependencies">
          <dep type="root">
            <governor idx="0">ROOT</governor>
            <dependent idx="11">spiked</dependent>
          </dep>
          <dep type="nsubj">
            <governor idx="11">spiked</governor>
            <dependent idx="1">Radiation</dependent>
          </dep>
          <dep type="prep">
            <governor idx="1">Radiation</governor>
            <dependent idx="2">at</dependent>
          </dep>
          <dep type="poss">
            <governor idx="10">yesterday</governor>
            <dependent idx="3">Japan</dependent>
          </dep>
          <dep type="possessive">
            <governor idx="3">Japan</governor>
            <dependent idx="4">'s</dependent>
          </dep>
          <dep type="amod">
            <governor idx="10">yesterday</governor>
            <dependent idx="5">damaged</dependent>
          </dep>
          <dep type="nn">
            <governor idx="10">yesterday</governor>
            <dependent idx="6">Fukushima</dependent>
          </dep>
          <dep type="nn">
            <governor idx="10">yesterday</governor>
            <dependent idx="7">Nuclear</dependent>
          </dep>
          <dep type="nn">
            <governor idx="10">yesterday</governor>
            <dependent idx="8">Power</dependent>
          </dep>
          <dep type="nn">
            <governor idx="10">yesterday</governor>
            <dependent idx="9">Plant</dependent>
          </dep>
          <dep type="pobj">
            <governor idx="2">at</governor>
            <dependent idx="10">yesterday</dependent>
          </dep>
          <dep type="prep">
            <governor idx="11">spiked</governor>
            <dependent idx="12">to</dependent>
          </dep>
          <dep type="amod">
            <governor idx="14">levels</governor>
            <dependent idx="13">lethal</dependent>
          </dep>
          <dep type="pobj">
            <governor idx="12">to</governor>
            <dependent idx="14">levels</dependent>
          </dep>
          <dep type="prep">
            <governor idx="11">spiked</governor>
            <dependent idx="15">around</dependent>
          </dep>
          <dep type="det">
            <governor idx="18">tank</governor>
            <dependent idx="16">a</dependent>
          </dep>
          <dep type="amod">
            <governor idx="18">tank</governor>
            <dependent idx="17">leaking</dependent>
          </dep>
          <dep type="pobj">
            <governor idx="15">around</governor>
            <dependent idx="18">tank</dependent>
          </dep>
        </dependencies>
        <dependencies type="collapsed-dependencies">
          <dep type="root">
            <governor idx="0">ROOT</governor>
            <dependent idx="11">spiked</dependent>
          </dep>
          <dep type="nsubj">
            <governor idx="11">spiked</governor>
            <dependent idx="1">Radiation</dependent>
          </dep>
          <dep type="poss">
            <governor idx="10">yesterday</governor>
            <dependent idx="3">Japan</dependent>
          </dep>
          <dep type="amod">
            <governor idx="10">yesterday</governor>
            <dependent idx="5">damaged</dependent>
          </dep>
          <dep type="nn">
            <governor idx="10">yesterday</governor>
            <dependent idx="6">Fukushima</dependent>
          </dep>
          <dep type="nn">
            <governor idx="10">yesterday</governor>
            <dependent idx="7">Nuclear</dependent>
          </dep>
          <dep type="nn">
            <governor idx="10">yesterday</governor>
            <dependent idx="8">Power</dependent>
          </dep>
          <dep type="nn">
            <governor idx="10">yesterday</governor>
            <dependent idx="9">Plant</dependent>
          </dep>
          <dep type="prep_at">
            <governor idx="1">Radiation</governor>
            <dependent idx="10">yesterday</dependent>
          </dep>
          <dep type="amod">
            <governor idx="14">levels</governor>
            <dependent idx="13">lethal</dependent>
          </dep>
          <dep type="prep_to">
            <governor idx="11">spiked</governor>
            <dependent idx="14">levels</dependent>
          </dep>
          <dep type="det">
            <governor idx="18">tank</governor>
            <dependent idx="16">a</dependent>
          </dep>
          <dep type="amod">
            <governor idx="18">tank</governor>
            <dependent idx="17">leaking</dependent>
          </dep>
          <dep type="prep_around">
            <governor idx="11">spiked</governor>
            <dependent idx="18">tank</dependent>
          </dep>
        </dependencies>
        <dependencies type="collapsed-ccprocessed-dependencies">
          <dep type="root">
            <governor idx="0">ROOT</governor>
            <dependent idx="11">spiked</dependent>
          </dep>
          <dep type="nsubj">
            <governor idx="11">spiked</governor>
            <dependent idx="1">Radiation</dependent>
          </dep>
          <dep type="poss">
            <governor idx="10">yesterday</governor>
            <dependent idx="3">Japan</dependent>
          </dep>
          <dep type="amod">
            <governor idx="10">yesterday</governor>
            <dependent idx="5">damaged</dependent>
          </dep>
          <dep type="nn">
            <governor idx="10">yesterday</governor>
            <dependent idx="6">Fukushima</dependent>
          </dep>
          <dep type="nn">
            <governor idx="10">yesterday</governor>
            <dependent idx="7">Nuclear</dependent>
          </dep>
          <dep type="nn">
            <governor idx="10">yesterday</governor>
            <dependent idx="8">Power</dependent>
          </dep>
          <dep type="nn">
            <governor idx="10">yesterday</governor>
            <dependent idx="9">Plant</dependent>
          </dep>
          <dep type="prep_at">
            <governor idx="1">Radiation</governor>
            <dependent idx="10">yesterday</dependent>
          </dep>
          <dep type="amod">
            <governor idx="14">levels</governor>
            <dependent idx="13">lethal</dependent>
          </dep>
          <dep type="prep_to">
            <governor idx="11">spiked</governor>
            <dependent idx="14">levels</dependent>
          </dep>
          <dep type="det">
            <governor idx="18">tank</governor>
            <dependent idx="16">a</dependent>
          </dep>
          <dep type="amod">
            <governor idx="18">tank</governor>
            <dependent idx="17">leaking</dependent>
          </dep>
          <dep type="prep_around">
            <governor idx="11">spiked</governor>
            <dependent idx="18">tank</dependent>
          </dep>
        </dependencies>
      </sentence>
      <sentence id="2">
        <tokens>
          <token id="1">
            <word>Today</word>
            <lemma>today</lemma>
            <CharacterOffsetBegin>116</CharacterOffsetBegin>
            <CharacterOffsetEnd>121</CharacterOffsetEnd>
            <POS>NN</POS>
          </token>
          <token id="2">
            <word>the</word>
            <lemma>the</lemma>
            <CharacterOffsetBegin>122</CharacterOffsetBegin>
            <CharacterOffsetEnd>125</CharacterOffsetEnd>
            <POS>DT</POS>
          </token>
          <token id="3">
            <word>national</word>
            <lemma>national</lemma>
            <CharacterOffsetBegin>126</CharacterOffsetBegin>
            <CharacterOffsetEnd>134</CharacterOffsetEnd>
            <POS>JJ</POS>
          </token>
          <token id="4">
            <word>Nuclear</word>
            <lemma>nuclear</lemma>
            <CharacterOffsetBegin>135</CharacterOffsetBegin>
            <CharacterOffsetEnd>142</CharacterOffsetEnd>
            <POS>JJ</POS>
          </token>
          <token id="5">
            <word>Regulation</word>
            <lemma>regulation</lemma>
            <CharacterOffsetBegin>143</CharacterOffsetBegin>
            <CharacterOffsetEnd>153</CharacterOffsetEnd>
            <POS>NN</POS>
          </token>
          <token id="6">
            <word>Authority</word>
            <lemma>Authority</lemma>
            <CharacterOffsetBegin>154</CharacterOffsetBegin>
            <CharacterOffsetEnd>163</CharacterOffsetEnd>
            <POS>NNP</POS>
          </token>
          <token id="7">
            <word>-LRB-</word>
            <lemma>-lrb-</lemma>
            <CharacterOffsetBegin>164</CharacterOffsetBegin>
            <CharacterOffsetEnd>165</CharacterOffsetEnd>
            <POS>-LRB-</POS>
          </token>
          <token id="8">
            <word>NRA</word>
            <lemma>NRA</lemma>
            <CharacterOffsetBegin>165</CharacterOffsetBegin>
            <CharacterOffsetEnd>168</CharacterOffsetEnd>
            <POS>NNP</POS>
          </token>
          <token id="9">
            <word>-RRB-</word>
            <lemma>-rrb-</lemma>
            <CharacterOffsetBegin>168</CharacterOffsetBegin>
            <CharacterOffsetEnd>169</CharacterOffsetEnd>
            <POS>-RRB-</POS>
          </token>
          <token id="10">
            <word>said</word>
            <lemma>say</lemma>
            <CharacterOffsetBegin>170</CharacterOffsetBegin>
            <CharacterOffsetEnd>174</CharacterOffsetEnd>
            <POS>VBD</POS>
          </token>
          <token id="11">
            <word>contaminated</word>
            <lemma>contaminate</lemma>
            <CharacterOffsetBegin>175</CharacterOffsetBegin>
            <CharacterOffsetEnd>187</CharacterOffsetEnd>
            <POS>VBN</POS>
          </token>
          <token id="12">
            <word>water</word>
            <lemma>water</lemma>
            <CharacterOffsetBegin>188</CharacterOffsetBegin>
            <CharacterOffsetEnd>193</CharacterOffsetEnd>
            <POS>NN</POS>
          </token>
          <token id="13">
            <word>may</word>
            <lemma>may</lemma>
            <CharacterOffsetBegin>194</CharacterOffsetBegin>
            <CharacterOffsetEnd>197</CharacterOffsetEnd>
            <POS>MD</POS>
          </token>
          <token id="14">
            <word>be</word>
            <lemma>be</lemma>
            <CharacterOffsetBegin>198</CharacterOffsetBegin>
            <CharacterOffsetEnd>200</CharacterOffsetEnd>
            <POS>VB</POS>
          </token>
          <token id="15">
            <word>pumped</word>
            <lemma>pump</lemma>
            <CharacterOffsetBegin>201</CharacterOffsetBegin>
            <CharacterOffsetEnd>207</CharacterOffsetEnd>
            <POS>VBN</POS>
          </token>
          <token id="16">
            <word>into</word>
            <lemma>into</lemma>
            <CharacterOffsetBegin>208</CharacterOffsetBegin>
            <CharacterOffsetEnd>212</CharacterOffsetEnd>
            <POS>IN</POS>
          </token>
          <token id="17">
            <word>the</word>
            <lemma>the</lemma>
            <CharacterOffsetBegin>213</CharacterOffsetBegin>
            <CharacterOffsetEnd>216</CharacterOffsetEnd>
            <POS>DT</POS>
          </token>
          <token id="18">
            <word>sea</word>
            <lemma>sea</lemma>
            <CharacterOffsetBegin>217</CharacterOffsetBegin>
            <CharacterOffsetEnd>220</CharacterOffsetEnd>
            <POS>NN</POS>
          </token>
          <token id="19">
            <word>.</word>
            <lemma>.</lemma>
            <CharacterOffsetBegin>220</CharacterOffsetBegin>
            <CharacterOffsetEnd>221</CharacterOffsetEnd>
            <POS>.</POS>
          </token>
        </tokens>
        <parse>(ROOT (S (NP-TMP (NN Today)) (NP (NP (DT the) (JJ national) (JJ Nuclear) (NN Regulation) (NNP Authority)) (PRN (-LRB- -LRB-) (NP (NNP NRA)) (-RRB- -RRB-))) (VP (VBD said) (ADJP (VBN contaminated) (SBAR (S (NP (NN water)) (VP (MD may) (VP (VB be) (VP (VBN pumped) (PP (IN into) (NP (DT the) (NN sea)))))))))) (. .))) </parse>
        <dependencies type="basic-dependencies">
          <dep type="root">
            <governor idx="0">ROOT</governor>
            <dependent idx="10">said</dependent>
          </dep>
          <dep type="tmod">
            <governor idx="10">said</governor>
            <dependent idx="1">Today</dependent>
          </dep>
          <dep type="det">
            <governor idx="6">Authority</governor>
            <dependent idx="2">the</dependent>
          </dep>
          <dep type="amod">
            <governor idx="6">Authority</governor>
            <dependent idx="3">national</dependent>
          </dep>
          <dep type="amod">
            <governor idx="6">Authority</governor>
            <dependent idx="4">Nuclear</dependent>
          </dep>
          <dep type="nn">
            <governor idx="6">Authority</governor>
            <dependent idx="5">Regulation</dependent>
          </dep>
          <dep type="nsubj">
            <governor idx="10">said</governor>
            <dependent idx="6">Authority</dependent>
          </dep>
          <dep type="appos">
            <governor idx="6">Authority</governor>
            <dependent idx="8">NRA</dependent>
          </dep>
          <dep type="acomp">
            <governor idx="10">said</governor>
            <dependent idx="11">contaminated</dependent>
          </dep>
          <dep type="nsubjpass">
            <governor idx="15">pumped</governor>
            <dependent idx="12">water</dependent>
          </dep>
          <dep type="aux">
            <governor idx="15">pumped</governor>
            <dependent idx="13">may</dependent>
          </dep>
          <dep type="auxpass">
            <governor idx="15">pumped</governor>
            <dependent idx="14">be</dependent>
          </dep>
          <dep type="ccomp">
            <governor idx="11">contaminated</governor>
            <dependent idx="15">pumped</dependent>
          </dep>
          <dep type="prep">
            <governor idx="15">pumped</governor>
            <dependent idx="16">into</dependent>
          </dep>
          <dep type="det">
            <governor idx="18">sea</governor>
            <dependent idx="17">the</dependent>
          </dep>
          <dep type="pobj">
            <governor idx="16">into</governor>
            <dependent idx="18">sea</dependent>
          </dep>
        </dependencies>
        <dependencies type="collapsed-dependencies">
          <dep type="root">
            <governor idx="0">ROOT</governor>
            <dependent idx="10">said</dependent>
          </dep>
          <dep type="tmod">
            <governor idx="10">said</governor>
            <dependent idx="1">Today</dependent>
          </dep>
          <dep type="det">
            <governor idx="6">Authority</governor>
            <dependent idx="2">the</dependent>
          </dep>
          <dep type="amod">
            <governor idx="6">Authority</governor>
            <dependent idx="3">national</dependent>
          </dep>
          <dep type="amod">
            <governor idx="6">Authority</governor>
            <dependent idx="4">Nuclear</dependent>
          </dep>
          <dep type="nn">
            <governor idx="6">Authority</governor>
            <dependent idx="5">Regulation</dependent>
          </dep>
          <dep type="nsubj">
            <governor idx="10">said</governor>
            <dependent idx="6">Authority</dependent>
          </dep>
          <dep type="appos">
            <governor idx="6">Authority</governor>
            <dependent idx="8">NRA</dependent>
          </dep>
          <dep type="acomp">
            <governor idx="10">said</governor>
            <dependent idx="11">contaminated</dependent>
          </dep>
          <dep type="nsubjpass">
            <governor idx="15">pumped</governor>
            <dependent idx="12">water</dependent>
          </dep>
          <dep type="aux">
            <governor idx="15">pumped</governor>
            <dependent idx="13">may</dependent>
          </dep>
          <dep type="auxpass">
            <governor idx="15">pumped</governor>
            <dependent idx="14">be</dependent>
          </dep>
          <dep type="ccomp">
            <governor idx="11">contaminated</governor>
            <dependent idx="15">pumped</dependent>
          </dep>
          <dep type="det">
            <governor idx="18">sea</governor>
            <dependent idx="17">the</dependent>
          </dep>
          <dep type="prep_into">
            <governor idx="15">pumped</governor>
            <dependent idx="18">sea</dependent>
          </dep>
        </dependencies>
        <dependencies type="collapsed-ccprocessed-dependencies">
          <dep type="root">
            <governor idx="0">ROOT</governor>
            <dependent idx="10">said</dependent>
          </dep>
          <dep type="tmod">
            <governor idx="10">said</governor>
            <dependent idx="1">Today</dependent>
          </dep>
          <dep type="det">
            <governor idx="6">Authority</governor>
            <dependent idx="2">the</dependent>
          </dep>
          <dep type="amod">
            <governor idx="6">Authority</governor>
            <dependent idx="3">national</dependent>
          </dep>
          <dep type="amod">
            <governor idx="6">Authority</governor>
            <dependent idx="4">Nuclear</dependent>
          </dep>
          <dep type="nn">
            <governor idx="6">Authority</governor>
            <dependent idx="5">Regulation</dependent>
          </dep>
          <dep type="nsubj">
            <governor idx="10">said</governor>
            <dependent idx="6">Authority</dependent>
          </dep>
          <dep type="appos">
            <governor idx="6">Authority</governor>
            <dependent idx="8">NRA</dependent>
          </dep>
          <dep type="acomp">
            <governor idx="10">said</governor>
            <dependent idx="11">contaminated</dependent>
          </dep>
          <dep type="nsubjpass">
            <governor idx="15">pumped</governor>
            <dependent idx="12">water</dependent>
          </dep>
          <dep type="aux">
            <governor idx="15">pumped</governor>
            <dependent idx="13">may</dependent>
          </dep>
          <dep type="auxpass">
            <governor idx="15">pumped</governor>
            <dependent idx="14">be</dependent>
          </dep>
          <dep type="ccomp">
            <governor idx="11">contaminated</governor>
            <dependent idx="15">pumped</dependent>
          </dep>
          <dep type="det">
            <governor idx="18">sea</governor>
            <dependent idx="17">the</dependent>
          </dep>
          <dep type="prep_into">
            <governor idx="15">pumped</governor>
            <dependent idx="18">sea</dependent>
          </dep>
        </dependencies>
      </sentence>
      <sentence id="3">
        <tokens>
          <token id="1">
            <word>A</word>
            <lemma>a</lemma>
            <CharacterOffsetBegin>222</CharacterOffsetBegin>
            <CharacterOffsetEnd>223</CharacterOffsetEnd>
            <POS>DT</POS>
          </token>
          <token id="2">
            <word>radiation</word>
            <lemma>radiation</lemma>
            <CharacterOffsetBegin>224</CharacterOffsetBegin>
            <CharacterOffsetEnd>233</CharacterOffsetEnd>
            <POS>NN</POS>
          </token>
          <token id="3">
            <word>leak</word>
            <lemma>leak</lemma>
            <CharacterOffsetBegin>234</CharacterOffsetBegin>
            <CharacterOffsetEnd>238</CharacterOffsetEnd>
            <POS>NN</POS>
          </token>
          <token id="4">
            <word>at</word>
            <lemma>at</lemma>
            <CharacterOffsetBegin>239</CharacterOffsetBegin>
            <CharacterOffsetEnd>241</CharacterOffsetEnd>
            <POS>IN</POS>
          </token>
          <token id="5">
            <word>Fukushima</word>
            <lemma>Fukushima</lemma>
            <CharacterOffsetBegin>242</CharacterOffsetBegin>
            <CharacterOffsetEnd>251</CharacterOffsetEnd>
            <POS>NNP</POS>
          </token>
          <token id="6">
            <word>Nuclear</word>
            <lemma>Nuclear</lemma>
            <CharacterOffsetBegin>252</CharacterOffsetBegin>
            <CharacterOffsetEnd>259</CharacterOffsetEnd>
            <POS>NNP</POS>
          </token>
          <token id="7">
            <word>Power</word>
            <lemma>Power</lemma>
            <CharacterOffsetBegin>260</CharacterOffsetBegin>
            <CharacterOffsetEnd>265</CharacterOffsetEnd>
            <POS>NNP</POS>
          </token>
          <token id="8">
            <word>Plant</word>
            <lemma>Plant</lemma>
            <CharacterOffsetBegin>266</CharacterOffsetBegin>
            <CharacterOffsetEnd>271</CharacterOffsetEnd>
            <POS>NNP</POS>
          </token>
          <token id="9">
            <word>reached</word>
            <lemma>reach</lemma>
            <CharacterOffsetBegin>272</CharacterOffsetBegin>
            <CharacterOffsetEnd>279</CharacterOffsetEnd>
            <POS>VBD</POS>
          </token>
          <token id="10">
            <word>lethal</word>
            <lemma>lethal</lemma>
            <CharacterOffsetBegin>280</CharacterOffsetBegin>
            <CharacterOffsetEnd>286</CharacterOffsetEnd>
            <POS>JJ</POS>
          </token>
          <token id="11">
            <word>levels</word>
            <lemma>level</lemma>
            <CharacterOffsetBegin>287</CharacterOffsetBegin>
            <CharacterOffsetEnd>293</CharacterOffsetEnd>
            <POS>NNS</POS>
          </token>
          <token id="12">
            <word>,</word>
            <lemma>,</lemma>
            <CharacterOffsetBegin>293</CharacterOffsetBegin>
            <CharacterOffsetEnd>294</CharacterOffsetEnd>
            <POS>,</POS>
          </token>
          <token id="13">
            <word>with</word>
            <lemma>with</lemma>
            <CharacterOffsetBegin>295</CharacterOffsetBegin>
            <CharacterOffsetEnd>299</CharacterOffsetEnd>
            <POS>IN</POS>
          </token>
          <token id="14">
            <word>authorities</word>
            <lemma>authority</lemma>
            <CharacterOffsetBegin>300</CharacterOffsetBegin>
            <CharacterOffsetEnd>311</CharacterOffsetEnd>
            <POS>NNS</POS>
          </token>
          <token id="15">
            <word>warning</word>
            <lemma>warn</lemma>
            <CharacterOffsetBegin>312</CharacterOffsetBegin>
            <CharacterOffsetEnd>319</CharacterOffsetEnd>
            <POS>VBG</POS>
          </token>
          <token id="16">
            <word>of</word>
            <lemma>of</lemma>
            <CharacterOffsetBegin>320</CharacterOffsetBegin>
            <CharacterOffsetEnd>322</CharacterOffsetEnd>
            <POS>IN</POS>
          </token>
          <token id="17">
            <word>contaminated</word>
            <lemma>contaminate</lemma>
            <CharacterOffsetBegin>323</CharacterOffsetBegin>
            <CharacterOffsetEnd>335</CharacterOffsetEnd>
            <POS>VBN</POS>
          </token>
          <token id="18">
            <word>water</word>
            <lemma>water</lemma>
            <CharacterOffsetBegin>336</CharacterOffsetBegin>
            <CharacterOffsetEnd>341</CharacterOffsetEnd>
            <POS>NN</POS>
          </token>
          <token id="19">
            <word>reaching</word>
            <lemma>reach</lemma>
            <CharacterOffsetBegin>342</CharacterOffsetBegin>
            <CharacterOffsetEnd>350</CharacterOffsetEnd>
            <POS>VBG</POS>
          </token>
          <token id="20">
            <word>the</word>
            <lemma>the</lemma>
            <CharacterOffsetBegin>351</CharacterOffsetBegin>
            <CharacterOffsetEnd>354</CharacterOffsetEnd>
            <POS>DT</POS>
          </token>
          <token id="21">
            <word>sea</word>
            <lemma>sea</lemma>
            <CharacterOffsetBegin>355</CharacterOffsetBegin>
            <CharacterOffsetEnd>358</CharacterOffsetEnd>
            <POS>NN</POS>
          </token>
          <token id="22">
            <word>.</word>
            <lemma>.</lemma>
            <CharacterOffsetBegin>358</CharacterOffsetBegin>
            <CharacterOffsetEnd>359</CharacterOffsetEnd>
            <POS>.</POS>
          </token>
        </tokens>
        <parse>(ROOT (S (NP (NP (DT A) (NN radiation) (NN leak)) (PP (IN at) (NP (NNP Fukushima) (NNP Nuclear) (NNP Power) (NNP Plant)))) (VP (VBD reached) (NP (JJ lethal) (NNS levels)) (, ,) (PP (IN with) (NP (NP (NNS authorities)) (VP (VBG warning) (PP (IN of) (NP (NP (ADJP (VBN contaminated)) (NN water)) (VP (VBG reaching) (NP (DT the) (NN sea))))))))) (. .))) </parse>
        <dependencies type="basic-dependencies">
          <dep type="root">
            <governor idx="0">ROOT</governor>
            <dependent idx="9">reached</dependent>
          </dep>
          <dep type="det">
            <governor idx="3">leak</governor>
            <dependent idx="1">A</dependent>
          </dep>
          <dep type="nn">
            <governor idx="3">leak</governor>
            <dependent idx="2">radiation</dependent>
          </dep>
          <dep type="nsubj">
            <governor idx="9">reached</governor>
            <dependent idx="3">leak</dependent>
          </dep>
          <dep type="prep">
            <governor idx="3">leak</governor>
            <dependent idx="4">at</dependent>
          </dep>
          <dep type="nn">
            <governor idx="8">Plant</governor>
            <dependent idx="5">Fukushima</dependent>
          </dep>
          <dep type="nn">
            <governor idx="8">Plant</governor>
            <dependent idx="6">Nuclear</dependent>
          </dep>
          <dep type="nn">
            <governor idx="8">Plant</governor>
            <dependent idx="7">Power</dependent>
          </dep>
          <dep type="pobj">
            <governor idx="4">at</governor>
            <dependent idx="8">Plant</dependent>
          </dep>
          <dep type="amod">
            <governor idx="11">levels</governor>
            <dependent idx="10">lethal</dependent>
          </dep>
          <dep type="dobj">
            <governor idx="9">reached</governor>
            <dependent idx="11">levels</dependent>
          </dep>
          <dep type="prep">
            <governor idx="9">reached</governor>
            <dependent idx="13">with</dependent>
          </dep>
          <dep type="pobj">
            <governor idx="13">with</governor>
            <dependent idx="14">authorities</dependent>
          </dep>
          <dep type="vmod">
            <governor idx="14">authorities</governor>
            <dependent idx="15">warning</dependent>
          </dep>
          <dep type="prep">
            <governor idx="15">warning</governor>
            <dependent idx="16">of</dependent>
          </dep>
          <dep type="amod">
            <governor idx="18">water</governor>
            <dependent idx="17">contaminated</dependent>
          </dep>
          <dep type="pobj">
            <governor idx="16">of</governor>
            <dependent idx="18">water</dependent>
          </dep>
          <dep type="vmod">
            <governor idx="18">water</governor>
            <dependent idx="19">reaching</dependent>
          </dep>
          <dep type="det">
            <governor idx="21">sea</governor>
            <dependent idx="20">the</dependent>
          </dep>
          <dep type="dobj">
            <governor idx="19">reaching</governor>
            <dependent idx="21">sea</dependent>
          </dep>
        </dependencies>
        <dependencies type="collapsed-dependencies">
          <dep type="root">
            <governor idx="0">ROOT</governor>
            <dependent idx="9">reached</dependent>
          </dep>
          <dep type="det">
            <governor idx="3">leak</governor>
            <dependent idx="1">A</dependent>
          </dep>
          <dep type="nn">
            <governor idx="3">leak</governor>
            <dependent idx="2">radiation</dependent>
          </dep>
          <dep type="nsubj">
            <governor idx="9">reached</governor>
            <dependent idx="3">leak</dependent>
          </dep>
          <dep type="nn">
            <governor idx="8">Plant</governor>
            <dependent idx="5">Fukushima</dependent>
          </dep>
          <dep type="nn">
            <governor idx="8">Plant</governor>
            <dependent idx="6">Nuclear</dependent>
          </dep>
          <dep type="nn">
            <governor idx="8">Plant</governor>
            <dependent idx="7">Power</dependent>
          </dep>
          <dep type="prep_at">
            <governor idx="3">leak</governor>
            <dependent idx="8">Plant</dependent>
          </dep>
          <dep type="amod">
            <governor idx="11">levels</governor>
            <dependent idx="10">lethal</dependent>
          </dep>
          <dep type="dobj">
            <governor idx="9">reached</governor>
            <dependent idx="11">levels</dependent>
          </dep>
          <dep type="prep_with">
            <governor idx="9">reached</governor>
            <dependent idx="14">authorities</dependent>
          </dep>
          <dep type="vmod">
            <governor idx="14">authorities</governor>
            <dependent idx="15">warning</dependent>
          </dep>
          <dep type="amod">
            <governor idx="18">water</governor>
            <dependent idx="17">contaminated</dependent>
          </dep>
          <dep type="prep_of">
            <governor idx="15">warning</governor>
            <dependent idx="18">water</dependent>
          </dep>
          <dep type="vmod">
            <governor idx="18">water</governor>
            <dependent idx="19">reaching</dependent>
          </dep>
          <dep type="det">
            <governor idx="21">sea</governor>
            <dependent idx="20">the</dependent>
          </dep>
          <dep type="dobj">
            <governor idx="19">reaching</governor>
            <dependent idx="21">sea</dependent>
          </dep>
        </dependencies>
        <dependencies type="collapsed-ccprocessed-dependencies">
          <dep type="root">
            <governor idx="0">ROOT</governor>
            <dependent idx="9">reached</dependent>
          </dep>
          <dep type="det">
            <governor idx="3">leak</governor>
            <dependent idx="1">A</dependent>
          </dep>
          <dep type="nn">
            <governor idx="3">leak</governor>
            <dependent idx="2">radiation</dependent>
          </dep>
          <dep type="nsubj">
            <governor idx="9">reached</governor>
            <dependent idx="3">leak</dependent>
          </dep>
          <dep type="nn">
            <governor idx="8">Plant</governor>
            <dependent idx="5">Fukushima</dependent>
          </dep>
          <dep type="nn">
            <governor idx="8">Plant</governor>
            <dependent idx="6">Nuclear</dependent>
          </dep>
          <dep type="nn">
            <governor idx="8">Plant</governor>
            <dependent idx="7">Power</dependent>
          </dep>
          <dep type="prep_at">
            <governor idx="3">leak</governor>
            <dependent idx="8">Plant</dependent>
          </dep>
          <dep type="amod">
            <governor idx="11">levels</governor>
            <dependent idx="10">lethal</dependent>
          </dep>
          <dep type="dobj">
            <governor idx="9">reached</governor>
            <dependent idx="11">levels</dependent>
          </dep>
          <dep type="prep_with">
            <governor idx="9">reached</governor>
            <dependent idx="14">authorities</dependent>
          </dep>
          <dep type="vmod">
            <governor idx="14">authorities</governor>
            <dependent idx="15">warning</dependent>
          </dep>
          <dep type="amod">
            <governor idx="18">water</governor>
            <dependent idx="17">contaminated</dependent>
          </dep>
          <dep type="prep_of">
            <governor idx="15">warning</governor>
            <dependent idx="18">water</dependent>
          </dep>
          <dep type="vmod">
            <governor idx="18">water</governor>
            <dependent idx="19">reaching</dependent>
          </dep>
          <dep type="det">
            <governor idx="21">sea</governor>
            <dependent idx="20">the</dependent>
          </dep>
          <dep type="dobj">
            <governor idx="19">reaching</governor>
            <dependent idx="21">sea</dependent>
          </dep>
        </dependencies>
      </sentence>
    </sentences>
  </document>
</root>


text:
const path = require('path');

/**
 * Helper function that attempts to resolve the specify named `config`
 * locally before attempting to resolve it from `node_modules`. This
 * tricks TravisCI into resolving correctly.
 *
 * @param {string} config Named `eslint-config-*` module
 * @returns {string} Full path resolved locally or from `node_modules`.
 */
module.exports = function resolveLocal(config) {
  try {
    return require.resolve(path.resolve(__dirname, '..', config));
  } catch (ex) {
    return require.resolve(config);
  }
};


text:
//
//  FNFreshTabBarController.h
//  FNTabBarDemo_test
//
//  Created by 张三松 on 16/9/5.
//  Copyright © 2017年 FeiNiu. All rights reserved.
//

#import <UIKit/UIKit.h>

/**
 *  外部自定义tabBarController继承于FNFreshTabBarController,并遵循FNFreshTabBarControllerDelegate协议
 */

@protocol FNBaseTabBarControllerDelegate <NSObject>

@optional
- (BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController;
- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController;

@end

@interface FNBaseTabBarController : UITabBarController

@property(weak, nonatomic)id<FNBaseTabBarControllerDelegate>fnBaseTabBarControllerDelegate;

@end